(API Change) Rename order_movement

Prefix with obs_ for the sake of consistency

Renamed enums:
- order_movement (now obs_order_movement)

Affected functions:
- obs_source_filter_setorder
- obs_sceneitem_setorder
This commit is contained in:
jp9000
2014-08-08 11:04:43 -07:00
parent 4122a5b9b5
commit d2b4f82637
5 changed files with 40 additions and 39 deletions
+11 -10
View File
@@ -709,16 +709,16 @@ void obs_sceneitem_setalignment(obs_sceneitem_t item, uint32_t alignment)
}
static inline void signal_move_dir(struct obs_scene_item *item,
enum order_movement movement)
enum obs_order_movement movement)
{
const char *command = NULL;
struct calldata params = {0};
switch (movement) {
case ORDER_MOVE_UP: command = "item_move_up"; break;
case ORDER_MOVE_DOWN: command = "item_move_down"; break;
case ORDER_MOVE_TOP: command = "item_move_top"; break;
case ORDER_MOVE_BOTTOM: command = "item_move_bottom"; break;
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;
}
calldata_setptr(&params, "scene", item->parent);
@@ -730,7 +730,8 @@ static inline void signal_move_dir(struct obs_scene_item *item,
calldata_free(&params);
}
void obs_sceneitem_setorder(obs_sceneitem_t item, enum order_movement movement)
void obs_sceneitem_setorder(obs_sceneitem_t item,
enum obs_order_movement movement)
{
if (!item) return;
@@ -745,13 +746,13 @@ void obs_sceneitem_setorder(obs_sceneitem_t item, enum order_movement movement)
detach_sceneitem(item);
if (movement == ORDER_MOVE_DOWN) {
if (movement == OBS_ORDER_MOVE_DOWN) {
attach_sceneitem(scene, item, prev ? prev->prev : NULL);
} else if (movement == ORDER_MOVE_UP) {
} else if (movement == OBS_ORDER_MOVE_UP) {
attach_sceneitem(scene, item, next ? next : prev);
} else if (movement == ORDER_MOVE_TOP) {
} else if (movement == OBS_ORDER_MOVE_TOP) {
struct obs_scene_item *last = next;
if (!last) {
last = prev;
@@ -762,7 +763,7 @@ void obs_sceneitem_setorder(obs_sceneitem_t item, enum order_movement movement)
attach_sceneitem(scene, item, last);
} else if (movement == ORDER_MOVE_BOTTOM) {
} else if (movement == OBS_ORDER_MOVE_BOTTOM) {
attach_sceneitem(scene, item, NULL);
}
+5 -5
View File
@@ -1190,7 +1190,7 @@ void obs_source_filter_remove(obs_source_t source, obs_source_t filter)
}
void obs_source_filter_setorder(obs_source_t source, obs_source_t filter,
enum order_movement movement)
enum obs_order_movement movement)
{
size_t idx, i;
@@ -1201,22 +1201,22 @@ void obs_source_filter_setorder(obs_source_t source, obs_source_t filter,
if (idx == DARRAY_INVALID)
return;
if (movement == ORDER_MOVE_UP) {
if (movement == OBS_ORDER_MOVE_UP) {
if (idx == source->filters.num-1)
return;
da_move_item(source->filters, idx, idx+1);
} else if (movement == ORDER_MOVE_DOWN) {
} else if (movement == OBS_ORDER_MOVE_DOWN) {
if (idx == 0)
return;
da_move_item(source->filters, idx, idx-1);
} else if (movement == ORDER_MOVE_TOP) {
} else if (movement == OBS_ORDER_MOVE_TOP) {
if (idx == source->filters.num-1)
return;
da_move_item(source->filters, idx, source->filters.num-1);
} else if (movement == ORDER_MOVE_BOTTOM) {
} else if (movement == OBS_ORDER_MOVE_BOTTOM) {
if (idx == 0)
return;
da_move_item(source->filters, idx, 0);
+7 -7
View File
@@ -74,11 +74,11 @@ extern "C" {
/** Used for changing the order of items (for example, filters in a source,
* or items in a scene) */
enum order_movement {
ORDER_MOVE_UP,
ORDER_MOVE_DOWN,
ORDER_MOVE_TOP,
ORDER_MOVE_BOTTOM
enum obs_order_movement {
OBS_ORDER_MOVE_UP,
OBS_ORDER_MOVE_DOWN,
OBS_ORDER_MOVE_TOP,
OBS_ORDER_MOVE_BOTTOM
};
/**
@@ -635,7 +635,7 @@ EXPORT void obs_source_filter_remove(obs_source_t source, obs_source_t filter);
/** Modifies the order of a specific filter */
EXPORT void obs_source_filter_setorder(obs_source_t source, obs_source_t filter,
enum order_movement movement);
enum obs_order_movement movement);
/** Gets the settings string for a source */
EXPORT obs_data_t obs_source_getsettings(obs_source_t source);
@@ -808,7 +808,7 @@ EXPORT void obs_sceneitem_setscale(obs_sceneitem_t item,
EXPORT void obs_sceneitem_setalignment(obs_sceneitem_t item,
uint32_t alignment);
EXPORT void obs_sceneitem_setorder(obs_sceneitem_t item,
enum order_movement movement);
enum obs_order_movement movement);
EXPORT void obs_sceneitem_set_bounds_type(obs_sceneitem_t item,
enum obs_bounds_type type);