Release tools: Add script to generate a list of bugs fixed from last release
[blender.git] / source / blender / sequencer / SEQ_add.hh
blob76db282ab69c8c4802499e76f7b3ffabcf8fcdf7
1 /* SPDX-FileCopyrightText: 2004 Blender Authors
3 * SPDX-License-Identifier: GPL-2.0-or-later */
5 #pragma once
7 /** \file
8 * \ingroup sequencer
9 */
11 #include "BLI_utildefines.h"
13 #include "DNA_scene_enums.h"
15 struct ListBase;
16 struct Main;
17 struct Mask;
18 struct MovieClip;
19 struct Scene;
20 struct Strip;
21 struct Stereo3dFormat;
23 /** #SeqLoadData.flags */
24 enum eSeqLoadFlags {
25 SEQ_LOAD_SOUND_CACHE = (1 << 1),
26 SEQ_LOAD_SOUND_MONO = (1 << 2),
27 SEQ_LOAD_MOVIE_SYNC_FPS = (1 << 3),
28 SEQ_LOAD_SET_VIEW_TRANSFORM = (1 << 4),
30 ENUM_OPERATORS(eSeqLoadFlags, SEQ_LOAD_SET_VIEW_TRANSFORM)
32 /* Api for adding new sequence strips. */
33 struct SeqLoadData {
34 int start_frame;
35 int channel;
36 char name[64]; /* Strip name. */
37 /** Typically a `filepath` but may reference any kind of path. */
38 char path[1024]; /* 1024 = FILE_MAX */
39 struct {
40 int len;
41 int end_frame;
42 } image; /* Only for image strips. */
43 Scene *scene; /* Only for scene strips. */
44 MovieClip *clip; /* Only for clip strips. */
45 Mask *mask; /* Only for mask strips. */
46 struct {
47 int type;
48 int end_frame;
49 Strip *seq1;
50 Strip *seq2;
51 } effect; /* Only for effect strips. */
52 eSeqLoadFlags flags;
53 eSeqImageFitMethod fit_method;
54 bool use_multiview;
55 char views_format;
56 Stereo3dFormat *stereo3d_format;
57 bool allow_invalid_file; /* Used by RNA API to create placeholder strips. */
58 double r_video_stream_start; /* For AV synchronization. Set by `SEQ_add_movie_strip`. */
59 bool adjust_playback_rate;
62 /**
63 * Initialize common SeqLoadData members
65 * \param load_data: SeqLoadData to be initialized
66 * \param name: strip name (can be NULL)
67 * \param path: path to file that is used as strip input (can be NULL)
68 * \param start_frame: timeline frame where strip will be created
69 * \param channel: timeline channel where strip will be created
71 void SEQ_add_load_data_init(
72 SeqLoadData *load_data, const char *name, const char *path, int start_frame, int channel);
73 /**
74 * Add image strip.
75 * \note Use #SEQ_add_image_set_directory() and #SEQ_add_image_load_file() to load image sequences
77 * \param bmain: Main reference
78 * \param scene: Scene where strips will be added
79 * \param seqbase: ListBase where strips will be added
80 * \param load_data: SeqLoadData with information necessary to create strip
81 * \return created strip
83 Strip *SEQ_add_image_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqLoadData *load_data);
84 /**
85 * Add sound strip.
86 * \note Use SEQ_add_image_set_directory() and SEQ_add_image_load_file() to load image sequences
88 * \param bmain: Main reference
89 * \param scene: Scene where strips will be added
90 * \param seqbase: ListBase where strips will be added
91 * \param load_data: SeqLoadData with information necessary to create strip
92 * \return created strip
94 Strip *SEQ_add_sound_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqLoadData *load_data);
96 /**
97 * Sync up the sound strip 'seq' with the video data in 'load_data'.
98 * This is intended to be used after adding a movie strip and you want to make sure that the audio
99 * track is properly synced up with the video.
101 * \param bmain: Main reference
102 * \param scene: Scene where the sound strip is located
103 * \param seq: The sound strip that will be synced
104 * \param load_data: SeqLoadData with information necessary to sync the sound strip
106 void SEQ_add_sound_av_sync(Main *bmain, Scene *scene, Strip *strip, SeqLoadData *load_data);
108 * Add meta strip.
110 * \param scene: Scene where strips will be added
111 * \param seqbase: ListBase where strips will be added
112 * \param load_data: SeqLoadData with information necessary to create strip
113 * \return created strip
115 Strip *SEQ_add_meta_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data);
117 * Add movie strip.
119 * \param bmain: Main reference
120 * \param scene: Scene where strips will be added
121 * \param seqbase: ListBase where strips will be added
122 * \param load_data: SeqLoadData with information necessary to create strip
123 * \return created strip
125 Strip *SEQ_add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqLoadData *load_data);
127 * Add scene strip.
129 * \param scene: Scene where strips will be added
130 * \param seqbase: ListBase where strips will be added
131 * \param load_data: SeqLoadData with information necessary to create strip
132 * \return created strip
134 Strip *SEQ_add_scene_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data);
136 * Add movieclip strip.
138 * \param scene: Scene where strips will be added
139 * \param seqbase: ListBase where strips will be added
140 * \param load_data: SeqLoadData with information necessary to create strip
141 * \return created strip
143 Strip *SEQ_add_movieclip_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data);
145 * Add mask strip.
147 * \param scene: Scene where strips will be added
148 * \param seqbase: ListBase where strips will be added
149 * \param load_data: SeqLoadData with information necessary to create strip
150 * \return created strip
152 Strip *SEQ_add_mask_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data);
154 * Add effect strip.
156 * \param scene: Scene where strips will be added
157 * \param seqbase: ListBase where strips will be added
158 * \param load_data: SeqLoadData with information necessary to create strip
159 * \return created strip
161 Strip *SEQ_add_effect_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data);
163 * Set directory used by image strip.
165 * \param seq: image strip to be changed
166 * \param path: directory path
168 void SEQ_add_image_set_directory(Strip *strip, const char *dirpath);
170 * Set directory used by image strip.
172 * \param seq: image strip to be changed
173 * \param strip_frame: frame index of strip to be changed
174 * \param filename: image filename (only filename, not complete path)
176 void SEQ_add_image_load_file(Scene *scene, Strip *strip, size_t strip_frame, const char *filename);
178 * Set image strip alpha mode
180 * \param seq: image strip to be changed
182 void SEQ_add_image_init_alpha_mode(Strip *strip);
183 void SEQ_add_reload_new_file(Main *bmain, Scene *scene, Strip *strip, bool lock_range);
184 void SEQ_add_movie_reload_if_needed(
185 Main *bmain, Scene *scene, Strip *strip, bool *r_was_reloaded, bool *r_can_produce_frames);