2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
27 /** \file DNA_sequence_types.h
33 #ifndef __DNA_SEQUENCE_TYPES_H__
34 #define __DNA_SEQUENCE_TYPES_H__
37 #include "DNA_color_types.h"
38 #include "DNA_listBase.h"
39 #include "DNA_vec_types.h"
46 /* strlens; 256= FILE_MAXFILE, 768= FILE_MAXDIR */
48 typedef struct StripElem {
50 int orig_width, orig_height;
53 typedef struct StripCrop {
60 typedef struct StripTransform {
65 typedef struct StripColorBalance {
75 typedef struct StripProxy {
76 char dir[768]; // custom directory for index and proxy files
77 // (defaults to BL_proxy)
79 char file[256]; // custom file
80 struct anim *anim; // custom proxy anim file
82 short tc; // time code in use
84 short quality; // proxy build quality
85 short build_size_flags; // size flags (see below) of all proxies
87 short build_tc_flags; // time code flags (see below) of all tc indices
91 typedef struct Strip {
92 struct Strip *next, *prev;
94 int startstill, endstill;
95 StripElem *stripdata; /* only used as an array in IMAGE sequences(!),
96 * and as a 1-element array in MOVIE sequences,
97 * NULL for all other strip-types */
101 StripTransform *transform;
102 StripColorBalance *color_balance DNA_DEPRECATED;
106 * The sequence structure is the basic struct used by any strip.
107 * each of the strips uses a different sequence structure.
109 * \warning The first part identical to ID (for use in ipo's)
110 * the commend above is historic, probably we can drop the ID compatibility,
111 * but take care making this change.
113 * \warning This is really a 'Strip' in the UI!, name is highly confusing.
115 typedef struct Sequence {
116 struct Sequence *next, *prev;
117 void *tmp; /* tmp var for copying, and tagging for linked selection */
118 void *lib; /* needed (to be like ipo), else it will raise libdata warnings, this should never be used */
119 char name[64]; /* SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths */
121 int flag, type; /*flags bitmap (see below) and the type of sequence*/
122 int len; /* the length of the contents of this strip - before handles are applied */
123 int start, startofs, endofs;
124 int startstill, endstill;
125 int machine, depth; /*machine - the strip channel, depth - the depth in the sequence when dealing with metastrips */
126 int startdisp, enddisp; /*starting and ending points in the sequence*/
131 short streamindex; /* streamindex for movie or sound files with several streams */
132 int multicam_source; /* for multicam source selection */
133 int clip_flag; /* MOVIECLIP render flags */
137 struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
139 /* these ID vars should never be NULL but can be when linked libs fail to load, so check on access */
141 struct Object *scene_camera; /* override scene camera */
142 struct MovieClip *clip; /* for MOVIECLIP strips */
143 struct Mask *mask; /* for MASK strips */
145 struct anim *anim; /* for MOVIE strips */
150 /* pointers for effects: */
151 struct Sequence *seq1, *seq2, *seq3;
153 ListBase seqbase; /* list of strips for metastrips */
155 struct bSound *sound; /* the linked "bSound" object */
159 float pitch, pan; /* pitch (-0.1..10), pan -2..2 */
162 void *effectdata; /* Struct pointer for effect settings */
164 int anim_startofs; /* only use part of animation file */
165 int anim_endofs; /* is subtle different to startofs / endofs */
171 /* is sfra needed anymore? - it looks like its only used in one place */
172 int sfra, pad; /* starting frame according to the timeline of the scene. */
178 typedef struct MetaStack {
179 struct MetaStack *next, *prev;
184 typedef struct Editing {
185 ListBase *seqbasep; /* pointer to the current list of seq's being edited (can be within a meta strip) */
186 ListBase seqbase; /* pointer to the top-most seq's */
189 /* Context vars, used to be static */
191 char act_imagedir[1024]; /* 1024 = FILE_MAX */
192 char act_sounddir[1024]; /* 1024 = FILE_MAX */
194 int over_ofs, over_cfra;
199 /* ************* Effect Variable Structs ********* */
200 typedef struct WipeVars {
201 float edgeWidth, angle;
202 short forward, wipetype;
205 typedef struct GlowVars {
206 float fMini; /* Minimum intensity to trigger a glow */
208 float fBoost; /* Amount to multiply glow intensity */
209 float dDist; /* Radius of glow blurring */
211 int bNoComp; /* SHOW/HIDE glow buffer */
214 typedef struct TransformVars {
222 int uniform_scale; /* preserve aspect/ratio when scaling */
225 typedef struct SolidColorVars {
230 typedef struct SpeedControlVars {
238 /* ***************** Sequence modifiers ****************** */
240 typedef struct SequenceModifierData {
241 struct SequenceModifierData *next, *prev;
243 char name[64]; /* MAX_NAME */
245 /* mask input, either sequence or maks ID */
246 int mask_input_type, pad;
248 struct Sequence *mask_sequence;
249 struct Mask *mask_id;
250 } SequenceModifierData;
252 typedef struct ColorBalanceModifierData {
253 SequenceModifierData modifier;
255 StripColorBalance color_balance;
256 float color_multiply;
257 } ColorBalanceModifierData;
259 typedef struct CurvesModifierData {
260 SequenceModifierData modifier;
262 struct CurveMapping curve_mapping;
263 } CurvesModifierData;
265 typedef struct HueCorrectModifierData {
266 SequenceModifierData modifier;
268 struct CurveMapping curve_mapping;
269 } HueCorrectModifierData;
271 typedef struct BrightContrastModifierData {
272 SequenceModifierData modifier;
276 } BrightContrastModifierData;
282 /* Editor->over_flag */
283 #define SEQ_EDIT_OVERLAY_SHOW 1
284 #define SEQ_EDIT_OVERLAY_ABS 2
286 #define SEQ_STRIP_OFSBOTTOM 0.2f
287 #define SEQ_STRIP_OFSTOP 0.8f
289 /* SpeedControlVars->flags */
290 #define SEQ_SPEED_INTEGRATE 1
291 #define SEQ_SPEED_BLEND 2
292 #define SEQ_SPEED_COMPRESS_IPO_Y 4
294 /* ***************** SEQUENCE ****************** */
295 #define SEQ_NAME_MAXSTR 64
298 #define SEQ_LEFTSEL (1 << 1)
299 #define SEQ_RIGHTSEL (1 << 2)
300 #define SEQ_OVERLAP (1 << 3)
301 #define SEQ_FILTERY (1 << 4)
302 #define SEQ_MUTE (1 << 5)
303 #define SEQ_MAKE_PREMUL (1 << 6)
304 #define SEQ_REVERSE_FRAMES (1 << 7)
305 #define SEQ_IPO_FRAME_LOCKED (1 << 8)
306 #define SEQ_EFFECT_NOT_LOADED (1 << 9)
307 #define SEQ_FLAG_DELETE (1 << 10)
308 #define SEQ_FLIPX (1 << 11)
309 #define SEQ_FLIPY (1 << 12)
310 #define SEQ_MAKE_FLOAT (1 << 13)
311 #define SEQ_LOCK (1 << 14)
312 #define SEQ_USE_PROXY (1 << 15)
313 #define SEQ_USE_TRANSFORM (1 << 16)
314 #define SEQ_USE_CROP (1 << 17)
315 /* #define SEQ_USE_COLOR_BALANCE (1 << 18) */ /* DEPRECATED */
316 #define SEQ_USE_PROXY_CUSTOM_DIR (1 << 19)
318 #define SEQ_USE_PROXY_CUSTOM_FILE (1 << 21)
319 #define SEQ_USE_EFFECT_DEFAULT_FADE (1 << 22)
321 // flags for whether those properties are animated or not
322 #define SEQ_AUDIO_VOLUME_ANIMATED (1 << 24)
323 #define SEQ_AUDIO_PITCH_ANIMATED (1 << 25)
324 #define SEQ_AUDIO_PAN_ANIMATED (1 << 26)
325 #define SEQ_AUDIO_DRAW_WAVEFORM (1 << 27)
327 #define SEQ_INVALID_EFFECT (1 << 31)
329 /* convenience define for all selection flags */
330 #define SEQ_ALLSEL (SELECT + SEQ_LEFTSEL + SEQ_RIGHTSEL)
332 /* deprecated, don't use a flag anymore*/
333 /*#define SEQ_ACTIVE 1048576*/
335 #define SEQ_COLOR_BALANCE_INVERSE_GAIN 1
336 #define SEQ_COLOR_BALANCE_INVERSE_GAMMA 2
337 #define SEQ_COLOR_BALANCE_INVERSE_LIFT 4
339 /* !!! has to be same as IMB_imbuf.h IMB_PROXY_... and IMB_TC_... */
341 #define SEQ_PROXY_IMAGE_SIZE_25 1
342 #define SEQ_PROXY_IMAGE_SIZE_50 2
343 #define SEQ_PROXY_IMAGE_SIZE_75 4
344 #define SEQ_PROXY_IMAGE_SIZE_100 8
346 #define SEQ_PROXY_TC_NONE 0
347 #define SEQ_PROXY_TC_RECORD_RUN 1
348 #define SEQ_PROXY_TC_FREE_RUN 2
349 #define SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN 4
350 #define SEQ_PROXY_TC_RECORD_RUN_NO_GAPS 8
351 #define SEQ_PROXY_TC_ALL 15
353 /* seq->type WATCH IT: SEQ_TYPE_EFFECT BIT is used to determine if this is an effect strip!!! */
359 SEQ_TYPE_SOUND_RAM = 4,
360 SEQ_TYPE_SOUND_HD = 5,
361 SEQ_TYPE_MOVIECLIP = 6,
368 SEQ_TYPE_ALPHAOVER = 11,
369 SEQ_TYPE_ALPHAUNDER = 12,
370 SEQ_TYPE_GAMCROSS = 13,
372 SEQ_TYPE_OVERDROP = 15,
373 /* SEQ_TYPE_PLUGIN = 24, */ /* Deprecated */
376 SEQ_TYPE_TRANSFORM = 27,
379 SEQ_TYPE_MULTICAM = 30,
380 SEQ_TYPE_ADJUSTMENT = 31,
381 SEQ_TYPE_EFFECT_MAX = 31
384 #define STRIPELEM_FAILED 0
385 #define STRIPELEM_OK 1
387 #define STRIPELEM_PREVIEW_DONE 1
389 #define SEQ_MOVIECLIP_RENDER_UNDISTORTED (1 << 0)
390 #define SEQ_MOVIECLIP_RENDER_STABILIZED (1 << 1)
392 #define SEQ_BLEND_REPLACE 0
393 /* all other BLEND_MODEs are simple SEQ_TYPE_EFFECT ids and therefore identical
394 * to the table above. (Only those effects that handle _exactly_ two inputs,
395 * otherwise, you can't really blend, right :) !)
399 #define SEQ_HAS_PATH(_seq) (ELEM4((_seq)->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD))
403 /* SequenceModifierData->type */
405 seqModifierType_ColorBalance = 1,
406 seqModifierType_Curves = 2,
407 seqModifierType_HueCorrect = 3,
408 seqModifierType_BrightContrast = 4,
410 NUM_SEQUENCE_MODIFIER_TYPES
413 /* SequenceModifierData->flag */
415 SEQUENCE_MODIFIER_MUTE = (1 << 0),
416 SEQUENCE_MODIFIER_EXPANDED = (1 << 1),
420 SEQUENCE_MASK_INPUT_STRIP = 0,
421 SEQUENCE_MASK_INPUT_ID = 1