mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Add ability to copy/paste scene filters
This commit is contained in:
parent
7dc9ff0575
commit
2940c80f49
|
@ -1041,6 +1041,9 @@ retryScene:
|
|||
opt_start_replaybuffer = false;
|
||||
}
|
||||
|
||||
copyString = nullptr;
|
||||
copyFiltersString = nullptr;
|
||||
|
||||
LogScenes();
|
||||
|
||||
disableSaving--;
|
||||
|
@ -4012,9 +4015,19 @@ void OBSBasic::on_scenes_customContextMenuRequested(const QPoint &pos)
|
|||
this, SLOT(on_actionAddScene_triggered()));
|
||||
|
||||
if (item) {
|
||||
QAction *pasteFilters = new QAction(
|
||||
QTStr("Paste.Filters"), this);
|
||||
pasteFilters->setEnabled(copyFiltersString);
|
||||
connect(pasteFilters, SIGNAL(triggered()), this,
|
||||
SLOT(ScenePasteFilters()));
|
||||
|
||||
popup.addSeparator();
|
||||
popup.addAction(QTStr("Duplicate"),
|
||||
this, SLOT(DuplicateSelectedScene()));
|
||||
popup.addAction(QTStr("Copy.Filters"),
|
||||
this, SLOT(SceneCopyFilters()));
|
||||
popup.addAction(pasteFilters);
|
||||
popup.addSeparator();
|
||||
popup.addAction(QTStr("Rename"),
|
||||
this, SLOT(EditSceneName()));
|
||||
popup.addAction(QTStr("Remove"),
|
||||
|
@ -6959,6 +6972,24 @@ void OBSBasic::AudioMixerPasteFilters()
|
|||
obs_source_copy_filters(dstSource, source);
|
||||
}
|
||||
|
||||
void OBSBasic::SceneCopyFilters()
|
||||
{
|
||||
copyFiltersString = obs_source_get_name(GetCurrentSceneSource());
|
||||
}
|
||||
|
||||
void OBSBasic::ScenePasteFilters()
|
||||
{
|
||||
OBSSource source = obs_get_source_by_name(copyFiltersString);
|
||||
obs_source_release(source);
|
||||
|
||||
OBSSource dstSource = GetCurrentSceneSource();
|
||||
|
||||
if (source == dstSource)
|
||||
return;
|
||||
|
||||
obs_source_copy_filters(dstSource, source);
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionCopyFilters_triggered()
|
||||
{
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
|
|
|
@ -529,6 +529,9 @@ private slots:
|
|||
void EnablePreview();
|
||||
void DisablePreview();
|
||||
|
||||
void SceneCopyFilters();
|
||||
void ScenePasteFilters();
|
||||
|
||||
private:
|
||||
/* OBS Callbacks */
|
||||
static void SceneReordered(void *data, calldata_t *params);
|
||||
|
|
Loading…
Reference in a new issue