mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-28 02:06:12 -04:00
frontend: Use OBSBasic::Get() in all places
This reduces duplicated code when getting the OBSBasic context.
This commit is contained in:
@@ -73,7 +73,7 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *, obs_source_t *source_) : source(
|
||||
labelL->setText("L");
|
||||
labelR->setText("R");
|
||||
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
|
||||
QIcon sourceIcon = main->GetSourceIcon(obs_source_get_id(source));
|
||||
QPixmap pixmap = sourceIcon.pixmap(QSize(16, 16));
|
||||
|
||||
@@ -27,7 +27,7 @@ void SourceToolbar::SetUndoProperties(obs_source_t *source, bool repeatable)
|
||||
return;
|
||||
}
|
||||
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
|
||||
OBSSource currentSceneSource = main->GetCurrentSceneSource();
|
||||
if (!currentSceneSource)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
static inline OBSScene GetCurrentScene()
|
||||
{
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
return main->GetCurrentScene();
|
||||
}
|
||||
|
||||
@@ -560,7 +560,7 @@ bool SourceTree::GroupedItemsSelected() const
|
||||
|
||||
void SourceTree::Remove(OBSSceneItem item, OBSScene scene)
|
||||
{
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
GetStm()->Remove(item);
|
||||
main->SaveProject();
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
static inline OBSScene GetCurrentScene()
|
||||
{
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
return main->GetCurrentScene();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ SourceTreeItem::SourceTreeItem(SourceTree *tree_, OBSSceneItem sceneitem_) : tre
|
||||
setStyleSheet("background: none");
|
||||
}
|
||||
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
const char *id = obs_source_get_id(source);
|
||||
|
||||
bool sourceVisible = obs_sceneitem_visible(sceneitem);
|
||||
@@ -268,7 +268,7 @@ void SourceTreeItem::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
expand->setChecked(!expand->isChecked());
|
||||
} else {
|
||||
obs_source_t *source = obs_sceneitem_get_source(sceneitem);
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
if (obs_source_configurable(source)) {
|
||||
main->CreatePropertiesWindow(source);
|
||||
}
|
||||
@@ -337,7 +337,7 @@ void SourceTreeItem::ExitEditModeInternal(bool save)
|
||||
return;
|
||||
}
|
||||
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
OBSScene scene = main->GetCurrentScene();
|
||||
|
||||
newName = QT_TO_UTF8(editor->text());
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
static inline OBSScene GetCurrentScene()
|
||||
{
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
return main->GetCurrentScene();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user