0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

libobs: Add refresh signal to scenes

This signal is used to specify when a scene needs a full refresh of its
item list.
This commit is contained in:
jp9000 2020-02-07 16:35:20 -08:00
parent 5027709320
commit 6d0ef75663
2 changed files with 18 additions and 0 deletions

View File

@ -135,6 +135,11 @@ Scene Signals
Called when scene items have been reoredered in the scene.
**refresh** (ptr scene)
Called when the entire scene item list needs to be refreshed.
Usually this is only used when groups have changed.
**item_visible** (ptr scene, ptr item, bool visible)
Called when a scene item's visibility state changes.

View File

@ -48,6 +48,7 @@ static const char *obs_scene_signals[] = {
"void item_add(ptr scene, ptr item)",
"void item_remove(ptr scene, ptr item)",
"void reorder(ptr scene)",
"void refresh(ptr scene)",
"void item_visible(ptr scene, ptr item, bool visible)",
"void item_select(ptr scene, ptr item)",
"void item_deselect(ptr scene, ptr item)",
@ -1919,6 +1920,18 @@ static inline void signal_reorder(struct obs_scene_item *item)
signal_parent(item->parent, command, &params);
}
static inline void signal_refresh(obs_scene_t *scene)
{
const char *command = NULL;
struct calldata params;
uint8_t stack[128];
command = "refresh";
calldata_init_fixed(&params, stack, sizeof(stack));
signal_parent(scene, command, &params);
}
void obs_sceneitem_set_order(obs_sceneitem_t *item,
enum obs_order_movement movement)
{