mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-15 07:44:10 +00:00
libobs: Replace item_move_* signals
These signals introduce unnecessary complexity. Instead of emitting a signal for a specific move direction, just signal that the scene has been reordered, that way the target just refreshes the list.
This commit is contained in:
parent
c6008316e2
commit
577d0b2129
|
@ -1,5 +1,6 @@
|
|||
/******************************************************************************
|
||||
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
|
||||
Copyright (C) 2013-2015 by Hugh Bailey <obs.jim@gmail.com>
|
||||
Philippe Groarke <philippe.groarke@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -22,10 +23,7 @@
|
|||
static const char *obs_scene_signals[] = {
|
||||
"void item_add(ptr scene, ptr item)",
|
||||
"void item_remove(ptr scene, ptr item)",
|
||||
"void item_move_up(ptr scene, ptr item)",
|
||||
"void item_move_down(ptr scene, ptr item)",
|
||||
"void item_move_top(ptr scene, ptr item)",
|
||||
"void item_move_bottom(ptr scene, ptr item)",
|
||||
"void reorder(ptr scene)",
|
||||
"void item_select(ptr scene, ptr item)",
|
||||
"void item_deselect(ptr scene, ptr item)",
|
||||
"void item_transform(ptr scene, ptr item)",
|
||||
|
@ -725,21 +723,14 @@ void obs_sceneitem_set_alignment(obs_sceneitem_t *item, uint32_t alignment)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void signal_move_dir(struct obs_scene_item *item,
|
||||
enum obs_order_movement movement)
|
||||
static inline void signal_reorder(struct obs_scene_item *item)
|
||||
{
|
||||
const char *command = NULL;
|
||||
struct calldata params = {0};
|
||||
|
||||
switch (movement) {
|
||||
case OBS_ORDER_MOVE_UP: command = "item_move_up"; break;
|
||||
case OBS_ORDER_MOVE_DOWN: command = "item_move_down"; break;
|
||||
case OBS_ORDER_MOVE_TOP: command = "item_move_top"; break;
|
||||
case OBS_ORDER_MOVE_BOTTOM: command = "item_move_bottom"; break;
|
||||
}
|
||||
command = "reorder";
|
||||
|
||||
calldata_set_ptr(¶ms, "scene", item->parent);
|
||||
calldata_set_ptr(¶ms, "item", item);
|
||||
|
||||
signal_handler_signal(item->parent->source->context.signals,
|
||||
command, ¶ms);
|
||||
|
@ -784,7 +775,7 @@ void obs_sceneitem_set_order(obs_sceneitem_t *item,
|
|||
attach_sceneitem(scene, item, NULL);
|
||||
}
|
||||
|
||||
signal_move_dir(item, movement);
|
||||
signal_reorder(item);
|
||||
|
||||
pthread_mutex_unlock(&scene->mutex);
|
||||
obs_scene_release(scene);
|
||||
|
|
Loading…
Reference in a new issue