45# include <AUD_Sound.h>
46# include <AUD_Special.h>
90 return paths.size() == 1 && file_handlers.size() == 1 &&
91 file_handler == file_handlers[0]->idname;
172 View2D *v2d = ®ion->v2d;
187 float scene_playback_rate =
float(scene->r.frs_sec) / scene->r.frs_sec_base;
203 scene, region, start_frame, end_frame, &snap_delta, &snap_frame);
207 start_frame += snap_delta;
209 end_frame = start_frame + strip_len;
229 dummy_seq.speed_factor = 1.0f;
256 mval[0] =
xy[0] - region->winrct.xmin;
257 mval[1] =
xy[1] - region->winrct.ymin;
276 scene, channels, seqbase, scene->r.cfra, sseq->
chanshown);
279 int max_channel = -1;
281 max_channel =
max_ii(seq->machine, max_channel);
284 if (max_channel != -1) {
293 if (id_type ==
ID_IM) {
303 else if (id_type ==
ID_MC) {
308 else if (id_type ==
ID_SO) {
344 if (id_type ==
ID_IM) {
348 else if (id_type ==
ID_MC) {
352 else if (id_type ==
ID_SO) {
374 mval[0] =
xy[0] - region->winrct.xmin;
375 mval[1] =
xy[1] - region->winrct.ymin;
398 uchar strip_color[4];
399 strip_color[3] = 255;
400 uchar text_color[4] = {255, 255, 255, 255};
423 data.col_background = color_pack(strip_color);
426 strip_color[0] = 255;
427 strip_color[1] = strip_color[2] = 33;
431 text_color[0] = text_color[1] = text_color[2] = 255;
436 text_color[0] = text_color[1] = text_color[2] = 10;
440 strip_color[3] = 204;
441 data.col_outline = color_pack(strip_color);
444 const float handle_size = use_thin_handle ? 5.0f : 8.0f;
448 float text_margin_x = 2.0f * (pixelx * handle_size) *
U.pixelsize;
451 rect.
xmin = x1 + text_margin_x;
452 rect.
ymin = text_margin_y;
453 rect.
xmax = x2 - text_margin_x;
464 const char *text_sep =
" | ";
465 const char *text_array[5];
469 char strip_duration_text[16];
470 int len_text_arr = 0;
476 text_array[len_text_arr++] = filename;
482 text_array[len_text_arr++] = text_sep;
483 text_array[len_text_arr++] = path;
487 SNPRINTF(strip_duration_text,
"%d",
int(x2 - x1));
488 text_array[len_text_arr++] = text_sep;
489 text_array[len_text_arr++] = strip_duration_text;
497 ®ion->v2d, &rect, text_display, strlen(text_display), text_color);
512 if (coords && coords->
in_use) {
540 AUD_Sound *sound = AUD_Sound_file(job_data->
path);
541 if (sound !=
nullptr) {
543 AUD_SoundInfo info = AUD_getInfo(sound);
547 AUD_Sound_free(sound);
553 char colorspace[64] =
"\0";
556 if (anim !=
nullptr) {
569 AUD_Sound *sound = AUD_Sound_file(job_data->
path);
570 if (sound !=
nullptr) {
572 AUD_SoundInfo info = AUD_getInfo(sound);
576 AUD_Sound_free(sound);
601 "SeqDragDropPreviewData");
742 "SEQUENCER_OT_image_strip_add",
749 "SEQUENCER_OT_movie_strip_add",
756 "SEQUENCER_OT_sound_strip_add",
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
SpaceSeq * CTX_wm_space_seq(const bContext *C)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
ImBufAnim * openanim(const char *filepath, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
const char * BKE_main_blendfile_path_from_global()
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
void void void BLI_path_split_file_part(const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
#define SNPRINTF(dst, format,...)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
size_t BLI_string_join_array(char *result, size_t result_maxncpy, const char *strings[], uint strings_num) ATTR_NONNULL()
#define SEQ_STRIP_OFSBOTTOM
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ USER_SEQ_ED_SIMPLE_TWEAKING
@ GPU_SEQ_FLAG_BACKGROUND
@ GPU_BLEND_ALPHA_PREMULT
void GPU_blend(eGPUBlend blend)
bool IMB_anim_get_fps(const ImBufAnim *anim, bool no_av_base, short *r_frs_sec, float *r_frs_sec_base)
void IMB_free_anim(ImBufAnim *anim)
int IMB_anim_get_duration(ImBufAnim *anim, IMB_Timecode_Type tc)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
void UI_Theme_Store(bThemeState *theme_state)
void UI_Theme_Restore(const bThemeState *theme_state)
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
void UI_SetTheme(int spacetype, int regionid)
void UI_view2d_text_cache_draw(ARegion *region)
void UI_view2d_text_cache_add_rectf(View2D *v2d, const rctf *rect_view, const char *str, size_t str_len, const unsigned char col[4])
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
@ WM_JOB_TYPE_SEQ_DRAG_DROP_PREVIEW
ListBase * SEQ_channels_displayed_get(Editing *ed)
draw_view in_light_buf[] float
VectorSet< Sequence * > SEQ_query_rendered_strips(const Scene *scene, ListBase *channels, ListBase *seqbase, const int timeline_frame, const int displayed_channel)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
blender::Vector< FileHandlerType * > file_handlers_poll_file_drop(const bContext *C, const blender::Span< std::string > paths)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_collection_clear(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
void RNA_struct_property_unset(PointerRNA *ptr, const char *identifier)
Editing * SEQ_editing_ensure(Scene *scene)
ListBase * SEQ_active_seqbase_get(const Editing *ed)
static float update_overlay_strip_position_data(bContext *C, const int mval[2])
void sequencer_dropboxes()
static bool test_single_file_handler_poll(const bContext *C, wmDrag *drag, blender::StringRef file_handler)
static bool image_drop_preview_poll(bContext *, wmDrag *drag, const wmEvent *)
static void get_drag_path(const bContext *C, wmDrag *drag, char r_path[FILE_MAX])
static void start_audio_video_job(bContext *C, wmDrag *drag, bool only_audio)
static void generic_poll_operations(const wmEvent *event, uint8_t type)
static void audio_prefetch(bContext *C, wmDrag *drag)
static void video_prefetch(bContext *C, wmDrag *drag)
static bool movie_drop_preview_poll(bContext *, wmDrag *drag, const wmEvent *)
static void sequencer_dropboxes_add_to_lb(ListBase *lb)
static void sound_drop_on_enter(wmDropBox *drop, wmDrag *)
static bool movie_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static void prefetch_data_fn(void *custom_data, wmJobWorkerStatus *)
static void image_drop_on_enter(wmDropBox *drop, wmDrag *)
static void draw_seq_in_view(bContext *C, wmWindow *, wmDrag *drag, const int xy[2])
static void nop_draw_droptip_fn(bContext *, wmWindow *, wmDrag *, const int[2])
static void sequencer_preview_dropboxes_add_to_lb(ListBase *lb)
static void sequencer_drop_copy(bContext *C, wmDrag *drag, wmDropBox *drop)
static void free_prefetch_data_fn(void *custom_data)
static bool generic_drop_draw_handling(wmDropBox *drop)
static bool sound_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool is_movie(wmDrag *drag)
static bool is_sound(wmDrag *drag)
static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static void sequencer_drop_on_exit(wmDropBox *drop, wmDrag *)
static bool sound_drop_preview_poll(bContext *, wmDrag *drag, const wmEvent *)
static SeqDropCoords g_drop_coords
static void movie_drop_on_enter(wmDropBox *drop, wmDrag *)
Sequence * find_nearest_seq(const Scene *scene, const View2D *v2d, const int mval[2], eSeqHandle *r_hand)
#define DEFAULT_IMG_STRIP_LENGTH
struct SequencerTimelineOverlay timeline_overlay
void(* on_drag_start)(bContext *C, wmDrag *drag)
void(* on_exit)(wmDropBox *drop, wmDrag *drag)
void(* on_enter)(wmDropBox *drop, wmDrag *drag)
void(* draw_in_view)(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2])
void(* draw_droptip)(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2])
struct wmEvent * eventstate
wmDropBox * WM_dropbox_add(ListBase *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)
blender::Span< std::string > WM_drag_get_paths(const wmDrag *drag)
int WM_drag_get_path_file_type(const wmDrag *drag)
bool WM_drag_is_ID_type(const wmDrag *drag, int idcode)
const char * WM_drag_get_single_path(const wmDrag *drag)
ID * WM_drag_get_local_ID_or_import_from_asset(const bContext *C, const wmDrag *drag, int idcode)
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
void WM_jobs_timer(wmJob *wm_job, double time_step, uint note, uint endnote)
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, const eWM_JobFlag flag, const eWM_JobType job_type)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *customdata))
void wmOrtho2_region_pixelspace(const ARegion *region)