mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-14 15:24:07 +00:00
UI: Add functions to open properties and filters
This commit is contained in:
parent
f0d372bdd7
commit
5b18faeb49
|
@ -606,6 +606,18 @@ struct OBSStudioAPI : obs_frontend_callbacks {
|
|||
|
||||
void obs_frontend_reset_video(void) override { main->ResetVideo(); }
|
||||
|
||||
void obs_frontend_open_source_properties(obs_source_t *source) override
|
||||
{
|
||||
QMetaObject::invokeMethod(main, "OpenProperties",
|
||||
Q_ARG(OBSSource, OBSSource(source)));
|
||||
}
|
||||
|
||||
void obs_frontend_open_source_filters(obs_source_t *source) override
|
||||
{
|
||||
QMetaObject::invokeMethod(main, "OpenFilters",
|
||||
Q_ARG(OBSSource, OBSSource(source)));
|
||||
}
|
||||
|
||||
void on_load(obs_data_t *settings) override
|
||||
{
|
||||
for (size_t i = saveCallbacks.size(); i > 0; i--) {
|
||||
|
|
|
@ -534,3 +534,15 @@ void obs_frontend_reset_video(void)
|
|||
if (callbacks_valid())
|
||||
c->obs_frontend_reset_video();
|
||||
}
|
||||
|
||||
void obs_frontend_open_source_properties(obs_source_t *source)
|
||||
{
|
||||
if (callbacks_valid())
|
||||
c->obs_frontend_open_source_properties(source);
|
||||
}
|
||||
|
||||
void obs_frontend_open_source_filters(obs_source_t *source)
|
||||
{
|
||||
if (callbacks_valid())
|
||||
c->obs_frontend_open_source_filters(source);
|
||||
}
|
||||
|
|
|
@ -215,6 +215,9 @@ EXPORT bool obs_frontend_virtualcam_active(void);
|
|||
|
||||
EXPORT void obs_frontend_reset_video(void);
|
||||
|
||||
EXPORT void obs_frontend_open_source_properties(obs_source_t *source);
|
||||
EXPORT void obs_frontend_open_source_filters(obs_source_t *source);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -134,6 +134,10 @@ struct obs_frontend_callbacks {
|
|||
virtual bool obs_frontend_virtualcam_active(void) = 0;
|
||||
|
||||
virtual void obs_frontend_reset_video(void) = 0;
|
||||
|
||||
virtual void
|
||||
obs_frontend_open_source_properties(obs_source_t *source) = 0;
|
||||
virtual void obs_frontend_open_source_filters(obs_source_t *source) = 0;
|
||||
};
|
||||
|
||||
EXPORT void
|
||||
|
|
|
@ -6007,14 +6007,24 @@ void OBSBasic::SceneNameEdited(QWidget *editor,
|
|||
UNUSED_PARAMETER(endHint);
|
||||
}
|
||||
|
||||
void OBSBasic::OpenFilters()
|
||||
void OBSBasic::OpenFilters(OBSSource source)
|
||||
{
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
OBSSource source = obs_sceneitem_get_source(item);
|
||||
|
||||
if (source == nullptr) {
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
source = obs_sceneitem_get_source(item);
|
||||
}
|
||||
CreateFiltersWindow(source);
|
||||
}
|
||||
|
||||
void OBSBasic::OpenProperties(OBSSource source)
|
||||
{
|
||||
if (source == nullptr) {
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
source = obs_sceneitem_get_source(item);
|
||||
}
|
||||
CreatePropertiesWindow(source);
|
||||
}
|
||||
|
||||
void OBSBasic::OpenSceneFilters()
|
||||
{
|
||||
OBSScene scene = GetCurrentScene();
|
||||
|
|
|
@ -1047,7 +1047,8 @@ private slots:
|
|||
QAbstractItemDelegate::EndEditHint endHint);
|
||||
|
||||
void OpenSceneFilters();
|
||||
void OpenFilters();
|
||||
void OpenFilters(OBSSource source = nullptr);
|
||||
void OpenProperties(OBSSource source = nullptr);
|
||||
|
||||
void EnablePreviewDisplay(bool enable);
|
||||
void TogglePreview();
|
||||
|
|
|
@ -648,3 +648,19 @@ Functions
|
|||
|
||||
:return: The value of the position of the T-bar to, with a value in 0-1023.
|
||||
:rtype: int
|
||||
|
||||
---------------------------------------
|
||||
|
||||
.. function:: void *obs_frontend_open_properties(obs_source_t *source)
|
||||
|
||||
Opens the properties window of the specified source.
|
||||
|
||||
:param source: The source to open the properties window of.
|
||||
|
||||
---------------------------------------
|
||||
|
||||
.. function:: void *obs_frontend_open_filters(obs_source_t *source)
|
||||
|
||||
Opens the filters window of the specified source.
|
||||
|
||||
:param source: The source to open the filters window of.
|
||||
|
|
Loading…
Reference in a new issue