mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-15 07:44:10 +00:00
(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:
parent
4122a5b9b5
commit
d2b4f82637
|
@ -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(¶ms, "scene", item->parent);
|
||||
|
@ -730,7 +730,8 @@ static inline void signal_move_dir(struct obs_scene_item *item,
|
|||
calldata_free(¶ms);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
14
libobs/obs.h
14
libobs/obs.h
|
@ -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);
|
||||
|
|
|
@ -55,7 +55,7 @@ using namespace std;
|
|||
|
||||
Q_DECLARE_METATYPE(OBSScene);
|
||||
Q_DECLARE_METATYPE(OBSSceneItem);
|
||||
Q_DECLARE_METATYPE(order_movement);
|
||||
Q_DECLARE_METATYPE(obs_order_movement);
|
||||
|
||||
static void AddExtraModulePaths()
|
||||
{
|
||||
|
@ -781,7 +781,7 @@ void OBSBasic::RenameSources(QString newName, QString prevName)
|
|||
}
|
||||
}
|
||||
|
||||
void OBSBasic::MoveSceneItem(OBSSceneItem item, order_movement movement)
|
||||
void OBSBasic::MoveSceneItem(OBSSceneItem item, obs_order_movement movement)
|
||||
{
|
||||
OBSScene scene = obs_sceneitem_getscene(item);
|
||||
if (scene != GetCurrentScene())
|
||||
|
@ -794,21 +794,21 @@ void OBSBasic::MoveSceneItem(OBSSceneItem item, order_movement movement)
|
|||
QListWidgetItem *listItem = ui->sources->takeItem(curRow);
|
||||
|
||||
switch (movement) {
|
||||
case ORDER_MOVE_UP:
|
||||
case OBS_ORDER_MOVE_UP:
|
||||
if (curRow > 0)
|
||||
curRow--;
|
||||
break;
|
||||
|
||||
case ORDER_MOVE_DOWN:
|
||||
case OBS_ORDER_MOVE_DOWN:
|
||||
if (curRow < ui->sources->count())
|
||||
curRow++;
|
||||
break;
|
||||
|
||||
case ORDER_MOVE_TOP:
|
||||
case OBS_ORDER_MOVE_TOP:
|
||||
curRow = 0;
|
||||
break;
|
||||
|
||||
case ORDER_MOVE_BOTTOM:
|
||||
case OBS_ORDER_MOVE_BOTTOM:
|
||||
curRow = ui->sources->count();
|
||||
break;
|
||||
}
|
||||
|
@ -1148,7 +1148,7 @@ void OBSBasic::SceneItemMoveUp(void *data, calldata_t params)
|
|||
QMetaObject::invokeMethod(static_cast<OBSBasic*>(data),
|
||||
"MoveSceneItem",
|
||||
Q_ARG(OBSSceneItem, OBSSceneItem(item)),
|
||||
Q_ARG(order_movement, ORDER_MOVE_UP));
|
||||
Q_ARG(obs_order_movement, OBS_ORDER_MOVE_UP));
|
||||
}
|
||||
|
||||
void OBSBasic::SceneItemMoveDown(void *data, calldata_t params)
|
||||
|
@ -1157,7 +1157,7 @@ void OBSBasic::SceneItemMoveDown(void *data, calldata_t params)
|
|||
QMetaObject::invokeMethod(static_cast<OBSBasic*>(data),
|
||||
"MoveSceneItem",
|
||||
Q_ARG(OBSSceneItem, OBSSceneItem(item)),
|
||||
Q_ARG(order_movement, ORDER_MOVE_DOWN));
|
||||
Q_ARG(obs_order_movement, OBS_ORDER_MOVE_DOWN));
|
||||
}
|
||||
|
||||
void OBSBasic::SceneItemMoveTop(void *data, calldata_t params)
|
||||
|
@ -1166,7 +1166,7 @@ void OBSBasic::SceneItemMoveTop(void *data, calldata_t params)
|
|||
QMetaObject::invokeMethod(static_cast<OBSBasic*>(data),
|
||||
"MoveSceneItem",
|
||||
Q_ARG(OBSSceneItem, OBSSceneItem(item)),
|
||||
Q_ARG(order_movement, ORDER_MOVE_TOP));
|
||||
Q_ARG(obs_order_movement, OBS_ORDER_MOVE_TOP));
|
||||
}
|
||||
|
||||
void OBSBasic::SceneItemMoveBottom(void *data, calldata_t params)
|
||||
|
@ -1175,7 +1175,7 @@ void OBSBasic::SceneItemMoveBottom(void *data, calldata_t params)
|
|||
QMetaObject::invokeMethod(static_cast<OBSBasic*>(data),
|
||||
"MoveSceneItem",
|
||||
Q_ARG(OBSSceneItem, OBSSceneItem(item)),
|
||||
Q_ARG(order_movement, ORDER_MOVE_BOTTOM));
|
||||
Q_ARG(obs_order_movement, OBS_ORDER_MOVE_BOTTOM));
|
||||
}
|
||||
|
||||
/* Main class functions */
|
||||
|
@ -1681,37 +1681,37 @@ void OBSBasic::on_actionSourceProperties_triggered()
|
|||
void OBSBasic::on_actionSourceUp_triggered()
|
||||
{
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
obs_sceneitem_setorder(item, ORDER_MOVE_UP);
|
||||
obs_sceneitem_setorder(item, OBS_ORDER_MOVE_UP);
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionSourceDown_triggered()
|
||||
{
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
obs_sceneitem_setorder(item, ORDER_MOVE_DOWN);
|
||||
obs_sceneitem_setorder(item, OBS_ORDER_MOVE_DOWN);
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionMoveUp_triggered()
|
||||
{
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
obs_sceneitem_setorder(item, ORDER_MOVE_UP);
|
||||
obs_sceneitem_setorder(item, OBS_ORDER_MOVE_UP);
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionMoveDown_triggered()
|
||||
{
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
obs_sceneitem_setorder(item, ORDER_MOVE_DOWN);
|
||||
obs_sceneitem_setorder(item, OBS_ORDER_MOVE_DOWN);
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionMoveToTop_triggered()
|
||||
{
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
obs_sceneitem_setorder(item, ORDER_MOVE_TOP);
|
||||
obs_sceneitem_setorder(item, OBS_ORDER_MOVE_TOP);
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionMoveToBottom_triggered()
|
||||
{
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
obs_sceneitem_setorder(item, ORDER_MOVE_BOTTOM);
|
||||
obs_sceneitem_setorder(item, OBS_ORDER_MOVE_BOTTOM);
|
||||
}
|
||||
|
||||
static char *ReadLogFile(const char *log)
|
||||
|
|
|
@ -156,7 +156,7 @@ private slots:
|
|||
void UpdateSceneSelection(OBSSource source);
|
||||
void RenameSources(QString newName, QString prevName);
|
||||
|
||||
void MoveSceneItem(OBSSceneItem item, order_movement movement);
|
||||
void MoveSceneItem(OBSSceneItem item, obs_order_movement movement);
|
||||
|
||||
void ActivateAudioSource(OBSSource source);
|
||||
void DeactivateAudioSource(OBSSource source);
|
||||
|
|
Loading…
Reference in a new issue