63# include <file/File.h>
64# include <file/FileManager.h>
101 if (sequencer_scene ==
nullptr) {
112 const bool do_invert =
event->modifier &
KM_CTRL;
190 if (sequencer_scene ==
nullptr) {
281 float channel = coords->
channel;
306 scene, region, start_frame, end_frame, channel, &snap_delta, &snap_point);
310 start_frame += snap_delta;
312 end_frame = start_frame + strip_len;
324 dummy_strip.channel_set(coords->
channel);
327 dummy_strip.speed_factor = 1.0f;
334 scene,
ed->current_strips(), &dummy_strip);
335 dummy_strip.channel_set(dummy_strip.channel + 1);
382 int max_channel = -1;
383 for (
Strip *strip : strips) {
384 max_channel =
max_ii(strip->channel, max_channel);
387 if (max_channel != -1) {
411 if (id_type ==
ID_IM) {
412 Image *ima = id_cast<Image *>(
id);
421 else if (id_type ==
ID_MC) {
425 else if (id_type ==
ID_SCE) {
429 else if (id_type ==
ID_MSK) {
433 else if (id_type ==
ID_TXT) {
435 char *buf =
txt_to_buf(id_cast<Text *>(
id), &buf_len);
439 else if (id_type ==
ID_SO) {
440 bSound *sound = id_cast<bSound *>(
id);
486 if (id_type ==
ID_IM) {
487 Image *ima = id_cast<Image *>(
id);
490 else if (id_type ==
ID_MC) {
491 MovieClip *clip = id_cast<MovieClip *>(
id);
494 else if (id_type ==
ID_SO) {
495 bSound *sound = id_cast<bSound *>(
id);
549 uchar strip_color[4];
550 strip_color[3] = 255;
551 uchar text_color[4] = {255, 255, 255, 255};
560 if (i < coords->num_audio) {
572 strip_color[0] = 255;
573 strip_color[1] = strip_color[2] = 33;
577 text_color[0] = text_color[1] = text_color[2] = 255;
582 text_color[0] = text_color[1] = text_color[2] = 10;
586 strip_color[3] = 204;
593 const float handle_size = pixelx * (5.0f *
U.pixelsize);
597 float text_margin_x = 2.0f * handle_size;
600 rect.
xmin = x1 + text_margin_x;
601 rect.
ymin = text_margin_y;
602 rect.
xmax = x2 - text_margin_x;
613 const char *text_sep =
" | ";
614 const char *text_array[5];
618 char strip_duration_text[16];
619 int len_text_arr = 0;
626 text_array[len_text_arr++] =
filename;
629 text_array[len_text_arr++] = path;
636 text_array[len_text_arr++] = text_sep;
637 text_array[len_text_arr++] = path;
642 text_array[len_text_arr++] = text_sep;
643 text_array[len_text_arr++] = strip_duration_text;
649 text_display,
FILE_MAX, text_array, len_text_arr);
652 ®ion->
v2d, &rect, text_display, text_display_len, text_color);
667 if (coords && coords->
in_use) {
695 if (sound !=
nullptr) {
697 SoundInfo info = bke::sound_info_get(sound);
702 const int audio_streams = int(aud::FileManager::queryStreams(job_data->
path).size());
706 catch (aud::Exception &ex) {
723 if (anim !=
nullptr) {
727 int audio_streams = 0;
733 audio_streams = int(aud::FileManager::queryStreams(job_data->
path).size());
735 catch (aud::Exception &ex) {
747 MEM_delete(job_data);
757 "Loading previews...",
837 const Scene *scene = id_cast<Scene *>(
id);
933 "SEQUENCER_OT_movieclip_strip_add",
999 if (sequencer_scene ==
nullptr) {
1032 "SEQUENCER_OT_image_strip_add",
1039 "SEQUENCER_OT_movie_strip_add",
1046 "SEQUENCER_OT_movieclip_strip_add",
1053 "SEQUENCER_OT_scene_strip_add",
1060 "SEQUENCER_OT_mask_strip_add",
1067 "SEQUENCER_OT_text_strip_add",
1074 "SEQUENCER_OT_effect_strip_add",
1081 "SEQUENCER_OT_sound_strip_add",
Main runtime representation of an asset.
std::shared_ptr< void > AUD_Sound
#define SNPRINTF_UTF8(dst, format,...)
#define ID_BLEND_PATH_FROM_GLOBAL(_id)
Singleton to manage exceptions.
@ GPU_SEQ_FLAG_BACKGROUND
Read Blender memory allocation and freeing.
SeqStripDrawData & add_strip(float content_start, float content_end, float top, float bottom, float content_top, float left_handle, float right_handle, float handle_width, bool single_image)
Vector< FileHandlerType * > file_handlers_poll_file_drop(const bContext *C, const Span< std::string > paths)
Span< std::unique_ptr< FileHandlerType > > file_handlers()
static bool generic_poll_operations(const bContext *C, const wmEvent *event, uint8_t type)
static bool scene_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent *)
static bool get_drag_path(const bContext *, wmDrag *drag, char r_path[FILE_MAX])
static void draw_strip_in_view(bContext *C, wmWindow *, wmDrag *drag, const int xy[2])
static void nop_draw_droptip_fn(bContext *, wmWindow *, wmDrag *, const int[2])
void sequencer_dropboxes()
static void sequencer_drop_on_exit(wmDropBox *drop, wmDrag *)
static void sequencer_dropboxes_add_to_lb(ListBaseT< wmDropBox > *lb)
static void text_drop_on_enter(wmDropBox *drop, wmDrag *)
static bool movie_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool is_sound(wmDrag *drag)
static bool movie_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent *)
static bool movieclip_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool movieclip_drop_preview_poll(bContext *, wmDrag *drag, const wmEvent *)
static bool color_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool image_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent *)
static bool is_image(wmDrag *drag)
uint color_pack(const uchar rgba[4])
static void sequencer_preview_dropboxes_add_to_lb(ListBaseT< wmDropBox > *lb)
static bool color_drop_preview_poll(bContext *, wmDrag *drag, const wmEvent *)
static void movieclip_drop_on_enter(wmDropBox *drop, wmDrag *drag)
static bool scene_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool is_movie(wmDrag *drag)
static void prefetch_data_fn(void *custom_data, wmJobWorkerStatus *)
static void video_prefetch(bContext *C, wmDrag *drag)
static void sequencer_drop_copy(bContext *C, wmDrag *drag, wmDropBox *drop)
static float update_overlay_strip_position_data(bContext *C, const int mval[2])
static bool text_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent *)
static bool mask_drop_preview_poll(bContext *, wmDrag *drag, const wmEvent *)
static void start_audio_video_job(bContext *C, wmDrag *drag, bool only_audio)
static void scene_drop_on_enter(wmDropBox *drop, wmDrag *drag)
static void mask_drop_on_enter(wmDropBox *drop, wmDrag *drag)
static bool mask_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool test_single_file_handler_poll(const bContext *C, wmDrag *drag, StringRef file_handler)
static void audio_prefetch(bContext *C, wmDrag *drag)
static void color_drop_on_enter(wmDropBox *drop, wmDrag *)
static SeqDropCoords g_drop_coords
static bool generic_drop_draw_handling(wmDropBox *drop)
static bool sound_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent *)
static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static void sound_drop_on_enter(wmDropBox *drop, wmDrag *)
static bool sound_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static void free_prefetch_data_fn(void *custom_data)
static bool text_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool is_text(wmDrag *drag)
static void movie_drop_on_enter(wmDropBox *drop, wmDrag *)
static void image_drop_on_enter(wmDropBox *drop, wmDrag *)
std::string filename(const std::string_view &str, size_t pos)
ListBaseT< Strip > * active_seqbase_get(const Editing *ed)
bool transform_test_overlap(const Scene *scene, Strip *strip1, Strip *strip2)
Editing * editing_ensure(Scene *scene)
ListBaseT< SeqTimelineChannel > * channels_displayed_get(const Editing *ed)
VectorSet< Strip * > query_rendered_strips(const Scene *scene, ListBaseT< SeqTimelineChannel > *channels, ListBaseT< Strip > *seqbase, const int timeline_frame, const int displayed_channel)
int default_strip_length(const double scene_fps)
eSeqOverlapMode tool_settings_overlap_mode_get(Scene *scene)
void theme_store(bThemeState *theme_state)
void theme_set(int spacetype, int regionid)
void theme_restore(const bThemeState *theme_state)
void get_color_3ubv(int colorid, unsigned char col[3])
void view2d_view_ortho(const View2D *v2d)
float view2d_pixel_size_get_y(const View2D *v2d)
void view2d_view_restore(const bContext *C)
void view2d_text_cache_draw(ARegion *region)
void view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void view2d_text_cache_add_rectf(View2D *v2d, const rctf *rect_view, const char *str, size_t str_len, const unsigned char col[4])
float view2d_pixel_size_get_x(const View2D *v2d)
MINLINE float min_ff(float a, float b)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
const char * WM_drag_get_single_path(const wmDrag *drag)
void wmOrtho2_region_pixelspace(const ARegion *region)
wmDropBox * WM_dropbox_add(ListBaseT< wmDropBox > *lb, const char *idname, bool(*poll)(bContext *C, wmDrag *drag, const wmEvent *event), void(*copy)(bContext *C, wmDrag *drag, wmDropBox *drop), void(*cancel)(Main *bmain, wmDrag *drag, wmDropBox *drop), WMDropboxTooltipFunc tooltip)
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
Scene * CTX_data_sequencer_scene(const bContext *C)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
wmDragAsset * WM_drag_get_asset_data(const wmDrag *drag, int idcode)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
void MOV_close(MovieReader *anim)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
@ WM_JOB_TYPE_SEQ_DRAG_DROP_PREVIEW
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_struct_property_unset(PointerRNA *ptr, const char *identifier)
wmWindow * CTX_wm_window(const bContext *C)
ID * WM_drag_get_local_ID_or_import_from_asset(const bContext *C, const wmDrag *drag, int idcode)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
MINLINE int max_ii(int a, int b)
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *customdata))
int BKE_mask_get_duration(Mask *mask)
bool WM_drag_is_ID_type(const wmDrag *drag, int idcode)
SpaceSeq * CTX_wm_space_seq(const bContext *C)
@ GPU_BLEND_ALPHA_PREMULT
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
VecBase< float, 4 > float4
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
VecBase< float, 2 > float2
void RNA_collection_clear(PointerRNA *ptr, const char *name)
BMesh const char void * data
wmWindowManager * CTX_wm_manager(const bContext *C)
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
MovieReader * openanim(const char *filepath, ImBufFlags ibuf_flags, int streamindex, bool keep_original_colorspace, ColorManagedColorspaceSettings *colorspace_settings)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
int WM_drag_get_path_file_type(const wmDrag *drag)
int BKE_movieclip_get_duration(MovieClip *clip)
void void void BLI_path_split_file_part(const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1
Main * CTX_data_main(const bContext *C)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, const eWM_JobFlag flag, const eWM_JobType job_type)
int MOV_get_video_stream_count(MovieReader *anim)
bool BLI_path_extension_check(const char *path, const char *ext) ATTR_NONNULL(1
char * txt_to_buf(struct Text *text, size_t *r_buf_strlen) ATTR_NONNULL(1
ID_Type GS(const char *name)
float MOV_get_fps(const MovieReader *anim)
Span< std::string > WM_drag_get_paths(const wmDrag *drag)
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
Scene * CTX_data_scene(const bContext *C)
void GPU_blend(GPUBlend blend)
ID * WM_drag_get_local_ID(const wmDrag *drag, short idcode)
BLI_INLINE void IMB_colormanagement_scene_linear_to_srgb_v3(float srgb[3], const float scene_linear[3])
size_t BLI_string_join_array(char *result, size_t result_maxncpy, const char *strings[], uint strings_num) ATTR_NONNULL()
ListBaseT< wmDropBox > * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
int MOV_get_duration_frames(const MovieReader *anim)
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
ARegion * CTX_wm_region(const bContext *C)
void WM_jobs_timer(wmJob *wm_job, double time_step, uint note, uint endnote, void(*timer_step)(void *))
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
ListBaseT< MovieClip > movieclips
ListBaseT< Scene > scenes
struct ToolSettings * toolsettings
eSpaceSeq_SequencerTimelineOverlay_Flag flag
struct blender::SoundInfo::@227301210053207103375114031212057322370226174015 specs
struct SequencerTimelineOverlay timeline_overlay
void(*) draw_droptip(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2])
void(*) on_enter(wmDropBox *drop, wmDrag *drag)
void(*) on_drag_start(bContext *C, wmDrag *drag)
void(*) on_exit(wmDropBox *drop, wmDrag *drag)
void(*) draw_in_view(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2])
bke::WindowRuntime * runtime