1 /* timeline.c generated by valac, the Vala compiler
2 * generated from timeline.vala, do not modify */
4 /* Copyright 2009-2010 Yorba Foundation
6 * This software is licensed under the GNU Lesser General Public License
7 * (version 2.1 or later). See the COPYING file in this distribution.
11 #include <glib-object.h>
20 #include <gobject/gvaluecollector.h>
23 #define TYPE_TRACK_CLIP_PAIR (track_clip_pair_get_type ())
24 #define TRACK_CLIP_PAIR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRACK_CLIP_PAIR, TrackClipPair))
25 #define TRACK_CLIP_PAIR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRACK_CLIP_PAIR, TrackClipPairClass))
26 #define IS_TRACK_CLIP_PAIR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRACK_CLIP_PAIR))
27 #define IS_TRACK_CLIP_PAIR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRACK_CLIP_PAIR))
28 #define TRACK_CLIP_PAIR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRACK_CLIP_PAIR, TrackClipPairClass))
30 typedef struct _TrackClipPair TrackClipPair;
31 typedef struct _TrackClipPairClass TrackClipPairClass;
32 typedef struct _TrackClipPairPrivate TrackClipPairPrivate;
34 #define MODEL_TYPE_TRACK (model_track_get_type ())
35 #define MODEL_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_TRACK, ModelTrack))
36 #define MODEL_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MODEL_TYPE_TRACK, ModelTrackClass))
37 #define MODEL_IS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_TRACK))
38 #define MODEL_IS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEL_TYPE_TRACK))
39 #define MODEL_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MODEL_TYPE_TRACK, ModelTrackClass))
41 typedef struct _ModelTrack ModelTrack;
42 typedef struct _ModelTrackClass ModelTrackClass;
44 #define MODEL_TYPE_CLIP (model_clip_get_type ())
45 #define MODEL_CLIP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_CLIP, ModelClip))
46 #define MODEL_CLIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MODEL_TYPE_CLIP, ModelClipClass))
47 #define MODEL_IS_CLIP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_CLIP))
48 #define MODEL_IS_CLIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEL_TYPE_CLIP))
49 #define MODEL_CLIP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MODEL_TYPE_CLIP, ModelClipClass))
51 typedef struct _ModelClip ModelClip;
52 typedef struct _ModelClipClass ModelClipClass;
53 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
54 typedef struct _ParamSpecTrackClipPair ParamSpecTrackClipPair;
56 #define TYPE_CLIPBOARD (clipboard_get_type ())
57 #define CLIPBOARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CLIPBOARD, Clipboard))
58 #define CLIPBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CLIPBOARD, ClipboardClass))
59 #define IS_CLIPBOARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CLIPBOARD))
60 #define IS_CLIPBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CLIPBOARD))
61 #define CLIPBOARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CLIPBOARD, ClipboardClass))
63 typedef struct _Clipboard Clipboard;
64 typedef struct _ClipboardClass ClipboardClass;
65 typedef struct _ClipboardPrivate ClipboardPrivate;
67 #define TYPE_CLIP_VIEW (clip_view_get_type ())
68 #define CLIP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CLIP_VIEW, ClipView))
69 #define CLIP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CLIP_VIEW, ClipViewClass))
70 #define IS_CLIP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CLIP_VIEW))
71 #define IS_CLIP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CLIP_VIEW))
72 #define CLIP_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CLIP_VIEW, ClipViewClass))
74 typedef struct _ClipView ClipView;
75 typedef struct _ClipViewClass ClipViewClass;
77 #define TYPE_TRACK_VIEW (track_view_get_type ())
78 #define TRACK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRACK_VIEW, TrackView))
79 #define IS_TRACK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRACK_VIEW))
80 #define TRACK_VIEW_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_TRACK_VIEW, TrackViewIface))
82 typedef struct _TrackView TrackView;
83 typedef struct _TrackViewIface TrackViewIface;
84 typedef struct _ClipViewPrivate ClipViewPrivate;
85 #define _track_clip_pair_unref0(var) ((var == NULL) ? NULL : (var = (track_clip_pair_unref (var), NULL)))
86 typedef struct _ParamSpecClipboard ParamSpecClipboard;
88 #define TYPE_TIME_LINE (time_line_get_type ())
89 #define TIME_LINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TIME_LINE, TimeLine))
90 #define TIME_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TIME_LINE, TimeLineClass))
91 #define IS_TIME_LINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TIME_LINE))
92 #define IS_TIME_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TIME_LINE))
93 #define TIME_LINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TIME_LINE, TimeLineClass))
95 typedef struct _TimeLine TimeLine;
96 typedef struct _TimeLineClass TimeLineClass;
97 typedef struct _TimeLinePrivate TimeLinePrivate;
99 #define MODEL_TYPE_PROJECT (model_project_get_type ())
100 #define MODEL_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_PROJECT, ModelProject))
101 #define MODEL_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MODEL_TYPE_PROJECT, ModelProjectClass))
102 #define MODEL_IS_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_PROJECT))
103 #define MODEL_IS_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEL_TYPE_PROJECT))
104 #define MODEL_PROJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MODEL_TYPE_PROJECT, ModelProjectClass))
106 typedef struct _ModelProject ModelProject;
107 typedef struct _ModelProjectClass ModelProjectClass;
109 #define MODEL_TYPE_TIME_SYSTEM (model_time_system_get_type ())
110 #define MODEL_TIME_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_TIME_SYSTEM, ModelTimeSystem))
111 #define MODEL_IS_TIME_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_TIME_SYSTEM))
112 #define MODEL_TIME_SYSTEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MODEL_TYPE_TIME_SYSTEM, ModelTimeSystemIface))
114 typedef struct _ModelTimeSystem ModelTimeSystem;
115 typedef struct _ModelTimeSystemIface ModelTimeSystemIface;
117 #define VIEW_TYPE_RULER (view_ruler_get_type ())
118 #define VIEW_RULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIEW_TYPE_RULER, ViewRuler))
119 #define VIEW_RULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIEW_TYPE_RULER, ViewRulerClass))
120 #define VIEW_IS_RULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIEW_TYPE_RULER))
121 #define VIEW_IS_RULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIEW_TYPE_RULER))
122 #define VIEW_RULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIEW_TYPE_RULER, ViewRulerClass))
124 typedef struct _ViewRuler ViewRuler;
125 typedef struct _ViewRulerClass ViewRulerClass;
126 #define _clipboard_unref0(var) ((var == NULL) ? NULL : (var = (clipboard_unref (var), NULL)))
128 #define MODEL_TYPE_TEMPO_INFORMATION (model_tempo_information_get_type ())
129 #define MODEL_TEMPO_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_TEMPO_INFORMATION, ModelTempoInformation))
130 #define MODEL_IS_TEMPO_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_TEMPO_INFORMATION))
131 #define MODEL_TEMPO_INFORMATION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MODEL_TYPE_TEMPO_INFORMATION, ModelTempoInformationIface))
133 typedef struct _ModelTempoInformation ModelTempoInformation;
134 typedef struct _ModelTempoInformationIface ModelTempoInformationIface;
136 #define TYPE_FRACTION (fraction_get_type ())
137 typedef struct _Fraction Fraction;
138 typedef struct _ModelProjectPrivate ModelProjectPrivate;
140 #define MODEL_TYPE_CLIP_FILE (model_clip_file_get_type ())
141 #define MODEL_CLIP_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_CLIP_FILE, ModelClipFile))
142 #define MODEL_CLIP_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MODEL_TYPE_CLIP_FILE, ModelClipFileClass))
143 #define MODEL_IS_CLIP_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_CLIP_FILE))
144 #define MODEL_IS_CLIP_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEL_TYPE_CLIP_FILE))
145 #define MODEL_CLIP_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MODEL_TYPE_CLIP_FILE, ModelClipFileClass))
147 typedef struct _ModelClipFile ModelClipFile;
148 typedef struct _ModelClipFileClass ModelClipFileClass;
150 #define TYPE_TIME_CODE (time_code_get_type ())
151 typedef struct _TimeCode TimeCode;
153 #define VIEW_TYPE_MEDIA_ENGINE (view_media_engine_get_type ())
154 #define VIEW_MEDIA_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIEW_TYPE_MEDIA_ENGINE, ViewMediaEngine))
155 #define VIEW_MEDIA_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIEW_TYPE_MEDIA_ENGINE, ViewMediaEngineClass))
156 #define VIEW_IS_MEDIA_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIEW_TYPE_MEDIA_ENGINE))
157 #define VIEW_IS_MEDIA_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIEW_TYPE_MEDIA_ENGINE))
158 #define VIEW_MEDIA_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIEW_TYPE_MEDIA_ENGINE, ViewMediaEngineClass))
160 typedef struct _ViewMediaEngine ViewMediaEngine;
161 typedef struct _ViewMediaEngineClass ViewMediaEngineClass;
163 #define MODEL_TYPE_PROJECT_LOADER (model_project_loader_get_type ())
164 #define MODEL_PROJECT_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_PROJECT_LOADER, ModelProjectLoader))
165 #define MODEL_PROJECT_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MODEL_TYPE_PROJECT_LOADER, ModelProjectLoaderClass))
166 #define MODEL_IS_PROJECT_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_PROJECT_LOADER))
167 #define MODEL_IS_PROJECT_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEL_TYPE_PROJECT_LOADER))
168 #define MODEL_PROJECT_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MODEL_TYPE_PROJECT_LOADER, ModelProjectLoaderClass))
170 typedef struct _ModelProjectLoader ModelProjectLoader;
171 typedef struct _ModelProjectLoaderClass ModelProjectLoaderClass;
173 #define MODEL_TYPE_UNDO_MANAGER (model_undo_manager_get_type ())
174 #define MODEL_UNDO_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_UNDO_MANAGER, ModelUndoManager))
175 #define MODEL_UNDO_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MODEL_TYPE_UNDO_MANAGER, ModelUndoManagerClass))
176 #define MODEL_IS_UNDO_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_UNDO_MANAGER))
177 #define MODEL_IS_UNDO_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEL_TYPE_UNDO_MANAGER))
178 #define MODEL_UNDO_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MODEL_TYPE_UNDO_MANAGER, ModelUndoManagerClass))
180 typedef struct _ModelUndoManager ModelUndoManager;
181 typedef struct _ModelUndoManagerClass ModelUndoManagerClass;
183 #define MODEL_TYPE_LIBRARY_IMPORTER (model_library_importer_get_type ())
184 #define MODEL_LIBRARY_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_LIBRARY_IMPORTER, ModelLibraryImporter))
185 #define MODEL_LIBRARY_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MODEL_TYPE_LIBRARY_IMPORTER, ModelLibraryImporterClass))
186 #define MODEL_IS_LIBRARY_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_LIBRARY_IMPORTER))
187 #define MODEL_IS_LIBRARY_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEL_TYPE_LIBRARY_IMPORTER))
188 #define MODEL_LIBRARY_IMPORTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MODEL_TYPE_LIBRARY_IMPORTER, ModelLibraryImporterClass))
190 typedef struct _ModelLibraryImporter ModelLibraryImporter;
191 typedef struct _ModelLibraryImporterClass ModelLibraryImporterClass;
193 #define LOGGING_TYPE_FACILITY (logging_facility_get_type ())
195 #define LOGGING_TYPE_LEVEL (logging_level_get_type ())
197 #define TYPE_CLASS_FACTORY (class_factory_get_type ())
198 #define CLASS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CLASS_FACTORY, ClassFactory))
199 #define CLASS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CLASS_FACTORY, ClassFactoryClass))
200 #define IS_CLASS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CLASS_FACTORY))
201 #define IS_CLASS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CLASS_FACTORY))
202 #define CLASS_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CLASS_FACTORY, ClassFactoryClass))
204 typedef struct _ClassFactory ClassFactory;
205 typedef struct _ClassFactoryClass ClassFactoryClass;
206 #define _class_factory_unref0(var) ((var == NULL) ? NULL : (var = (class_factory_unref (var), NULL)))
208 #define MODEL_TYPE_MEDIA_TYPE (model_media_type_get_type ())
209 typedef struct _ModelClipPrivate ModelClipPrivate;
210 #define _g_free0(var) (var = (g_free (var), NULL))
211 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
212 #define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
214 struct _TrackClipPair {
215 GTypeInstance parent_instance;
216 volatile int ref_count;
217 TrackClipPairPrivate * priv;
222 struct _TrackClipPairClass {
223 GTypeClass parent_class;
224 void (*finalize) (TrackClipPair *self);
227 struct _ParamSpecTrackClipPair {
228 GParamSpec parent_instance;
232 GTypeInstance parent_instance;
233 volatile int ref_count;
234 ClipboardPrivate * priv;
238 struct _ClipboardClass {
239 GTypeClass parent_class;
240 void (*finalize) (Clipboard *self);
243 struct _ClipboardPrivate {
247 struct _TrackViewIface {
248 GTypeInterface parent_iface;
249 void (*move_to_top) (TrackView* self, ClipView* clip_view);
250 void (*resize) (TrackView* self);
251 ModelTrack* (*get_track) (TrackView* self);
252 gint (*get_track_height) (TrackView* self);
253 GtkWidget* (*find_child) (TrackView* self, double x, double y);
254 void (*select_all) (TrackView* self);
258 GtkDrawingArea parent_instance;
259 ClipViewPrivate * priv;
262 gboolean is_selected;
266 struct _ClipViewClass {
267 GtkDrawingAreaClass parent_class;
270 struct _ParamSpecClipboard {
271 GParamSpec parent_instance;
274 struct _ModelTimeSystemIface {
275 GTypeInterface parent_iface;
276 void (*calculate_pixel_step) (ModelTimeSystem* self, float inc, float pixel_min, float pixel_div);
277 gint64 (*xpos_to_time) (ModelTimeSystem* self, gint x);
278 gint64 (*xsize_to_time) (ModelTimeSystem* self, gint x);
279 gint (*time_to_xpos) (ModelTimeSystem* self, gint64 time);
280 gint64 (*get_pixel_snap_time) (ModelTimeSystem* self);
281 gint (*time_to_xsize) (ModelTimeSystem* self, gint64 time);
282 float (*get_pixel_percentage) (ModelTimeSystem* self);
283 gint (*get_start_token) (ModelTimeSystem* self, gint xsize);
284 gint (*get_next_position) (ModelTimeSystem* self, gint token);
285 gint (*get_pixel_height) (ModelTimeSystem* self, gint token);
286 char* (*get_display_string) (ModelTimeSystem* self, gint token);
287 gint (*frame_to_xsize) (ModelTimeSystem* self, gint frame);
288 gint (*xsize_to_frame) (ModelTimeSystem* self, gint xsize);
289 char* (*get_time_string) (ModelTimeSystem* self, gint64 time);
290 char* (*get_time_duration) (ModelTimeSystem* self, gint64 time);
294 GtkEventBox parent_instance;
295 TimeLinePrivate * priv;
296 ModelProject* project;
297 ModelTimeSystem* provider;
299 GeeArrayList* tracks;
300 GeeArrayList* selected_clips;
301 Clipboard* clipboard;
304 struct _TimeLineClass {
305 GtkEventBoxClass parent_class;
308 struct _TimeLinePrivate {
309 GtkWidget* drag_widget;
315 GtkLabel* high_water;
323 struct _ModelTempoInformationIface {
324 GTypeInterface parent_iface;
325 void (*get_time_signature) (ModelTempoInformation* self, Fraction* result);
326 gint (*get_bpm) (ModelTempoInformation* self);
337 struct _ModelProject {
338 GObject parent_instance;
339 ModelProjectPrivate * priv;
340 GeeArrayList* tracks;
341 GeeArrayList* inactive_tracks;
342 GeeArrayList* clipfiles;
343 ViewMediaEngine* media_engine;
345 ModelProjectLoader* loader;
346 ModelUndoManager* undo_manager;
347 ModelLibraryImporter* importer;
348 Fraction default_framerate;
349 gboolean click_during_play;
350 gboolean click_during_record;
352 gboolean library_visible;
354 gboolean snap_to_clip;
357 struct _ModelProjectClass {
358 GObjectClass parent_class;
359 void (*get_clip_time) (ModelProject* self, ModelClipFile* f, TimeCode* result);
360 char* (*get_project_file) (ModelProject* self);
361 void (*do_append) (ModelProject* self, ModelTrack* track, ModelClipFile* clipfile, const char* name, gint64 insert_time);
362 void (*add_track) (ModelProject* self, ModelTrack* track);
363 void (*insert_track) (ModelProject* self, gint index, ModelTrack* track);
364 void (*load) (ModelProject* self, const char* fname);
365 void (*save) (ModelProject* self, const char* filename);
366 char* (*get_app_name) (ModelProject* self);
367 void (*load_complete) (ModelProject* self);
371 LOGGING_FACILITY_SIGNAL_HANDLERS,
372 LOGGING_FACILITY_DEVELOPER_WARNINGS,
373 LOGGING_FACILITY_GRAPH,
374 LOGGING_FACILITY_LOADING,
375 LOGGING_FACILITY_IMPORT,
376 LOGGING_FACILITY_SINGLEDECODEBIN
380 LOGGING_LEVEL_CRITICAL,
382 LOGGING_LEVEL_MEDIUM,
385 LOGGING_LEVEL_VERBOSE
389 MODEL_MEDIA_TYPE_AUDIO,
390 MODEL_MEDIA_TYPE_VIDEO
394 GObject parent_instance;
395 ModelClipPrivate * priv;
396 ModelClipFile* clipfile;
398 gboolean is_recording;
402 struct _ModelClipClass {
403 GObjectClass parent_class;
407 static gpointer track_clip_pair_parent_class = NULL;
408 static gpointer clipboard_parent_class = NULL;
409 static gpointer time_line_parent_class = NULL;
411 gpointer track_clip_pair_ref (gpointer instance);
412 void track_clip_pair_unref (gpointer instance);
413 GParamSpec* param_spec_track_clip_pair (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
414 void value_set_track_clip_pair (GValue* value, gpointer v_object);
415 void value_take_track_clip_pair (GValue* value, gpointer v_object);
416 gpointer value_get_track_clip_pair (const GValue* value);
417 GType track_clip_pair_get_type (void);
418 GType model_track_get_type (void);
419 GType model_clip_get_type (void);
421 TRACK_CLIP_PAIR_DUMMY_PROPERTY
423 TrackClipPair* track_clip_pair_new (ModelTrack* track, ModelClip* clip);
424 TrackClipPair* track_clip_pair_construct (GType object_type, ModelTrack* track, ModelClip* clip);
425 static void track_clip_pair_finalize (TrackClipPair* obj);
426 gpointer clipboard_ref (gpointer instance);
427 void clipboard_unref (gpointer instance);
428 GParamSpec* param_spec_clipboard (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
429 void value_set_clipboard (GValue* value, gpointer v_object);
430 void value_take_clipboard (GValue* value, gpointer v_object);
431 gpointer value_get_clipboard (const GValue* value);
432 GType clipboard_get_type (void);
433 #define CLIPBOARD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CLIPBOARD, ClipboardPrivate))
435 CLIPBOARD_DUMMY_PROPERTY
437 GType clip_view_get_type (void);
438 GType track_view_get_type (void);
439 gint64 model_clip_get_start (ModelClip* self);
440 ModelTrack* track_view_get_track (TrackView* self);
441 void clipboard_select (Clipboard* self, GeeArrayList* selected_clips);
442 void model_track_do_clip_paste (ModelTrack* self, ModelClip* clip, gint64 position);
443 ModelClip* model_clip_copy (ModelClip* self);
444 void clipboard_paste (Clipboard* self, ModelTrack* selected_track, gint64 time);
445 Clipboard* clipboard_new (void);
446 Clipboard* clipboard_construct (GType object_type);
447 static void clipboard_finalize (Clipboard* obj);
448 GType time_line_get_type (void);
449 GType model_project_get_type (void);
450 GType model_time_system_get_type (void);
451 GType view_ruler_get_type (void);
452 #define TIME_LINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TIME_LINE, TimeLinePrivate))
454 TIME_LINE_DUMMY_PROPERTY
456 #define TIME_LINE_BAR_HEIGHT 32
457 #define TIME_LINE_BORDER 4
458 #define TIME_LINE_RULER_HEIGHT 32
459 static void time_line_on_geometry_changed (TimeLine* self);
460 static void _time_line_on_geometry_changed_model_time_system_geometry_changed (ModelTimeSystem* _sender, gpointer self);
461 ViewRuler* view_ruler_new (ModelTimeSystem* provider, gint height);
462 ViewRuler* view_ruler_construct (GType object_type, ModelTimeSystem* provider, gint height);
463 void time_line_on_ruler_position_changed (TimeLine* self, gint x);
464 static void _time_line_on_ruler_position_changed_view_ruler_position_changed (ViewRuler* _sender, gint x, gpointer self);
465 static void time_line_on_track_added (TimeLine* self, ModelTrack* track);
466 static void _time_line_on_track_added_model_project_track_added (ModelProject* _sender, ModelTrack* track, gpointer self);
467 static void time_line_on_track_removed (TimeLine* self, ModelTrack* track);
468 static void _time_line_on_track_removed_model_project_track_removed (ModelProject* _sender, ModelTrack* track, gpointer self);
469 GType fraction_get_type (void);
470 Fraction* fraction_dup (const Fraction* self);
471 void fraction_free (Fraction* self);
472 GType model_tempo_information_get_type (void);
473 GType model_clip_file_get_type (void);
474 GType time_code_get_type (void);
475 TimeCode* time_code_dup (const TimeCode* self);
476 void time_code_free (TimeCode* self);
477 GType view_media_engine_get_type (void);
478 GType model_project_loader_get_type (void);
479 gpointer model_undo_manager_ref (gpointer instance);
480 void model_undo_manager_unref (gpointer instance);
481 GParamSpec* model_param_spec_undo_manager (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
482 void model_value_set_undo_manager (GValue* value, gpointer v_object);
483 void model_value_take_undo_manager (GValue* value, gpointer v_object);
484 gpointer model_value_get_undo_manager (const GValue* value);
485 GType model_undo_manager_get_type (void);
486 GType model_library_importer_get_type (void);
487 static void time_line_on_position_changed (TimeLine* self);
488 static void _time_line_on_position_changed_view_media_engine_position_changed (ViewMediaEngine* _sender, gint64 position, gpointer self);
489 void parse_color (const char* color, GdkColor* result);
490 void model_time_system_calculate_pixel_step (ModelTimeSystem* self, float inc, float pixel_min, float pixel_div);
491 TimeLine* time_line_new (ModelProject* p, ModelTimeSystem* provider, GdkDragAction actions);
492 TimeLine* time_line_construct (GType object_type, ModelProject* p, ModelTimeSystem* provider, GdkDragAction actions);
493 gint64 model_project_get_length (ModelProject* self);
494 void time_line_zoom (TimeLine* self, float inc);
495 float model_time_system_get_pixel_percentage (ModelTimeSystem* self);
496 void time_line_zoom_to_project (TimeLine* self, double width);
497 void track_view_resize (TrackView* self);
498 gint64 model_project_transport_get_position (ModelProject* self);
499 GType logging_facility_get_type (void);
500 GType logging_level_get_type (void);
501 void logging_emit (GObject* object, LoggingFacility facility, LoggingLevel level, const char* message);
502 gpointer class_factory_ref (gpointer instance);
503 void class_factory_unref (gpointer instance);
504 GParamSpec* param_spec_class_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
505 void value_set_class_factory (GValue* value, gpointer v_object);
506 void value_take_class_factory (GValue* value, gpointer v_object);
507 gpointer value_get_class_factory (const GValue* value);
508 GType class_factory_get_type (void);
509 ClassFactory* class_factory_get_class_factory (void);
510 TrackView* class_factory_get_track_view (ClassFactory* self, ModelTrack* track, TimeLine* timeline);
511 void time_line_on_clip_view_added (TimeLine* self, ClipView* clip_view);
512 static void _time_line_on_clip_view_added_track_view_clip_view_added (TrackView* _sender, ClipView* clip_view, gpointer self);
513 GType model_media_type_get_type (void);
514 ModelMediaType model_track_media_type (ModelTrack* self);
515 static void time_line_on_clip_view_selection_request (TimeLine* self, ClipView* clip_view, gboolean extend);
516 static void _time_line_on_clip_view_selection_request_clip_view_selection_request (ClipView* _sender, ClipView* clip_view, gboolean extend_selection, gpointer self);
517 static void time_line_on_clip_view_move_request (TimeLine* self, ClipView* clip_view, gint64 delta);
518 static void _time_line_on_clip_view_move_request_clip_view_move_request (ClipView* _sender, ClipView* clip_view, gint64 delta, gpointer self);
519 static void time_line_on_clip_view_move_commit (TimeLine* self, ClipView* clip_view, gint64 delta);
520 static void _time_line_on_clip_view_move_commit_clip_view_move_commit (ClipView* _sender, ClipView* clip_view, gint64 delta, gpointer self);
521 static void time_line_on_clip_view_move_begin (TimeLine* self, ClipView* clip_view, gboolean copy);
522 static void _time_line_on_clip_view_move_begin_clip_view_move_begin (ClipView* _sender, ClipView* clip_view, gboolean copy, gpointer self);
523 static void time_line_on_clip_view_trim_begin (TimeLine* self, ClipView* clip, GdkWindowEdge edge);
524 static void _time_line_on_clip_view_trim_begin_clip_view_trim_begin (ClipView* _sender, ClipView* clip_view, GdkWindowEdge edge, gpointer self);
525 static void time_line_on_clip_view_trim_commit (TimeLine* self, ClipView* clip_view, GdkWindowEdge edge);
526 static void _time_line_on_clip_view_trim_commit_clip_view_trim_commit (ClipView* _sender, ClipView* clip_view, GdkWindowEdge edge, gpointer self);
527 void time_line_deselect_all_clips (TimeLine* self);
528 void model_undo_manager_start_transaction (ModelUndoManager* self, const char* description);
529 gint64 model_clip_get_end (ModelClip* self);
530 void model_clip_gnonlin_disconnect (ModelClip* self);
531 void model_track_remove_clip_from_array (ModelTrack* self, ModelClip* pos);
532 void model_track_append_at_time (ModelTrack* self, ModelClip* c, gint64 time, gboolean select);
533 void track_view_move_to_top (TrackView* self, ClipView* clip_view);
534 gint64 model_clip_get_duration (ModelClip* self);
535 gboolean time_line_is_clip_selected (TimeLine* self);
536 void model_clip_gnonlin_connect (ModelClip* self);
537 void model_track_move (ModelTrack* self, ModelClip* c, gint64 pos, gint64 original_time);
538 void model_undo_manager_end_transaction (ModelUndoManager* self, const char* description);
539 void model_clip_trim (ModelClip* self, gint64 delta, GdkWindowEdge edge);
540 void model_track_trim (ModelTrack* self, ModelClip* clip, gint64 delta, GdkWindowEdge edge);
541 #define CLIP_VIEW_SNAP_DELTA 10
542 gint model_time_system_time_to_xsize (ModelTimeSystem* self, gint64 time);
543 gint64 model_time_system_xsize_to_time (ModelTimeSystem* self, gint x);
544 gboolean model_track_clip_is_near (ModelTrack* self, ModelClip* clip, gint64 range, gint64* adjustment);
545 void clip_view_snap (ClipView* self, gint64 amount);
546 static void time_line_constrain_move (TimeLine* self, ClipView* clip_view, gint64* delta);
547 static gboolean time_line_move_allowed (TimeLine* self, gint64* move_distance);
548 static void time_line_move_the_clips (TimeLine* self, gint64 move_distance);
549 gint model_time_system_time_to_xpos (ModelTimeSystem* self, gint64 time);
550 void time_line_do_clip_move (TimeLine* self, ClipView* clip_view, gint64 delta);
551 void model_clip_set_start (ModelClip* self, gint64 value);
552 gboolean model_project_transport_is_recording (ModelProject* self);
553 void time_line_update_pos (TimeLine* self, gint event_x);
554 gboolean time_line_gap_selected (TimeLine* self);
555 void clip_view_delete_clip (ClipView* self);
556 void time_line_delete_selection (TimeLine* self);
557 void time_line_do_cut (TimeLine* self);
558 void time_line_do_copy (TimeLine* self);
559 void time_line_do_paste (TimeLine* self, gint64 pos);
560 void time_line_paste (TimeLine* self);
561 gboolean model_track_get_is_selected (ModelTrack* self);
562 static TrackView* time_line_find_video_track_view (TimeLine* self);
563 static TrackView* time_line_find_audio_track_view (TimeLine* self);
564 void track_view_select_all (TrackView* self);
565 void time_line_select_all (TimeLine* self);
566 static gboolean time_line_real_expose_event (GtkWidget* base, GdkEventExpose* event);
567 GtkWidget* time_line_find_child (TimeLine* self, double x, double y);
568 void dialog_utils_warning (const char* major_message, const char* minor_message);
569 GtkResponseType dialog_utils_add_cancel (const char* message);
570 void model_project_create_clip_importer (ModelProject* self, ModelTrack* track, gboolean timeline_add, gint64 time_to_add, gboolean both_tracks, GtkWindow* progress_window_parent, gint number);
571 gint64 model_time_system_xpos_to_time (ModelTimeSystem* self, gint x);
572 void model_library_importer_add_file (ModelLibraryImporter* self, const char* filename, GError** error);
573 void model_library_importer_start (ModelLibraryImporter* self, GError** error);
574 static void time_line_real_drag_data_received (GtkWidget* base, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint drag_info, guint time);
575 void model_project_snap_coord (ModelProject* self, gint64* coord, gint64 span);
576 gint64 model_time_system_get_pixel_snap_time (ModelTimeSystem* self);
577 void view_media_engine_go (ViewMediaEngine* self, gint64 pos);
578 static void time_line_deselect_all (TimeLine* self);
579 GtkWidget* track_view_find_child (TrackView* self, double x, double y);
580 void model_track_set_selected (ModelTrack* self, gboolean is_selected);
581 static gboolean time_line_real_button_press_event (GtkWidget* base, GdkEventButton* event);
582 static gboolean time_line_real_button_release_event (GtkWidget* base, GdkEventButton* event);
583 static gboolean time_line_real_motion_notify_event (GtkWidget* base, GdkEventMotion* event);
584 static void time_line_finalize (GObject* obj);
585 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
586 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
587 static gint _vala_array_length (gpointer array);
589 extern const GtkTargetEntry drag_target_entries[1];
592 static gpointer _g_object_ref0 (gpointer self) {
593 return self ? g_object_ref (self) : NULL;
597 #line 10 "timeline.vala"
598 TrackClipPair* track_clip_pair_construct (GType object_type, ModelTrack* track, ModelClip* clip) {
599 #line 600 "timeline.c"
603 #line 10 "timeline.vala"
604 g_return_val_if_fail (MODEL_IS_TRACK (track), NULL);
605 #line 10 "timeline.vala"
606 g_return_val_if_fail (MODEL_IS_CLIP (clip), NULL);
607 #line 608 "timeline.c"
608 self = (TrackClipPair*) g_type_create_instance (object_type);
609 #line 11 "timeline.vala"
610 self->track = (_tmp0_ = _g_object_ref0 (track), _g_object_unref0 (self->track), _tmp0_);
611 #line 12 "timeline.vala"
612 self->clip = (_tmp1_ = _g_object_ref0 (clip), _g_object_unref0 (self->clip), _tmp1_);
613 #line 614 "timeline.c"
618 #line 10 "timeline.vala"
619 TrackClipPair* track_clip_pair_new (ModelTrack* track, ModelClip* clip) {
620 #line 10 "timeline.vala"
621 return track_clip_pair_construct (TYPE_TRACK_CLIP_PAIR, track, clip);
622 #line 623 "timeline.c"
626 static void value_track_clip_pair_init (GValue* value) {
627 value->data[0].v_pointer = NULL;
631 static void value_track_clip_pair_free_value (GValue* value) {
632 if (value->data[0].v_pointer) {
633 track_clip_pair_unref (value->data[0].v_pointer);
638 static void value_track_clip_pair_copy_value (const GValue* src_value, GValue* dest_value) {
639 if (src_value->data[0].v_pointer) {
640 dest_value->data[0].v_pointer = track_clip_pair_ref (src_value->data[0].v_pointer);
642 dest_value->data[0].v_pointer = NULL;
647 static gpointer value_track_clip_pair_peek_pointer (const GValue* value) {
648 return value->data[0].v_pointer;
652 static gchar* value_track_clip_pair_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
653 if (collect_values[0].v_pointer) {
654 TrackClipPair* object;
655 object = collect_values[0].v_pointer;
656 if (object->parent_instance.g_class == NULL) {
657 return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
658 } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
659 return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
661 value->data[0].v_pointer = track_clip_pair_ref (object);
663 value->data[0].v_pointer = NULL;
669 static gchar* value_track_clip_pair_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
670 TrackClipPair** object_p;
671 object_p = collect_values[0].v_pointer;
673 return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
675 if (!value->data[0].v_pointer) {
677 } else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
678 *object_p = value->data[0].v_pointer;
680 *object_p = track_clip_pair_ref (value->data[0].v_pointer);
686 GParamSpec* param_spec_track_clip_pair (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
687 ParamSpecTrackClipPair* spec;
688 g_return_val_if_fail (g_type_is_a (object_type, TYPE_TRACK_CLIP_PAIR), NULL);
689 spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
690 G_PARAM_SPEC (spec)->value_type = object_type;
691 return G_PARAM_SPEC (spec);
695 gpointer value_get_track_clip_pair (const GValue* value) {
696 g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TRACK_CLIP_PAIR), NULL);
697 return value->data[0].v_pointer;
701 void value_set_track_clip_pair (GValue* value, gpointer v_object) {
703 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TRACK_CLIP_PAIR));
704 old = value->data[0].v_pointer;
706 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TRACK_CLIP_PAIR));
707 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
708 value->data[0].v_pointer = v_object;
709 track_clip_pair_ref (value->data[0].v_pointer);
711 value->data[0].v_pointer = NULL;
714 track_clip_pair_unref (old);
719 void value_take_track_clip_pair (GValue* value, gpointer v_object) {
721 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TRACK_CLIP_PAIR));
722 old = value->data[0].v_pointer;
724 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TRACK_CLIP_PAIR));
725 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
726 value->data[0].v_pointer = v_object;
728 value->data[0].v_pointer = NULL;
731 track_clip_pair_unref (old);
736 static void track_clip_pair_class_init (TrackClipPairClass * klass) {
737 track_clip_pair_parent_class = g_type_class_peek_parent (klass);
738 TRACK_CLIP_PAIR_CLASS (klass)->finalize = track_clip_pair_finalize;
742 static void track_clip_pair_instance_init (TrackClipPair * self) {
747 static void track_clip_pair_finalize (TrackClipPair* obj) {
748 TrackClipPair * self;
749 self = TRACK_CLIP_PAIR (obj);
750 _g_object_unref0 (self->track);
751 _g_object_unref0 (self->clip);
755 GType track_clip_pair_get_type (void) {
756 static volatile gsize track_clip_pair_type_id__volatile = 0;
757 if (g_once_init_enter (&track_clip_pair_type_id__volatile)) {
758 static const GTypeValueTable g_define_type_value_table = { value_track_clip_pair_init, value_track_clip_pair_free_value, value_track_clip_pair_copy_value, value_track_clip_pair_peek_pointer, "p", value_track_clip_pair_collect_value, "p", value_track_clip_pair_lcopy_value };
759 static const GTypeInfo g_define_type_info = { sizeof (TrackClipPairClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) track_clip_pair_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackClipPair), 0, (GInstanceInitFunc) track_clip_pair_instance_init, &g_define_type_value_table };
760 static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
761 GType track_clip_pair_type_id;
762 track_clip_pair_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TrackClipPair", &g_define_type_info, &g_define_type_fundamental_info, 0);
763 g_once_init_leave (&track_clip_pair_type_id__volatile, track_clip_pair_type_id);
765 return track_clip_pair_type_id__volatile;
769 gpointer track_clip_pair_ref (gpointer instance) {
772 g_atomic_int_inc (&self->ref_count);
777 void track_clip_pair_unref (gpointer instance) {
780 if (g_atomic_int_dec_and_test (&self->ref_count)) {
781 TRACK_CLIP_PAIR_GET_CLASS (self)->finalize (self);
782 g_type_free_instance ((GTypeInstance *) self);
787 #line 22 "timeline.vala"
788 void clipboard_select (Clipboard* self, GeeArrayList* selected_clips) {
789 #line 22 "timeline.vala"
790 g_return_if_fail (IS_CLIPBOARD (self));
791 #line 22 "timeline.vala"
792 g_return_if_fail (GEE_IS_ARRAY_LIST (selected_clips));
793 #line 23 "timeline.vala"
794 gee_abstract_collection_clear (GEE_ABSTRACT_COLLECTION (self->clips));
795 #line 24 "timeline.vala"
796 self->priv->minimum_time = (gint64) (-1);
797 #line 798 "timeline.c"
799 GeeIterator* _clip_view_it;
800 _clip_view_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (selected_clips));
801 #line 25 "timeline.vala"
803 #line 804 "timeline.c"
805 GtkContainer* _tmp0_;
806 TrackView* track_view;
807 gboolean _tmp1_ = FALSE;
809 TrackClipPair* _tmp3_;
810 TrackClipPair* track_clip_pair;
811 #line 25 "timeline.vala"
812 if (!gee_iterator_next (_clip_view_it)) {
813 #line 25 "timeline.vala"
815 #line 816 "timeline.c"
817 #line 25 "timeline.vala"
818 clip_view = (ClipView*) gee_iterator_get (_clip_view_it);
819 #line 26 "timeline.vala"
820 track_view = _g_object_ref0 ((_tmp0_ = gtk_widget_get_parent (GTK_WIDGET (clip_view)), IS_TRACK_VIEW (_tmp0_) ? ((TrackView*) _tmp0_) : NULL));
821 #line 27 "timeline.vala"
822 if (self->priv->minimum_time < 0) {
823 #line 27 "timeline.vala"
825 #line 826 "timeline.c"
827 #line 27 "timeline.vala"
828 _tmp1_ = model_clip_get_start (clip_view->clip) < self->priv->minimum_time;
829 #line 830 "timeline.c"
831 #line 27 "timeline.vala"
833 #line 28 "timeline.vala"
834 self->priv->minimum_time = model_clip_get_start (clip_view->clip);
835 #line 836 "timeline.c"
837 #line 30 "timeline.vala"
838 track_clip_pair = (_tmp3_ = track_clip_pair_new (_tmp2_ = track_view_get_track (track_view), clip_view->clip), _g_object_unref0 (_tmp2_), _tmp3_);
839 #line 31 "timeline.vala"
840 gee_abstract_collection_add (GEE_ABSTRACT_COLLECTION (self->clips), track_clip_pair);
841 #line 842 "timeline.c"
842 _g_object_unref0 (clip_view);
843 _g_object_unref0 (track_view);
844 _track_clip_pair_unref0 (track_clip_pair);
846 _g_object_unref0 (_clip_view_it);
851 #line 35 "timeline.vala"
852 void clipboard_paste (Clipboard* self, ModelTrack* selected_track, gint64 time) {
853 #line 35 "timeline.vala"
854 g_return_if_fail (IS_CLIPBOARD (self));
855 #line 35 "timeline.vala"
856 g_return_if_fail (MODEL_IS_TRACK (selected_track));
857 #line 36 "timeline.vala"
858 if (gee_collection_get_size (GEE_COLLECTION (self->clips)) != 1) {
859 #line 860 "timeline.c"
861 GeeIterator* _pair_it;
862 _pair_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->clips));
863 #line 37 "timeline.vala"
865 #line 866 "timeline.c"
868 #line 37 "timeline.vala"
869 if (!gee_iterator_next (_pair_it)) {
870 #line 37 "timeline.vala"
872 #line 873 "timeline.c"
874 #line 37 "timeline.vala"
875 pair = (TrackClipPair*) gee_iterator_get (_pair_it);
876 #line 38 "timeline.vala"
877 model_track_do_clip_paste (pair->track, _tmp0_ = model_clip_copy (pair->clip), (time + model_clip_get_start (pair->clip)) - self->priv->minimum_time);
878 #line 879 "timeline.c"
879 _g_object_unref0 (_tmp0_);
880 _track_clip_pair_unref0 (pair);
882 _g_object_unref0 (_pair_it);
886 TrackClipPair* _tmp1_;
887 #line 41 "timeline.vala"
888 model_track_do_clip_paste (selected_track, _tmp2_ = model_clip_copy ((_tmp1_ = (TrackClipPair*) gee_abstract_list_get (GEE_ABSTRACT_LIST (self->clips), 0))->clip), time);
889 #line 890 "timeline.c"
890 _g_object_unref0 (_tmp2_);
891 _track_clip_pair_unref0 (_tmp1_);
896 #line 18 "timeline.vala"
897 Clipboard* clipboard_construct (GType object_type) {
898 #line 899 "timeline.c"
900 self = (Clipboard*) g_type_create_instance (object_type);
905 #line 18 "timeline.vala"
906 Clipboard* clipboard_new (void) {
907 #line 18 "timeline.vala"
908 return clipboard_construct (TYPE_CLIPBOARD);
909 #line 910 "timeline.c"
913 static void value_clipboard_init (GValue* value) {
914 value->data[0].v_pointer = NULL;
918 static void value_clipboard_free_value (GValue* value) {
919 if (value->data[0].v_pointer) {
920 clipboard_unref (value->data[0].v_pointer);
925 static void value_clipboard_copy_value (const GValue* src_value, GValue* dest_value) {
926 if (src_value->data[0].v_pointer) {
927 dest_value->data[0].v_pointer = clipboard_ref (src_value->data[0].v_pointer);
929 dest_value->data[0].v_pointer = NULL;
934 static gpointer value_clipboard_peek_pointer (const GValue* value) {
935 return value->data[0].v_pointer;
939 static gchar* value_clipboard_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
940 if (collect_values[0].v_pointer) {
942 object = collect_values[0].v_pointer;
943 if (object->parent_instance.g_class == NULL) {
944 return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
945 } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
946 return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
948 value->data[0].v_pointer = clipboard_ref (object);
950 value->data[0].v_pointer = NULL;
956 static gchar* value_clipboard_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
957 Clipboard** object_p;
958 object_p = collect_values[0].v_pointer;
960 return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
962 if (!value->data[0].v_pointer) {
964 } else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
965 *object_p = value->data[0].v_pointer;
967 *object_p = clipboard_ref (value->data[0].v_pointer);
973 GParamSpec* param_spec_clipboard (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
974 ParamSpecClipboard* spec;
975 g_return_val_if_fail (g_type_is_a (object_type, TYPE_CLIPBOARD), NULL);
976 spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
977 G_PARAM_SPEC (spec)->value_type = object_type;
978 return G_PARAM_SPEC (spec);
982 gpointer value_get_clipboard (const GValue* value) {
983 g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_CLIPBOARD), NULL);
984 return value->data[0].v_pointer;
988 void value_set_clipboard (GValue* value, gpointer v_object) {
990 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_CLIPBOARD));
991 old = value->data[0].v_pointer;
993 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_CLIPBOARD));
994 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
995 value->data[0].v_pointer = v_object;
996 clipboard_ref (value->data[0].v_pointer);
998 value->data[0].v_pointer = NULL;
1001 clipboard_unref (old);
1006 void value_take_clipboard (GValue* value, gpointer v_object) {
1008 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_CLIPBOARD));
1009 old = value->data[0].v_pointer;
1011 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_CLIPBOARD));
1012 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
1013 value->data[0].v_pointer = v_object;
1015 value->data[0].v_pointer = NULL;
1018 clipboard_unref (old);
1023 static void clipboard_class_init (ClipboardClass * klass) {
1024 clipboard_parent_class = g_type_class_peek_parent (klass);
1025 CLIPBOARD_CLASS (klass)->finalize = clipboard_finalize;
1026 g_type_class_add_private (klass, sizeof (ClipboardPrivate));
1030 static void clipboard_instance_init (Clipboard * self) {
1031 self->priv = CLIPBOARD_GET_PRIVATE (self);
1032 self->clips = gee_array_list_new (TYPE_TRACK_CLIP_PAIR, (GBoxedCopyFunc) track_clip_pair_ref, track_clip_pair_unref, NULL);
1033 self->priv->minimum_time = (gint64) (-1);
1034 self->ref_count = 1;
1038 static void clipboard_finalize (Clipboard* obj) {
1040 self = CLIPBOARD (obj);
1041 _g_object_unref0 (self->clips);
1045 GType clipboard_get_type (void) {
1046 static volatile gsize clipboard_type_id__volatile = 0;
1047 if (g_once_init_enter (&clipboard_type_id__volatile)) {
1048 static const GTypeValueTable g_define_type_value_table = { value_clipboard_init, value_clipboard_free_value, value_clipboard_copy_value, value_clipboard_peek_pointer, "p", value_clipboard_collect_value, "p", value_clipboard_lcopy_value };
1049 static const GTypeInfo g_define_type_info = { sizeof (ClipboardClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clipboard_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Clipboard), 0, (GInstanceInitFunc) clipboard_instance_init, &g_define_type_value_table };
1050 static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
1051 GType clipboard_type_id;
1052 clipboard_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Clipboard", &g_define_type_info, &g_define_type_fundamental_info, 0);
1053 g_once_init_leave (&clipboard_type_id__volatile, clipboard_type_id);
1055 return clipboard_type_id__volatile;
1059 gpointer clipboard_ref (gpointer instance) {
1062 g_atomic_int_inc (&self->ref_count);
1067 void clipboard_unref (gpointer instance) {
1070 if (g_atomic_int_dec_and_test (&self->ref_count)) {
1071 CLIPBOARD_GET_CLASS (self)->finalize (self);
1072 g_type_free_instance ((GTypeInstance *) self);
1077 #line 124 "timeline.vala"
1078 static void _time_line_on_geometry_changed_model_time_system_geometry_changed (ModelTimeSystem* _sender, gpointer self) {
1079 #line 1080 "timeline.c"
1080 time_line_on_geometry_changed (self);
1084 #line 368 "timeline.vala"
1085 static void _time_line_on_ruler_position_changed_view_ruler_position_changed (ViewRuler* _sender, gint x, gpointer self) {
1086 #line 1087 "timeline.c"
1087 time_line_on_ruler_position_changed (self, x);
1091 #line 135 "timeline.vala"
1092 static void _time_line_on_track_added_model_project_track_added (ModelProject* _sender, ModelTrack* track, gpointer self) {
1093 #line 1094 "timeline.c"
1094 time_line_on_track_added (self, track);
1098 #line 148 "timeline.vala"
1099 static void _time_line_on_track_removed_model_project_track_removed (ModelProject* _sender, ModelTrack* track, gpointer self) {
1100 #line 1101 "timeline.c"
1101 time_line_on_track_removed (self, track);
1105 #line 130 "timeline.vala"
1106 static void _time_line_on_position_changed_view_media_engine_position_changed (ViewMediaEngine* _sender, gint64 position, gpointer self) {
1107 #line 1108 "timeline.c"
1108 time_line_on_position_changed (self);
1112 #line 75 "timeline.vala"
1113 TimeLine* time_line_construct (GType object_type, ModelProject* p, ModelTimeSystem* provider, GdkDragAction actions) {
1114 #line 1115 "timeline.c"
1117 ModelProject* _tmp1_;
1121 GdkColor _tmp4_ = {0};
1123 GdkColor _tmp6_ = {0};
1124 #line 75 "timeline.vala"
1125 g_return_val_if_fail (MODEL_IS_PROJECT (p), NULL);
1126 #line 75 "timeline.vala"
1127 g_return_val_if_fail (MODEL_IS_TIME_SYSTEM (provider), NULL);
1128 #line 1129 "timeline.c"
1129 self = g_object_newv (object_type, 0, NULL);
1130 #line 76 "timeline.vala"
1131 gtk_widget_add_events (GTK_WIDGET (self), (gint) GDK_POINTER_MOTION_MASK);
1132 #line 77 "timeline.vala"
1133 self->priv->drag_widget = (_tmp0_ = NULL, _g_object_unref0 (self->priv->drag_widget), _tmp0_);
1134 #line 78 "timeline.vala"
1135 g_object_set (GTK_WIDGET (self), "can-focus", TRUE, NULL);
1136 #line 79 "timeline.vala"
1137 self->project = (_tmp1_ = _g_object_ref0 (p), _g_object_unref0 (self->project), _tmp1_);
1138 #line 80 "timeline.vala"
1139 self->provider = provider;
1140 #line 81 "timeline.vala"
1141 g_signal_connect_object (provider, "geometry-changed", (GCallback) _time_line_on_geometry_changed_model_time_system_geometry_changed, self, 0);
1142 #line 83 "timeline.vala"
1143 self->priv->vbox = (_tmp2_ = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0)), _g_object_unref0 (self->priv->vbox), _tmp2_);
1144 #line 84 "timeline.vala"
1145 self->ruler = (_tmp3_ = g_object_ref_sink (view_ruler_new (provider, TIME_LINE_RULER_HEIGHT)), _g_object_unref0 (self->ruler), _tmp3_);
1146 #line 85 "timeline.vala"
1147 g_signal_connect_object (self->ruler, "position-changed", (GCallback) _time_line_on_ruler_position_changed_view_ruler_position_changed, self, 0);
1148 #line 86 "timeline.vala"
1149 gtk_box_pack_start (GTK_BOX (self->priv->vbox), GTK_WIDGET (self->ruler), FALSE, FALSE, (guint) 0);
1150 #line 88 "timeline.vala"
1151 g_signal_connect_object (self->project, "track-added", (GCallback) _time_line_on_track_added_model_project_track_added, self, 0);
1152 #line 89 "timeline.vala"
1153 g_signal_connect_object (self->project, "track-removed", (GCallback) _time_line_on_track_removed_model_project_track_removed, self, 0);
1154 #line 90 "timeline.vala"
1155 g_signal_connect_object (self->project->media_engine, "position-changed", (GCallback) _time_line_on_position_changed_view_media_engine_position_changed, self, 0);
1156 #line 91 "timeline.vala"
1157 gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (self->priv->vbox));
1158 #line 93 "timeline.vala"
1159 gtk_widget_modify_bg (GTK_WIDGET (self), GTK_STATE_NORMAL, (_tmp5_ = (parse_color ("#444", &_tmp4_), _tmp4_), &_tmp5_));
1160 #line 94 "timeline.vala"
1161 gtk_widget_modify_fg (GTK_WIDGET (self), GTK_STATE_NORMAL, (_tmp7_ = (parse_color ("#f00", &_tmp6_), _tmp6_), &_tmp7_));
1162 #line 96 "timeline.vala"
1163 self->priv->pixel_div = self->priv->pixel_max / self->priv->pixel_min;
1164 #line 97 "timeline.vala"
1165 model_time_system_calculate_pixel_step (provider, 0.5f, self->priv->pixel_min, self->priv->pixel_div);
1166 #line 98 "timeline.vala"
1167 gtk_drag_dest_set (GTK_WIDGET (self), GTK_DEST_DEFAULT_ALL, drag_target_entries, G_N_ELEMENTS (drag_target_entries), actions);
1168 #line 1169 "timeline.c"
1173 #line 75 "timeline.vala"
1174 TimeLine* time_line_new (ModelProject* p, ModelTimeSystem* provider, GdkDragAction actions) {
1175 #line 75 "timeline.vala"
1176 return time_line_construct (TYPE_TIME_LINE, p, provider, actions);
1177 #line 1178 "timeline.c"
1181 #line 101 "timeline.vala"
1182 void time_line_zoom_to_project (TimeLine* self, double width) {
1183 #line 1184 "timeline.c"
1186 #line 101 "timeline.vala"
1187 g_return_if_fail (IS_TIME_LINE (self));
1188 #line 102 "timeline.vala"
1189 if (model_project_get_length (self->project) == 0) {
1190 #line 103 "timeline.vala"
1192 #line 1193 "timeline.c"
1194 #line 106 "timeline.vala"
1195 width = width - 12.0;
1196 #line 108 "timeline.vala"
1197 numerator = log ((width * GST_SECOND) / (((double) model_project_get_length (self->project)) * ((double) self->priv->pixel_min)));
1198 #line 110 "timeline.vala"
1199 denominator = log ((double) self->priv->pixel_div);
1200 #line 112 "timeline.vala"
1201 time_line_zoom (self, ((float) (numerator / denominator)) - model_time_system_get_pixel_percentage (self->provider));
1202 #line 1203 "timeline.c"
1206 #line 115 "timeline.vala"
1207 void time_line_zoom (TimeLine* self, float inc) {
1208 #line 115 "timeline.vala"
1209 g_return_if_fail (IS_TIME_LINE (self));
1210 #line 116 "timeline.vala"
1211 model_time_system_calculate_pixel_step (self->provider, inc, self->priv->pixel_min, self->priv->pixel_div);
1212 #line 1213 "timeline.c"
1214 GeeIterator* _track_it;
1215 _track_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->tracks));
1216 #line 117 "timeline.vala"
1218 #line 1219 "timeline.c"
1220 #line 117 "timeline.vala"
1221 if (!gee_iterator_next (_track_it)) {
1222 #line 117 "timeline.vala"
1224 #line 1225 "timeline.c"
1226 #line 117 "timeline.vala"
1227 track = (TrackView*) gee_iterator_get (_track_it);
1228 #line 118 "timeline.vala"
1229 track_view_resize (track);
1230 #line 1231 "timeline.c"
1231 _g_object_unref0 (track);
1233 _g_object_unref0 (_track_it);
1235 #line 120 "timeline.vala"
1236 g_signal_emit_by_name (self->project->media_engine, "position-changed", model_project_transport_get_position (self->project));
1237 #line 121 "timeline.vala"
1238 gtk_widget_queue_draw (GTK_WIDGET (self));
1239 #line 1240 "timeline.c"
1243 #line 124 "timeline.vala"
1244 static void time_line_on_geometry_changed (TimeLine* self) {
1245 #line 124 "timeline.vala"
1246 g_return_if_fail (IS_TIME_LINE (self));
1247 #line 125 "timeline.vala"
1248 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_geometry_changed");
1249 #line 126 "timeline.vala"
1250 model_time_system_calculate_pixel_step (self->provider, (float) 0, self->priv->pixel_min, self->priv->pixel_div);
1251 #line 127 "timeline.vala"
1252 gtk_widget_queue_draw (GTK_WIDGET (self->ruler));
1253 #line 1254 "timeline.c"
1257 #line 130 "timeline.vala"
1258 static void time_line_on_position_changed (TimeLine* self) {
1259 #line 130 "timeline.vala"
1260 g_return_if_fail (IS_TIME_LINE (self));
1261 #line 131 "timeline.vala"
1262 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_position_changed");
1263 #line 132 "timeline.vala"
1264 gtk_widget_queue_draw (GTK_WIDGET (self));
1265 #line 1266 "timeline.c"
1269 #line 160 "timeline.vala"
1270 static void _time_line_on_clip_view_added_track_view_clip_view_added (TrackView* _sender, ClipView* clip_view, gpointer self) {
1271 #line 1272 "timeline.c"
1272 time_line_on_clip_view_added (self, clip_view);
1276 #line 135 "timeline.vala"
1277 static void time_line_on_track_added (TimeLine* self, ModelTrack* track) {
1278 #line 1279 "timeline.c"
1279 ClassFactory* _tmp0_;
1281 TrackView* track_view;
1282 #line 135 "timeline.vala"
1283 g_return_if_fail (IS_TIME_LINE (self));
1284 #line 135 "timeline.vala"
1285 g_return_if_fail (MODEL_IS_TRACK (track));
1286 #line 136 "timeline.vala"
1287 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_track_added");
1288 #line 137 "timeline.vala"
1289 track_view = (_tmp1_ = class_factory_get_track_view (_tmp0_ = class_factory_get_class_factory (), track, self), _class_factory_unref0 (_tmp0_), _tmp1_);
1290 #line 138 "timeline.vala"
1291 g_signal_connect_object (track_view, "clip-view-added", (GCallback) _time_line_on_clip_view_added_track_view_clip_view_added, self, 0);
1292 #line 139 "timeline.vala"
1293 gee_abstract_collection_add (GEE_ABSTRACT_COLLECTION (self->tracks), track_view);
1294 #line 140 "timeline.vala"
1295 gtk_box_pack_start (GTK_BOX (self->priv->vbox), GTK_WIDGET (track_view), FALSE, FALSE, (guint) 0);
1296 #line 141 "timeline.vala"
1297 g_signal_emit_by_name (self, "trackview-added", track_view);
1298 #line 142 "timeline.vala"
1299 if (model_track_media_type (track) == MODEL_MEDIA_TYPE_VIDEO) {
1300 #line 143 "timeline.vala"
1301 gtk_box_reorder_child (GTK_BOX (self->priv->vbox), GTK_WIDGET (track_view), 1);
1302 #line 1303 "timeline.c"
1304 #line 145 "timeline.vala"
1305 gtk_widget_show_all (GTK_WIDGET (self->priv->vbox));
1306 #line 1307 "timeline.c"
1307 _g_object_unref0 (track_view);
1311 #line 148 "timeline.vala"
1312 static void time_line_on_track_removed (TimeLine* self, ModelTrack* track) {
1313 #line 148 "timeline.vala"
1314 g_return_if_fail (IS_TIME_LINE (self));
1315 #line 148 "timeline.vala"
1316 g_return_if_fail (MODEL_IS_TRACK (track));
1317 #line 149 "timeline.vala"
1318 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_track_removed");
1319 #line 1320 "timeline.c"
1321 GeeIterator* _track_view_it;
1322 _track_view_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->tracks));
1323 #line 150 "timeline.vala"
1325 #line 1326 "timeline.c"
1326 TrackView* track_view;
1329 #line 150 "timeline.vala"
1330 if (!gee_iterator_next (_track_view_it)) {
1331 #line 150 "timeline.vala"
1333 #line 1334 "timeline.c"
1335 #line 150 "timeline.vala"
1336 track_view = (TrackView*) gee_iterator_get (_track_view_it);
1337 #line 151 "timeline.vala"
1338 if ((_tmp1_ = (_tmp0_ = track_view_get_track (track_view)) == track, _g_object_unref0 (_tmp0_), _tmp1_)) {
1339 #line 152 "timeline.vala"
1340 g_signal_emit_by_name (self, "trackview-removed", track_view);
1341 #line 153 "timeline.vala"
1342 gtk_container_remove (GTK_CONTAINER (self->priv->vbox), GTK_WIDGET (track_view));
1343 #line 154 "timeline.vala"
1344 gee_abstract_collection_remove (GEE_ABSTRACT_COLLECTION (self->tracks), track_view);
1345 #line 1346 "timeline.c"
1346 _g_object_unref0 (track_view);
1347 #line 155 "timeline.vala"
1349 #line 1350 "timeline.c"
1351 _g_object_unref0 (track_view);
1353 _g_object_unref0 (_track_view_it);
1358 #line 234 "timeline.vala"
1359 static void _time_line_on_clip_view_selection_request_clip_view_selection_request (ClipView* _sender, ClipView* clip_view, gboolean extend_selection, gpointer self) {
1360 #line 1361 "timeline.c"
1361 time_line_on_clip_view_selection_request (self, clip_view, extend_selection);
1365 #line 327 "timeline.vala"
1366 static void _time_line_on_clip_view_move_request_clip_view_move_request (ClipView* _sender, ClipView* clip_view, gint64 delta, gpointer self) {
1367 #line 1368 "timeline.c"
1368 time_line_on_clip_view_move_request (self, clip_view, delta);
1372 #line 267 "timeline.vala"
1373 static void _time_line_on_clip_view_move_commit_clip_view_move_commit (ClipView* _sender, ClipView* clip_view, gint64 delta, gpointer self) {
1374 #line 1375 "timeline.c"
1375 time_line_on_clip_view_move_commit (self, clip_view, delta);
1379 #line 177 "timeline.vala"
1380 static void _time_line_on_clip_view_move_begin_clip_view_move_begin (ClipView* _sender, ClipView* clip_view, gboolean copy, gpointer self) {
1381 #line 1382 "timeline.c"
1382 time_line_on_clip_view_move_begin (self, clip_view, copy);
1386 #line 219 "timeline.vala"
1387 static void _time_line_on_clip_view_trim_begin_clip_view_trim_begin (ClipView* _sender, ClipView* clip_view, GdkWindowEdge edge, gpointer self) {
1388 #line 1389 "timeline.c"
1389 time_line_on_clip_view_trim_begin (self, clip_view, edge);
1393 #line 288 "timeline.vala"
1394 static void _time_line_on_clip_view_trim_commit_clip_view_trim_commit (ClipView* _sender, ClipView* clip_view, GdkWindowEdge edge, gpointer self) {
1395 #line 1396 "timeline.c"
1396 time_line_on_clip_view_trim_commit (self, clip_view, edge);
1400 #line 160 "timeline.vala"
1401 void time_line_on_clip_view_added (TimeLine* self, ClipView* clip_view) {
1402 #line 160 "timeline.vala"
1403 g_return_if_fail (IS_TIME_LINE (self));
1404 #line 160 "timeline.vala"
1405 g_return_if_fail (IS_CLIP_VIEW (clip_view));
1406 #line 161 "timeline.vala"
1407 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_clip_clip_view_added");
1408 #line 162 "timeline.vala"
1409 g_signal_connect_object (clip_view, "selection-request", (GCallback) _time_line_on_clip_view_selection_request_clip_view_selection_request, self, 0);
1410 #line 163 "timeline.vala"
1411 g_signal_connect_object (clip_view, "move-request", (GCallback) _time_line_on_clip_view_move_request_clip_view_move_request, self, 0);
1412 #line 164 "timeline.vala"
1413 g_signal_connect_object (clip_view, "move-commit", (GCallback) _time_line_on_clip_view_move_commit_clip_view_move_commit, self, 0);
1414 #line 165 "timeline.vala"
1415 g_signal_connect_object (clip_view, "move-begin", (GCallback) _time_line_on_clip_view_move_begin_clip_view_move_begin, self, 0);
1416 #line 166 "timeline.vala"
1417 g_signal_connect_object (clip_view, "trim-begin", (GCallback) _time_line_on_clip_view_trim_begin_clip_view_trim_begin, self, 0);
1418 #line 167 "timeline.vala"
1419 g_signal_connect_object (clip_view, "trim-commit", (GCallback) _time_line_on_clip_view_trim_commit_clip_view_trim_commit, self, 0);
1420 #line 1421 "timeline.c"
1424 #line 170 "timeline.vala"
1425 void time_line_deselect_all_clips (TimeLine* self) {
1426 #line 170 "timeline.vala"
1427 g_return_if_fail (IS_TIME_LINE (self));
1428 #line 1429 "timeline.c"
1430 GeeIterator* _selected_clip_view_it;
1431 _selected_clip_view_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->selected_clips));
1432 #line 171 "timeline.vala"
1434 #line 1435 "timeline.c"
1435 ClipView* selected_clip_view;
1436 #line 171 "timeline.vala"
1437 if (!gee_iterator_next (_selected_clip_view_it)) {
1438 #line 171 "timeline.vala"
1440 #line 1441 "timeline.c"
1442 #line 171 "timeline.vala"
1443 selected_clip_view = (ClipView*) gee_iterator_get (_selected_clip_view_it);
1444 #line 172 "timeline.vala"
1445 selected_clip_view->is_selected = FALSE;
1446 #line 1447 "timeline.c"
1447 _g_object_unref0 (selected_clip_view);
1449 _g_object_unref0 (_selected_clip_view_it);
1451 #line 174 "timeline.vala"
1452 gee_abstract_collection_clear (GEE_ABSTRACT_COLLECTION (self->selected_clips));
1453 #line 1454 "timeline.c"
1457 #line 177 "timeline.vala"
1458 static void time_line_on_clip_view_move_begin (TimeLine* self, ClipView* clip_view, gboolean copy) {
1459 #line 1460 "timeline.c"
1463 GtkFixed* the_parent;
1464 #line 177 "timeline.vala"
1465 g_return_if_fail (IS_TIME_LINE (self));
1466 #line 177 "timeline.vala"
1467 g_return_if_fail (IS_CLIP_VIEW (clip_view));
1468 #line 178 "timeline.vala"
1469 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_clip_view_move_begin");
1470 #line 179 "timeline.vala"
1471 self->priv->copying = copy;
1472 #line 180 "timeline.vala"
1474 #line 181 "timeline.vala"
1475 model_undo_manager_start_transaction (self->project->undo_manager, "Copy Clip");
1476 #line 1477 "timeline.c"
1478 #line 183 "timeline.vala"
1480 #line 1481 "timeline.c"
1482 GeeIterator* _selected_clip_it;
1483 _selected_clip_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->selected_clips));
1484 #line 185 "timeline.vala"
1486 #line 1487 "timeline.c"
1487 ClipView* selected_clip;
1489 TrackView* track_view;
1490 #line 185 "timeline.vala"
1491 if (!gee_iterator_next (_selected_clip_it)) {
1492 #line 185 "timeline.vala"
1494 #line 1495 "timeline.c"
1496 #line 185 "timeline.vala"
1497 selected_clip = (ClipView*) gee_iterator_get (_selected_clip_it);
1498 #line 186 "timeline.vala"
1499 if (max_clip == NULL) {
1500 #line 1501 "timeline.c"
1502 #line 187 "timeline.vala"
1503 max_clip = (_tmp0_ = _g_object_ref0 (selected_clip), _g_object_unref0 (max_clip), _tmp0_);
1504 #line 1505 "timeline.c"
1506 #line 188 "timeline.vala"
1507 if (model_clip_get_end (max_clip->clip) < model_clip_get_end (selected_clip->clip)) {
1508 #line 1509 "timeline.c"
1510 #line 189 "timeline.vala"
1511 max_clip = (_tmp1_ = _g_object_ref0 (selected_clip), _g_object_unref0 (max_clip), _tmp1_);
1512 #line 1513 "timeline.c"
1515 #line 191 "timeline.vala"
1516 selected_clip->initial_time = model_clip_get_start (selected_clip->clip);
1517 #line 192 "timeline.vala"
1518 model_clip_gnonlin_disconnect (selected_clip->clip);
1519 #line 193 "timeline.vala"
1520 track_view = _g_object_ref0 ((_tmp2_ = gtk_widget_get_parent (GTK_WIDGET (selected_clip)), IS_TRACK_VIEW (_tmp2_) ? ((TrackView*) _tmp2_) : NULL));
1521 #line 194 "timeline.vala"
1522 if (track_view != NULL) {
1523 #line 1524 "timeline.c"
1525 #line 195 "timeline.vala"
1526 model_track_remove_clip_from_array (_tmp3_ = track_view_get_track (track_view), selected_clip->clip);
1527 #line 1528 "timeline.c"
1528 _g_object_unref0 (_tmp3_);
1530 #line 197 "timeline.vala"
1532 #line 1533 "timeline.c"
1535 #line 201 "timeline.vala"
1536 clip = model_clip_copy (selected_clip->clip);
1537 #line 202 "timeline.vala"
1538 model_track_append_at_time (_tmp4_ = track_view_get_track (track_view), clip, model_clip_get_start (selected_clip->clip), FALSE);
1539 #line 1540 "timeline.c"
1540 _g_object_unref0 (_tmp4_);
1541 _g_object_unref0 (clip);
1543 _g_object_unref0 (selected_clip);
1544 _g_object_unref0 (track_view);
1546 _g_object_unref0 (_selected_clip_it);
1548 #line 206 "timeline.vala"
1549 self->priv->high_water = (_tmp5_ = g_object_ref_sink ((GtkLabel*) gtk_label_new (NULL)), _g_object_unref0 (self->priv->high_water), _tmp5_);
1550 #line 207 "timeline.vala"
1551 the_parent = _g_object_ref0 ((_tmp6_ = gtk_widget_get_parent (GTK_WIDGET (clip_view)), GTK_IS_FIXED (_tmp6_) ? ((GtkFixed*) _tmp6_) : NULL));
1552 #line 208 "timeline.vala"
1553 gtk_fixed_put (the_parent, GTK_WIDGET (self->priv->high_water), GTK_WIDGET (max_clip)->allocation.x + GTK_WIDGET (max_clip)->allocation.width, GTK_WIDGET (max_clip)->allocation.y);
1554 #line 1555 "timeline.c"
1556 GeeIterator* _selected_clip_it;
1557 _selected_clip_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->selected_clips));
1558 #line 213 "timeline.vala"
1560 #line 1561 "timeline.c"
1561 ClipView* selected_clip;
1563 TrackView* track_view;
1564 #line 213 "timeline.vala"
1565 if (!gee_iterator_next (_selected_clip_it)) {
1566 #line 213 "timeline.vala"
1568 #line 1569 "timeline.c"
1570 #line 213 "timeline.vala"
1571 selected_clip = (ClipView*) gee_iterator_get (_selected_clip_it);
1572 #line 214 "timeline.vala"
1573 track_view = _g_object_ref0 ((_tmp7_ = gtk_widget_get_parent (GTK_WIDGET (selected_clip)), IS_TRACK_VIEW (_tmp7_) ? ((TrackView*) _tmp7_) : NULL));
1574 #line 215 "timeline.vala"
1575 track_view_move_to_top (track_view, selected_clip);
1576 #line 1577 "timeline.c"
1577 _g_object_unref0 (selected_clip);
1578 _g_object_unref0 (track_view);
1580 _g_object_unref0 (_selected_clip_it);
1582 _g_object_unref0 (max_clip);
1583 _g_object_unref0 (the_parent);
1587 #line 219 "timeline.vala"
1588 static void time_line_on_clip_view_trim_begin (TimeLine* self, ClipView* clip, GdkWindowEdge edge) {
1589 #line 219 "timeline.vala"
1590 g_return_if_fail (IS_TIME_LINE (self));
1591 #line 219 "timeline.vala"
1592 g_return_if_fail (IS_CLIP_VIEW (clip));
1593 #line 220 "timeline.vala"
1594 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_clip_view_trim_begin");
1595 #line 221 "timeline.vala"
1597 #line 1598 "timeline.c"
1598 case GDK_WINDOW_EDGE_WEST:
1600 #line 223 "timeline.vala"
1601 clip->initial_time = model_clip_get_start (clip->clip);
1602 #line 224 "timeline.vala"
1604 #line 1605 "timeline.c"
1606 case GDK_WINDOW_EDGE_EAST:
1608 #line 226 "timeline.vala"
1609 clip->initial_time = model_clip_get_duration (clip->clip);
1610 #line 227 "timeline.vala"
1612 #line 1613 "timeline.c"
1616 #line 229 "timeline.vala"
1618 #line 230 "timeline.vala"
1620 #line 1621 "timeline.c"
1626 #line 234 "timeline.vala"
1627 static void time_line_on_clip_view_selection_request (TimeLine* self, ClipView* clip_view, gboolean extend) {
1628 #line 1629 "timeline.c"
1629 gboolean in_selected_clips;
1630 #line 234 "timeline.vala"
1631 g_return_if_fail (IS_TIME_LINE (self));
1632 #line 234 "timeline.vala"
1633 g_return_if_fail (IS_CLIP_VIEW (clip_view));
1634 #line 235 "timeline.vala"
1635 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_clip_view_selection_request");
1636 #line 241 "timeline.vala"
1637 in_selected_clips = gee_abstract_collection_contains (GEE_ABSTRACT_COLLECTION (self->selected_clips), clip_view);
1638 #line 242 "timeline.vala"
1640 #line 243 "timeline.vala"
1641 if (!in_selected_clips) {
1642 #line 244 "timeline.vala"
1643 time_line_deselect_all_clips (self);
1644 #line 245 "timeline.vala"
1645 clip_view->is_selected = TRUE;
1646 #line 246 "timeline.vala"
1647 gee_abstract_collection_add (GEE_ABSTRACT_COLLECTION (self->selected_clips), clip_view);
1648 #line 1649 "timeline.c"
1651 #line 249 "timeline.vala"
1652 if (gee_collection_get_size (GEE_COLLECTION (self->selected_clips)) > 1) {
1653 #line 1654 "timeline.c"
1654 gboolean _tmp0_ = FALSE;
1655 #line 250 "timeline.vala"
1656 if (in_selected_clips) {
1657 #line 250 "timeline.vala"
1658 _tmp0_ = clip_view->is_selected;
1659 #line 1660 "timeline.c"
1661 #line 250 "timeline.vala"
1663 #line 1664 "timeline.c"
1665 #line 250 "timeline.vala"
1667 #line 1668 "timeline.c"
1669 #line 251 "timeline.vala"
1670 clip_view->is_selected = FALSE;
1671 #line 253 "timeline.vala"
1672 self->priv->drag_widget = (_tmp1_ = NULL, _g_object_unref0 (self->priv->drag_widget), _tmp1_);
1673 #line 254 "timeline.vala"
1674 gee_abstract_collection_remove (GEE_ABSTRACT_COLLECTION (self->selected_clips), clip_view);
1675 #line 1676 "timeline.c"
1678 #line 257 "timeline.vala"
1679 if (!in_selected_clips) {
1680 #line 258 "timeline.vala"
1681 clip_view->is_selected = TRUE;
1682 #line 259 "timeline.vala"
1683 gee_abstract_collection_add (GEE_ABSTRACT_COLLECTION (self->selected_clips), clip_view);
1684 #line 1685 "timeline.c"
1687 #line 262 "timeline.vala"
1688 g_signal_emit_by_name (self, "track-changed");
1689 #line 263 "timeline.vala"
1690 g_signal_emit_by_name (self, "selection-changed", time_line_is_clip_selected (self));
1691 #line 264 "timeline.vala"
1692 gtk_widget_queue_draw (GTK_WIDGET (self));
1693 #line 1694 "timeline.c"
1697 #line 267 "timeline.vala"
1698 static void time_line_on_clip_view_move_commit (TimeLine* self, ClipView* clip_view, gint64 delta) {
1699 #line 1700 "timeline.c"
1703 #line 267 "timeline.vala"
1704 g_return_if_fail (IS_TIME_LINE (self));
1705 #line 267 "timeline.vala"
1706 g_return_if_fail (IS_CLIP_VIEW (clip_view));
1707 #line 268 "timeline.vala"
1708 gdk_window_set_cursor (GTK_WIDGET (self)->window, NULL);
1709 #line 269 "timeline.vala"
1710 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_clip_view_move_request");
1711 #line 270 "timeline.vala"
1712 fixed = _g_object_ref0 ((_tmp0_ = gtk_widget_get_parent (GTK_WIDGET (self->priv->high_water)), GTK_IS_FIXED (_tmp0_) ? ((GtkFixed*) _tmp0_) : NULL));
1713 #line 271 "timeline.vala"
1714 gtk_container_remove (GTK_CONTAINER (fixed), GTK_WIDGET (self->priv->high_water));
1715 #line 272 "timeline.vala"
1716 self->priv->high_water = (_tmp1_ = NULL, _g_object_unref0 (self->priv->high_water), _tmp1_);
1717 #line 274 "timeline.vala"
1718 model_undo_manager_start_transaction (self->project->undo_manager, "Move Clip");
1719 #line 1720 "timeline.c"
1721 GeeIterator* _selected_clip_view_it;
1722 _selected_clip_view_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->selected_clips));
1723 #line 275 "timeline.vala"
1725 #line 1726 "timeline.c"
1726 ClipView* selected_clip_view;
1728 TrackView* track_view;
1730 #line 275 "timeline.vala"
1731 if (!gee_iterator_next (_selected_clip_view_it)) {
1732 #line 275 "timeline.vala"
1734 #line 1735 "timeline.c"
1736 #line 275 "timeline.vala"
1737 selected_clip_view = (ClipView*) gee_iterator_get (_selected_clip_view_it);
1738 #line 276 "timeline.vala"
1739 track_view = _g_object_ref0 ((_tmp2_ = gtk_widget_get_parent (GTK_WIDGET (selected_clip_view)), IS_TRACK_VIEW (_tmp2_) ? ((TrackView*) _tmp2_) : NULL));
1740 #line 277 "timeline.vala"
1741 model_clip_gnonlin_connect (selected_clip_view->clip);
1742 #line 278 "timeline.vala"
1743 model_track_move (_tmp3_ = track_view_get_track (track_view), selected_clip_view->clip, model_clip_get_start (selected_clip_view->clip), selected_clip_view->initial_time);
1744 #line 1745 "timeline.c"
1745 _g_object_unref0 (_tmp3_);
1746 _g_object_unref0 (selected_clip_view);
1747 _g_object_unref0 (track_view);
1749 _g_object_unref0 (_selected_clip_view_it);
1751 #line 281 "timeline.vala"
1752 model_undo_manager_end_transaction (self->project->undo_manager, "Move Clip");
1753 #line 282 "timeline.vala"
1754 if (self->priv->copying) {
1755 #line 283 "timeline.vala"
1756 self->priv->copying = FALSE;
1757 #line 284 "timeline.vala"
1758 model_undo_manager_end_transaction (self->project->undo_manager, "Copy Clip");
1759 #line 1760 "timeline.c"
1761 _g_object_unref0 (fixed);
1765 #line 288 "timeline.vala"
1766 static void time_line_on_clip_view_trim_commit (TimeLine* self, ClipView* clip_view, GdkWindowEdge edge) {
1767 #line 1768 "timeline.c"
1769 TrackView* track_view;
1772 #line 288 "timeline.vala"
1773 g_return_if_fail (IS_TIME_LINE (self));
1774 #line 288 "timeline.vala"
1775 g_return_if_fail (IS_CLIP_VIEW (clip_view));
1776 #line 289 "timeline.vala"
1777 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_clip_view_move_commit");
1778 #line 290 "timeline.vala"
1779 gdk_window_set_cursor (GTK_WIDGET (self)->window, NULL);
1780 #line 291 "timeline.vala"
1781 track_view = _g_object_ref0 ((_tmp0_ = gtk_widget_get_parent (GTK_WIDGET (clip_view)), IS_TRACK_VIEW (_tmp0_) ? ((TrackView*) _tmp0_) : NULL));
1782 #line 292 "timeline.vala"
1784 #line 293 "timeline.vala"
1786 #line 1787 "timeline.c"
1787 case GDK_WINDOW_EDGE_WEST:
1789 #line 295 "timeline.vala"
1790 delta = model_clip_get_start (clip_view->clip) - clip_view->initial_time;
1791 #line 296 "timeline.vala"
1793 #line 1794 "timeline.c"
1795 case GDK_WINDOW_EDGE_EAST:
1797 #line 298 "timeline.vala"
1798 delta = model_clip_get_duration (clip_view->clip) - clip_view->initial_time;
1799 #line 299 "timeline.vala"
1801 #line 1802 "timeline.c"
1805 #line 301 "timeline.vala"
1807 #line 302 "timeline.vala"
1809 #line 1810 "timeline.c"
1812 #line 305 "timeline.vala"
1813 model_undo_manager_start_transaction (self->project->undo_manager, "Trim Clip");
1814 #line 306 "timeline.vala"
1815 model_clip_trim (clip_view->clip, -delta, edge);
1816 #line 307 "timeline.vala"
1817 model_clip_gnonlin_connect (clip_view->clip);
1818 #line 308 "timeline.vala"
1819 model_track_trim (_tmp1_ = track_view_get_track (track_view), clip_view->clip, delta, edge);
1820 #line 1821 "timeline.c"
1821 _g_object_unref0 (_tmp1_);
1822 #line 309 "timeline.vala"
1823 model_undo_manager_end_transaction (self->project->undo_manager, "Trim Clip");
1824 #line 1825 "timeline.c"
1825 _g_object_unref0 (track_view);
1829 #line 312 "timeline.vala"
1830 static void time_line_constrain_move (TimeLine* self, ClipView* clip_view, gint64* delta) {
1831 #line 1832 "timeline.c"
1835 TrackView* track_view;
1837 #line 312 "timeline.vala"
1838 g_return_if_fail (IS_TIME_LINE (self));
1839 #line 312 "timeline.vala"
1840 g_return_if_fail (IS_CLIP_VIEW (clip_view));
1841 #line 313 "timeline.vala"
1842 min_delta = CLIP_VIEW_SNAP_DELTA;
1843 #line 314 "timeline.vala"
1844 delta_xsize = model_time_system_time_to_xsize (self->provider, *delta);
1845 #line 315 "timeline.vala"
1846 track_view = _g_object_ref0 ((_tmp0_ = TRACK_VIEW (gtk_widget_get_parent (GTK_WIDGET (clip_view))), IS_TRACK_VIEW (_tmp0_) ? ((TrackView*) _tmp0_) : NULL));
1847 #line 316 "timeline.vala"
1848 track = track_view_get_track (track_view);
1849 #line 317 "timeline.vala"
1850 if (abs (delta_xsize) < min_delta) {
1851 #line 1852 "timeline.c"
1853 gint64 adjustment = 0LL;
1854 #line 318 "timeline.vala"
1855 range = model_time_system_xsize_to_time (self->provider, min_delta);
1856 #line 320 "timeline.vala"
1857 if (model_track_clip_is_near (track, clip_view->clip, range, &adjustment)) {
1858 #line 321 "timeline.vala"
1859 *delta = adjustment;
1860 #line 322 "timeline.vala"
1861 clip_view_snap (clip_view, (gint64) model_time_system_time_to_xsize (self->provider, adjustment));
1862 #line 1863 "timeline.c"
1865 _g_object_unref0 (track_view);
1866 _g_object_unref0 (track);
1870 #line 327 "timeline.vala"
1871 static void time_line_on_clip_view_move_request (TimeLine* self, ClipView* clip_view, gint64 delta) {
1872 #line 327 "timeline.vala"
1873 g_return_if_fail (IS_TIME_LINE (self));
1874 #line 327 "timeline.vala"
1875 g_return_if_fail (IS_CLIP_VIEW (clip_view));
1876 #line 328 "timeline.vala"
1877 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_clip_view_move_request");
1878 #line 329 "timeline.vala"
1879 if (self->project->snap_to_clip) {
1880 #line 330 "timeline.vala"
1881 time_line_constrain_move (self, clip_view, &delta);
1882 #line 1883 "timeline.c"
1884 #line 332 "timeline.vala"
1885 if (time_line_move_allowed (self, &delta)) {
1886 #line 333 "timeline.vala"
1887 time_line_move_the_clips (self, delta);
1888 #line 1889 "timeline.c"
1893 #line 337 "timeline.vala"
1894 static gboolean time_line_move_allowed (TimeLine* self, gint64* move_distance) {
1895 #line 1896 "timeline.c"
1896 gboolean result = FALSE;
1898 #line 337 "timeline.vala"
1899 g_return_val_if_fail (IS_TIME_LINE (self), FALSE);
1900 #line 338 "timeline.vala"
1901 if (self->priv->drag_widget == NULL) {
1902 #line 1903 "timeline.c"
1904 #line 339 "timeline.vala"
1906 #line 1907 "timeline.c"
1908 #line 342 "timeline.vala"
1910 #line 1911 "timeline.c"
1912 GeeIterator* _clip_view_it;
1913 _clip_view_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->selected_clips));
1914 #line 344 "timeline.vala"
1916 #line 1917 "timeline.c"
1917 ClipView* clip_view;
1919 #line 344 "timeline.vala"
1920 if (!gee_iterator_next (_clip_view_it)) {
1921 #line 344 "timeline.vala"
1923 #line 1924 "timeline.c"
1925 #line 344 "timeline.vala"
1926 clip_view = (ClipView*) gee_iterator_get (_clip_view_it);
1927 #line 345 "timeline.vala"
1928 if (max_clip == NULL) {
1929 #line 1930 "timeline.c"
1931 #line 346 "timeline.vala"
1932 max_clip = (_tmp0_ = _g_object_ref0 (clip_view), _g_object_unref0 (max_clip), _tmp0_);
1933 #line 1934 "timeline.c"
1935 #line 347 "timeline.vala"
1936 if (model_clip_get_end (clip_view->clip) > model_clip_get_end (max_clip->clip)) {
1937 #line 1938 "timeline.c"
1939 #line 348 "timeline.vala"
1940 max_clip = (_tmp1_ = _g_object_ref0 (clip_view), _g_object_unref0 (max_clip), _tmp1_);
1941 #line 1942 "timeline.c"
1944 #line 350 "timeline.vala"
1945 position = model_time_system_time_to_xpos (self->provider, model_clip_get_start (clip_view->clip) + (*move_distance));
1946 #line 351 "timeline.vala"
1947 if (position < TIME_LINE_BORDER) {
1948 #line 1949 "timeline.c"
1950 _g_object_unref0 (clip_view);
1951 _g_object_unref0 (_clip_view_it);
1952 _g_object_unref0 (max_clip);
1953 #line 352 "timeline.vala"
1955 #line 1956 "timeline.c"
1957 _g_object_unref0 (clip_view);
1959 _g_object_unref0 (_clip_view_it);
1962 _g_object_unref0 (max_clip);
1963 #line 355 "timeline.vala"
1965 #line 1966 "timeline.c"
1969 #line 358 "timeline.vala"
1970 static void time_line_move_the_clips (TimeLine* self, gint64 move_distance) {
1971 #line 358 "timeline.vala"
1972 g_return_if_fail (IS_TIME_LINE (self));
1973 #line 1974 "timeline.c"
1975 GeeIterator* _clip_view_it;
1976 _clip_view_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->selected_clips));
1977 #line 359 "timeline.vala"
1979 #line 1980 "timeline.c"
1980 ClipView* clip_view;
1981 #line 359 "timeline.vala"
1982 if (!gee_iterator_next (_clip_view_it)) {
1983 #line 359 "timeline.vala"
1985 #line 1986 "timeline.c"
1987 #line 359 "timeline.vala"
1988 clip_view = (ClipView*) gee_iterator_get (_clip_view_it);
1989 #line 360 "timeline.vala"
1990 time_line_do_clip_move (self, clip_view, move_distance);
1991 #line 1992 "timeline.c"
1992 _g_object_unref0 (clip_view);
1994 _g_object_unref0 (_clip_view_it);
1999 #line 364 "timeline.vala"
2000 void time_line_do_clip_move (TimeLine* self, ClipView* clip_view, gint64 delta) {
2001 #line 364 "timeline.vala"
2002 g_return_if_fail (IS_TIME_LINE (self));
2003 #line 364 "timeline.vala"
2004 g_return_if_fail (IS_CLIP_VIEW (clip_view));
2005 #line 365 "timeline.vala"
2006 model_clip_set_start (clip_view->clip, model_clip_get_start (clip_view->clip) + delta);
2007 #line 2008 "timeline.c"
2011 #line 368 "timeline.vala"
2012 void time_line_on_ruler_position_changed (TimeLine* self, gint x) {
2013 #line 368 "timeline.vala"
2014 g_return_if_fail (IS_TIME_LINE (self));
2015 #line 369 "timeline.vala"
2016 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_ruler_position_changed");
2017 #line 370 "timeline.vala"
2018 if (!model_project_transport_is_recording (self->project)) {
2019 #line 371 "timeline.vala"
2020 time_line_update_pos (self, x);
2021 #line 2022 "timeline.c"
2026 #line 375 "timeline.vala"
2027 gboolean time_line_is_clip_selected (TimeLine* self) {
2028 #line 2029 "timeline.c"
2029 gboolean result = FALSE;
2030 #line 375 "timeline.vala"
2031 g_return_val_if_fail (IS_TIME_LINE (self), FALSE);
2032 #line 2033 "timeline.c"
2033 result = gee_collection_get_size (GEE_COLLECTION (self->selected_clips)) > 0;
2034 #line 376 "timeline.vala"
2036 #line 2037 "timeline.c"
2040 #line 379 "timeline.vala"
2041 gboolean time_line_gap_selected (TimeLine* self) {
2042 #line 2043 "timeline.c"
2043 gboolean result = FALSE;
2044 #line 379 "timeline.vala"
2045 g_return_val_if_fail (IS_TIME_LINE (self), FALSE);
2046 #line 2047 "timeline.c"
2048 #line 380 "timeline.vala"
2050 #line 2051 "timeline.c"
2054 #line 384 "timeline.vala"
2055 void time_line_delete_selection (TimeLine* self) {
2056 #line 2057 "timeline.c"
2058 #line 384 "timeline.vala"
2059 g_return_if_fail (IS_TIME_LINE (self));
2060 #line 385 "timeline.vala"
2061 model_undo_manager_start_transaction (self->project->undo_manager, "Delete Clips From Timeline");
2062 #line 386 "timeline.vala"
2063 self->priv->drag_widget = (_tmp0_ = NULL, _g_object_unref0 (self->priv->drag_widget), _tmp0_);
2064 #line 387 "timeline.vala"
2065 if (time_line_is_clip_selected (self)) {
2066 #line 388 "timeline.vala"
2068 #line 2069 "timeline.c"
2071 #line 388 "timeline.vala"
2072 if (!(gee_collection_get_size (GEE_COLLECTION (self->selected_clips)) > 0)) {
2073 #line 388 "timeline.vala"
2075 #line 2076 "timeline.c"
2077 #line 389 "timeline.vala"
2078 clip_view_delete_clip (_tmp1_ = (ClipView*) gee_abstract_list_get (GEE_ABSTRACT_LIST (self->selected_clips), 0));
2079 #line 2080 "timeline.c"
2080 _g_object_unref0 (_tmp1_);
2081 #line 390 "timeline.vala"
2082 _tmp2_ = (ClipView*) gee_abstract_list_remove_at (GEE_ABSTRACT_LIST (self->selected_clips), 0);
2083 #line 2084 "timeline.c"
2084 _g_object_unref0 (_tmp2_);
2086 #line 392 "timeline.vala"
2087 g_signal_emit_by_name (self, "track-changed");
2088 #line 2089 "timeline.c"
2091 #line 409 "timeline.vala"
2092 model_undo_manager_end_transaction (self->project->undo_manager, "Delete Clips From Timeline");
2093 #line 2094 "timeline.c"
2097 #line 412 "timeline.vala"
2098 void time_line_do_cut (TimeLine* self) {
2099 #line 412 "timeline.vala"
2100 g_return_if_fail (IS_TIME_LINE (self));
2101 #line 413 "timeline.vala"
2102 clipboard_select (self->clipboard, self->selected_clips);
2103 #line 414 "timeline.vala"
2104 time_line_delete_selection (self);
2105 #line 2106 "timeline.c"
2109 #line 417 "timeline.vala"
2110 void time_line_do_copy (TimeLine* self) {
2111 #line 417 "timeline.vala"
2112 g_return_if_fail (IS_TIME_LINE (self));
2113 #line 418 "timeline.vala"
2114 clipboard_select (self->clipboard, self->selected_clips);
2115 #line 419 "timeline.vala"
2116 g_signal_emit_by_name (self, "selection-changed", TRUE);
2117 #line 2118 "timeline.c"
2121 #line 422 "timeline.vala"
2122 void time_line_paste (TimeLine* self) {
2123 #line 422 "timeline.vala"
2124 g_return_if_fail (IS_TIME_LINE (self));
2125 #line 423 "timeline.vala"
2126 time_line_do_paste (self, model_project_transport_get_position (self->project));
2127 #line 2128 "timeline.c"
2131 #line 426 "timeline.vala"
2132 void time_line_do_paste (TimeLine* self, gint64 pos) {
2133 #line 2134 "timeline.c"
2136 #line 426 "timeline.vala"
2137 g_return_if_fail (IS_TIME_LINE (self));
2138 #line 427 "timeline.vala"
2140 #line 2141 "timeline.c"
2142 GeeIterator* _track_view_it;
2143 _track_view_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->tracks));
2144 #line 428 "timeline.vala"
2146 #line 2147 "timeline.c"
2147 TrackView* track_view;
2150 #line 428 "timeline.vala"
2151 if (!gee_iterator_next (_track_view_it)) {
2152 #line 428 "timeline.vala"
2154 #line 2155 "timeline.c"
2156 #line 428 "timeline.vala"
2157 track_view = (TrackView*) gee_iterator_get (_track_view_it);
2158 #line 429 "timeline.vala"
2159 if ((_tmp1_ = model_track_get_is_selected (_tmp0_ = track_view_get_track (track_view)), _g_object_unref0 (_tmp0_), _tmp1_)) {
2160 #line 2161 "timeline.c"
2162 #line 430 "timeline.vala"
2163 view = (_tmp2_ = _g_object_ref0 (track_view), _g_object_unref0 (view), _tmp2_);
2164 #line 2165 "timeline.c"
2166 _g_object_unref0 (track_view);
2168 _g_object_unref0 (_track_view_it);
2170 #line 435 "timeline.vala"
2172 #line 2173 "timeline.c"
2174 TrackClipPair* _tmp4_;
2178 #line 436 "timeline.vala"
2179 if ((_tmp5_ = (_tmp4_ = (TrackClipPair*) gee_abstract_list_get (GEE_ABSTRACT_LIST (self->clipboard->clips), 0))->clip->type == MODEL_MEDIA_TYPE_VIDEO, _track_clip_pair_unref0 (_tmp4_), _tmp5_)) {
2180 #line 2181 "timeline.c"
2182 #line 437 "timeline.vala"
2183 _tmp3_ = (_tmp6_ = time_line_find_video_track_view (self), _g_object_unref0 (_tmp3_), _tmp6_);
2184 #line 2185 "timeline.c"
2187 #line 437 "timeline.vala"
2188 _tmp3_ = (_tmp7_ = time_line_find_audio_track_view (self), _g_object_unref0 (_tmp3_), _tmp7_);
2189 #line 2190 "timeline.c"
2191 #line 436 "timeline.vala"
2192 view = (_tmp8_ = _g_object_ref0 (_tmp3_), _g_object_unref0 (view), _tmp8_);
2193 #line 2194 "timeline.c"
2194 _g_object_unref0 (_tmp3_);
2196 #line 439 "timeline.vala"
2197 model_undo_manager_start_transaction (self->project->undo_manager, "Paste");
2198 #line 440 "timeline.vala"
2199 clipboard_paste (self->clipboard, _tmp9_ = track_view_get_track (view), pos);
2200 #line 2201 "timeline.c"
2201 _g_object_unref0 (_tmp9_);
2202 #line 441 "timeline.vala"
2203 model_undo_manager_end_transaction (self->project->undo_manager, "Paste");
2204 #line 442 "timeline.vala"
2205 gtk_widget_queue_draw (GTK_WIDGET (self));
2206 #line 2207 "timeline.c"
2207 _g_object_unref0 (view);
2211 #line 445 "timeline.vala"
2212 void time_line_select_all (TimeLine* self) {
2213 #line 445 "timeline.vala"
2214 g_return_if_fail (IS_TIME_LINE (self));
2215 #line 2216 "timeline.c"
2217 GeeIterator* _track_it;
2218 _track_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->tracks));
2219 #line 446 "timeline.vala"
2221 #line 2222 "timeline.c"
2223 #line 446 "timeline.vala"
2224 if (!gee_iterator_next (_track_it)) {
2225 #line 446 "timeline.vala"
2227 #line 2228 "timeline.c"
2229 #line 446 "timeline.vala"
2230 track = (TrackView*) gee_iterator_get (_track_it);
2231 #line 447 "timeline.vala"
2232 track_view_select_all (track);
2233 #line 2234 "timeline.c"
2234 _g_object_unref0 (track);
2236 _g_object_unref0 (_track_it);
2241 #line 451 "timeline.vala"
2242 static gboolean time_line_real_expose_event (GtkWidget* base, GdkEventExpose* event) {
2243 #line 2244 "timeline.c"
2245 gboolean result = FALSE;
2247 self = TIME_LINE (base);
2248 #line 452 "timeline.vala"
2249 GTK_WIDGET_CLASS (time_line_parent_class)->expose_event (GTK_WIDGET (GTK_EVENT_BOX (self)), event);
2250 #line 454 "timeline.vala"
2251 xpos = model_time_system_time_to_xpos (self->provider, model_project_transport_get_position (self->project));
2252 #line 455 "timeline.vala"
2253 gdk_draw_line (GDK_DRAWABLE (GTK_WIDGET (self)->window), gtk_widget_get_style (GTK_WIDGET (self))->fg_gc[(gint) GTK_STATE_NORMAL], xpos, 0, xpos, GTK_WIDGET (self)->allocation.height);
2254 #line 2255 "timeline.c"
2256 #line 459 "timeline.vala"
2258 #line 2259 "timeline.c"
2262 #line 462 "timeline.vala"
2263 static void time_line_real_drag_data_received (GtkWidget* base, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint drag_info, guint time) {
2264 #line 2265 "timeline.c"
2266 GError * _inner_error_;
2274 TrackView* track_view;
2275 gboolean timeline_add;
2276 self = TIME_LINE (base);
2277 #line 462 "timeline.vala"
2278 g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
2279 #line 462 "timeline.vala"
2280 g_return_if_fail (selection_data != NULL);
2281 #line 2282 "timeline.c"
2282 _inner_error_ = NULL;
2283 #line 465 "timeline.vala"
2284 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_drag_data_received");
2285 #line 2286 "timeline.c"
2286 a = (_tmp1_ = _tmp0_ = gtk_selection_data_get_uris (selection_data), a_length1 = _vala_array_length (_tmp0_), _a_size_ = a_length1, _tmp1_);
2287 #line 467 "timeline.vala"
2288 gtk_drag_finish (context, TRUE, FALSE, (guint32) time);
2289 #line 469 "timeline.vala"
2291 #line 470 "timeline.vala"
2292 track_view = (_tmp2_ = time_line_find_child (self, (double) x, (double) y), IS_TRACK_VIEW (_tmp2_) ? ((TrackView*) _tmp2_) : NULL);
2293 #line 472 "timeline.vala"
2294 if (track_view == NULL) {
2295 #line 2296 "timeline.c"
2296 a = (_vala_array_free (a, a_length1, (GDestroyNotify) g_free), NULL);
2297 _g_object_unref0 (track);
2298 _g_object_unref0 (track_view);
2299 #line 473 "timeline.vala"
2301 #line 2302 "timeline.c"
2303 #line 476 "timeline.vala"
2304 timeline_add = TRUE;
2305 #line 478 "timeline.vala"
2306 if (a_length1 > 1) {
2307 #line 479 "timeline.vala"
2308 if (gtk_drag_get_source_widget (context) != NULL) {
2309 #line 480 "timeline.vala"
2310 dialog_utils_warning ("Cannot add files", "Files must be dropped onto the timeline individually.");
2311 #line 2312 "timeline.c"
2312 a = (_vala_array_free (a, a_length1, (GDestroyNotify) g_free), NULL);
2313 _g_object_unref0 (track);
2314 _g_object_unref0 (track_view);
2315 #line 482 "timeline.vala"
2317 #line 2318 "timeline.c"
2319 #line 485 "timeline.vala"
2320 if (dialog_utils_add_cancel ("Files must be dropped onto the timeline individually.\n" "Do you wish to add these files to the library?") != GTK_RESPONSE_YES) {
2321 #line 2322 "timeline.c"
2322 a = (_vala_array_free (a, a_length1, (GDestroyNotify) g_free), NULL);
2323 _g_object_unref0 (track);
2324 _g_object_unref0 (track_view);
2325 #line 488 "timeline.vala"
2327 #line 2328 "timeline.c"
2329 #line 490 "timeline.vala"
2330 timeline_add = FALSE;
2331 #line 2332 "timeline.c"
2334 #line 492 "timeline.vala"
2335 track = (_tmp3_ = track_view_get_track (track_view), _g_object_unref0 (track), _tmp3_);
2336 #line 2337 "timeline.c"
2338 #line 495 "timeline.vala"
2339 model_project_create_clip_importer (self->project, track, timeline_add, model_time_system_xpos_to_time (self->provider, x), context->action == GDK_ACTION_COPY, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))), a_length1);
2340 #line 2341 "timeline.c"
2343 char** s_collection;
2344 int s_collection_length1;
2346 #line 498 "timeline.vala"
2348 #line 2349 "timeline.c"
2349 s_collection_length1 = a_length1;
2350 for (s_it = 0; s_it < a_length1; s_it = s_it + 1) {
2352 s = g_strdup (s_collection[s_it]);
2359 #line 501 "timeline.vala"
2360 _tmp4_ = g_filename_from_uri (s, NULL, &_inner_error_);
2361 #line 2362 "timeline.c"
2362 if (_inner_error_ != NULL) {
2363 if (_inner_error_->domain == G_CONVERT_ERROR) {
2364 goto __catch16_g_convert_error;
2367 _g_free0 (filename);
2368 a = (_vala_array_free (a, a_length1, (GDestroyNotify) g_free), NULL);
2369 _g_object_unref0 (track);
2370 _g_object_unref0 (track_view);
2371 g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
2372 g_clear_error (&_inner_error_);
2375 #line 501 "timeline.vala"
2376 filename = (_tmp5_ = _tmp4_, _g_free0 (filename), _tmp5_);
2377 #line 2378 "timeline.c"
2380 __catch16_g_convert_error:
2384 _inner_error_ = NULL;
2388 _g_free0 (filename);
2389 #line 502 "timeline.vala"
2391 #line 2392 "timeline.c"
2395 if (_inner_error_ != NULL) {
2397 _g_free0 (filename);
2398 goto __catch15_g_error;
2400 #line 503 "timeline.vala"
2401 model_library_importer_add_file (self->project->importer, filename, &_inner_error_);
2402 #line 2403 "timeline.c"
2403 if (_inner_error_ != NULL) {
2405 _g_free0 (filename);
2406 goto __catch15_g_error;
2409 _g_free0 (filename);
2413 #line 505 "timeline.vala"
2414 model_library_importer_start (self->project->importer, &_inner_error_);
2415 #line 2416 "timeline.c"
2416 if (_inner_error_ != NULL) {
2417 goto __catch15_g_error;
2425 _inner_error_ = NULL;
2427 #line 507 "timeline.vala"
2428 g_signal_emit_by_name (self->project, "error-occurred", "Error importing", e->message);
2429 #line 2430 "timeline.c"
2434 if (_inner_error_ != NULL) {
2435 a = (_vala_array_free (a, a_length1, (GDestroyNotify) g_free), NULL);
2436 _g_object_unref0 (track);
2437 _g_object_unref0 (track_view);
2438 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
2439 g_clear_error (&_inner_error_);
2442 a = (_vala_array_free (a, a_length1, (GDestroyNotify) g_free), NULL);
2443 _g_object_unref0 (track);
2444 _g_object_unref0 (track_view);
2448 #line 511 "timeline.vala"
2449 void time_line_update_pos (TimeLine* self, gint event_x) {
2450 #line 2451 "timeline.c"
2452 #line 511 "timeline.vala"
2453 g_return_if_fail (IS_TIME_LINE (self));
2454 #line 512 "timeline.vala"
2455 time = model_time_system_xpos_to_time (self->provider, event_x);
2456 #line 513 "timeline.vala"
2457 if (self->project->snap_to_clip) {
2458 #line 514 "timeline.vala"
2459 model_project_snap_coord (self->project, &time, model_time_system_get_pixel_snap_time (self->provider));
2460 #line 2461 "timeline.c"
2462 #line 516 "timeline.vala"
2463 view_media_engine_go (self->project->media_engine, time);
2464 #line 2465 "timeline.c"
2468 #line 519 "timeline.vala"
2469 GtkWidget* time_line_find_child (TimeLine* self, double x, double y) {
2470 #line 2471 "timeline.c"
2471 GtkWidget* result = NULL;
2472 #line 519 "timeline.vala"
2473 g_return_val_if_fail (IS_TIME_LINE (self), NULL);
2474 #line 2475 "timeline.c"
2476 GList* w_collection;
2478 #line 520 "timeline.vala"
2479 w_collection = gtk_container_get_children (GTK_CONTAINER (self->priv->vbox));
2480 #line 2481 "timeline.c"
2481 for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
2483 #line 520 "timeline.vala"
2484 w = _g_object_ref0 ((GtkWidget*) w_it->data);
2485 #line 2486 "timeline.c"
2487 gboolean _tmp0_ = FALSE;
2488 #line 521 "timeline.vala"
2489 if (w->allocation.y <= y) {
2490 #line 521 "timeline.vala"
2491 _tmp0_ = y < (w->allocation.y + w->allocation.height);
2492 #line 2493 "timeline.c"
2494 #line 521 "timeline.vala"
2496 #line 2497 "timeline.c"
2498 #line 521 "timeline.vala"
2500 #line 2501 "timeline.c"
2502 _g_list_free0 (w_collection);
2503 #line 522 "timeline.vala"
2505 #line 2506 "timeline.c"
2507 _g_object_unref0 (w);
2510 #line 520 "timeline.vala"
2511 _g_list_free0 (w_collection);
2512 #line 2513 "timeline.c"
2515 #line 524 "timeline.vala"
2517 #line 2518 "timeline.c"
2521 #line 527 "timeline.vala"
2522 static void time_line_deselect_all (TimeLine* self) {
2523 #line 527 "timeline.vala"
2524 g_return_if_fail (IS_TIME_LINE (self));
2525 #line 2526 "timeline.c"
2527 GeeIterator* _clip_view_it;
2528 _clip_view_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->selected_clips));
2529 #line 528 "timeline.vala"
2531 #line 2532 "timeline.c"
2532 ClipView* clip_view;
2533 #line 528 "timeline.vala"
2534 if (!gee_iterator_next (_clip_view_it)) {
2535 #line 528 "timeline.vala"
2537 #line 2538 "timeline.c"
2539 #line 528 "timeline.vala"
2540 clip_view = (ClipView*) gee_iterator_get (_clip_view_it);
2541 #line 529 "timeline.vala"
2542 clip_view->is_selected = FALSE;
2543 #line 2544 "timeline.c"
2544 _g_object_unref0 (clip_view);
2546 _g_object_unref0 (_clip_view_it);
2548 #line 531 "timeline.vala"
2549 gee_abstract_collection_clear (GEE_ABSTRACT_COLLECTION (self->selected_clips));
2550 #line 532 "timeline.vala"
2551 g_signal_emit_by_name (self, "selection-changed", FALSE);
2552 #line 2553 "timeline.c"
2556 #line 535 "timeline.vala"
2557 static gboolean time_line_real_button_press_event (GtkWidget* base, GdkEventButton* event) {
2558 #line 2559 "timeline.c"
2560 gboolean result = FALSE;
2563 self = TIME_LINE (base);
2564 #line 540 "timeline.vala"
2565 self->priv->drag_widget = (_tmp0_ = NULL, _g_object_unref0 (self->priv->drag_widget), _tmp0_);
2566 #line 541 "timeline.vala"
2567 child = time_line_find_child (self, (*event).x, (*event).y);
2568 #line 543 "timeline.vala"
2569 if (VIEW_IS_RULER (child)) {
2570 #line 2571 "timeline.c"
2575 #line 544 "timeline.vala"
2576 ruler = _g_object_ref0 ((_tmp1_ = child, VIEW_IS_RULER (_tmp1_) ? ((ViewRuler*) _tmp1_) : NULL));
2577 #line 545 "timeline.vala"
2578 g_signal_emit_by_name (GTK_WIDGET (ruler), "button-press-event", event, &_tmp2_);
2579 #line 545 "timeline.vala"
2581 #line 546 "timeline.vala"
2582 self->priv->drag_widget = (_tmp3_ = _g_object_ref0 (child), _g_object_unref0 (self->priv->drag_widget), _tmp3_);
2583 #line 2584 "timeline.c"
2584 _g_object_unref0 (ruler);
2586 #line 547 "timeline.vala"
2587 if (IS_TRACK_VIEW (child)) {
2588 #line 2589 "timeline.c"
2590 TrackView* track_view;
2592 #line 548 "timeline.vala"
2593 track_view = _g_object_ref0 ((_tmp4_ = child, IS_TRACK_VIEW (_tmp4_) ? ((TrackView*) _tmp4_) : NULL));
2594 #line 550 "timeline.vala"
2595 self->priv->drag_widget = (_tmp5_ = track_view_find_child (track_view, (*event).x, (*event).y), _g_object_unref0 (self->priv->drag_widget), _tmp5_);
2596 #line 551 "timeline.vala"
2597 if (self->priv->drag_widget != NULL) {
2598 #line 2599 "timeline.c"
2600 #line 552 "timeline.vala"
2601 g_signal_emit_by_name (self->priv->drag_widget, "button-press-event", event, &_tmp6_);
2602 #line 552 "timeline.vala"
2604 #line 2605 "timeline.c"
2607 #line 554 "timeline.vala"
2608 time_line_deselect_all (self);
2609 #line 556 "timeline.vala"
2610 model_track_set_selected (_tmp7_ = track_view_get_track (track_view), TRUE);
2611 #line 2612 "timeline.c"
2612 _g_object_unref0 (_tmp7_);
2614 _g_object_unref0 (track_view);
2616 #line 559 "timeline.vala"
2617 time_line_deselect_all (self);
2618 #line 2619 "timeline.c"
2621 #line 561 "timeline.vala"
2622 gtk_widget_queue_draw (GTK_WIDGET (self));
2623 #line 2624 "timeline.c"
2625 _g_object_unref0 (child);
2626 #line 563 "timeline.vala"
2628 #line 2629 "timeline.c"
2632 #line 566 "timeline.vala"
2633 static gboolean time_line_real_button_release_event (GtkWidget* base, GdkEventButton* event) {
2634 #line 2635 "timeline.c"
2636 gboolean result = FALSE;
2637 self = TIME_LINE (base);
2638 #line 567 "timeline.vala"
2639 if (self->priv->drag_widget != NULL) {
2640 #line 2641 "timeline.c"
2643 #line 568 "timeline.vala"
2644 g_signal_emit_by_name (self->priv->drag_widget, "button-release-event", event, &_tmp0_);
2645 #line 568 "timeline.vala"
2647 #line 569 "timeline.vala"
2648 self->priv->drag_widget = (_tmp1_ = NULL, _g_object_unref0 (self->priv->drag_widget), _tmp1_);
2649 #line 2650 "timeline.c"
2652 #line 571 "timeline.vala"
2654 #line 2655 "timeline.c"
2658 #line 574 "timeline.vala"
2659 static gboolean time_line_real_motion_notify_event (GtkWidget* base, GdkEventMotion* event) {
2660 #line 2661 "timeline.c"
2662 gboolean result = FALSE;
2663 self = TIME_LINE (base);
2664 #line 575 "timeline.vala"
2665 if (self->priv->drag_widget != NULL) {
2666 #line 2667 "timeline.c"
2668 #line 576 "timeline.vala"
2669 g_signal_emit_by_name (self->priv->drag_widget, "motion-notify-event", event, &_tmp0_);
2670 #line 576 "timeline.vala"
2672 #line 2673 "timeline.c"
2675 #line 578 "timeline.vala"
2676 widget = time_line_find_child (self, (*event).x, (*event).y);
2677 #line 579 "timeline.vala"
2678 if (IS_TRACK_VIEW (widget)) {
2679 #line 2680 "timeline.c"
2681 TrackView* track_view;
2682 #line 580 "timeline.vala"
2683 track_view = _g_object_ref0 ((_tmp1_ = widget, IS_TRACK_VIEW (_tmp1_) ? ((TrackView*) _tmp1_) : NULL));
2684 #line 581 "timeline.vala"
2685 if (track_view != NULL) {
2686 #line 2687 "timeline.c"
2688 ClipView* clip_view;
2689 #line 582 "timeline.vala"
2690 clip_view = (_tmp2_ = track_view_find_child (track_view, (*event).x, (*event).y), IS_CLIP_VIEW (_tmp2_) ? ((ClipView*) _tmp2_) : NULL);
2691 #line 583 "timeline.vala"
2692 if (clip_view != NULL) {
2693 #line 2694 "timeline.c"
2695 #line 584 "timeline.vala"
2696 g_signal_emit_by_name (GTK_WIDGET (clip_view), "motion-notify-event", event, &_tmp3_);
2697 #line 584 "timeline.vala"
2699 #line 2700 "timeline.c"
2701 #line 586 "timeline.vala"
2702 gdk_window_set_cursor (GTK_WIDGET (self)->window, NULL);
2703 #line 2704 "timeline.c"
2705 _g_object_unref0 (clip_view);
2707 _g_object_unref0 (track_view);
2709 #line 589 "timeline.vala"
2710 if (VIEW_IS_RULER (widget)) {
2711 #line 2712 "timeline.c"
2713 #line 590 "timeline.vala"
2714 g_signal_emit_by_name (widget, "motion-notify-event", event, &_tmp4_);
2715 #line 590 "timeline.vala"
2717 #line 2718 "timeline.c"
2719 #line 592 "timeline.vala"
2720 gdk_window_set_cursor (GTK_WIDGET (self)->window, NULL);
2721 #line 2722 "timeline.c"
2724 _g_object_unref0 (widget);
2727 #line 595 "timeline.vala"
2729 #line 2730 "timeline.c"
2733 #line 598 "timeline.vala"
2734 static TrackView* time_line_find_video_track_view (TimeLine* self) {
2735 #line 2736 "timeline.c"
2736 TrackView* result = NULL;
2737 #line 598 "timeline.vala"
2738 g_return_val_if_fail (IS_TIME_LINE (self), NULL);
2739 #line 2740 "timeline.c"
2741 GeeIterator* _track_it;
2742 _track_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->tracks));
2743 #line 599 "timeline.vala"
2745 #line 2746 "timeline.c"
2749 #line 599 "timeline.vala"
2750 if (!gee_iterator_next (_track_it)) {
2751 #line 599 "timeline.vala"
2753 #line 2754 "timeline.c"
2755 #line 599 "timeline.vala"
2756 track = (TrackView*) gee_iterator_get (_track_it);
2757 #line 600 "timeline.vala"
2758 if ((_tmp1_ = model_track_media_type (_tmp0_ = track_view_get_track (track)) == MODEL_MEDIA_TYPE_VIDEO, _g_object_unref0 (_tmp0_), _tmp1_)) {
2759 #line 2760 "timeline.c"
2761 _g_object_unref0 (_track_it);
2762 #line 601 "timeline.vala"
2764 #line 2765 "timeline.c"
2766 _g_object_unref0 (track);
2768 _g_object_unref0 (_track_it);
2771 #line 605 "timeline.vala"
2773 #line 2774 "timeline.c"
2777 #line 608 "timeline.vala"
2778 static TrackView* time_line_find_audio_track_view (TimeLine* self) {
2779 #line 2780 "timeline.c"
2780 TrackView* result = NULL;
2781 #line 608 "timeline.vala"
2782 g_return_val_if_fail (IS_TIME_LINE (self), NULL);
2783 #line 2784 "timeline.c"
2785 GeeIterator* _track_it;
2786 _track_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->tracks));
2787 #line 609 "timeline.vala"
2789 #line 2790 "timeline.c"
2793 #line 609 "timeline.vala"
2794 if (!gee_iterator_next (_track_it)) {
2795 #line 609 "timeline.vala"
2797 #line 2798 "timeline.c"
2799 #line 609 "timeline.vala"
2800 track = (TrackView*) gee_iterator_get (_track_it);
2801 #line 610 "timeline.vala"
2802 if ((_tmp1_ = model_track_media_type (_tmp0_ = track_view_get_track (track)) == MODEL_MEDIA_TYPE_AUDIO, _g_object_unref0 (_tmp0_), _tmp1_)) {
2803 #line 2804 "timeline.c"
2805 _g_object_unref0 (_track_it);
2806 #line 611 "timeline.vala"
2808 #line 2809 "timeline.c"
2810 _g_object_unref0 (track);
2812 _g_object_unref0 (_track_it);
2815 #line 615 "timeline.vala"
2817 #line 2818 "timeline.c"
2821 static void time_line_class_init (TimeLineClass * klass) {
2822 time_line_parent_class = g_type_class_peek_parent (klass);
2823 g_type_class_add_private (klass, sizeof (TimeLinePrivate));
2824 GTK_WIDGET_CLASS (klass)->expose_event = time_line_real_expose_event;
2825 GTK_WIDGET_CLASS (klass)->drag_data_received = time_line_real_drag_data_received;
2826 GTK_WIDGET_CLASS (klass)->button_press_event = time_line_real_button_press_event;
2827 GTK_WIDGET_CLASS (klass)->button_release_event = time_line_real_button_release_event;
2828 GTK_WIDGET_CLASS (klass)->motion_notify_event = time_line_real_motion_notify_event;
2829 G_OBJECT_CLASS (klass)->finalize = time_line_finalize;
2830 g_signal_new ("selection_changed", TYPE_TIME_LINE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
2831 g_signal_new ("track_changed", TYPE_TIME_LINE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
2832 g_signal_new ("trackview_added", TYPE_TIME_LINE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, TYPE_TRACK_VIEW);
2833 g_signal_new ("trackview_removed", TYPE_TIME_LINE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, TYPE_TRACK_VIEW);
2837 static void time_line_instance_init (TimeLine * self) {
2838 self->priv = TIME_LINE_GET_PRIVATE (self);
2839 self->priv->drag_widget = NULL;
2840 self->tracks = gee_array_list_new (TYPE_TRACK_VIEW, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
2841 self->selected_clips = gee_array_list_new (TYPE_CLIP_VIEW, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
2842 self->clipboard = clipboard_new ();
2843 self->priv->pixel_min = 0.1f;
2844 self->priv->pixel_max = 4505.0f;
2848 static void time_line_finalize (GObject* obj) {
2850 self = TIME_LINE (obj);
2851 _g_object_unref0 (self->project);
2852 _g_object_unref0 (self->ruler);
2853 _g_object_unref0 (self->priv->drag_widget);
2854 _g_object_unref0 (self->tracks);
2855 _g_object_unref0 (self->priv->vbox);
2856 _g_object_unref0 (self->selected_clips);
2857 _clipboard_unref0 (self->clipboard);
2858 _g_object_unref0 (self->priv->high_water);
2859 G_OBJECT_CLASS (time_line_parent_class)->finalize (obj);
2863 GType time_line_get_type (void) {
2864 static volatile gsize time_line_type_id__volatile = 0;
2865 if (g_once_init_enter (&time_line_type_id__volatile)) {
2866 static const GTypeInfo g_define_type_info = { sizeof (TimeLineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) time_line_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TimeLine), 0, (GInstanceInitFunc) time_line_instance_init, NULL };
2867 GType time_line_type_id;
2868 time_line_type_id = g_type_register_static (GTK_TYPE_EVENT_BOX, "TimeLine", &g_define_type_info, 0);
2869 g_once_init_leave (&time_line_type_id__volatile, time_line_type_id);
2871 return time_line_type_id__volatile;
2875 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2876 if ((array != NULL) && (destroy_func != NULL)) {
2878 for (i = 0; i < array_length; i = i + 1) {
2879 if (((gpointer*) array)[i] != NULL) {
2880 destroy_func (((gpointer*) array)[i]);
2887 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2888 _vala_array_destroy (array, array_length, destroy_func);
2893 static gint _vala_array_length (gpointer array) {
2897 while (((gpointer*) array)[length]) {