Added add/remove signals to scenes
Scenes will now signal via their source when an item has been added or removed from them. "add" - Item added to the scene. Parameters: "scene": Scene that the item was added to. "item": Item that was added. "remove" - Item removed from the scene. Parameters: "scene": Scene that the item was removed from. "item": Item that was removed.
This commit is contained in:
19
libobs/obs.c
19
libobs/obs.c
@@ -462,15 +462,26 @@ obs_source_t obs_get_output_source(uint32_t channel)
|
||||
void obs_set_output_source(uint32_t channel, obs_source_t source)
|
||||
{
|
||||
struct obs_source *prev_source;
|
||||
struct calldata params = {0};
|
||||
assert(channel < MAX_CHANNELS);
|
||||
|
||||
prev_source = obs->data.channels[channel];
|
||||
|
||||
calldata_setuint32(¶ms, "channel", channel);
|
||||
calldata_setptr(¶ms, "prev_source", prev_source);
|
||||
calldata_setptr(¶ms, "source", source);
|
||||
signal_handler_signal(obs->signals, "channel-change", ¶ms);
|
||||
calldata_getptr(¶ms, "source", &source);
|
||||
calldata_free(¶ms);
|
||||
|
||||
obs->data.channels[channel] = source;
|
||||
|
||||
if (source)
|
||||
obs_source_addref(source);
|
||||
if (prev_source)
|
||||
obs_source_release(prev_source);
|
||||
if (source != prev_source) {
|
||||
if (source)
|
||||
obs_source_addref(source);
|
||||
if (prev_source)
|
||||
obs_source_release(prev_source);
|
||||
}
|
||||
}
|
||||
|
||||
void obs_enum_sources(bool (*enum_proc)(obs_source_t, void*), void *param)
|
||||
|
Reference in New Issue
Block a user