New upstream version 24.0.1+dfsg1
This commit is contained in:
parent
b14f9eae6d
commit
5a730d6ec3
842 changed files with 42245 additions and 33385 deletions
|
|
@ -51,13 +51,15 @@ static obs_properties_t *color_source_properties(void *unused)
|
|||
obs_properties_t *props = obs_properties_create();
|
||||
|
||||
obs_properties_add_color(props, "color",
|
||||
obs_module_text("ColorSource.Color"));
|
||||
obs_module_text("ColorSource.Color"));
|
||||
|
||||
obs_properties_add_int(props, "width",
|
||||
obs_module_text("ColorSource.Width"), 0, 4096, 1);
|
||||
obs_module_text("ColorSource.Width"), 0, 4096,
|
||||
1);
|
||||
|
||||
obs_properties_add_int(props, "height",
|
||||
obs_module_text("ColorSource.Height"), 0, 4096, 1);
|
||||
obs_module_text("ColorSource.Height"), 0, 4096,
|
||||
1);
|
||||
|
||||
return props;
|
||||
}
|
||||
|
|
@ -68,9 +70,9 @@ static void color_source_render(void *data, gs_effect_t *effect)
|
|||
|
||||
struct color_source *context = data;
|
||||
|
||||
gs_effect_t *solid = obs_get_base_effect(OBS_EFFECT_SOLID);
|
||||
gs_eparam_t *color = gs_effect_get_param_by_name(solid, "color");
|
||||
gs_technique_t *tech = gs_effect_get_technique(solid, "Solid");
|
||||
gs_effect_t *solid = obs_get_base_effect(OBS_EFFECT_SOLID);
|
||||
gs_eparam_t *color = gs_effect_get_param_by_name(solid, "color");
|
||||
gs_technique_t *tech = gs_effect_get_technique(solid, "Solid");
|
||||
|
||||
struct vec4 colorVal;
|
||||
vec4_from_rgba(&colorVal, context->color);
|
||||
|
|
@ -99,25 +101,22 @@ static uint32_t color_source_getheight(void *data)
|
|||
|
||||
static void color_source_defaults(obs_data_t *settings)
|
||||
{
|
||||
struct obs_video_info ovi;
|
||||
obs_get_video_info(&ovi);
|
||||
|
||||
obs_data_set_default_int(settings, "color", 0xFFFFFFFF);
|
||||
obs_data_set_default_int(settings, "width", ovi.base_width);
|
||||
obs_data_set_default_int(settings, "height", ovi.base_height);
|
||||
obs_data_set_default_int(settings, "width", 400);
|
||||
obs_data_set_default_int(settings, "height", 400);
|
||||
}
|
||||
|
||||
struct obs_source_info color_source_info = {
|
||||
.id = "color_source",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW,
|
||||
.create = color_source_create,
|
||||
.destroy = color_source_destroy,
|
||||
.update = color_source_update,
|
||||
.get_name = color_source_get_name,
|
||||
.get_defaults = color_source_defaults,
|
||||
.get_width = color_source_getwidth,
|
||||
.get_height = color_source_getheight,
|
||||
.video_render = color_source_render,
|
||||
.get_properties = color_source_properties
|
||||
.id = "color_source",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW,
|
||||
.create = color_source_create,
|
||||
.destroy = color_source_destroy,
|
||||
.update = color_source_update,
|
||||
.get_name = color_source_get_name,
|
||||
.get_defaults = color_source_defaults,
|
||||
.get_width = color_source_getwidth,
|
||||
.get_height = color_source_getheight,
|
||||
.video_render = color_source_render,
|
||||
.get_properties = color_source_properties,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ SlideShow.Loop="Bucle"
|
|||
SlideShow.Transition="Transición"
|
||||
SlideShow.Transition.Cut="Corte"
|
||||
SlideShow.Transition.Fade="Desvanecimiento"
|
||||
SlideShow.Transition.Swipe="Deslizar Rapido"
|
||||
SlideShow.Transition.Slide="Deslizar"
|
||||
SlideShow.Transition.Swipe="Deslizar"
|
||||
SlideShow.Transition.Slide="Diapositiva"
|
||||
SlideShow.PlaybackBehavior="Comportamiento de visibilidad"
|
||||
SlideShow.PlaybackBehavior.StopRestart="Detener cuando no sea visible, reiniciar cuando sea visible"
|
||||
SlideShow.PlaybackBehavior.PauseUnpause="Pausar cuando no sea visible, reanudar cuando sea visible"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,36 @@
|
|||
ImageInput="Imaxe"
|
||||
File="Ficheiro de imaxe"
|
||||
UnloadWhenNotShowing="Non descargar a imaxe cando non se mostre"
|
||||
UnloadWhenNotShowing="Descargar a imaxe cando non se amosa"
|
||||
|
||||
SlideShow="Diaporama"
|
||||
SlideShow.TransitionSpeed="Velocidade da transición (milisegundos)"
|
||||
SlideShow.SlideTime="Tempo entre diapositivas (milisegundos)"
|
||||
SlideShow.Files="Ficheiros de imaxe"
|
||||
SlideShow.CustomSize="Límite do tamaño/relación de aspecto"
|
||||
SlideShow.CustomSize.Auto="Automático"
|
||||
SlideShow.Randomize="Reproducir ao chou"
|
||||
SlideShow.Loop="Bucle"
|
||||
SlideShow.Transition="Transición"
|
||||
SlideShow.Transition.Cut="Cortar"
|
||||
SlideShow.Transition.Fade="Esvaecer"
|
||||
SlideShow.Transition.Swipe="Esvarar"
|
||||
SlideShow.Transition.Slide="Diapositiva"
|
||||
SlideShow.PlaybackBehavior="Comportamento da visibilidade"
|
||||
SlideShow.PlaybackBehavior.StopRestart="Parar cando non é visíbel, reiniciar cando sexa visíbel"
|
||||
SlideShow.PlaybackBehavior.PauseUnpause="Pór en pausa cando non é visíbel, reiniciar cando sexa visíbel"
|
||||
SlideShow.PlaybackBehavior.AlwaysPlay="Reproducir sempre cando non estea visíbel"
|
||||
SlideShow.SlideMode="Modo de diapositiva"
|
||||
SlideShow.SlideMode.Auto="Automático"
|
||||
SlideShow.SlideMode.Manual="Manual (use as teclas rápidas para controlar o disporama)"
|
||||
SlideShow.PlayPause="Reproducir/Pór en pausa"
|
||||
SlideShow.Restart="Reiniciar"
|
||||
SlideShow.Stop="Parar"
|
||||
SlideShow.NextSlide="Seguinte diapositiva"
|
||||
SlideShow.PreviousSlide="Diapositiva anterior"
|
||||
SlideShow.HideWhenDone="Agochar cando se reproduce o diaporama"
|
||||
|
||||
ColorSource="Orixe da cor"
|
||||
ColorSource.Color="Cor"
|
||||
ColorSource.Width="Largo"
|
||||
ColorSource.Height="Alto"
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ SlideShow.Transition.Cut="Decupare"
|
|||
SlideShow.Transition.Fade="Estompare"
|
||||
SlideShow.Transition.Swipe="Glisare"
|
||||
SlideShow.Transition.Slide="Culisare"
|
||||
SlideShow.SlideMode="Mod de culisare"
|
||||
SlideShow.SlideMode.Auto="Automat"
|
||||
SlideShow.PlayPause="Redă/Pune pe pauză"
|
||||
SlideShow.Restart="Repornește"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,36 @@
|
|||
ImageInput="Slika"
|
||||
File="Slikovna datoteka"
|
||||
UnloadWhenNotShowing="Ne naloži slike, ko ni prikazana"
|
||||
UnloadWhenNotShowing="Razloži sliko, ko ni prikazana"
|
||||
|
||||
SlideShow="Slikovna predstavitev"
|
||||
SlideShow.TransitionSpeed="Hitrost prehodov (ms)"
|
||||
SlideShow.SlideTime="Čas med slikami (ms)"
|
||||
SlideShow.Files="Slikovne datoteke"
|
||||
SlideShow.CustomSize="Omejitev velikost/Razmerje"
|
||||
SlideShow.CustomSize.Auto="Samodejno"
|
||||
SlideShow.Randomize="Naključno predvajanje"
|
||||
SlideShow.Loop="Ponavljaj"
|
||||
SlideShow.Transition="Prehod"
|
||||
SlideShow.Transition.Cut="Izreži"
|
||||
SlideShow.Transition.Fade="Pojemaj"
|
||||
SlideShow.Transition.Swipe="Potegni"
|
||||
SlideShow.Transition.Slide="Podrsaj"
|
||||
SlideShow.PlaybackBehavior="Vedenje vidnosti"
|
||||
SlideShow.PlaybackBehavior.StopRestart="Ustavi, ko ni vidno; ponovno zaženi, ko je vidno"
|
||||
SlideShow.PlaybackBehavior.PauseUnpause="Premor, ko ni vidno; nadaljuj, ko je vidno"
|
||||
SlideShow.PlaybackBehavior.AlwaysPlay="Vedno predvajaj, ko ni vidno"
|
||||
SlideShow.SlideMode="Način predstavitve"
|
||||
SlideShow.SlideMode.Auto="Samodejno"
|
||||
SlideShow.SlideMode.Manual="Ročno (uporabi hitre tipke na nadzor predstavitve)"
|
||||
SlideShow.PlayPause="Predvajaj/Premor"
|
||||
SlideShow.Restart="Ponovno zaženi"
|
||||
SlideShow.Stop="Ustavi"
|
||||
SlideShow.NextSlide="Naslednja slika"
|
||||
SlideShow.PreviousSlide="Prejšnja slika"
|
||||
SlideShow.HideWhenDone="Skrij, ko je predstavitev končana"
|
||||
|
||||
ColorSource="Barvni vir"
|
||||
ColorSource.Color="Barva"
|
||||
ColorSource.Width="Širina"
|
||||
ColorSource.Height="Višina"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,31 +4,27 @@
|
|||
#include <util/dstr.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define blog(log_level, format, ...) \
|
||||
#define blog(log_level, format, ...) \
|
||||
blog(log_level, "[image_source: '%s'] " format, \
|
||||
obs_source_get_name(context->source), ##__VA_ARGS__)
|
||||
obs_source_get_name(context->source), ##__VA_ARGS__)
|
||||
|
||||
#define debug(format, ...) \
|
||||
blog(LOG_DEBUG, format, ##__VA_ARGS__)
|
||||
#define info(format, ...) \
|
||||
blog(LOG_INFO, format, ##__VA_ARGS__)
|
||||
#define warn(format, ...) \
|
||||
blog(LOG_WARNING, format, ##__VA_ARGS__)
|
||||
#define debug(format, ...) blog(LOG_DEBUG, format, ##__VA_ARGS__)
|
||||
#define info(format, ...) blog(LOG_INFO, format, ##__VA_ARGS__)
|
||||
#define warn(format, ...) blog(LOG_WARNING, format, ##__VA_ARGS__)
|
||||
|
||||
struct image_source {
|
||||
obs_source_t *source;
|
||||
|
||||
char *file;
|
||||
bool persistent;
|
||||
time_t file_timestamp;
|
||||
float update_time_elapsed;
|
||||
uint64_t last_time;
|
||||
bool active;
|
||||
char *file;
|
||||
bool persistent;
|
||||
time_t file_timestamp;
|
||||
float update_time_elapsed;
|
||||
uint64_t last_time;
|
||||
bool active;
|
||||
|
||||
gs_image_file2_t if2;
|
||||
};
|
||||
|
||||
|
||||
static time_t get_modified_timestamp(const char *filename)
|
||||
{
|
||||
struct stat stats;
|
||||
|
|
@ -152,9 +148,9 @@ static void image_source_render(void *data, gs_effect_t *effect)
|
|||
return;
|
||||
|
||||
gs_effect_set_texture(gs_effect_get_param_by_name(effect, "image"),
|
||||
context->if2.image.texture);
|
||||
gs_draw_sprite(context->if2.image.texture, 0,
|
||||
context->if2.image.cx, context->if2.image.cy);
|
||||
context->if2.image.texture);
|
||||
gs_draw_sprite(context->if2.image.texture, 0, context->if2.image.cx,
|
||||
context->if2.image.cy);
|
||||
}
|
||||
|
||||
static void image_source_tick(void *data, float seconds)
|
||||
|
|
@ -212,7 +208,6 @@ static void image_source_tick(void *data, float seconds)
|
|||
context->last_time = frame_time;
|
||||
}
|
||||
|
||||
|
||||
static const char *image_filter =
|
||||
"All formats (*.bmp *.tga *.png *.jpeg *.jpg *.gif *.psd);;"
|
||||
"BMP Files (*.bmp);;"
|
||||
|
|
@ -240,11 +235,10 @@ static obs_properties_t *image_source_properties(void *data)
|
|||
dstr_resize(&path, slash - path.array + 1);
|
||||
}
|
||||
|
||||
obs_properties_add_path(props,
|
||||
"file", obs_module_text("File"),
|
||||
OBS_PATH_FILE, image_filter, path.array);
|
||||
obs_properties_add_bool(props,
|
||||
"unload", obs_module_text("UnloadWhenNotShowing"));
|
||||
obs_properties_add_path(props, "file", obs_module_text("File"),
|
||||
OBS_PATH_FILE, image_filter, path.array);
|
||||
obs_properties_add_bool(props, "unload",
|
||||
obs_module_text("UnloadWhenNotShowing"));
|
||||
dstr_free(&path);
|
||||
|
||||
return props;
|
||||
|
|
@ -257,22 +251,21 @@ uint64_t image_source_get_memory_usage(void *data)
|
|||
}
|
||||
|
||||
static struct obs_source_info image_source_info = {
|
||||
.id = "image_source",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO,
|
||||
.get_name = image_source_get_name,
|
||||
.create = image_source_create,
|
||||
.destroy = image_source_destroy,
|
||||
.update = image_source_update,
|
||||
.get_defaults = image_source_defaults,
|
||||
.show = image_source_show,
|
||||
.hide = image_source_hide,
|
||||
.get_width = image_source_getwidth,
|
||||
.get_height = image_source_getheight,
|
||||
.video_render = image_source_render,
|
||||
.video_tick = image_source_tick,
|
||||
.get_properties = image_source_properties
|
||||
};
|
||||
.id = "image_source",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO,
|
||||
.get_name = image_source_get_name,
|
||||
.create = image_source_create,
|
||||
.destroy = image_source_destroy,
|
||||
.update = image_source_update,
|
||||
.get_defaults = image_source_defaults,
|
||||
.show = image_source_show,
|
||||
.hide = image_source_hide,
|
||||
.get_width = image_source_getwidth,
|
||||
.get_height = image_source_getheight,
|
||||
.video_render = image_source_render,
|
||||
.video_tick = image_source_tick,
|
||||
.get_properties = image_source_properties};
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("image-source", "en-US")
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@
|
|||
#include <util/darray.h>
|
||||
#include <util/dstr.h>
|
||||
|
||||
#define do_log(level, format, ...) \
|
||||
#define do_log(level, format, ...) \
|
||||
blog(level, "[slideshow: '%s'] " format, \
|
||||
obs_source_get_name(ss->source), ##__VA_ARGS__)
|
||||
obs_source_get_name(ss->source), ##__VA_ARGS__)
|
||||
|
||||
#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__)
|
||||
#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__)
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#define S_TR_SPEED "transition_speed"
|
||||
#define S_CUSTOM_SIZE "use_custom_size"
|
||||
|
|
@ -55,12 +57,14 @@
|
|||
#define T_TR_SWIPE T_TR_("Swipe")
|
||||
#define T_TR_SLIDE T_TR_("Slide")
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
extern uint64_t image_source_get_memory_usage(void *data);
|
||||
|
||||
#define BYTES_TO_MBYTES (1024 * 1024)
|
||||
#define MAX_MEM_USAGE (250 * BYTES_TO_MBYTES)
|
||||
#define MAX_MEM_USAGE (250 * BYTES_TO_MBYTES)
|
||||
|
||||
struct image_file_data {
|
||||
char *path;
|
||||
|
|
@ -182,7 +186,7 @@ static const char *ss_getname(void *unused)
|
|||
}
|
||||
|
||||
static void add_file(struct slideshow *ss, struct darray *array,
|
||||
const char *path, uint32_t *cx, uint32_t *cy)
|
||||
const char *path, uint32_t *cx, uint32_t *cy)
|
||||
{
|
||||
DARRAY(struct image_file_data) new_files;
|
||||
struct image_file_data data;
|
||||
|
|
@ -207,8 +211,10 @@ static void add_file(struct slideshow *ss, struct darray *array,
|
|||
data.source = new_source;
|
||||
da_push_back(new_files, &data);
|
||||
|
||||
if (new_cx > *cx) *cx = new_cx;
|
||||
if (new_cy > *cy) *cy = new_cy;
|
||||
if (new_cx > *cx)
|
||||
*cx = new_cx;
|
||||
if (new_cy > *cy)
|
||||
*cy = new_cy;
|
||||
|
||||
void *source_data = obs_obj_get_data(new_source);
|
||||
ss->mem_usage += image_source_get_memory_usage(source_data);
|
||||
|
|
@ -221,12 +227,9 @@ static bool valid_extension(const char *ext)
|
|||
{
|
||||
if (!ext)
|
||||
return false;
|
||||
return astrcmpi(ext, ".bmp") == 0 ||
|
||||
astrcmpi(ext, ".tga") == 0 ||
|
||||
astrcmpi(ext, ".png") == 0 ||
|
||||
astrcmpi(ext, ".jpeg") == 0 ||
|
||||
astrcmpi(ext, ".jpg") == 0 ||
|
||||
astrcmpi(ext, ".gif") == 0;
|
||||
return astrcmpi(ext, ".bmp") == 0 || astrcmpi(ext, ".tga") == 0 ||
|
||||
astrcmpi(ext, ".png") == 0 || astrcmpi(ext, ".jpeg") == 0 ||
|
||||
astrcmpi(ext, ".jpg") == 0 || astrcmpi(ext, ".gif") == 0;
|
||||
}
|
||||
|
||||
static inline bool item_valid(struct slideshow *ss)
|
||||
|
|
@ -241,19 +244,16 @@ static void do_transition(void *data, bool to_null)
|
|||
|
||||
if (valid && ss->use_cut)
|
||||
obs_transition_set(ss->transition,
|
||||
ss->files.array[ss->cur_item].source);
|
||||
ss->files.array[ss->cur_item].source);
|
||||
|
||||
else if (valid && !to_null)
|
||||
obs_transition_start(ss->transition,
|
||||
OBS_TRANSITION_MODE_AUTO,
|
||||
ss->tr_speed,
|
||||
ss->files.array[ss->cur_item].source);
|
||||
obs_transition_start(ss->transition, OBS_TRANSITION_MODE_AUTO,
|
||||
ss->tr_speed,
|
||||
ss->files.array[ss->cur_item].source);
|
||||
|
||||
else
|
||||
obs_transition_start(ss->transition,
|
||||
OBS_TRANSITION_MODE_AUTO,
|
||||
ss->tr_speed,
|
||||
NULL);
|
||||
obs_transition_start(ss->transition, OBS_TRANSITION_MODE_AUTO,
|
||||
ss->tr_speed, NULL);
|
||||
}
|
||||
|
||||
static void ss_update(void *data, obs_data_t *settings)
|
||||
|
|
@ -344,8 +344,8 @@ static void ss_update(void *data, obs_data_t *settings)
|
|||
dstr_copy(&dir_path, path);
|
||||
dstr_cat_ch(&dir_path, '/');
|
||||
dstr_cat(&dir_path, ent->d_name);
|
||||
add_file(ss, &new_files.da, dir_path.array,
|
||||
&cx, &cy);
|
||||
add_file(ss, &new_files.da, dir_path.array, &cx,
|
||||
&cy);
|
||||
|
||||
if (ss->mem_usage >= MAX_MEM_USAGE)
|
||||
break;
|
||||
|
|
@ -447,7 +447,7 @@ static void ss_update(void *data, obs_data_t *settings)
|
|||
obs_transition_set_size(ss->transition, cx, cy);
|
||||
obs_transition_set_alignment(ss->transition, OBS_ALIGN_CENTER);
|
||||
obs_transition_set_scale_type(ss->transition,
|
||||
OBS_TRANSITION_SCALE_ASPECT);
|
||||
OBS_TRANSITION_SCALE_ASPECT);
|
||||
|
||||
if (ss->randomize && ss->files.num)
|
||||
ss->cur_item = random_file(ss);
|
||||
|
|
@ -475,7 +475,7 @@ static void ss_restart(void *data)
|
|||
ss->cur_item = 0;
|
||||
|
||||
obs_transition_set(ss->transition,
|
||||
ss->files.array[ss->cur_item].source);
|
||||
ss->files.array[ss->cur_item].source);
|
||||
|
||||
ss->stop = false;
|
||||
ss->paused = false;
|
||||
|
|
@ -522,7 +522,7 @@ static void ss_previous_slide(void *data)
|
|||
}
|
||||
|
||||
static void play_pause_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
|
|
@ -533,8 +533,8 @@ static void play_pause_hotkey(void *data, obs_hotkey_id id,
|
|||
ss_play_pause(ss);
|
||||
}
|
||||
|
||||
static void restart_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
static void restart_hotkey(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey,
|
||||
bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
|
|
@ -545,8 +545,8 @@ static void restart_hotkey(void *data, obs_hotkey_id id,
|
|||
ss_restart(ss);
|
||||
}
|
||||
|
||||
static void stop_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
static void stop_hotkey(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey,
|
||||
bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
|
|
@ -558,7 +558,7 @@ static void stop_hotkey(void *data, obs_hotkey_id id,
|
|||
}
|
||||
|
||||
static void next_slide_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
|
|
@ -573,7 +573,7 @@ static void next_slide_hotkey(void *data, obs_hotkey_id id,
|
|||
}
|
||||
|
||||
static void previous_slide_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
|
|
@ -607,30 +607,26 @@ static void *ss_create(obs_data_t *settings, obs_source_t *source)
|
|||
ss->paused = false;
|
||||
ss->stop = false;
|
||||
|
||||
ss->play_pause_hotkey = obs_hotkey_register_source(source,
|
||||
"SlideShow.PlayPause",
|
||||
obs_module_text("SlideShow.PlayPause"),
|
||||
play_pause_hotkey, ss);
|
||||
ss->play_pause_hotkey = obs_hotkey_register_source(
|
||||
source, "SlideShow.PlayPause",
|
||||
obs_module_text("SlideShow.PlayPause"), play_pause_hotkey, ss);
|
||||
|
||||
ss->restart_hotkey = obs_hotkey_register_source(source,
|
||||
"SlideShow.Restart",
|
||||
obs_module_text("SlideShow.Restart"),
|
||||
restart_hotkey, ss);
|
||||
ss->restart_hotkey = obs_hotkey_register_source(
|
||||
source, "SlideShow.Restart",
|
||||
obs_module_text("SlideShow.Restart"), restart_hotkey, ss);
|
||||
|
||||
ss->stop_hotkey = obs_hotkey_register_source(source,
|
||||
"SlideShow.Stop",
|
||||
obs_module_text("SlideShow.Stop"),
|
||||
stop_hotkey, ss);
|
||||
ss->stop_hotkey = obs_hotkey_register_source(
|
||||
source, "SlideShow.Stop", obs_module_text("SlideShow.Stop"),
|
||||
stop_hotkey, ss);
|
||||
|
||||
ss->prev_hotkey = obs_hotkey_register_source(source,
|
||||
"SlideShow.NextSlide",
|
||||
obs_module_text("SlideShow.NextSlide"),
|
||||
next_slide_hotkey, ss);
|
||||
ss->prev_hotkey = obs_hotkey_register_source(
|
||||
source, "SlideShow.NextSlide",
|
||||
obs_module_text("SlideShow.NextSlide"), next_slide_hotkey, ss);
|
||||
|
||||
ss->prev_hotkey = obs_hotkey_register_source(source,
|
||||
"SlideShow.PreviousSlide",
|
||||
obs_module_text("SlideShow.PreviousSlide"),
|
||||
previous_slide_hotkey, ss);
|
||||
ss->prev_hotkey = obs_hotkey_register_source(
|
||||
source, "SlideShow.PreviousSlide",
|
||||
obs_module_text("SlideShow.PreviousSlide"),
|
||||
previous_slide_hotkey, ss);
|
||||
|
||||
pthread_mutex_init_value(&ss->mutex);
|
||||
if (pthread_mutex_init(&ss->mutex, NULL) != 0)
|
||||
|
|
@ -682,7 +678,7 @@ static void ss_video_tick(void *data, float seconds)
|
|||
/* ----------------------------------------------------- */
|
||||
/* fade to transparency when the file list becomes empty */
|
||||
if (!ss->files.num) {
|
||||
obs_source_t* active_transition_source =
|
||||
obs_source_t *active_transition_source =
|
||||
obs_transition_get_active_source(ss->transition);
|
||||
|
||||
if (active_transition_source) {
|
||||
|
|
@ -725,8 +721,9 @@ static void ss_video_tick(void *data, float seconds)
|
|||
}
|
||||
|
||||
static inline bool ss_audio_render_(obs_source_t *transition, uint64_t *ts_out,
|
||||
struct obs_source_audio_mix *audio_output,
|
||||
uint32_t mixers, size_t channels, size_t sample_rate)
|
||||
struct obs_source_audio_mix *audio_output,
|
||||
uint32_t mixers, size_t channels,
|
||||
size_t sample_rate)
|
||||
{
|
||||
struct obs_source_audio_mix child_audio;
|
||||
uint64_t source_ts;
|
||||
|
|
@ -747,8 +744,9 @@ static inline bool ss_audio_render_(obs_source_t *transition, uint64_t *ts_out,
|
|||
float *out = audio_output->output[mix].data[ch];
|
||||
float *in = child_audio.output[mix].data[ch];
|
||||
|
||||
memcpy(out, in, AUDIO_OUTPUT_FRAMES *
|
||||
MAX_AUDIO_CHANNELS * sizeof(float));
|
||||
memcpy(out, in,
|
||||
AUDIO_OUTPUT_FRAMES * MAX_AUDIO_CHANNELS *
|
||||
sizeof(float));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -759,8 +757,9 @@ static inline bool ss_audio_render_(obs_source_t *transition, uint64_t *ts_out,
|
|||
}
|
||||
|
||||
static bool ss_audio_render(void *data, uint64_t *ts_out,
|
||||
struct obs_source_audio_mix *audio_output,
|
||||
uint32_t mixers, size_t channels, size_t sample_rate)
|
||||
struct obs_source_audio_mix *audio_output,
|
||||
uint32_t mixers, size_t channels,
|
||||
size_t sample_rate)
|
||||
{
|
||||
struct slideshow *ss = data;
|
||||
obs_source_t *transition = get_transition(ss);
|
||||
|
|
@ -770,7 +769,7 @@ static bool ss_audio_render(void *data, uint64_t *ts_out,
|
|||
return false;
|
||||
|
||||
success = ss_audio_render_(transition, ts_out, audio_output, mixers,
|
||||
channels, sample_rate);
|
||||
channels, sample_rate);
|
||||
|
||||
obs_source_release(transition);
|
||||
return success;
|
||||
|
|
@ -803,9 +802,10 @@ static void ss_defaults(obs_data_t *settings)
|
|||
obs_data_set_default_string(settings, S_TRANSITION, "fade");
|
||||
obs_data_set_default_int(settings, S_SLIDE_TIME, 8000);
|
||||
obs_data_set_default_int(settings, S_TR_SPEED, 700);
|
||||
obs_data_set_default_string(settings, S_CUSTOM_SIZE, T_CUSTOM_SIZE_AUTO);
|
||||
obs_data_set_default_string(settings, S_CUSTOM_SIZE,
|
||||
T_CUSTOM_SIZE_AUTO);
|
||||
obs_data_set_default_string(settings, S_BEHAVIOR,
|
||||
S_BEHAVIOR_ALWAYS_PLAY);
|
||||
S_BEHAVIOR_ALWAYS_PLAY);
|
||||
obs_data_set_default_string(settings, S_MODE, S_MODE_AUTO);
|
||||
obs_data_set_default_bool(settings, S_LOOP, true);
|
||||
}
|
||||
|
|
@ -813,12 +813,7 @@ static void ss_defaults(obs_data_t *settings)
|
|||
static const char *file_filter =
|
||||
"Image files (*.bmp *.tga *.png *.jpeg *.jpg *.gif)";
|
||||
|
||||
static const char *aspects[] = {
|
||||
"16:9",
|
||||
"16:10",
|
||||
"4:3",
|
||||
"1:1"
|
||||
};
|
||||
static const char *aspects[] = {"16:9", "16:10", "4:3", "1:1"};
|
||||
|
||||
#define NUM_ASPECTS (sizeof(aspects) / sizeof(const char *))
|
||||
|
||||
|
|
@ -841,36 +836,38 @@ static obs_properties_t *ss_properties(void *data)
|
|||
/* ----------------- */
|
||||
|
||||
p = obs_properties_add_list(ppts, S_BEHAVIOR, T_BEHAVIOR,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
obs_property_list_add_string(p, T_BEHAVIOR_ALWAYS_PLAY,
|
||||
S_BEHAVIOR_ALWAYS_PLAY);
|
||||
S_BEHAVIOR_ALWAYS_PLAY);
|
||||
obs_property_list_add_string(p, T_BEHAVIOR_STOP_RESTART,
|
||||
S_BEHAVIOR_STOP_RESTART);
|
||||
S_BEHAVIOR_STOP_RESTART);
|
||||
obs_property_list_add_string(p, T_BEHAVIOR_PAUSE_UNPAUSE,
|
||||
S_BEHAVIOR_PAUSE_UNPAUSE);
|
||||
S_BEHAVIOR_PAUSE_UNPAUSE);
|
||||
|
||||
p = obs_properties_add_list(ppts, S_MODE, T_MODE,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
p = obs_properties_add_list(ppts, S_MODE, T_MODE, OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
obs_property_list_add_string(p, T_MODE_AUTO, S_MODE_AUTO);
|
||||
obs_property_list_add_string(p, T_MODE_MANUAL, S_MODE_MANUAL);
|
||||
|
||||
p = obs_properties_add_list(ppts, S_TRANSITION, T_TRANSITION,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
obs_property_list_add_string(p, T_TR_CUT, TR_CUT);
|
||||
obs_property_list_add_string(p, T_TR_FADE, TR_FADE);
|
||||
obs_property_list_add_string(p, T_TR_SWIPE, TR_SWIPE);
|
||||
obs_property_list_add_string(p, T_TR_SLIDE, TR_SLIDE);
|
||||
|
||||
obs_properties_add_int(ppts, S_SLIDE_TIME, T_SLIDE_TIME,
|
||||
50, 3600000, 50);
|
||||
obs_properties_add_int(ppts, S_TR_SPEED, T_TR_SPEED,
|
||||
0, 3600000, 50);
|
||||
obs_properties_add_int(ppts, S_SLIDE_TIME, T_SLIDE_TIME, 50, 3600000,
|
||||
50);
|
||||
obs_properties_add_int(ppts, S_TR_SPEED, T_TR_SPEED, 0, 3600000, 50);
|
||||
obs_properties_add_bool(ppts, S_LOOP, T_LOOP);
|
||||
obs_properties_add_bool(ppts, S_HIDE, T_HIDE);
|
||||
obs_properties_add_bool(ppts, S_RANDOMIZE, T_RANDOMIZE);
|
||||
|
||||
p = obs_properties_add_list(ppts, S_CUSTOM_SIZE, T_CUSTOM_SIZE,
|
||||
OBS_COMBO_TYPE_EDITABLE, OBS_COMBO_FORMAT_STRING);
|
||||
OBS_COMBO_TYPE_EDITABLE,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_property_list_add_string(p, T_CUSTOM_SIZE_AUTO, T_CUSTOM_SIZE_AUTO);
|
||||
|
||||
|
|
@ -897,7 +894,8 @@ static obs_properties_t *ss_properties(void *data)
|
|||
}
|
||||
|
||||
obs_properties_add_editable_list(ppts, S_FILES, T_FILES,
|
||||
OBS_EDITABLE_LIST_TYPE_FILES, file_filter, path.array);
|
||||
OBS_EDITABLE_LIST_TYPE_FILES,
|
||||
file_filter, path.array);
|
||||
dstr_free(&path);
|
||||
|
||||
return ppts;
|
||||
|
|
@ -924,23 +922,22 @@ static void ss_deactivate(void *data)
|
|||
}
|
||||
|
||||
struct obs_source_info slideshow_info = {
|
||||
.id = "slideshow",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO |
|
||||
OBS_SOURCE_CUSTOM_DRAW |
|
||||
OBS_SOURCE_COMPOSITE,
|
||||
.get_name = ss_getname,
|
||||
.create = ss_create,
|
||||
.destroy = ss_destroy,
|
||||
.update = ss_update,
|
||||
.activate = ss_activate,
|
||||
.deactivate = ss_deactivate,
|
||||
.video_render = ss_video_render,
|
||||
.video_tick = ss_video_tick,
|
||||
.audio_render = ss_audio_render,
|
||||
.id = "slideshow",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW |
|
||||
OBS_SOURCE_COMPOSITE,
|
||||
.get_name = ss_getname,
|
||||
.create = ss_create,
|
||||
.destroy = ss_destroy,
|
||||
.update = ss_update,
|
||||
.activate = ss_activate,
|
||||
.deactivate = ss_deactivate,
|
||||
.video_render = ss_video_render,
|
||||
.video_tick = ss_video_tick,
|
||||
.audio_render = ss_audio_render,
|
||||
.enum_active_sources = ss_enum_sources,
|
||||
.get_width = ss_width,
|
||||
.get_height = ss_height,
|
||||
.get_defaults = ss_defaults,
|
||||
.get_properties = ss_properties
|
||||
.get_width = ss_width,
|
||||
.get_height = ss_height,
|
||||
.get_defaults = ss_defaults,
|
||||
.get_properties = ss_properties,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue