Skip to content

Commit 09e7df1

Browse files
authored
Merge branch 'Aitum:main' into main
2 parents a6e374d + d539e44 commit 09e7df1

File tree

3 files changed

+13
-46
lines changed

3 files changed

+13
-46
lines changed

config-dialog.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,7 @@ OBSBasicSettings::OBSBasicSettings(CanvasDock *canvas_dock, QMainWindow *parent)
788788

789789
fileFormat = new QComboBox;
790790
fileFormat->addItem(QString::fromUtf8("mp4"));
791-
if (obs_get_version() >= MAKE_SEMANTIC_VERSION(30, 2, 0))
792-
fileFormat->addItem(QString::fromUtf8("hybrid_mp4"));
791+
fileFormat->addItem(QString::fromUtf8("hybrid_mp4"));
793792
fileFormat->addItem(QString::fromUtf8("fragmented_mp4"));
794793
fileFormat->addItem(QString::fromUtf8("mov"));
795794
fileFormat->addItem(QString::fromUtf8("fragmented_mov"));

source-tree.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,12 @@ void SourceTreeItem::Renamed(const QString &name)
518518
label->setText(name);
519519
}
520520

521+
extern std::list<CanvasDock *> canvas_docks;
522+
521523
void SourceTreeItem::Update(bool force)
522524
{
525+
if (std::find(canvas_docks.begin(), canvas_docks.end(), tree->canvasDock) == canvas_docks.end())
526+
return;
523527
obs_scene_t *scene = tree->canvasDock->scene;
524528
obs_scene_t *itemScene = obs_sceneitem_get_scene(sceneitem);
525529

@@ -677,6 +681,8 @@ static bool enumItem(obs_scene_t *, obs_sceneitem_t *item, void *ptr)
677681

678682
void SourceTreeModel::SceneChanged()
679683
{
684+
if (std::find(canvas_docks.begin(), canvas_docks.end(), st->canvasDock) == canvas_docks.end())
685+
return;
680686
obs_scene_t *scene = st->canvasDock->scene;
681687

682688
beginResetModel();

vertical-canvas.cpp

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,6 @@ bool version_info_downloaded(void *param, struct file_download_data *file)
572572

573573
bool obs_module_load(void)
574574
{
575-
if (obs_get_version() < MAKE_SEMANTIC_VERSION(30, 0, 0)) {
576-
blog(LOG_ERROR, "[Vertical Canvas] loading version %s failed, OBS version %s is to low", PROJECT_VERSION,
577-
obs_get_version_string());
578-
return false;
579-
}
580575
blog(LOG_INFO, "[Vertical Canvas] loaded version %s", PROJECT_VERSION);
581576
obs_frontend_add_event_callback(frontend_event, nullptr);
582577

@@ -1617,41 +1612,10 @@ static bool SceneItemHasVideo(obs_sceneitem_t *item)
16171612
return (flags & OBS_SOURCE_VIDEO) != 0;
16181613
}
16191614

1620-
#if LIBOBS_API_VER < MAKE_SEMANTIC_VERSION(31, 0, 0)
1621-
static config_t *(*get_user_config_func)(void) = nullptr;
1622-
static config_t *user_config = nullptr;
1623-
#endif
16241615

16251616
config_t *get_user_config(void)
16261617
{
1627-
#if LIBOBS_API_VER < MAKE_SEMANTIC_VERSION(31, 0, 0)
1628-
if (user_config)
1629-
return user_config;
1630-
if (!get_user_config_func) {
1631-
if (obs_get_version() < MAKE_SEMANTIC_VERSION(31, 0, 0)) {
1632-
get_user_config_func = obs_frontend_get_global_config;
1633-
blog(LOG_INFO, "[Vertical Canvas] use global config");
1634-
} else {
1635-
#ifdef __APPLE__
1636-
auto handle = os_dlopen("obs-frontend-api.dylib");
1637-
#else
1638-
auto handle = os_dlopen("obs-frontend-api");
1639-
#endif
1640-
if (handle) {
1641-
get_user_config_func = (config_t * (*)(void)) os_dlsym(handle, "obs_frontend_get_user_config");
1642-
os_dlclose(handle);
1643-
if (get_user_config_func)
1644-
blog(LOG_INFO, "[Vertical Canvas] use user config");
1645-
}
1646-
}
1647-
}
1648-
if (get_user_config_func)
1649-
return get_user_config_func();
1650-
user_config = obs_frontend_get_global_config();
1651-
return user_config;
1652-
#else
16531618
return obs_frontend_get_user_config();
1654-
#endif
16551619
}
16561620

16571621
void CanvasDock::DrawOverflow(float scale)
@@ -2922,12 +2886,8 @@ static bool CenterAlignSelectedItems(obs_scene_t *scene, obs_sceneitem_t *item,
29222886
vec2_set(&itemInfo.bounds, float(obs_source_get_base_width(scene_source)), float(obs_source_get_base_height(scene_source)));
29232887
itemInfo.bounds_type = boundsType;
29242888
itemInfo.bounds_alignment = OBS_ALIGN_CENTER;
2925-
#if LIBOBS_API_VER < MAKE_SEMANTIC_VERSION(30, 1, 0)
2926-
obs_sceneitem_set_info(item, &itemInfo);
2927-
#else
29282889
itemInfo.crop_to_bounds = obs_sceneitem_get_bounds_crop(item);
29292890
obs_sceneitem_set_info2(item, &itemInfo);
2930-
#endif
29312891

29322892
UNUSED_PARAMETER(scene);
29332893
return true;
@@ -4687,14 +4647,16 @@ bool CanvasDock::add_sources_of_type_to_menu(void *param, obs_source_t *source)
46874647
if (strcmp(obs_source_get_unversioned_id(source), id) == 0) {
46884648
auto name = QString::fromUtf8(obs_source_get_name(source));
46894649
QList<QAction *> actions = menu->actions();
4690-
QAction *before = nullptr;
4650+
QAction *after = nullptr;
46914651
for (QAction *menuAction : actions) {
4692-
if (menuAction->text().compare(name, Qt::CaseInsensitive) >= 0)
4693-
before = menuAction;
4652+
if (menuAction->text().compare(name) >= 0) {
4653+
after = menuAction;
4654+
break;
4655+
}
46944656
}
46954657
auto na = new QAction(name, menu);
46964658
connect(na, &QAction::triggered, cd, [cd, source] { cd->AddSourceToScene(source); }, Qt::QueuedConnection);
4697-
menu->insertAction(before, na);
4659+
menu->insertAction(after, na);
46984660
struct descendant_info info = {false, cd->source, obs_scene_get_source(cd->scene)};
46994661
obs_source_enum_full_tree(source, check_descendant, &info);
47004662
na->setEnabled(!info.exists);

0 commit comments

Comments
 (0)