UI: Add `obs_frontend_open_source_interaction()`
Adds a frontend api call to open the interact dialog of a source, just like the `_properties` and `_filters` functions.master
parent
466ba5ae29
commit
47397ce527
|
@ -618,6 +618,12 @@ struct OBSStudioAPI : obs_frontend_callbacks {
|
||||||
Q_ARG(OBSSource, OBSSource(source)));
|
Q_ARG(OBSSource, OBSSource(source)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void obs_frontend_open_source_interaction(obs_source_t *source) override
|
||||||
|
{
|
||||||
|
QMetaObject::invokeMethod(main, "OpenInteraction",
|
||||||
|
Q_ARG(OBSSource, OBSSource(source)));
|
||||||
|
}
|
||||||
|
|
||||||
char *obs_frontend_get_current_record_output_path(void) override
|
char *obs_frontend_get_current_record_output_path(void) override
|
||||||
{
|
{
|
||||||
const char *recordOutputPath = main->GetCurrentOutputPath();
|
const char *recordOutputPath = main->GetCurrentOutputPath();
|
||||||
|
|
|
@ -547,6 +547,12 @@ void obs_frontend_open_source_filters(obs_source_t *source)
|
||||||
c->obs_frontend_open_source_filters(source);
|
c->obs_frontend_open_source_filters(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void obs_frontend_open_source_interaction(obs_source_t *source)
|
||||||
|
{
|
||||||
|
if (callbacks_valid())
|
||||||
|
c->obs_frontend_open_source_interaction(source);
|
||||||
|
}
|
||||||
|
|
||||||
char *obs_frontend_get_current_record_output_path(void)
|
char *obs_frontend_get_current_record_output_path(void)
|
||||||
{
|
{
|
||||||
return !!callbacks_valid()
|
return !!callbacks_valid()
|
||||||
|
|
|
@ -220,6 +220,7 @@ EXPORT void obs_frontend_reset_video(void);
|
||||||
|
|
||||||
EXPORT void obs_frontend_open_source_properties(obs_source_t *source);
|
EXPORT void obs_frontend_open_source_properties(obs_source_t *source);
|
||||||
EXPORT void obs_frontend_open_source_filters(obs_source_t *source);
|
EXPORT void obs_frontend_open_source_filters(obs_source_t *source);
|
||||||
|
EXPORT void obs_frontend_open_source_interaction(obs_source_t *source);
|
||||||
|
|
||||||
EXPORT char *obs_frontend_get_current_record_output_path(void);
|
EXPORT char *obs_frontend_get_current_record_output_path(void);
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,8 @@ struct obs_frontend_callbacks {
|
||||||
virtual void
|
virtual void
|
||||||
obs_frontend_open_source_properties(obs_source_t *source) = 0;
|
obs_frontend_open_source_properties(obs_source_t *source) = 0;
|
||||||
virtual void obs_frontend_open_source_filters(obs_source_t *source) = 0;
|
virtual void obs_frontend_open_source_filters(obs_source_t *source) = 0;
|
||||||
|
virtual void
|
||||||
|
obs_frontend_open_source_interaction(obs_source_t *source) = 0;
|
||||||
|
|
||||||
virtual char *obs_frontend_get_current_record_output_path(void) = 0;
|
virtual char *obs_frontend_get_current_record_output_path(void) = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6199,6 +6199,15 @@ void OBSBasic::OpenProperties(OBSSource source)
|
||||||
CreatePropertiesWindow(source);
|
CreatePropertiesWindow(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OBSBasic::OpenInteraction(OBSSource source)
|
||||||
|
{
|
||||||
|
if (source == nullptr) {
|
||||||
|
OBSSceneItem item = GetCurrentSceneItem();
|
||||||
|
source = obs_sceneitem_get_source(item);
|
||||||
|
}
|
||||||
|
CreateInteractionWindow(source);
|
||||||
|
}
|
||||||
|
|
||||||
void OBSBasic::OpenSceneFilters()
|
void OBSBasic::OpenSceneFilters()
|
||||||
{
|
{
|
||||||
OBSScene scene = GetCurrentScene();
|
OBSScene scene = GetCurrentScene();
|
||||||
|
|
|
@ -1092,6 +1092,7 @@ private slots:
|
||||||
void OpenSceneFilters();
|
void OpenSceneFilters();
|
||||||
void OpenFilters(OBSSource source = nullptr);
|
void OpenFilters(OBSSource source = nullptr);
|
||||||
void OpenProperties(OBSSource source = nullptr);
|
void OpenProperties(OBSSource source = nullptr);
|
||||||
|
void OpenInteraction(OBSSource source = nullptr);
|
||||||
|
|
||||||
void EnablePreviewDisplay(bool enable);
|
void EnablePreviewDisplay(bool enable);
|
||||||
void TogglePreview();
|
void TogglePreview();
|
||||||
|
|
|
@ -749,6 +749,15 @@ Functions
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
.. function:: void *obs_frontend_open_source_interaction(obs_source_t *source)
|
||||||
|
|
||||||
|
Opens the interact window of the specified source. Only call if
|
||||||
|
source has the *OBS_SOURCE_INTERACTION* output flag.
|
||||||
|
|
||||||
|
:param source: The source to open the interact window of
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
.. function:: char *obs_frontend_get_current_record_output_path(void)
|
.. function:: char *obs_frontend_get_current_record_output_path(void)
|
||||||
|
|
||||||
:return: A new pointer to the current record output path. Free
|
:return: A new pointer to the current record output path. Free
|
||||||
|
|
Loading…
Reference in New Issue