diff --git a/UI/api-interface.cpp b/UI/api-interface.cpp index 7ffa5dc6d..0f2632d60 100644 --- a/UI/api-interface.cpp +++ b/UI/api-interface.cpp @@ -618,6 +618,13 @@ struct OBSStudioAPI : obs_frontend_callbacks { Q_ARG(OBSSource, OBSSource(source))); } + char *obs_frontend_get_current_record_output_path(void) override + { + const char *recordOutputPath = main->GetCurrentOutputPath(); + + return bstrdup(recordOutputPath); + } + void on_load(obs_data_t *settings) override { for (size_t i = saveCallbacks.size(); i > 0; i--) { diff --git a/UI/obs-frontend-api/obs-frontend-api.cpp b/UI/obs-frontend-api/obs-frontend-api.cpp index ea529f1cb..423696edc 100644 --- a/UI/obs-frontend-api/obs-frontend-api.cpp +++ b/UI/obs-frontend-api/obs-frontend-api.cpp @@ -546,3 +546,10 @@ void obs_frontend_open_source_filters(obs_source_t *source) if (callbacks_valid()) c->obs_frontend_open_source_filters(source); } + +char *obs_frontend_get_current_record_output_path(void) +{ + return !!callbacks_valid() + ? c->obs_frontend_get_current_record_output_path() + : nullptr; +} diff --git a/UI/obs-frontend-api/obs-frontend-api.h b/UI/obs-frontend-api/obs-frontend-api.h index 429998cca..298761481 100644 --- a/UI/obs-frontend-api/obs-frontend-api.h +++ b/UI/obs-frontend-api/obs-frontend-api.h @@ -220,6 +220,8 @@ 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); +EXPORT char *obs_frontend_get_current_record_output_path(void); + /* ------------------------------------------------------------------------- */ #ifdef __cplusplus diff --git a/UI/obs-frontend-api/obs-frontend-internal.hpp b/UI/obs-frontend-api/obs-frontend-internal.hpp index 8f8a41495..8d54a2be0 100644 --- a/UI/obs-frontend-api/obs-frontend-internal.hpp +++ b/UI/obs-frontend-api/obs-frontend-internal.hpp @@ -138,6 +138,8 @@ struct obs_frontend_callbacks { virtual void obs_frontend_open_source_properties(obs_source_t *source) = 0; virtual void obs_frontend_open_source_filters(obs_source_t *source) = 0; + + virtual char *obs_frontend_get_current_record_output_path(void) = 0; }; EXPORT void