Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OBS 31 #4

Merged
merged 2 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 30 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# --- Detect if the plugin is build out of tree or not ---
if(CMAKE_PROJECT_NAME STREQUAL "obs-studio")
set(BUILD_OUT_OF_TREE OFF)
if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
legacy_check()
endif()
else()
set(BUILD_OUT_OF_TREE ON)
cmake_minimum_required(VERSION 3.18)
Expand Down Expand Up @@ -32,12 +29,17 @@ target_sources(${PROJECT_NAME} PRIVATE
version.h)

if(BUILD_OUT_OF_TREE)
find_package(libobs REQUIRED)
find_package(obs-frontend-api REQUIRED)
include(cmake/ObsPluginHelpers.cmake)
find_qt(COMPONENTS Widgets COMPONENTS_LINUX Gui)
set(OBS_FRONTEND_API_NAME "obs-frontend-api")
find_package(libobs REQUIRED)
find_package(obs-frontend-api REQUIRED)
include(cmake/ObsPluginHelpers.cmake)
find_qt(COMPONENTS Widgets COMPONENTS_LINUX Gui)
set(OBS_FRONTEND_API_NAME "obs-frontend-api")
else()
if(OBS_VERSION VERSION_GREATER_EQUAL 30.1.0)
find_package(Qt6 COMPONENTS Core Widgets)
else()
find_qt(COMPONENTS Widgets COMPONENTS_LINUX Gui)
endif()
set(OBS_FRONTEND_API_NAME "frontend-api")
endif()

Expand Down Expand Up @@ -71,25 +73,25 @@ target_link_libraries(${PROJECT_NAME}
OBS::libobs)

if(BUILD_OUT_OF_TREE)
if(NOT LIB_OUT_DIR)
set(LIB_OUT_DIR "/lib/obs-plugins")
endif()
if(NOT DATA_OUT_DIR)
set(DATA_OUT_DIR "/share/obs/obs-plugins/${PROJECT_NAME}")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR})
install(DIRECTORY data/locale
DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_OUT_DIR})
setup_plugin_target(${PROJECT_NAME})
if(NOT LIB_OUT_DIR)
set(LIB_OUT_DIR "/lib/obs-plugins")
endif()
if(NOT DATA_OUT_DIR)
set(DATA_OUT_DIR "/share/obs/obs-plugins/${PROJECT_NAME}")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR})
install(DIRECTORY data/locale
DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_OUT_DIR})
setup_plugin_target(${PROJECT_NAME})
else()
target_include_directories(${PROJECT_NAME} PRIVATE
"${CMAKE_SOURCE_DIR}/UI/obs-frontend-api")
if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
set_target_properties_obs(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro" PREFIX "")
else()
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro")
setup_plugin_target(${PROJECT_NAME})
endif()
target_include_directories(${PROJECT_NAME} PRIVATE
"${CMAKE_SOURCE_DIR}/UI/obs-frontend-api")
if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
set_target_properties_obs(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro" PREFIX "")
else()
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro")
setup_plugin_target(${PROJECT_NAME})
endif()
endif()
1 change: 1 addition & 0 deletions downstream-keyer-dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ DownstreamKeyerDock::DownstreamKeyerDock(QWidget *parent, int oc, obs_view_t *v,

auto config = new QPushButton(this);
config->setProperty("themeID", "configIconSmall");
config->setProperty("class", "icon-gear");

connect(config, &QAbstractButton::clicked, this,
&DownstreamKeyerDock::ConfigClicked);
Expand Down
8 changes: 8 additions & 0 deletions downstream-keyer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ DownstreamKeyer::DownstreamKeyer(int channel, QString name, obs_view_t *v,
auto actionAddScene = new QAction(this);
actionAddScene->setObjectName(QStringLiteral("actionAddScene"));
actionAddScene->setProperty("themeID", "addIconSmall");
actionAddScene->setProperty("class", "icon-plus");
actionAddScene->setText(QT_UTF8(obs_module_text("Add")));
connect(actionAddScene, SIGNAL(triggered()), this,
SLOT(on_actionAddScene_triggered()));
Expand All @@ -74,6 +75,7 @@ DownstreamKeyer::DownstreamKeyer(int channel, QString name, obs_view_t *v,
actionRemoveScene->setObjectName(QStringLiteral("actionRemoveScene"));
actionRemoveScene->setShortcutContext(Qt::WidgetWithChildrenShortcut);
actionRemoveScene->setProperty("themeID", "removeIconSmall");
actionRemoveScene->setProperty("class", "icon-minus");
actionRemoveScene->setText(QT_UTF8(obs_module_text("Remove")));
connect(actionRemoveScene, SIGNAL(triggered()), this,
SLOT(on_actionRemoveScene_triggered()));
Expand All @@ -84,6 +86,7 @@ DownstreamKeyer::DownstreamKeyer(int channel, QString name, obs_view_t *v,
auto actionSceneUp = new QAction(this);
actionSceneUp->setObjectName(QStringLiteral("actionSceneUp"));
actionSceneUp->setProperty("themeID", "upArrowIconSmall");
actionSceneUp->setProperty("class", "icon-up");
actionSceneUp->setText(QT_UTF8(obs_module_text("MoveUp")));
connect(actionSceneUp, SIGNAL(triggered()), this,
SLOT(on_actionSceneUp_triggered()));
Expand All @@ -92,6 +95,7 @@ DownstreamKeyer::DownstreamKeyer(int channel, QString name, obs_view_t *v,
auto actionSceneDown = new QAction(this);
actionSceneDown->setObjectName(QStringLiteral("actionSceneDown"));
actionSceneDown->setProperty("themeID", "downArrowIconSmall");
actionSceneDown->setProperty("class", "icon-down");
actionSceneDown->setText(QT_UTF8(obs_module_text("MoveDown")));
connect(actionSceneDown, SIGNAL(triggered()), this,
SLOT(on_actionSceneDown_triggered()));
Expand All @@ -102,6 +106,7 @@ DownstreamKeyer::DownstreamKeyer(int channel, QString name, obs_view_t *v,
auto actionSceneNull = new QAction(this);
actionSceneNull->setObjectName(QStringLiteral("actionSceneNull"));
actionSceneNull->setProperty("themeID", "pauseIconSmall");
actionSceneNull->setProperty("class", "icon-media-pause");
actionSceneNull->setText(QT_UTF8(obs_module_text("None")));
connect(actionSceneNull, SIGNAL(triggered()), this,
SLOT(on_actionSceneNull_triggered()));
Expand Down Expand Up @@ -409,6 +414,7 @@ void DownstreamKeyer::Save(obs_data_t *data)
: "");
obs_data_set_int(data, "hide_transition_duration",
hideTransitionDuration);
obs_data_set_bool(data, "tie", tie->isChecked());
obs_data_array_t *sceneArray = obs_data_array_create();
for (int i = 0; i < scenesList->count(); i++) {
auto item = scenesList->item(i);
Expand Down Expand Up @@ -620,6 +626,7 @@ void DownstreamKeyer::Load(obs_data_t *data)
transitionType::hide);
hideTransitionDuration =
obs_data_get_int(data, "hide_transition_duration");
tie->setChecked(obs_data_get_bool(data, "tie"));
scenesList->clear();
obs_data_array_t *sceneArray = obs_data_get_array(data, "scenes");
const auto sceneName = QT_UTF8(obs_data_get_string(data, "scene"));
Expand Down Expand Up @@ -1041,6 +1048,7 @@ void DownstreamKeyer::SetOutputChannel(int oc)
LockedCheckBox::LockedCheckBox()
{
setProperty("lockCheckBox", true);
setProperty("class", "indicator-lock");
}

LockedCheckBox::LockedCheckBox(QWidget *parent) : QCheckBox(parent) {}