-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathmove-transition.h
294 lines (266 loc) · 10.2 KB
/
move-transition.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
#pragma once
#include <obs-module.h>
#include <util/darray.h>
#include "version.h"
#define MOVE_SOURCE_FILTER_ID "move_source_filter"
#define MOVE_SOURCE_SWAP_FILTER_ID "move_source_swap_filter"
#define MOVE_VALUE_FILTER_ID "move_value_filter"
#define MOVE_AUDIO_VALUE_FILTER_ID "move_audio_value_filter"
#define AUDIO_MOVE_FILTER_ID "audio_move_filter"
#define MOVE_ACTION_FILTER_ID "move_action_filter"
#define MOVE_AUDIO_ACTION_FILTER_ID "move_audio_action_filter"
#define MOVE_DIRECTSHOW_FILTER_ID "move_directshow_filter"
#define PLUGIN_INFO \
"<a href=\"https://obsproject.com/forum/resources/move-transition.913/\">Move Transition</a> (" PROJECT_VERSION \
") by <a href=\"https://www.exeldro.com\">Exeldro</a>"
#define S_MATCH "match"
#define S_MOVE_ALL "move_all"
#define S_MOVE_MATCH "move_match"
#define S_MOVE_IN "move_in"
#define S_MOVE_OUT "move_out"
#define S_NAME_PART_MATCH "name_part_match"
#define S_NAME_NUMBER_MATCH "name_number_match"
#define S_NAME_LAST_WORD_MATCH "name_last_word_match"
#define S_GENERAL "general"
#define S_SOURCE "source"
#define S_POSITION_IN "position_in"
#define S_POSITION_OUT "position_out"
#define S_ZOOM_IN "zoom_in"
#define S_ZOOM_OUT "zoom_out"
#define S_EASING_MATCH "easing_match"
#define S_EASING_IN "easing_in"
#define S_EASING_OUT "easing_out"
#define S_EASING_FUNCTION_MATCH "easing_function_match"
#define S_EASING_FUNCTION_IN "easing_function_in"
#define S_EASING_FUNCTION_OUT "easing_function_out"
#define S_CURVE_MATCH "curve_match"
#define S_CURVE_IN "curve_in"
#define S_CURVE_OUT "curve_out"
#define S_CURVE_OVERRIDE_MATCH "curve_override_match"
#define S_CURVE_OVERRIDE_IN "curve_override_in"
#define S_CURVE_OVERRIDE_OUT "curve_override_out"
#define S_TRANSITION_MATCH "transition_match"
#define S_TRANSITION_SCALE "transition_scale_match"
#define S_TRANSITION_IN "transition_in"
#define S_TRANSITION_OUT "transition_out"
#define S_START_DELAY_MATCH_FROM "start_delay_match_from"
#define S_START_DELAY_MATCH_TO "start_delay_match_to"
#define S_START_DELAY_IN "start_delay_in"
#define S_START_DELAY_OUT "start_delay_out"
#define S_END_DELAY_MATCH_FROM "end_delay_match_from"
#define S_END_DELAY_MATCH_TO "end_delay_match_to"
#define S_END_DELAY_IN "end_delay_in"
#define S_END_DELAY_OUT "end_delay_out"
#define S_START_MOVE_MATCH_FROM "start_move_match_from"
#define S_START_MOVE_MATCH_TO "start_move_match_to"
#define S_START_MOVE_IN "start_move_match_in"
#define S_START_MOVE_OUT "start_move_match_out"
#define S_CUSTOM_DURATION "custom_duration"
#define S_DURATION "duration"
#define S_ROT "rot"
#define S_POS "pos"
#define S_SCALE "scale"
#define S_BOUNDS "bounds"
#define S_CROP "crop"
#define S_TRANSFORM_TEXT "transform_text"
#define S_SWITCH_PERCENTAGE "switch_percentage"
#define S_CACHE_TRANSITIONS "cache_transitions"
#define S_NESTED_SCENES "nested_scenes"
#define S_START_TRIGGER "start_trigger"
#define S_START_TRIGGER_UDP_PORT "start_trigger_udp_port"
#define S_START_TRIGGER_UDP_PACKET "start_trigger_udp_packet"
#define S_STOP_TRIGGER "stop_trigger"
#define S_STOP_TRIGGER_UDP_PORT "stop_trigger_udp_port"
#define S_STOP_TRIGGER_UDP_PACKET "stop_trigger_udp_packet"
#define S_START_DELAY "start_delay"
#define S_END_DELAY "end_delay"
#define S_ACTIONS "actions"
#define S_SIMULTANEOUS_MOVE "simultaneous_move"
#define S_NEXT_MOVE "next_move"
#define S_NEXT_MOVE_ON "next_move_on"
#define S_FILTER "filter"
#define S_SINGLE_SETTING "single_setting"
#define S_MOVE_VALUE_TYPE "move_value_type"
#define S_SETTING_VALUE "setting_value"
#define S_SETTING_RANDOM "setting_random"
#define S_SETTING_NAME "setting_name"
#define S_SETTING_INT "setting_int"
#define S_SETTING_INT_MIN "setting_int_min"
#define S_SETTING_INT_MAX "setting_int_max"
#define S_SETTING_FLOAT "setting_float"
#define S_SETTING_FLOAT_MIN "setting_float_min"
#define S_SETTING_FLOAT_MAX "setting_float_max"
#define S_SETTING_DECIMALS "setting_decimals"
#define S_SETTING_FORMAT_TYPE "setting_format_type"
#define S_SETTING_FORMAT "setting_format"
#define S_SETTING_COLOR "setting_color"
#define S_SETTING_COLOR_MIN "setting_color_min"
#define S_SETTING_COLOR_MAX "setting_color_max"
#define S_SETTING_COLOR_ALPHA "setting_color_alpha"
#define S_SETTING_COLOR_ALPHA_MIN "setting_color_alpha_min"
#define S_SETTING_COLOR_ALPHA_MAX "setting_color_alpha_max"
#define S_SETTING_TEXT "setting_text"
#define S_SETTINGS "settings"
#define S_SETTING_FROM "setting_from"
#define S_SETTING_TO "setting_to"
#define S_VALUE_TYPE "value_type"
#define S_TRANSFORM "transform"
#define S_TRANSFORM_RELATIVE "transform_relative"
#define S_VISIBILITY_ORDER "visibility_order"
#define S_CHANGE_VISIBILITY "change_visibility"
#define S_CHANGE_ORDER "change_order"
#define S_ORDER_POSITION "order_position"
#define S_MEDIA_ACTION "media_action"
#define S_MEDIA_ACTION_START "media_action_start"
#define S_MEDIA_ACTION_START_TIME "media_action_start_time"
#define S_MEDIA_ACTION_END "media_action_end"
#define S_MEDIA_ACTION_END_TIME "media_action_end_time"
#define S_AUDIO_ACTION "audio_action"
#define S_MUTE_ACTION "mute_action"
#define S_AUDIO_FADE "audio_fade"
#define S_AUDIO_FADE_PERCENT "audio_fade_percent"
#define S_ENABLED_MATCH_MOVING "enabled_match_moving"
#define S_MATCH_SOURCE "match_source"
#define NO_OVERRIDE (-1)
#define ZOOM_NO 0
#define ZOOM_YES 1
#define EASE_NONE 0
#define EASE_IN 1
#define EASE_OUT 2
#define EASE_IN_OUT 3
#define EASING_QUADRATIC 1
#define EASING_CUBIC 2
#define EASING_QUARTIC 3
#define EASING_QUINTIC 4
#define EASING_SINE 5
#define EASING_CIRCULAR 6
#define EASING_EXPONENTIAL 7
#define EASING_ELASTIC 8
#define EASING_BOUNCE 9
#define EASING_BACK 10
#define POS_NONE 0
#define POS_CENTER (1 << 0)
#define POS_EDGE (1 << 1)
#define POS_LEFT (1 << 2)
#define POS_RIGHT (1 << 3)
#define POS_TOP (1 << 4)
#define POS_BOTTOM (1 << 5)
#define POS_SWIPE (1 << 6)
#define START_TRIGGER_NONE 0
#define START_TRIGGER_ACTIVATE 1
#define START_TRIGGER_DEACTIVATE 2
#define START_TRIGGER_SHOW 3
#define START_TRIGGER_HIDE 4
#define START_TRIGGER_ENABLE 5
#define START_TRIGGER_SOURCE_ACTIVATE 6
#define START_TRIGGER_SOURCE_DEACTIVATE 7
#define START_TRIGGER_SOURCE_SHOW 8
#define START_TRIGGER_SOURCE_HIDE 9
#define START_TRIGGER_ENABLE_DISABLE_OLD 10
#define START_TRIGGER_MEDIA_STARTED 11
#define START_TRIGGER_MEDIA_ENDED 12
#define START_TRIGGER_LOAD 13
#define START_TRIGGER_MOVE_MATCH 14
#define START_TRIGGER_MOVE_IN 15
#define START_TRIGGER_MOVE_OUT 16
#define START_TRIGGER_UDP 17
#define MOVE_VALUE_UNKNOWN 0
#define MOVE_VALUE_INT 1
#define MOVE_VALUE_FLOAT 2
#define MOVE_VALUE_COLOR 3
#define MOVE_VALUE_TEXT 4
#define MOVE_VALUE_COLOR_ALPHA 5
#define MOVE_VALUE_FORMAT_DECIMALS 0
#define MOVE_VALUE_FORMAT_FLOAT 1
#define MOVE_VALUE_FORMAT_TIME 2
#define NEXT_MOVE_ON_END 0
#define NEXT_MOVE_ON_HOTKEY 1
#define NEXT_MOVE_REVERSE "Reverse"
#define CHANGE_VISIBILITY_NONE 0
#define CHANGE_VISIBILITY_SHOW_START 1
#define CHANGE_VISIBILITY_HIDE_END 2
#define CHANGE_VISIBILITY_TOGGLE 3
#define CHANGE_VISIBILITY_SHOW_END 4
#define CHANGE_VISIBILITY_HIDE_START 5
#define CHANGE_VISIBILITY_TOGGLE_START 6
#define CHANGE_VISIBILITY_TOGGLE_END 7
#define CHANGE_VISIBILITY_SHOW_START_END 8
#define CHANGE_VISIBILITY_HIDE_START_END 9
#define CHANGE_VISIBILITY_SHOW_MIDPOINT 10
#define CHANGE_VISIBILITY_HIDE_MIDPOINT 11
#define CHANGE_VISIBILITY_TOGGLE_MIDPOINT 12
#define CHANGE_ORDER_NONE 0
#define CHANGE_ORDER_RELATIVE (1 << 0)
#define CHANGE_ORDER_ABSOLUTE (1 << 1)
#define CHANGE_ORDER_START (1 << 2)
#define CHANGE_ORDER_END (1 << 3)
#define CHANGE_ORDER_MIDPOINT (1 << 4)
#define MEDIA_ACTION_NONE 0
#define MEDIA_ACTION_PLAY 1
#define MEDIA_ACTION_PAUSE 2
#define MEDIA_ACTION_STOP 3
#define MEDIA_ACTION_RESTART 4
#define MEDIA_ACTION_NEXT 5
#define MEDIA_ACTION_PREVIOUS 6
#define MEDIA_ACTION_PLAY_FROM 7
#define MEDIA_ACTION_PAUSE_AT 8
#define MUTE_ACTION_NONE 0
#define MUTE_ACTION_MUTE_START 1
#define MUTE_ACTION_UNMUTE_START 2
#define MUTE_ACTION_MUTE_END 3
#define MUTE_ACTION_UNMUTE_END 4
#define MUTE_ACTION_MUTE_DURING 5
#define MUTE_ACTION_UNMUTE_DURING 6
#define MUTE_ACTION_MUTE_MIDPOINT 7
#define MUTE_ACTION_UNMUTE_MIDPOINT 8
#define MOVE_VALUE_TYPE_SINGLE_SETTING 0
#define MOVE_VALUE_TYPE_SETTINGS 1
#define MOVE_VALUE_TYPE_RANDOM 2
#define MOVE_VALUE_TYPE_SETTING_ADD 3
#define MOVE_VALUE_TYPE_TYPING 4
struct move_filter {
obs_source_t *source;
char *filter_name;
obs_hotkey_id move_start_hotkey;
obs_hotkey_id move_hold_hotkey;
bool holding;
bool custom_duration;
uint64_t duration;
uint64_t start_delay;
uint64_t end_delay;
uint32_t start_trigger;
uint32_t stop_trigger;
bool moving;
float running_duration;
char *simultaneous_move_name;
char *next_move_name;
bool enabled;
long long easing;
long long easing_function;
DARRAY(obs_source_t *) filters_done;
long long next_move_on;
bool reverse;
bool enabled_match_moving;
void (*move_start)(void *data);
obs_source_t *(*get_alternative_filter)(void *data, const char *name);
};
bool is_move_filter(const char *filter_id);
void move_filter_init(struct move_filter *move_filter, obs_source_t *source, void (*move_start)(void *data));
void move_filter_destroy(struct move_filter *move_filter);
void move_filter_update(struct move_filter *move_filter, obs_data_t *settings);
void move_filter_start(struct move_filter *move_filter);
bool move_filter_start_internal(struct move_filter *move_filter);
void move_filter_stop(struct move_filter *move_filter);
void move_filter_ended(struct move_filter *move_filter);
bool move_filter_tick(struct move_filter *move_filter, float seconds, float *t);
void move_filter_properties(struct move_filter *move_filter, obs_properties_t *ppts);
bool move_filter_start_trigger_changed(void *priv, obs_properties_t *props, obs_property_t *property, obs_data_t *settings);
bool move_filter_stop_trigger_changed(void *priv, obs_properties_t *props, obs_property_t *property, obs_data_t *settings);
void move_filter_defaults(obs_data_t *settings);
void move_filter_activate(void *data);
void move_filter_deactivate(void *data);
void move_filter_show(void *data);
void move_filter_hide(void *data);
void prop_list_add_easings(obs_property_t *p);
void prop_list_add_easing_functions(obs_property_t *p);
void prop_list_add_move_source_filter(obs_source_t *parent, obs_source_t *child, void *data);