UI,obs-transitions: Enable missing files dialog for stinger transition
Adds transitions to the missing files check, allowing for stinger transitions to be shown in the dialogmaster
parent
1abf7ae3cf
commit
c9302d13ce
|
@ -1791,7 +1791,8 @@ obs_data_array_t *OBSBasic::SaveTransitions()
|
|||
return transitions;
|
||||
}
|
||||
|
||||
void OBSBasic::LoadTransitions(obs_data_array_t *transitions)
|
||||
void OBSBasic::LoadTransitions(obs_data_array_t *transitions,
|
||||
obs_load_source_cb cb, void *private_data)
|
||||
{
|
||||
size_t count = obs_data_array_count(transitions);
|
||||
|
||||
|
@ -1806,6 +1807,8 @@ void OBSBasic::LoadTransitions(obs_data_array_t *transitions)
|
|||
if (!obs_obj_invalid(source)) {
|
||||
InitTransition(source);
|
||||
AddTransitionBeforeSeparator(QT_UTF8(name), source);
|
||||
if (cb)
|
||||
cb(private_data, source);
|
||||
}
|
||||
|
||||
obs_data_release(settings);
|
||||
|
|
|
@ -1047,7 +1047,7 @@ void OBSBasic::LoadData(obs_data_t *data, const char *file)
|
|||
obs_load_sources(sources, cb, files);
|
||||
|
||||
if (transitions)
|
||||
LoadTransitions(transitions);
|
||||
LoadTransitions(transitions, cb, files);
|
||||
if (sceneOrder)
|
||||
LoadSceneListOrder(sceneOrder);
|
||||
|
||||
|
|
|
@ -404,7 +404,8 @@ private:
|
|||
obs_source_t *FindTransition(const char *name);
|
||||
OBSSource GetCurrentTransition();
|
||||
obs_data_array_t *SaveTransitions();
|
||||
void LoadTransitions(obs_data_array_t *transitions);
|
||||
void LoadTransitions(obs_data_array_t *transitions,
|
||||
obs_load_source_cb cb, void *private_data);
|
||||
|
||||
obs_source_t *fadeTransition;
|
||||
obs_source_t *cutTransition;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <obs-module.h>
|
||||
#include <util/dstr.h>
|
||||
#include "util/platform.h"
|
||||
|
||||
#define TIMING_TIME 0
|
||||
#define TIMING_FRAME 1
|
||||
|
@ -729,6 +730,60 @@ static obs_properties_t *stinger_properties(void *data)
|
|||
return ppts;
|
||||
}
|
||||
|
||||
static void missing_file_callback(void *src, const char *new_path, void *data)
|
||||
{
|
||||
struct stinger_info *s = src;
|
||||
obs_data_t *settings = obs_source_get_settings(s->source);
|
||||
|
||||
const char *type = data;
|
||||
|
||||
if (strcmp(type, "media_source") == 0) {
|
||||
obs_data_set_string(settings, "path", new_path);
|
||||
} else if (strcmp(type, "matte_source") == 0) {
|
||||
obs_data_set_string(settings, "track_matte_path", new_path);
|
||||
}
|
||||
|
||||
obs_source_update(s->source, settings);
|
||||
obs_data_release(settings);
|
||||
}
|
||||
|
||||
static obs_missing_files_t *stinger_missing_files(void *data)
|
||||
{
|
||||
struct stinger_info *s = data;
|
||||
obs_data_t *settings = obs_source_get_settings(s->source);
|
||||
obs_missing_files_t *files = obs_missing_files_create();
|
||||
|
||||
const char *path = obs_data_get_string(settings, "path");
|
||||
|
||||
if (strcmp(path, "") != 0) {
|
||||
if (!os_file_exists(path)) {
|
||||
obs_missing_file_t *file = obs_missing_file_create(
|
||||
path, missing_file_callback,
|
||||
OBS_MISSING_FILE_SOURCE, s->source,
|
||||
(void *)"media_source");
|
||||
|
||||
obs_missing_files_add_file(files, file);
|
||||
}
|
||||
}
|
||||
|
||||
const char *track_matte_path =
|
||||
obs_data_get_string(settings, "track_matte_path");
|
||||
|
||||
if (strcmp(track_matte_path, "") != 0) {
|
||||
if (!os_file_exists(track_matte_path)) {
|
||||
obs_missing_file_t *file = obs_missing_file_create(
|
||||
track_matte_path, missing_file_callback,
|
||||
OBS_MISSING_FILE_SOURCE, s->source,
|
||||
(void *)"matte_source");
|
||||
|
||||
obs_missing_files_add_file(files, file);
|
||||
}
|
||||
}
|
||||
|
||||
obs_data_release(settings);
|
||||
return files;
|
||||
}
|
||||
|
||||
struct obs_source_info stinger_transition = {
|
||||
.id = "obs_stinger_transition",
|
||||
.type = OBS_SOURCE_TYPE_TRANSITION,
|
||||
|
@ -740,6 +795,7 @@ struct obs_source_info stinger_transition = {
|
|||
.video_render = stinger_video_render,
|
||||
.video_tick = stinger_video_tick,
|
||||
.audio_render = stinger_audio_render,
|
||||
.missing_files = stinger_missing_files,
|
||||
.get_properties = stinger_properties,
|
||||
.enum_active_sources = stinger_enum_active_sources,
|
||||
.enum_all_sources = stinger_enum_all_sources,
|
||||
|
|
Loading…
Reference in New Issue