1 /* lombard.c generated by valac, the Vala compiler
2 * generated from lombard.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>
22 #include <gdk/gdkkeysyms.h>
23 #include <glib/gstdio.h>
27 #define TYPE_APP (app_get_type ())
28 #define APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP, App))
29 #define APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP, AppClass))
30 #define IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP))
31 #define IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP))
32 #define APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP, AppClass))
34 typedef struct _App App;
35 typedef struct _AppClass AppClass;
36 typedef struct _AppPrivate AppPrivate;
38 #define MODEL_TYPE_VIDEO_PROJECT (model_video_project_get_type ())
39 #define MODEL_VIDEO_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_VIDEO_PROJECT, ModelVideoProject))
40 #define MODEL_VIDEO_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MODEL_TYPE_VIDEO_PROJECT, ModelVideoProjectClass))
41 #define MODEL_IS_VIDEO_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_VIDEO_PROJECT))
42 #define MODEL_IS_VIDEO_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEL_TYPE_VIDEO_PROJECT))
43 #define MODEL_VIDEO_PROJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MODEL_TYPE_VIDEO_PROJECT, ModelVideoProjectClass))
45 typedef struct _ModelVideoProject ModelVideoProject;
46 typedef struct _ModelVideoProjectClass ModelVideoProjectClass;
47 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
48 #define _g_free0(var) (var = (g_free (var), NULL))
49 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
50 #define _gst_caps_unref0(var) ((var == NULL) ? NULL : (var = (gst_caps_unref (var), NULL)))
51 typedef struct _ModelVideoProjectPrivate ModelVideoProjectPrivate;
52 #define __g_slist_free_g_free0(var) ((var == NULL) ? NULL : (var = (_g_slist_free_g_free (var), NULL)))
53 #define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
54 #define _class_factory_unref0(var) ((var == NULL) ? NULL : (var = (class_factory_unref (var), NULL)))
57 GtkWindow parent_instance;
62 GtkWindowClass parent_class;
66 GtkDrawingArea* drawing_area;
67 ModelVideoProject* project;
68 ViewVideoOutput* video_output;
69 ViewAudioOutput* audio_output;
70 ViewOggVorbisExport* export_connector;
72 ClipLibraryView* library;
73 ViewStatusBar* status_bar;
75 GtkScrolledWindow* library_scrolled;
76 GtkScrolledWindow* timeline_scrolled;
77 GtkAdjustment* h_adjustment;
78 double prev_adjustment_lower;
79 double prev_adjustment_upper;
80 GtkActionGroup* main_group;
84 GtkUIManager* manager;
85 char* project_filename;
86 GeeArrayList* load_errors;
90 struct _ModelVideoProject {
91 ModelProject parent_instance;
92 ModelVideoProjectPrivate * priv;
93 ModelTimecodeTimeSystem* time_provider;
96 struct _ModelVideoProjectClass {
97 ModelProjectClass parent_class;
101 extern gint debug_level;
102 gint debug_level = 0;
103 static gpointer app_parent_class = NULL;
104 static TransportDelegateIface* app_transport_delegate_parent_iface = NULL;
106 GType app_get_type (void);
107 GType model_video_project_get_type (void);
108 #define APP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_APP, AppPrivate))
112 #define APP_NAME "Lombard"
113 #define APP_LibraryToggle "Library"
114 static void app_on_open (App* self);
115 static void _app_on_open_gtk_action_callback (GtkAction* action, gpointer self);
116 static void app_on_save (App* self);
117 static void _app_on_save_gtk_action_callback (GtkAction* action, gpointer self);
118 static void app_on_save_as (App* self);
119 static void _app_on_save_as_gtk_action_callback (GtkAction* action, gpointer self);
120 static void app_on_play_pause (App* self);
121 static void _app_on_play_pause_gtk_action_callback (GtkAction* action, gpointer self);
122 static void app_on_export (App* self);
123 static void _app_on_export_gtk_action_callback (GtkAction* action, gpointer self);
124 static void app_on_quit (App* self);
125 static void _app_on_quit_gtk_action_callback (GtkAction* action, gpointer self);
126 static void app_on_undo (App* self);
127 static void _app_on_undo_gtk_action_callback (GtkAction* action, gpointer self);
128 static void app_on_cut (App* self);
129 static void _app_on_cut_gtk_action_callback (GtkAction* action, gpointer self);
130 static void app_on_copy (App* self);
131 static void _app_on_copy_gtk_action_callback (GtkAction* action, gpointer self);
132 static void app_on_paste (App* self);
133 static void _app_on_paste_gtk_action_callback (GtkAction* action, gpointer self);
134 static void app_on_delete (App* self);
135 static void _app_on_delete_gtk_action_callback (GtkAction* action, gpointer self);
136 static void app_on_select_all (App* self);
137 static void _app_on_select_all_gtk_action_callback (GtkAction* action, gpointer self);
138 void app_on_split_at_playhead (App* self);
139 static void _app_on_split_at_playhead_gtk_action_callback (GtkAction* action, gpointer self);
140 void app_on_trim_to_playhead (App* self);
141 static void _app_on_trim_to_playhead_gtk_action_callback (GtkAction* action, gpointer self);
142 void app_on_clip_properties (App* self);
143 static void _app_on_clip_properties_gtk_action_callback (GtkAction* action, gpointer self);
144 static void app_on_zoom_in (App* self);
145 static void _app_on_zoom_in_gtk_action_callback (GtkAction* action, gpointer self);
146 static void app_on_zoom_out (App* self);
147 static void _app_on_zoom_out_gtk_action_callback (GtkAction* action, gpointer self);
148 static void app_on_zoom_to_project (App* self);
149 static void _app_on_zoom_to_project_gtk_action_callback (GtkAction* action, gpointer self);
150 static void app_on_go_start (App* self);
151 static void _app_on_go_start_gtk_action_callback (GtkAction* action, gpointer self);
152 static void app_on_go_end (App* self);
153 static void _app_on_go_end_gtk_action_callback (GtkAction* action, gpointer self);
154 static void app_on_help_contents (App* self);
155 static void _app_on_help_contents_gtk_action_callback (GtkAction* action, gpointer self);
156 static void app_on_about (App* self);
157 static void _app_on_about_gtk_action_callback (GtkAction* action, gpointer self);
158 static void app_on_save_graph (App* self);
159 static void _app_on_save_graph_gtk_action_callback (GtkAction* action, gpointer self);
160 static void app_on_view_library (App* self);
161 static void _app_on_view_library_gtk_action_callback (GtkAction* action, gpointer self);
162 static void app_on_snap (App* self);
163 static void _app_on_snap_gtk_action_callback (GtkAction* action, gpointer self);
164 #define APP_ui "\n" \
166 " <menubar name=\"MenuBar\">\n" \
167 " <menu name=\"Project\" action=\"Project\">\n" \
168 " <menuitem name=\"Open\" action=\"Open\"/>\n" \
169 " <menuitem name=\"Save\" action=\"Save\"/>\n" \
170 " <menuitem name=\"SaveAs\" action=\"SaveAs\"/>\n" \
172 " <menuitem name=\"Play\" action=\"Play\"/>\n" \
174 " <menuitem name=\"Export\" action=\"Export\"/>\n" \
175 " <menuitem name=\"Quit\" action=\"Quit\"/>\n" \
177 " <menu name=\"EditMenu\" action=\"Edit\">\n" \
178 " <menuitem name=\"EditUndo\" action=\"Undo\"/>\n" \
180 " <menuitem name=\"EditCut\" action=\"Cut\"/>\n" \
181 " <menuitem name=\"EditCopy\" action=\"Copy\"/>\n" \
182 " <menuitem name=\"EditPaste\" action=\"Paste\"/>\n" \
183 " <menuitem name=\"EditDelete\" action=\"Delete\"/>\n" \
185 " <menuitem name=\"EditSelectAll\" action=\"SelectAll\"/>\n" \
187 " <menuitem name=\"ClipSplitAtPlayhead\" action=\"SplitAtPlayhead\"" \
189 " <menuitem name=\"ClipTrimToPlayhead\" action=\"TrimToPlayhead\"/" \
192 " <menuitem name=\"ClipViewProperties\" action=\"ClipProperties\"/" \
195 " <menu name=\"ViewMenu\" action=\"View\">\n" \
196 " <menuitem name=\"ViewLibrary\" action=\"Library\"/>\n" \
198 " <menuitem name=\"ViewZoomIn\" action=\"ZoomIn\"/>\n" \
199 " <menuitem name=\"ViewZoomOut\" action=\"ZoomOut\"/>\n" \
200 " <menuitem name=\"ViewZoomProject\" action=\"ZoomProject\"/>\n" \
202 " <menuitem name=\"Snap\" action=\"Snap\"/>\n" \
204 " <menu name=\"GoMenu\" action=\"Go\">\n" \
205 " <menuitem name=\"GoStart\" action=\"Start\"/>\n" \
206 " <menuitem name=\"GoEnd\" action=\"End\"/>\n" \
208 " <menu name=\"HelpMenu\" action=\"Help\">\n" \
209 " <menuitem name=\"HelpContents\" action=\"Contents\"/>\n" \
211 " <menuitem name=\"HelpAbout\" action=\"About\"/>\n" \
212 " <menuitem name=\"SaveGraph\" action=\"SaveGraph\"/>\n" \
216 " <popup name=\"ClipContextMenu\">\n" \
217 " <menuitem name=\"ClipContextCut\" action=\"Cut\"/>\n" \
218 " <menuitem name=\"ClipContextCopy\" action=\"Copy\"/>\n" \
220 " <menuitem name=\"ClipContextProperties\" action=\"ClipProperties\"" \
223 " <popup name=\"LibraryContextMenu\">\n" \
224 " <menuitem name=\"ClipContextProperties\" action=\"ClipProperties\"" \
228 #define APP_SCROLL_MARGIN 0.05f
229 static void app_on_drawing_realize (App* self);
230 static void _app_on_drawing_realize_gtk_widget_realize (GtkWidget* _sender, gpointer self);
231 ModelVideoProject* model_video_project_new (const char* filename, GError** error);
232 ModelVideoProject* model_video_project_construct (GType object_type, const char* filename, GError** error);
233 void app_set_project_name (App* self, const char* filename);
234 static void _app_set_project_name_model_project_name_changed (ModelProject* _sender, const char* project_file, gpointer self);
235 void app_on_load_error (App* self, const char* message);
236 static void _app_on_load_error_model_project_load_error (ModelProject* _sender, const char* _error_, gpointer self);
237 void app_on_load_complete (App* self);
238 static void _app_on_load_complete_model_project_load_complete (ModelProject* _sender, gpointer self);
239 void app_do_error_dialog (const char* message, const char* minor_message);
240 static void _app_do_error_dialog_model_project_error_occurred (ModelProject* _sender, const char* major_message, const char* minor_message, gpointer self);
241 static void app_on_undo_changed (App* self, gboolean can_undo);
242 static void _app_on_undo_changed_model_undo_manager_undo_changed (ModelUndoManager* _sender, gboolean can_undo, gpointer self);
243 static void app_on_post_export (App* self, gboolean canceled);
244 static void _app_on_post_export_view_media_engine_post_export (ViewMediaEngine* _sender, gboolean canceled, gpointer self);
245 static void app_on_playstate_changed (App* self, PlayState playstate);
246 static void _app_on_playstate_changed_model_project_playstate_changed (ModelProject* _sender, PlayState playstate, gpointer self);
247 void app_on_timeline_selection_changed (App* self, gboolean selected);
248 static void _app_on_timeline_selection_changed_time_line_selection_changed (TimeLine* _sender, gboolean selected, gpointer self);
249 void app_on_track_changed (App* self);
250 static void _app_on_track_changed_time_line_track_changed (TimeLine* _sender, gpointer self);
251 static void app_on_drag_data_received (App* self, GtkWidget* w, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint drag_info, guint time);
252 static void _app_on_drag_data_received_gtk_widget_drag_data_received (GtkWidget* _sender, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint info, guint time_, gpointer self);
253 static void app_on_timeline_size_allocate (App* self, GdkRectangle* rectangle);
254 static void _app_on_timeline_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self);
255 void app_on_position_changed (App* self);
256 static void _app_on_position_changed_view_media_engine_position_changed (ViewMediaEngine* _sender, gint64 position, gpointer self);
257 static void app_on_callback_pulse (App* self);
258 static void _app_on_callback_pulse_view_media_engine_callback_pulse (ViewMediaEngine* _sender, gpointer self);
259 void app_on_library_selection_changed (App* self, gboolean selected);
260 static void _app_on_library_selection_changed_clip_library_view_selection_changed (ClipLibraryView* _sender, gboolean selected, gpointer self);
261 static void app_toggle_library (App* self, gboolean showing);
262 static gboolean app_on_delete_event (App* self);
263 static gboolean _app_on_delete_event_gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self);
264 static void app_default_track_set (App* self);
265 static void app_update_menu (App* self);
266 App* app_new (const char* project_file, GError** error);
267 App* app_construct (GType object_type, const char* project_file, GError** error);
268 static gboolean app_do_save (App* self);
269 static void app_on_library_size_allocate (App* self, GdkRectangle* rectangle);
270 static void _app_on_library_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self);
271 static void app_on_adjustment_changed (App* self, GtkAdjustment* a);
272 static void _app_on_adjustment_changed_gtk_adjustment_changed (GtkAdjustment* _sender, gpointer self);
273 void app_load_project (App* self, const char* filename);
274 void app_load_file (App* self, const char* name, ModelLibraryImporter* im);
275 static void _g_slist_free_g_free (GSList* self);
276 static void app_on_importer_started (App* self, ModelClipImporter* i, gint num);
277 static void _app_on_importer_started_model_library_importer_started (ModelLibraryImporter* _sender, ModelClipImporter* i, gint num, gpointer self);
278 static gboolean app_do_save_dialog (App* self);
279 static void app_scroll_toward_center (App* self, gint xpos);
280 gboolean model_video_project_get_framerate_fraction (ModelVideoProject* self, Fraction* rate);
281 static Fraction* _fraction_dup (Fraction* self);
282 static void app_set_sensitive_group (App* self, GtkActionGroup* group, const char* group_path, gboolean sensitive);
283 void model_video_project_go_previous_frame (ModelVideoProject* self);
284 void model_video_project_go_next_frame (ModelVideoProject* self);
285 static gboolean app_real_key_press_event (GtkWidget* base, GdkEventKey* event);
286 static gint64 app_get_zoom_center_time (App* self);
287 static void app_do_zoom (App* self, float increment);
288 static gboolean app_real_is_recording (TransportDelegate* base);
289 static gboolean app_real_is_playing (TransportDelegate* base);
290 static gboolean app_real_is_stopped (TransportDelegate* base);
291 static void app_finalize (GObject* obj);
292 void _vala_main (char** args, int args_length1);
293 static int _vala_strcmp0 (const char * str1, const char * str2);
295 const GOptionEntry options[2] = {{"debug-level", (gchar) 0, 0, G_OPTION_ARG_INT, &debug_level, "Control amount of diagnostic information", "[0 (minimal),5 (maximum)]"}, {NULL}};
296 static const GtkActionEntry APP_entries[28] = {{"Project", NULL, "_Project", NULL, NULL, (GCallback) NULL}, {"Open", GTK_STOCK_OPEN, "_Open...", NULL, NULL, (GCallback) _app_on_open_gtk_action_callback}, {"Save", GTK_STOCK_SAVE, NULL, NULL, NULL, (GCallback) _app_on_save_gtk_action_callback}, {"SaveAs", GTK_STOCK_SAVE_AS, "Save _As...", "<Shift><Control>S", NULL, (GCallback) _app_on_save_as_gtk_action_callback}, {"Play", GTK_STOCK_MEDIA_PLAY, "_Play / Pause", "space", NULL, (GCallback) _app_on_play_pause_gtk_action_callback}, {"Export", NULL, "_Export...", "<Control>E", NULL, (GCallback) _app_on_export_gtk_action_callback}, {"Quit", GTK_STOCK_QUIT, NULL, NULL, NULL, (GCallback) _app_on_quit_gtk_action_callback}, {"Edit", NULL, "_Edit", NULL, NULL, (GCallback) NULL}, {"Undo", GTK_STOCK_UNDO, NULL, "<Control>Z", NULL, (GCallback) _app_on_undo_gtk_action_callback}, {"Cut", GTK_STOCK_CUT, NULL, NULL, NULL, (GCallback) _app_on_cut_gtk_action_callback}, {"Copy", GTK_STOCK_COPY, NULL, NULL, NULL, (GCallback) _app_on_copy_gtk_action_callback}, {"Paste", GTK_STOCK_PASTE, NULL, NULL, NULL, (GCallback) _app_on_paste_gtk_action_callback}, {"Delete", GTK_STOCK_DELETE, NULL, "Delete", NULL, (GCallback) _app_on_delete_gtk_action_callback}, {"SelectAll", GTK_STOCK_SELECT_ALL, NULL, "<Control>A", NULL, (GCallback) _app_on_select_all_gtk_action_callback}, {"SplitAtPlayhead", NULL, "_Split at Playhead", "<Control>P", NULL, (GCallback) _app_on_split_at_playhead_gtk_action_callback}, {"TrimToPlayhead", NULL, "Trim to Play_head", "<Control>H", NULL, (GCallback) _app_on_trim_to_playhead_gtk_action_callback}, {"ClipProperties", GTK_STOCK_PROPERTIES, "Properti_es", "<Alt>Return", NULL, (GCallback) _app_on_clip_properties_gtk_action_callback}, {"View", NULL, "_View", NULL, NULL, (GCallback) NULL}, {"ZoomIn", GTK_STOCK_ZOOM_IN, "Zoom _In", "<Control>plus", NULL, (GCallback) _app_on_zoom_in_gtk_action_callback}, {"ZoomOut", GTK_STOCK_ZOOM_OUT, "Zoom _Out", "<Control>minus", NULL, (GCallback) _app_on_zoom_out_gtk_action_callback}, {"ZoomProject", NULL, "Fit to _Window", "<Shift>Z", NULL, (GCallback) _app_on_zoom_to_project_gtk_action_callback}, {"Go", NULL, "_Go", NULL, NULL, (GCallback) NULL}, {"Start", GTK_STOCK_GOTO_FIRST, "_Start", "Home", NULL, (GCallback) _app_on_go_start_gtk_action_callback}, {"End", GTK_STOCK_GOTO_LAST, "_End", "End", NULL, (GCallback) _app_on_go_end_gtk_action_callback}, {"Help", NULL, "_Help", NULL, NULL, (GCallback) NULL}, {"Contents", GTK_STOCK_HELP, "_Contents", "F1", "More information on Lombard", (GCallback) _app_on_help_contents_gtk_action_callback}, {"About", GTK_STOCK_ABOUT, NULL, NULL, NULL, (GCallback) _app_on_about_gtk_action_callback}, {"SaveGraph", NULL, "Save _Graph", NULL, "Save graph", (GCallback) _app_on_save_graph_gtk_action_callback}};
297 static const GtkToggleActionEntry APP_check_actions[2] = {{APP_LibraryToggle, NULL, "_Library", "F9", NULL, (GCallback) _app_on_view_library_gtk_action_callback, TRUE}, {"Snap", NULL, "_Snap to Clip Edges", NULL, NULL, (GCallback) _app_on_snap_gtk_action_callback, TRUE}};
298 static const DialogUtilsfilter_description_struct APP_filters[2] = {{"Lombard Project Files", MODEL_PROJECT_LOMBARD_FILE_EXTENSION}, {"Fillmore Project Files", MODEL_PROJECT_FILLMORE_FILE_EXTENSION}};
299 static const DialogUtilsfilter_description_struct APP_export_filters[1] = {{"Ogg Files", "ogg"}};
302 #line 445 "lombard.vala"
303 static void _app_on_open_gtk_action_callback (GtkAction* action, gpointer self) {
304 #line 242 "lombard.c"
309 #line 485 "lombard.vala"
310 static void _app_on_save_gtk_action_callback (GtkAction* action, gpointer self) {
311 #line 249 "lombard.c"
316 #line 481 "lombard.vala"
317 static void _app_on_save_as_gtk_action_callback (GtkAction* action, gpointer self) {
318 #line 256 "lombard.c"
319 app_on_save_as (self);
323 #line 727 "lombard.vala"
324 static void _app_on_play_pause_gtk_action_callback (GtkAction* action, gpointer self) {
325 #line 263 "lombard.c"
326 app_on_play_pause (self);
330 #line 739 "lombard.vala"
331 static void _app_on_export_gtk_action_callback (GtkAction* action, gpointer self) {
332 #line 270 "lombard.c"
333 app_on_export (self);
337 #line 269 "lombard.vala"
338 static void _app_on_quit_gtk_action_callback (GtkAction* action, gpointer self) {
339 #line 277 "lombard.c"
344 #line 770 "lombard.vala"
345 static void _app_on_undo_gtk_action_callback (GtkAction* action, gpointer self) {
346 #line 284 "lombard.c"
351 #line 781 "lombard.vala"
352 static void _app_on_cut_gtk_action_callback (GtkAction* action, gpointer self) {
353 #line 291 "lombard.c"
358 #line 785 "lombard.vala"
359 static void _app_on_copy_gtk_action_callback (GtkAction* action, gpointer self) {
360 #line 298 "lombard.c"
365 #line 789 "lombard.vala"
366 static void _app_on_paste_gtk_action_callback (GtkAction* action, gpointer self) {
367 #line 305 "lombard.c"
372 #line 774 "lombard.vala"
373 static void _app_on_delete_gtk_action_callback (GtkAction* action, gpointer self) {
374 #line 312 "lombard.c"
375 app_on_delete (self);
379 #line 808 "lombard.vala"
380 static void _app_on_select_all_gtk_action_callback (GtkAction* action, gpointer self) {
381 #line 319 "lombard.c"
382 app_on_select_all (self);
386 #line 535 "lombard.vala"
387 static void _app_on_split_at_playhead_gtk_action_callback (GtkAction* action, gpointer self) {
388 #line 326 "lombard.c"
389 app_on_split_at_playhead (self);
393 #line 539 "lombard.vala"
394 static void _app_on_trim_to_playhead_gtk_action_callback (GtkAction* action, gpointer self) {
395 #line 333 "lombard.c"
396 app_on_trim_to_playhead (self);
400 #line 543 "lombard.vala"
401 static void _app_on_clip_properties_gtk_action_callback (GtkAction* action, gpointer self) {
402 #line 340 "lombard.c"
403 app_on_clip_properties (self);
407 #line 699 "lombard.vala"
408 static void _app_on_zoom_in_gtk_action_callback (GtkAction* action, gpointer self) {
409 #line 347 "lombard.c"
410 app_on_zoom_in (self);
414 #line 703 "lombard.vala"
415 static void _app_on_zoom_out_gtk_action_callback (GtkAction* action, gpointer self) {
416 #line 354 "lombard.c"
417 app_on_zoom_out (self);
421 #line 707 "lombard.vala"
422 static void _app_on_zoom_to_project_gtk_action_callback (GtkAction* action, gpointer self) {
423 #line 361 "lombard.c"
424 app_on_zoom_to_project (self);
428 #line 818 "lombard.vala"
429 static void _app_on_go_start_gtk_action_callback (GtkAction* action, gpointer self) {
430 #line 368 "lombard.c"
431 app_on_go_start (self);
435 #line 820 "lombard.vala"
436 static void _app_on_go_end_gtk_action_callback (GtkAction* action, gpointer self) {
437 #line 375 "lombard.c"
438 app_on_go_end (self);
442 #line 824 "lombard.vala"
443 static void _app_on_help_contents_gtk_action_callback (GtkAction* action, gpointer self) {
444 #line 382 "lombard.c"
445 app_on_help_contents (self);
449 #line 831 "lombard.vala"
450 static void _app_on_about_gtk_action_callback (GtkAction* action, gpointer self) {
451 #line 389 "lombard.c"
456 #line 843 "lombard.vala"
457 static void _app_on_save_graph_gtk_action_callback (GtkAction* action, gpointer self) {
458 #line 396 "lombard.c"
459 app_on_save_graph (self);
463 #line 685 "lombard.vala"
464 static void _app_on_view_library_gtk_action_callback (GtkAction* action, gpointer self) {
465 #line 403 "lombard.c"
466 app_on_view_library (self);
470 #line 681 "lombard.vala"
471 static void _app_on_snap_gtk_action_callback (GtkAction* action, gpointer self) {
472 #line 410 "lombard.c"
477 #line 344 "lombard.vala"
478 static void _app_on_drawing_realize_gtk_widget_realize (GtkWidget* _sender, gpointer self) {
479 #line 417 "lombard.c"
480 app_on_drawing_realize (self);
484 #line 371 "lombard.vala"
485 static void _app_set_project_name_model_project_name_changed (ModelProject* _sender, const char* project_file, gpointer self) {
486 #line 424 "lombard.c"
487 app_set_project_name (self, project_file);
491 #line 380 "lombard.vala"
492 static void _app_on_load_error_model_project_load_error (ModelProject* _sender, const char* _error_, gpointer self) {
493 #line 431 "lombard.c"
494 app_on_load_error (self, _error_);
498 #line 385 "lombard.vala"
499 static void _app_on_load_complete_model_project_load_complete (ModelProject* _sender, gpointer self) {
500 #line 438 "lombard.c"
501 app_on_load_complete (self);
505 #line 376 "lombard.vala"
506 static void _app_do_error_dialog_model_project_error_occurred (ModelProject* _sender, const char* major_message, const char* minor_message, gpointer self) {
507 #line 445 "lombard.c"
508 app_do_error_dialog (major_message, minor_message);
512 #line 800 "lombard.vala"
513 static void _app_on_undo_changed_model_undo_manager_undo_changed (ModelUndoManager* _sender, gboolean can_undo, gpointer self) {
514 #line 452 "lombard.c"
515 app_on_undo_changed (self, can_undo);
519 #line 757 "lombard.vala"
520 static void _app_on_post_export_view_media_engine_post_export (ViewMediaEngine* _sender, gboolean canceled, gpointer self) {
521 #line 459 "lombard.c"
522 app_on_post_export (self, canceled);
526 #line 793 "lombard.vala"
527 static void _app_on_playstate_changed_model_project_playstate_changed (ModelProject* _sender, PlayState playstate, gpointer self) {
528 #line 466 "lombard.c"
529 app_on_playstate_changed (self, playstate);
533 #line 625 "lombard.vala"
534 static void _app_on_timeline_selection_changed_time_line_selection_changed (TimeLine* _sender, gboolean selected, gpointer self) {
535 #line 473 "lombard.c"
536 app_on_timeline_selection_changed (self, selected);
540 #line 575 "lombard.vala"
541 static void _app_on_track_changed_time_line_track_changed (TimeLine* _sender, gpointer self) {
542 #line 480 "lombard.c"
543 app_on_track_changed (self);
547 #line 366 "lombard.vala"
548 static void _app_on_drag_data_received_gtk_widget_drag_data_received (GtkWidget* _sender, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint info, guint time_, gpointer self) {
549 #line 487 "lombard.c"
550 app_on_drag_data_received (self, _sender, context, x, y, selection_data, info, time_);
554 #line 711 "lombard.vala"
555 static void _app_on_timeline_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self) {
556 #line 494 "lombard.c"
557 app_on_timeline_size_allocate (self, allocation);
561 #line 562 "lombard.vala"
562 static void _app_on_position_changed_view_media_engine_position_changed (ViewMediaEngine* _sender, gint64 position, gpointer self) {
563 #line 501 "lombard.c"
564 app_on_position_changed (self);
568 #line 567 "lombard.vala"
569 static void _app_on_callback_pulse_view_media_engine_callback_pulse (ViewMediaEngine* _sender, gpointer self) {
570 #line 508 "lombard.c"
571 app_on_callback_pulse (self);
575 static gpointer _g_object_ref0 (gpointer self) {
576 return self ? g_object_ref (self) : NULL;
580 #line 632 "lombard.vala"
581 static void _app_on_library_selection_changed_clip_library_view_selection_changed (ClipLibraryView* _sender, gboolean selected, gpointer self) {
582 #line 520 "lombard.c"
583 app_on_library_selection_changed (self, selected);
587 #line 263 "lombard.vala"
588 static gboolean _app_on_delete_event_gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self) {
589 #line 527 "lombard.c"
591 result = app_on_delete_event (self);
596 #line 165 "lombard.vala"
597 App* app_construct (GType object_type, const char* project_file, GError** error) {
598 #line 536 "lombard.c"
599 GError * _inner_error_;
602 GeeArrayList* _tmp4_;
603 GtkDrawingArea* _tmp5_;
605 GdkColor _tmp6_ = {0};
606 GtkActionGroup* _tmp8_;
607 GtkUIManager* _tmp9_;
609 ModelVideoProject* _tmp11_;
610 ModelVideoProject* _tmp12_;
612 ViewAudioOutput* _tmp14_;
613 ViewAudioOutput* _tmp15_;
614 ViewAudioOutput* _tmp16_;
618 ClipLibraryView* _tmp20_;
619 ViewStatusBar* _tmp21_;
620 GtkScrolledWindow* _tmp22_;
621 GtkMenuItem* save_graph;
622 _inner_error_ = NULL;
623 self = g_object_newv (object_type, 0, NULL);
628 #line 167 "lombard.vala"
629 gtk_window_set_icon_from_file (GTK_WINDOW (self), _tmp2_ = g_file_get_path (_tmp1_ = g_file_get_child (_tmp0_ = app_dirs_get_resources_dir (), "lombard_icon.png")), &_inner_error_);
630 #line 568 "lombard.c"
632 _g_object_unref0 (_tmp1_);
633 _g_object_unref0 (_tmp0_);
634 if (_inner_error_ != NULL) {
635 goto __catch0_g_error;
643 _inner_error_ = NULL;
645 #line 170 "lombard.vala"
646 g_warning ("lombard.vala:170: Could not load application icon: %s", e->message);
647 #line 585 "lombard.c"
652 if (_inner_error_ != NULL) {
653 g_propagate_error (error, _inner_error_);
654 g_object_unref (self);
657 #line 173 "lombard.vala"
658 if (debug_level > (-1)) {
659 #line 174 "lombard.vala"
660 logging_set_logging_level ((LoggingLevel) debug_level);
661 #line 599 "lombard.c"
663 #line 176 "lombard.vala"
664 class_factory_set_transport_delegate (TRANSPORT_DELEGATE (self));
665 #line 177 "lombard.vala"
666 gtk_window_set_default_size (GTK_WINDOW (self), 600, 500);
667 #line 178 "lombard.vala"
668 self->priv->project_filename = (_tmp3_ = g_strdup (project_file), _g_free0 (self->priv->project_filename), _tmp3_);
669 #line 180 "lombard.vala"
670 self->priv->load_errors = (_tmp4_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL), _g_object_unref0 (self->priv->load_errors), _tmp4_);
671 #line 181 "lombard.vala"
672 self->priv->drawing_area = (_tmp5_ = g_object_ref_sink ((GtkDrawingArea*) gtk_drawing_area_new ()), _g_object_unref0 (self->priv->drawing_area), _tmp5_);
673 #line 182 "lombard.vala"
674 g_signal_connect_object (GTK_WIDGET (self->priv->drawing_area), "realize", (GCallback) _app_on_drawing_realize_gtk_widget_realize, self, 0);
675 #line 183 "lombard.vala"
676 gtk_widget_modify_bg (GTK_WIDGET (self->priv->drawing_area), GTK_STATE_NORMAL, (_tmp7_ = (parse_color ("#000", &_tmp6_), _tmp6_), &_tmp7_));
677 #line 185 "lombard.vala"
678 self->priv->main_group = (_tmp8_ = gtk_action_group_new ("main"), _g_object_unref0 (self->priv->main_group), _tmp8_);
679 #line 186 "lombard.vala"
680 gtk_action_group_add_actions (self->priv->main_group, APP_entries, G_N_ELEMENTS (APP_entries), self);
681 #line 187 "lombard.vala"
682 gtk_action_group_add_toggle_actions (self->priv->main_group, APP_check_actions, G_N_ELEMENTS (APP_check_actions), self);
683 #line 189 "lombard.vala"
684 self->priv->manager = (_tmp9_ = gtk_ui_manager_new (), _g_object_unref0 (self->priv->manager), _tmp9_);
685 #line 190 "lombard.vala"
686 gtk_ui_manager_insert_action_group (self->priv->manager, self->priv->main_group, 0);
687 #line 625 "lombard.c"
689 #line 192 "lombard.vala"
690 gtk_ui_manager_add_ui_from_string (self->priv->manager, APP_ui, (gssize) (-1), &_inner_error_);
691 #line 629 "lombard.c"
692 if (_inner_error_ != NULL) {
693 goto __catch1_g_error;
701 _inner_error_ = NULL;
703 #line 193 "lombard.vala"
704 g_error ("lombard.vala:193: %s", e->message);
705 #line 643 "lombard.c"
710 if (_inner_error_ != NULL) {
711 g_propagate_error (error, _inner_error_);
712 g_object_unref (self);
715 #line 195 "lombard.vala"
716 self->priv->menubar = (_tmp10_ = GTK_MENU_BAR (get_widget (self->priv->manager, "/MenuBar")), _g_object_unref0 (self->priv->menubar), _tmp10_);
717 #line 197 "lombard.vala"
718 _tmp11_ = model_video_project_new (self->priv->project_filename, &_inner_error_);
719 #line 657 "lombard.c"
720 if (_inner_error_ != NULL) {
721 g_propagate_error (error, _inner_error_);
722 g_object_unref (self);
725 #line 197 "lombard.vala"
726 self->priv->project = (_tmp12_ = _tmp11_, _g_object_unref0 (self->priv->project), _tmp12_);
727 #line 198 "lombard.vala"
728 MODEL_PROJECT (self->priv->project)->snap_to_clip = TRUE;
729 #line 199 "lombard.vala"
730 g_signal_connect_object (MODEL_PROJECT (self->priv->project), "name-changed", (GCallback) _app_set_project_name_model_project_name_changed, self, 0);
731 #line 200 "lombard.vala"
732 g_signal_connect_object (MODEL_PROJECT (self->priv->project), "load-error", (GCallback) _app_on_load_error_model_project_load_error, self, 0);
733 #line 201 "lombard.vala"
734 g_signal_connect_object (MODEL_PROJECT (self->priv->project), "load-complete", (GCallback) _app_on_load_complete_model_project_load_complete, self, 0);
735 #line 202 "lombard.vala"
736 g_signal_connect (MODEL_PROJECT (self->priv->project), "error-occurred", (GCallback) _app_do_error_dialog_model_project_error_occurred, NULL);
737 #line 203 "lombard.vala"
738 g_signal_connect_object (MODEL_PROJECT (self->priv->project)->undo_manager, "undo-changed", (GCallback) _app_on_undo_changed_model_undo_manager_undo_changed, self, 0);
739 #line 204 "lombard.vala"
740 g_signal_connect_object (MODEL_PROJECT (self->priv->project)->media_engine, "post-export", (GCallback) _app_on_post_export_view_media_engine_post_export, self, 0);
741 #line 205 "lombard.vala"
742 g_signal_connect_object (MODEL_PROJECT (self->priv->project), "playstate-changed", (GCallback) _app_on_playstate_changed_model_project_playstate_changed, self, 0);
743 #line 207 "lombard.vala"
744 _tmp15_ = (_tmp14_ = view_audio_output_new (_tmp13_ = view_media_engine_get_project_audio_caps (MODEL_PROJECT (self->priv->project)->media_engine), &_inner_error_), _gst_caps_unref0 (_tmp13_), _tmp14_);
745 #line 683 "lombard.c"
746 if (_inner_error_ != NULL) {
747 g_propagate_error (error, _inner_error_);
748 g_object_unref (self);
751 #line 207 "lombard.vala"
752 self->priv->audio_output = (_tmp16_ = _tmp15_, _g_object_unref0 (self->priv->audio_output), _tmp16_);
753 #line 208 "lombard.vala"
754 view_media_engine_connect_output (MODEL_PROJECT (self->priv->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->audio_output));
755 #line 210 "lombard.vala"
756 self->priv->timeline = (_tmp17_ = g_object_ref_sink (time_line_new (MODEL_PROJECT (self->priv->project), MODEL_TIME_SYSTEM (self->priv->project->time_provider), GDK_ACTION_COPY | GDK_ACTION_MOVE)), _g_object_unref0 (self->priv->timeline), _tmp17_);
757 #line 212 "lombard.vala"
758 g_signal_connect_object (self->priv->timeline, "selection-changed", (GCallback) _app_on_timeline_selection_changed_time_line_selection_changed, self, 0);
759 #line 213 "lombard.vala"
760 g_signal_connect_object (self->priv->timeline, "track-changed", (GCallback) _app_on_track_changed_time_line_track_changed, self, 0);
761 #line 214 "lombard.vala"
762 g_signal_connect_object (GTK_WIDGET (self->priv->timeline), "drag-data-received", (GCallback) _app_on_drag_data_received_gtk_widget_drag_data_received, self, 0);
763 #line 215 "lombard.vala"
764 g_signal_connect_object (GTK_WIDGET (self->priv->timeline), "size-allocate", (GCallback) _app_on_timeline_size_allocate_gtk_widget_size_allocate, self, 0);
765 #line 216 "lombard.vala"
766 g_signal_connect_object (MODEL_PROJECT (self->priv->project)->media_engine, "position-changed", (GCallback) _app_on_position_changed_view_media_engine_position_changed, self, 0);
767 #line 217 "lombard.vala"
768 g_signal_connect_object (MODEL_PROJECT (self->priv->project)->media_engine, "callback-pulse", (GCallback) _app_on_callback_pulse_view_media_engine_callback_pulse, self, 0);
769 #line 218 "lombard.vala"
770 clip_view_context_menu = (_tmp18_ = _g_object_ref0 (GTK_MENU (gtk_ui_manager_get_widget (self->priv->manager, "/ClipContextMenu"))), _g_object_unref0 (clip_view_context_menu), _tmp18_);
771 #line 219 "lombard.vala"
772 clip_library_view_context_menu = (_tmp19_ = _g_object_ref0 (GTK_MENU (gtk_ui_manager_get_widget (self->priv->manager, "/LibraryContextMenu"))), _g_object_unref0 (clip_library_view_context_menu), _tmp19_);
773 #line 221 "lombard.vala"
774 self->priv->library = (_tmp20_ = g_object_ref_sink (clip_library_view_new (MODEL_PROJECT (self->priv->project), MODEL_TIME_SYSTEM (self->priv->project->time_provider), "Drag clips here.", GDK_ACTION_COPY | GDK_ACTION_MOVE)), _g_object_unref0 (self->priv->library), _tmp20_);
775 #line 223 "lombard.vala"
776 g_signal_connect_object (self->priv->library, "selection-changed", (GCallback) _app_on_library_selection_changed_clip_library_view_selection_changed, self, 0);
777 #line 224 "lombard.vala"
778 g_signal_connect_object (GTK_WIDGET (self->priv->library), "drag-data-received", (GCallback) _app_on_drag_data_received_gtk_widget_drag_data_received, self, 0);
779 #line 226 "lombard.vala"
780 self->priv->status_bar = (_tmp21_ = g_object_ref_sink (view_status_bar_new (MODEL_PROJECT (self->priv->project), MODEL_TIME_SYSTEM (self->priv->project->time_provider), TIME_LINE_BAR_HEIGHT)), _g_object_unref0 (self->priv->status_bar), _tmp21_);
781 #line 228 "lombard.vala"
782 self->priv->library_scrolled = (_tmp22_ = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL)), _g_object_unref0 (self->priv->library_scrolled), _tmp22_);
783 #line 229 "lombard.vala"
784 gtk_scrolled_window_set_policy (self->priv->library_scrolled, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
785 #line 230 "lombard.vala"
786 gtk_scrolled_window_add_with_viewport (self->priv->library_scrolled, GTK_WIDGET (self->priv->library));
787 #line 232 "lombard.vala"
788 app_toggle_library (self, TRUE);
789 #line 234 "lombard.vala"
790 save_graph = GTK_MENU_ITEM (get_widget (self->priv->manager, "/MenuBar/HelpMenu/SaveGraph"));
791 #line 239 "lombard.vala"
792 if (save_graph != NULL) {
793 #line 240 "lombard.vala"
794 gtk_object_destroy (GTK_OBJECT (save_graph));
795 #line 733 "lombard.c"
797 #line 243 "lombard.vala"
798 gtk_window_add_accel_group (GTK_WINDOW (self), gtk_ui_manager_get_accel_group (self->priv->manager));
799 #line 245 "lombard.vala"
800 app_on_undo_changed (self, FALSE);
801 #line 247 "lombard.vala"
802 g_signal_connect_object (GTK_WIDGET (self), "delete-event", (GCallback) _app_on_delete_event_gtk_widget_delete_event, self, 0);
803 #line 249 "lombard.vala"
804 if (self->priv->project_filename == NULL) {
805 #line 250 "lombard.vala"
806 app_default_track_set (self);
807 #line 251 "lombard.vala"
808 app_on_load_complete (self);
809 #line 747 "lombard.c"
811 #line 254 "lombard.vala"
812 app_update_menu (self);
813 #line 255 "lombard.vala"
814 gtk_widget_show_all (GTK_WIDGET (self));
815 #line 753 "lombard.c"
816 _g_object_unref0 (save_graph);
821 #line 165 "lombard.vala"
822 App* app_new (const char* project_file, GError** error) {
823 #line 165 "lombard.vala"
824 return app_construct (TYPE_APP, project_file, error);
825 #line 763 "lombard.c"
829 #line 258 "lombard.vala"
830 static void app_default_track_set (App* self) {
831 #line 769 "lombard.c"
832 ModelVideoTrack* _tmp0_;
833 ModelAudioTrack* _tmp1_;
834 #line 258 "lombard.vala"
835 g_return_if_fail (IS_APP (self));
836 #line 259 "lombard.vala"
837 model_project_add_track (MODEL_PROJECT (self->priv->project), MODEL_TRACK (_tmp0_ = model_video_track_new (MODEL_PROJECT (self->priv->project))));
838 #line 776 "lombard.c"
839 _g_object_unref0 (_tmp0_);
840 #line 260 "lombard.vala"
841 model_project_add_track (MODEL_PROJECT (self->priv->project), MODEL_TRACK (_tmp1_ = model_audio_track_new (MODEL_PROJECT (self->priv->project), "Audio Track")));
842 #line 780 "lombard.c"
843 _g_object_unref0 (_tmp1_);
847 #line 263 "lombard.vala"
848 static gboolean app_on_delete_event (App* self) {
849 #line 787 "lombard.c"
850 gboolean result = FALSE;
851 #line 263 "lombard.vala"
852 g_return_val_if_fail (IS_APP (self), FALSE);
853 #line 264 "lombard.vala"
854 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_delete_event");
855 #line 265 "lombard.vala"
857 #line 795 "lombard.c"
859 #line 266 "lombard.vala"
861 #line 799 "lombard.c"
865 #line 269 "lombard.vala"
866 static void app_on_quit (App* self) {
867 #line 269 "lombard.vala"
868 g_return_if_fail (IS_APP (self));
869 #line 270 "lombard.vala"
870 if (model_undo_manager_get_is_dirty (MODEL_PROJECT (self->priv->project)->undo_manager)) {
871 #line 271 "lombard.vala"
872 switch (dialog_utils_save_close_cancel (GTK_WINDOW (self), NULL, "Save changes before closing?")) {
873 #line 811 "lombard.c"
874 case GTK_RESPONSE_ACCEPT:
876 #line 273 "lombard.vala"
877 if (!app_do_save (self)) {
878 #line 274 "lombard.vala"
880 #line 818 "lombard.c"
882 #line 276 "lombard.vala"
884 #line 822 "lombard.c"
886 case GTK_RESPONSE_CLOSE:
888 #line 278 "lombard.vala"
890 #line 828 "lombard.c"
892 case GTK_RESPONSE_DELETE_EVENT:
893 case GTK_RESPONSE_CANCEL:
895 #line 281 "lombard.vala"
897 #line 835 "lombard.c"
901 #line 283 "lombard.vala"
903 #line 284 "lombard.vala"
905 #line 843 "lombard.c"
909 #line 288 "lombard.vala"
911 #line 849 "lombard.c"
915 #line 424 "lombard.vala"
916 static void _app_on_library_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self) {
917 #line 855 "lombard.c"
918 app_on_library_size_allocate (self, allocation);
922 #line 356 "lombard.vala"
923 static void _app_on_adjustment_changed_gtk_adjustment_changed (GtkAdjustment* _sender, gpointer self) {
924 #line 862 "lombard.c"
925 app_on_adjustment_changed (self, _sender);
929 #line 291 "lombard.vala"
930 static void app_toggle_library (App* self, gboolean showing) {
931 #line 291 "lombard.vala"
932 g_return_if_fail (IS_APP (self));
933 #line 292 "lombard.vala"
934 if (self->priv->vbox == NULL) {
935 #line 873 "lombard.c"
939 GtkScrolledWindow* _tmp2_;
940 GtkVBox* timeline_vbox;
941 GtkAdjustment* _tmp3_;
942 #line 293 "lombard.vala"
943 self->priv->vbox = (_tmp0_ = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0)), _g_object_unref0 (self->priv->vbox), _tmp0_);
944 #line 294 "lombard.vala"
945 gtk_box_pack_start (GTK_BOX (self->priv->vbox), GTK_WIDGET (self->priv->menubar), FALSE, FALSE, (guint) 0);
946 #line 296 "lombard.vala"
947 v_pane = g_object_ref_sink ((GtkVPaned*) gtk_vpaned_new ());
948 #line 297 "lombard.vala"
949 gtk_paned_set_position (GTK_PANED (v_pane), 290);
950 #line 299 "lombard.vala"
951 self->priv->h_pane = (_tmp1_ = g_object_ref_sink ((GtkHPaned*) gtk_hpaned_new ()), _g_object_unref0 (self->priv->h_pane), _tmp1_);
952 #line 300 "lombard.vala"
953 gtk_paned_set_position (GTK_PANED (self->priv->h_pane), 300);
954 #line 301 "lombard.vala"
955 GTK_PANED (self->priv->h_pane)->child2_resize = (guint) 1;
956 #line 302 "lombard.vala"
957 GTK_PANED (self->priv->h_pane)->child1_resize = (guint) 0;
958 #line 304 "lombard.vala"
960 #line 305 "lombard.vala"
961 gtk_paned_add1 (GTK_PANED (self->priv->h_pane), GTK_WIDGET (self->priv->library_scrolled));
962 #line 306 "lombard.vala"
963 gtk_paned_add2 (GTK_PANED (self->priv->h_pane), GTK_WIDGET (self->priv->drawing_area));
964 #line 902 "lombard.c"
966 #line 308 "lombard.vala"
967 gtk_paned_add2 (GTK_PANED (self->priv->h_pane), GTK_WIDGET (self->priv->drawing_area));
968 #line 906 "lombard.c"
970 #line 310 "lombard.vala"
971 g_signal_connect_object (GTK_PANED (self->priv->h_pane)->child2, "size-allocate", (GCallback) _app_on_library_size_allocate_gtk_widget_size_allocate, self, 0);
972 #line 311 "lombard.vala"
973 gtk_paned_add1 (GTK_PANED (v_pane), GTK_WIDGET (self->priv->h_pane));
974 #line 313 "lombard.vala"
975 self->priv->timeline_scrolled = (_tmp2_ = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL)), _g_object_unref0 (self->priv->timeline_scrolled), _tmp2_);
976 #line 314 "lombard.vala"
977 gtk_scrolled_window_set_policy (self->priv->timeline_scrolled, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
978 #line 315 "lombard.vala"
979 gtk_scrolled_window_add_with_viewport (self->priv->timeline_scrolled, GTK_WIDGET (self->priv->timeline));
980 #line 317 "lombard.vala"
981 timeline_vbox = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0));
982 #line 318 "lombard.vala"
983 gtk_box_pack_start (GTK_BOX (timeline_vbox), GTK_WIDGET (self->priv->status_bar), FALSE, FALSE, (guint) 0);
984 #line 319 "lombard.vala"
985 gtk_box_pack_start (GTK_BOX (timeline_vbox), GTK_WIDGET (self->priv->timeline_scrolled), TRUE, TRUE, (guint) 0);
986 #line 320 "lombard.vala"
987 gtk_paned_add2 (GTK_PANED (v_pane), GTK_WIDGET (timeline_vbox));
988 #line 322 "lombard.vala"
989 GTK_PANED (v_pane)->child1_resize = (guint) 1;
990 #line 323 "lombard.vala"
991 GTK_PANED (v_pane)->child2_resize = (guint) 0;
992 #line 325 "lombard.vala"
993 self->priv->h_adjustment = (_tmp3_ = _g_object_ref0 (gtk_scrolled_window_get_hadjustment (self->priv->timeline_scrolled)), _g_object_unref0 (self->priv->h_adjustment), _tmp3_);
994 #line 326 "lombard.vala"
995 g_signal_connect_object (self->priv->h_adjustment, "changed", (GCallback) _app_on_adjustment_changed_gtk_adjustment_changed, self, 0);
996 #line 327 "lombard.vala"
997 self->priv->prev_adjustment_lower = gtk_adjustment_get_lower (self->priv->h_adjustment);
998 #line 328 "lombard.vala"
999 self->priv->prev_adjustment_upper = gtk_adjustment_get_upper (self->priv->h_adjustment);
1000 #line 330 "lombard.vala"
1001 gtk_box_pack_start (GTK_BOX (self->priv->vbox), GTK_WIDGET (v_pane), TRUE, TRUE, (guint) 0);
1002 #line 332 "lombard.vala"
1003 gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (self->priv->vbox));
1004 #line 942 "lombard.c"
1005 _g_object_unref0 (v_pane);
1006 _g_object_unref0 (timeline_vbox);
1008 #line 334 "lombard.vala"
1009 MODEL_PROJECT (self->priv->project)->library_visible = showing;
1010 #line 335 "lombard.vala"
1012 #line 336 "lombard.vala"
1013 gtk_paned_add1 (GTK_PANED (self->priv->h_pane), GTK_WIDGET (self->priv->library_scrolled));
1014 #line 952 "lombard.c"
1016 #line 338 "lombard.vala"
1017 gtk_container_remove (GTK_CONTAINER (self->priv->h_pane), GTK_WIDGET (self->priv->library_scrolled));
1018 #line 956 "lombard.c"
1021 #line 341 "lombard.vala"
1022 gtk_widget_show_all (GTK_WIDGET (self));
1023 #line 961 "lombard.c"
1027 #line 344 "lombard.vala"
1028 static void app_on_drawing_realize (App* self) {
1029 #line 967 "lombard.c"
1030 GError * _inner_error_;
1031 #line 344 "lombard.vala"
1032 g_return_if_fail (IS_APP (self));
1033 #line 971 "lombard.c"
1034 _inner_error_ = NULL;
1035 #line 345 "lombard.vala"
1036 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_drawing_realize");
1037 #line 346 "lombard.vala"
1038 self->priv->loading = TRUE;
1039 #line 347 "lombard.vala"
1040 model_project_load (MODEL_PROJECT (self->priv->project), self->priv->project_filename);
1041 #line 979 "lombard.c"
1043 ViewVideoOutput* _tmp0_;
1044 ViewVideoOutput* _tmp1_;
1045 #line 349 "lombard.vala"
1046 _tmp0_ = view_video_output_new (GTK_WIDGET (self->priv->drawing_area), &_inner_error_);
1047 #line 985 "lombard.c"
1048 if (_inner_error_ != NULL) {
1049 goto __catch2_g_error;
1051 #line 349 "lombard.vala"
1052 self->priv->video_output = (_tmp1_ = _tmp0_, _g_object_unref0 (self->priv->video_output), _tmp1_);
1053 #line 350 "lombard.vala"
1054 view_media_engine_connect_output (MODEL_PROJECT (self->priv->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->video_output));
1055 #line 993 "lombard.c"
1062 _inner_error_ = NULL;
1064 #line 352 "lombard.vala"
1065 app_do_error_dialog ("Could not create video output", e->message);
1066 #line 1004 "lombard.c"
1071 if (_inner_error_ != NULL) {
1072 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);
1073 g_clear_error (&_inner_error_);
1079 #line 356 "lombard.vala"
1080 static void app_on_adjustment_changed (App* self, GtkAdjustment* a) {
1081 #line 1019 "lombard.c"
1082 gboolean _tmp0_ = FALSE;
1083 #line 356 "lombard.vala"
1084 g_return_if_fail (IS_APP (self));
1085 #line 356 "lombard.vala"
1086 g_return_if_fail (GTK_IS_ADJUSTMENT (a));
1087 #line 357 "lombard.vala"
1088 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_adjustment_changed");
1089 #line 358 "lombard.vala"
1090 if (self->priv->prev_adjustment_upper != gtk_adjustment_get_upper (a)) {
1091 #line 358 "lombard.vala"
1093 #line 1031 "lombard.c"
1095 #line 359 "lombard.vala"
1096 _tmp0_ = self->priv->prev_adjustment_lower != gtk_adjustment_get_lower (a);
1097 #line 1035 "lombard.c"
1099 #line 358 "lombard.vala"
1101 #line 361 "lombard.vala"
1102 self->priv->prev_adjustment_lower = gtk_adjustment_get_lower (a);
1103 #line 362 "lombard.vala"
1104 self->priv->prev_adjustment_upper = gtk_adjustment_get_upper (a);
1105 #line 1043 "lombard.c"
1110 #line 366 "lombard.vala"
1111 static void app_on_drag_data_received (App* self, GtkWidget* w, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint drag_info, guint time) {
1112 #line 366 "lombard.vala"
1113 g_return_if_fail (IS_APP (self));
1114 #line 366 "lombard.vala"
1115 g_return_if_fail (GTK_IS_WIDGET (w));
1116 #line 366 "lombard.vala"
1117 g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
1118 #line 366 "lombard.vala"
1119 g_return_if_fail (selection_data != NULL);
1120 #line 368 "lombard.vala"
1121 gtk_window_present (GTK_WINDOW (self));
1122 #line 1060 "lombard.c"
1126 #line 371 "lombard.vala"
1127 void app_set_project_name (App* self, const char* filename) {
1128 #line 1066 "lombard.c"
1130 #line 371 "lombard.vala"
1131 g_return_if_fail (IS_APP (self));
1132 #line 372 "lombard.vala"
1133 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "set_project_name");
1134 #line 373 "lombard.vala"
1135 gtk_window_set_title (GTK_WINDOW (self), _tmp0_ = model_project_get_file_display_name (MODEL_PROJECT (self->priv->project)));
1136 #line 1074 "lombard.c"
1141 #line 376 "lombard.vala"
1142 void app_do_error_dialog (const char* message, const char* minor_message) {
1143 #line 376 "lombard.vala"
1144 g_return_if_fail (message != NULL);
1145 #line 377 "lombard.vala"
1146 dialog_utils_error (message, minor_message);
1147 #line 1085 "lombard.c"
1151 #line 380 "lombard.vala"
1152 void app_on_load_error (App* self, const char* message) {
1153 #line 380 "lombard.vala"
1154 g_return_if_fail (IS_APP (self));
1155 #line 380 "lombard.vala"
1156 g_return_if_fail (message != NULL);
1157 #line 381 "lombard.vala"
1158 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_load_error");
1159 #line 382 "lombard.vala"
1160 gee_abstract_collection_add (GEE_ABSTRACT_COLLECTION (self->priv->load_errors), message);
1161 #line 1099 "lombard.c"
1165 #line 385 "lombard.vala"
1166 void app_on_load_complete (App* self) {
1167 #line 1105 "lombard.c"
1168 ModelVideoTrack* _tmp0_;
1171 GtkToggleAction* action;
1172 GtkToggleAction* _tmp5_;
1174 #line 385 "lombard.vala"
1175 g_return_if_fail (IS_APP (self));
1176 #line 386 "lombard.vala"
1177 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_load_complete");
1178 #line 387 "lombard.vala"
1179 gtk_widget_queue_draw (GTK_WIDGET (self));
1180 #line 388 "lombard.vala"
1181 if ((_tmp1_ = (_tmp0_ = model_project_find_video_track (MODEL_PROJECT (self->priv->project))) == NULL, _g_object_unref0 (_tmp0_), _tmp1_)) {
1182 #line 1120 "lombard.c"
1183 ModelVideoTrack* _tmp2_;
1184 #line 389 "lombard.vala"
1185 model_project_add_track (MODEL_PROJECT (self->priv->project), MODEL_TRACK (_tmp2_ = model_video_track_new (MODEL_PROJECT (self->priv->project))));
1186 #line 1124 "lombard.c"
1187 _g_object_unref0 (_tmp2_);
1189 #line 392 "lombard.vala"
1190 gst_element_set_state (GST_ELEMENT (MODEL_PROJECT (self->priv->project)->media_engine->pipeline), GST_STATE_PAUSED);
1191 #line 393 "lombard.vala"
1192 gtk_paned_set_position (GTK_PANED (self->priv->h_pane), GTK_WIDGET (self->priv->h_pane)->allocation.width - MODEL_PROJECT (self->priv->project)->library_width);
1193 #line 394 "lombard.vala"
1194 action = _g_object_ref0 ((_tmp3_ = gtk_action_group_get_action (self->priv->main_group, APP_LibraryToggle), GTK_IS_TOGGLE_ACTION (_tmp3_) ? ((GtkToggleAction*) _tmp3_) : NULL));
1195 #line 395 "lombard.vala"
1196 if (gtk_toggle_action_get_active (action) != MODEL_PROJECT (self->priv->project)->library_visible) {
1197 #line 396 "lombard.vala"
1198 gtk_toggle_action_set_active (action, MODEL_PROJECT (self->priv->project)->library_visible);
1199 #line 1137 "lombard.c"
1201 #line 399 "lombard.vala"
1202 action = (_tmp5_ = _g_object_ref0 ((_tmp4_ = gtk_action_group_get_action (self->priv->main_group, "Snap"), GTK_IS_TOGGLE_ACTION (_tmp4_) ? ((GtkToggleAction*) _tmp4_) : NULL)), _g_object_unref0 (action), _tmp5_);
1203 #line 400 "lombard.vala"
1204 if (gtk_toggle_action_get_active (action) != MODEL_PROJECT (self->priv->project)->snap_to_clip) {
1205 #line 401 "lombard.vala"
1206 gtk_toggle_action_set_active (action, MODEL_PROJECT (self->priv->project)->snap_to_clip);
1207 #line 1145 "lombard.c"
1209 #line 404 "lombard.vala"
1210 if (MODEL_PROJECT (self->priv->project)->library_visible) {
1211 #line 405 "lombard.vala"
1212 if (GTK_PANED (self->priv->h_pane)->child1 != GTK_WIDGET (self->priv->library_scrolled)) {
1213 #line 406 "lombard.vala"
1214 gtk_paned_add1 (GTK_PANED (self->priv->h_pane), GTK_WIDGET (self->priv->library_scrolled));
1215 #line 1153 "lombard.c"
1218 #line 409 "lombard.vala"
1219 if (GTK_PANED (self->priv->h_pane)->child1 == GTK_WIDGET (self->priv->library_scrolled)) {
1220 #line 410 "lombard.vala"
1221 gtk_container_remove (GTK_CONTAINER (self->priv->h_pane), GTK_WIDGET (self->priv->library_scrolled));
1222 #line 1160 "lombard.c"
1225 #line 414 "lombard.vala"
1226 if (gee_collection_get_size (GEE_COLLECTION (self->priv->load_errors)) > 0) {
1227 #line 1165 "lombard.c"
1229 #line 415 "lombard.vala"
1230 message = g_strdup ("");
1231 #line 1169 "lombard.c"
1234 _s_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->priv->load_errors));
1235 #line 416 "lombard.vala"
1237 #line 1175 "lombard.c"
1241 #line 416 "lombard.vala"
1242 if (!gee_iterator_next (_s_it)) {
1243 #line 416 "lombard.vala"
1245 #line 1183 "lombard.c"
1247 #line 416 "lombard.vala"
1248 s = (char*) gee_iterator_get (_s_it);
1249 #line 417 "lombard.vala"
1250 message = (_tmp7_ = g_strconcat (_tmp6_ = g_strconcat (message, s, NULL), "\n", NULL), _g_free0 (message), _tmp7_);
1251 #line 1189 "lombard.c"
1255 _g_object_unref0 (_s_it);
1257 #line 419 "lombard.vala"
1258 app_do_error_dialog ("An error occurred loading the project.", message);
1259 #line 1197 "lombard.c"
1262 #line 421 "lombard.vala"
1263 self->priv->loading = FALSE;
1264 #line 1202 "lombard.c"
1265 _g_object_unref0 (action);
1269 #line 424 "lombard.vala"
1270 static void app_on_library_size_allocate (App* self, GdkRectangle* rectangle) {
1271 #line 1209 "lombard.c"
1272 gboolean _tmp0_ = FALSE;
1273 #line 424 "lombard.vala"
1274 g_return_if_fail (IS_APP (self));
1275 #line 425 "lombard.vala"
1276 if (!self->priv->loading) {
1277 #line 425 "lombard.vala"
1278 _tmp0_ = GTK_PANED (self->priv->h_pane)->child1 == GTK_WIDGET (self->priv->library_scrolled);
1279 #line 1217 "lombard.c"
1281 #line 425 "lombard.vala"
1283 #line 1221 "lombard.c"
1285 #line 425 "lombard.vala"
1287 #line 426 "lombard.vala"
1288 MODEL_PROJECT (self->priv->project)->library_width = (*rectangle).width;
1289 #line 1227 "lombard.c"
1294 #line 432 "lombard.vala"
1295 void app_load_file (App* self, const char* name, ModelLibraryImporter* im) {
1296 #line 1234 "lombard.c"
1297 GError * _inner_error_;
1298 gboolean _tmp0_ = FALSE;
1301 #line 432 "lombard.vala"
1302 g_return_if_fail (IS_APP (self));
1303 #line 432 "lombard.vala"
1304 g_return_if_fail (name != NULL);
1305 #line 432 "lombard.vala"
1306 g_return_if_fail (MODEL_IS_LIBRARY_IMPORTER (im));
1307 #line 1245 "lombard.c"
1308 _inner_error_ = NULL;
1309 #line 433 "lombard.vala"
1310 if ((_tmp2_ = _vala_strcmp0 (_tmp1_ = get_file_extension (name), MODEL_PROJECT_LOMBARD_FILE_EXTENSION) == 0, _g_free0 (_tmp1_), _tmp2_)) {
1311 #line 433 "lombard.vala"
1313 #line 1251 "lombard.c"
1316 #line 434 "lombard.vala"
1317 _tmp0_ = _vala_strcmp0 (_tmp3_ = get_file_extension (name), MODEL_PROJECT_FILLMORE_FILE_EXTENSION) == 0;
1318 #line 1256 "lombard.c"
1321 #line 433 "lombard.vala"
1323 #line 435 "lombard.vala"
1324 app_load_project (self, name);
1325 #line 1263 "lombard.c"
1328 #line 438 "lombard.vala"
1329 model_library_importer_add_file (im, name, &_inner_error_);
1330 #line 1268 "lombard.c"
1331 if (_inner_error_ != NULL) {
1332 goto __catch3_g_error;
1340 _inner_error_ = NULL;
1342 #line 440 "lombard.vala"
1343 app_do_error_dialog ("Error loading file", e->message);
1344 #line 1282 "lombard.c"
1349 if (_inner_error_ != NULL) {
1350 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);
1351 g_clear_error (&_inner_error_);
1358 static void _g_slist_free_g_free (GSList* self) {
1359 g_slist_foreach (self, (GFunc) g_free, NULL);
1360 g_slist_free (self);
1364 #line 466 "lombard.vala"
1365 static void _app_on_importer_started_model_library_importer_started (ModelLibraryImporter* _sender, ModelClipImporter* i, gint num, gpointer self) {
1366 #line 1304 "lombard.c"
1367 app_on_importer_started (self, i, num);
1371 #line 445 "lombard.vala"
1372 static void app_on_open (App* self) {
1373 #line 1311 "lombard.c"
1374 GError * _inner_error_;
1378 GSList* _tmp0_ = NULL;
1379 #line 445 "lombard.vala"
1380 g_return_if_fail (IS_APP (self));
1381 #line 1319 "lombard.c"
1382 _inner_error_ = NULL;
1383 #line 446 "lombard.vala"
1384 gee_abstract_collection_clear (GEE_ABSTRACT_COLLECTION (self->priv->load_errors));
1385 #line 1323 "lombard.c"
1387 #line 448 "lombard.vala"
1388 if ((_tmp1_ = dialog_utils_open (GTK_WINDOW (self), APP_filters, G_N_ELEMENTS (APP_filters), TRUE, TRUE, &_tmp0_), filenames = (_tmp2_ = _tmp0_, __g_slist_free_g_free0 (filenames), _tmp2_), _tmp1_)) {
1389 #line 449 "lombard.vala"
1390 model_project_create_clip_importer (MODEL_PROJECT (self->priv->project), NULL, FALSE, (gint64) 0, FALSE, NULL, 0);
1391 #line 450 "lombard.vala"
1392 g_signal_connect_object (MODEL_PROJECT (self->priv->project)->importer, "started", (GCallback) _app_on_importer_started_model_library_importer_started, self, 0);
1393 #line 1331 "lombard.c"
1396 GSList* s_collection;
1398 #line 452 "lombard.vala"
1399 s_collection = filenames;
1400 #line 1338 "lombard.c"
1401 for (s_it = s_collection; s_it != NULL; s_it = s_it->next) {
1403 #line 452 "lombard.vala"
1404 s = g_strdup ((const char*) s_it->data);
1405 #line 1343 "lombard.c"
1412 #line 455 "lombard.vala"
1413 _tmp3_ = g_filename_from_uri (s, NULL, &_inner_error_);
1414 #line 1352 "lombard.c"
1415 if (_inner_error_ != NULL) {
1416 if (_inner_error_->domain == G_CONVERT_ERROR) {
1417 goto __catch5_g_convert_error;
1421 __g_slist_free_g_free0 (filenames);
1422 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);
1423 g_clear_error (&_inner_error_);
1426 #line 455 "lombard.vala"
1427 str = (_tmp4_ = _tmp3_, _g_free0 (str), _tmp4_);
1428 #line 1366 "lombard.c"
1431 __catch5_g_convert_error:
1435 _inner_error_ = NULL;
1438 #line 456 "lombard.vala"
1439 str = (_tmp5_ = g_strdup (s), _g_free0 (str), _tmp5_);
1440 #line 1378 "lombard.c"
1445 if (_inner_error_ != NULL) {
1448 goto __catch4_g_error;
1450 #line 457 "lombard.vala"
1451 app_load_file (self, str, MODEL_PROJECT (self->priv->project)->importer);
1452 #line 1390 "lombard.c"
1458 #line 459 "lombard.vala"
1459 model_library_importer_start (MODEL_PROJECT (self->priv->project)->importer, &_inner_error_);
1460 #line 1398 "lombard.c"
1461 if (_inner_error_ != NULL) {
1462 goto __catch4_g_error;
1470 _inner_error_ = NULL;
1472 #line 461 "lombard.vala"
1473 app_do_error_dialog ("Could not open file", e->message);
1474 #line 1412 "lombard.c"
1479 if (_inner_error_ != NULL) {
1480 __g_slist_free_g_free0 (filenames);
1481 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);
1482 g_clear_error (&_inner_error_);
1486 __g_slist_free_g_free0 (filenames);
1490 #line 466 "lombard.vala"
1491 static void app_on_importer_started (App* self, ModelClipImporter* i, gint num) {
1492 #line 1430 "lombard.c"
1493 MultiFileProgress* _tmp0_;
1494 #line 466 "lombard.vala"
1495 g_return_if_fail (IS_APP (self));
1496 #line 466 "lombard.vala"
1497 g_return_if_fail (MODEL_IS_CLIP_IMPORTER (i));
1498 #line 467 "lombard.vala"
1499 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_importer_started");
1500 #line 468 "lombard.vala"
1501 _tmp0_ = g_object_ref_sink (multi_file_progress_new (GTK_WINDOW (self), num, "Import", MULTI_FILE_PROGRESS_INTERFACE (i)));
1502 #line 1440 "lombard.c"
1503 _g_object_unref0 (_tmp0_);
1507 #line 471 "lombard.vala"
1508 static gboolean app_do_save_dialog (App* self) {
1509 #line 1447 "lombard.c"
1510 gboolean result = FALSE;
1512 gboolean create_directory;
1513 #line 471 "lombard.vala"
1514 g_return_val_if_fail (IS_APP (self), FALSE);
1515 #line 472 "lombard.vala"
1516 filename = model_project_get_project_file (MODEL_PROJECT (self->priv->project));
1517 #line 473 "lombard.vala"
1518 create_directory = filename == NULL;
1519 #line 474 "lombard.vala"
1520 if (dialog_utils_save (GTK_WINDOW (self), "Save Project", create_directory, APP_filters, G_N_ELEMENTS (APP_filters), &filename)) {
1521 #line 475 "lombard.vala"
1522 model_project_save (MODEL_PROJECT (self->priv->project), filename);
1523 #line 1461 "lombard.c"
1525 _g_free0 (filename);
1526 #line 476 "lombard.vala"
1528 #line 1466 "lombard.c"
1531 _g_free0 (filename);
1532 #line 478 "lombard.vala"
1534 #line 1472 "lombard.c"
1538 #line 481 "lombard.vala"
1539 static void app_on_save_as (App* self) {
1540 #line 481 "lombard.vala"
1541 g_return_if_fail (IS_APP (self));
1542 #line 482 "lombard.vala"
1543 app_do_save_dialog (self);
1544 #line 1482 "lombard.c"
1548 #line 485 "lombard.vala"
1549 static void app_on_save (App* self) {
1550 #line 485 "lombard.vala"
1551 g_return_if_fail (IS_APP (self));
1552 #line 486 "lombard.vala"
1554 #line 1492 "lombard.c"
1558 #line 489 "lombard.vala"
1559 static gboolean app_do_save (App* self) {
1560 #line 1498 "lombard.c"
1561 gboolean result = FALSE;
1564 #line 489 "lombard.vala"
1565 g_return_val_if_fail (IS_APP (self), FALSE);
1566 #line 490 "lombard.vala"
1567 if ((_tmp1_ = (_tmp0_ = model_project_get_project_file (MODEL_PROJECT (self->priv->project))) != NULL, _g_free0 (_tmp0_), _tmp1_)) {
1568 #line 491 "lombard.vala"
1569 model_project_save (MODEL_PROJECT (self->priv->project), NULL);
1570 #line 1508 "lombard.c"
1572 #line 492 "lombard.vala"
1574 #line 1512 "lombard.c"
1576 result = app_do_save_dialog (self);
1577 #line 494 "lombard.vala"
1579 #line 1517 "lombard.c"
1583 #line 497 "lombard.vala"
1584 void app_load_project (App* self, const char* filename) {
1585 #line 1523 "lombard.c"
1586 GError * _inner_error_;
1587 #line 497 "lombard.vala"
1588 g_return_if_fail (IS_APP (self));
1589 #line 497 "lombard.vala"
1590 g_return_if_fail (filename != NULL);
1591 #line 1529 "lombard.c"
1592 _inner_error_ = NULL;
1593 #line 498 "lombard.vala"
1594 self->priv->loading = TRUE;
1595 #line 1533 "lombard.c"
1597 ViewVideoOutput* _tmp0_;
1598 ViewVideoOutput* _tmp1_;
1599 #line 501 "lombard.vala"
1600 view_media_engine_disconnect_output (MODEL_PROJECT (self->priv->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->video_output));
1601 #line 502 "lombard.vala"
1602 _tmp0_ = view_video_output_new (GTK_WIDGET (self->priv->drawing_area), &_inner_error_);
1603 #line 1541 "lombard.c"
1604 if (_inner_error_ != NULL) {
1605 goto __catch6_g_error;
1607 #line 502 "lombard.vala"
1608 self->priv->video_output = (_tmp1_ = _tmp0_, _g_object_unref0 (self->priv->video_output), _tmp1_);
1609 #line 503 "lombard.vala"
1610 view_media_engine_connect_output (MODEL_PROJECT (self->priv->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->video_output));
1611 #line 1549 "lombard.c"
1618 _inner_error_ = NULL;
1620 #line 505 "lombard.vala"
1621 app_do_error_dialog ("Could not create video output", e->message);
1622 #line 1560 "lombard.c"
1627 if (_inner_error_ != NULL) {
1628 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);
1629 g_clear_error (&_inner_error_);
1632 #line 508 "lombard.vala"
1633 model_project_load (MODEL_PROJECT (self->priv->project), filename);
1634 #line 1572 "lombard.c"
1638 #line 514 "lombard.vala"
1639 static void app_scroll_toward_center (App* self, gint xpos) {
1640 #line 1578 "lombard.c"
1647 #line 514 "lombard.vala"
1648 g_return_if_fail (IS_APP (self));
1649 #line 515 "lombard.vala"
1650 cursor_pos = xpos - ((gint) gtk_adjustment_get_value (self->priv->h_adjustment));
1651 #line 520 "lombard.vala"
1652 page_size = (gint) gtk_adjustment_get_page_size (self->priv->h_adjustment);
1653 #line 521 "lombard.vala"
1654 diff = (page_size / 2) - cursor_pos;
1655 #line 522 "lombard.vala"
1656 d = sign (diff) * ((gint) sqrt ((double) abs (diff)));
1657 #line 523 "lombard.vala"
1658 cursor_pos = cursor_pos + d;
1659 #line 525 "lombard.vala"
1660 x = MAX (0, xpos - cursor_pos);
1661 #line 526 "lombard.vala"
1662 max_value = (gint) (gtk_adjustment_get_upper (self->priv->h_adjustment) - GTK_WIDGET (self->priv->timeline_scrolled)->allocation.width);
1663 #line 527 "lombard.vala"
1664 if (x > max_value) {
1665 #line 528 "lombard.vala"
1667 #line 1605 "lombard.c"
1669 #line 530 "lombard.vala"
1670 gtk_adjustment_set_value (self->priv->h_adjustment, (double) x);
1671 #line 532 "lombard.vala"
1672 gtk_adjustment_set_value (self->priv->h_adjustment, (double) x);
1673 #line 1611 "lombard.c"
1677 #line 535 "lombard.vala"
1678 void app_on_split_at_playhead (App* self) {
1679 #line 535 "lombard.vala"
1680 g_return_if_fail (IS_APP (self));
1681 #line 536 "lombard.vala"
1682 model_project_split_at_playhead (MODEL_PROJECT (self->priv->project));
1683 #line 1621 "lombard.c"
1687 #line 539 "lombard.vala"
1688 void app_on_trim_to_playhead (App* self) {
1689 #line 539 "lombard.vala"
1690 g_return_if_fail (IS_APP (self));
1691 #line 540 "lombard.vala"
1692 model_project_trim_to_playhead (MODEL_PROJECT (self->priv->project));
1693 #line 1631 "lombard.c"
1697 static Fraction* _fraction_dup (Fraction* self) {
1699 dup = g_new0 (Fraction, 1);
1700 memcpy (dup, self, sizeof (Fraction));
1705 static gpointer __fraction_dup0 (gpointer self) {
1706 return self ? _fraction_dup (self) : NULL;
1710 #line 543 "lombard.vala"
1711 void app_on_clip_properties (App* self) {
1712 #line 1650 "lombard.c"
1713 Fraction* frames_per_second;
1715 Fraction _tmp0_ = {0};
1716 #line 543 "lombard.vala"
1717 g_return_if_fail (IS_APP (self));
1718 #line 544 "lombard.vala"
1719 frames_per_second = NULL;
1720 #line 545 "lombard.vala"
1721 model_video_project_get_framerate_fraction (self->priv->project, &_tmp0_);
1722 #line 545 "lombard.vala"
1723 frames_per_second = (_tmp1_ = __fraction_dup0 (&_tmp0_), _g_free0 (frames_per_second), _tmp1_);
1724 #line 546 "lombard.vala"
1725 if (clip_library_view_has_selection (self->priv->library)) {
1726 #line 1664 "lombard.c"
1727 GeeArrayList* files;
1728 #line 547 "lombard.vala"
1729 files = clip_library_view_get_selected_files (self->priv->library);
1730 #line 548 "lombard.vala"
1731 if (gee_collection_get_size (GEE_COLLECTION (files)) == 1) {
1732 #line 1670 "lombard.c"
1734 ModelClipFile* clip_file;
1735 #line 549 "lombard.vala"
1736 file_name = (char*) gee_abstract_list_get (GEE_ABSTRACT_LIST (files), 0);
1737 #line 550 "lombard.vala"
1738 clip_file = model_project_find_clipfile (MODEL_PROJECT (self->priv->project), file_name);
1739 #line 551 "lombard.vala"
1740 dialog_utils_show_clip_properties (GTK_WINDOW (self), NULL, clip_file, frames_per_second);
1741 #line 1679 "lombard.c"
1742 _g_free0 (file_name);
1743 _g_object_unref0 (clip_file);
1745 _g_object_unref0 (files);
1747 GeeArrayList* clips;
1748 #line 554 "lombard.vala"
1749 clips = _g_object_ref0 (self->priv->timeline->selected_clips);
1750 #line 555 "lombard.vala"
1751 if (gee_collection_get_size (GEE_COLLECTION (clips)) == 1) {
1752 #line 1690 "lombard.c"
1753 ClipView* clip_view;
1754 #line 556 "lombard.vala"
1755 clip_view = (ClipView*) gee_abstract_list_get (GEE_ABSTRACT_LIST (clips), 0);
1756 #line 557 "lombard.vala"
1757 dialog_utils_show_clip_properties (GTK_WINDOW (self), clip_view, NULL, frames_per_second);
1758 #line 1696 "lombard.c"
1759 _g_object_unref0 (clip_view);
1761 _g_object_unref0 (clips);
1763 _g_free0 (frames_per_second);
1767 #line 562 "lombard.vala"
1768 void app_on_position_changed (App* self) {
1769 #line 562 "lombard.vala"
1770 g_return_if_fail (IS_APP (self));
1771 #line 563 "lombard.vala"
1772 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_position_changed");
1773 #line 564 "lombard.vala"
1774 app_update_menu (self);
1775 #line 1713 "lombard.c"
1779 #line 567 "lombard.vala"
1780 static void app_on_callback_pulse (App* self) {
1781 #line 567 "lombard.vala"
1782 g_return_if_fail (IS_APP (self));
1783 #line 568 "lombard.vala"
1784 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_callback_pulse");
1785 #line 569 "lombard.vala"
1786 if (model_project_transport_is_playing (MODEL_PROJECT (self->priv->project))) {
1787 #line 570 "lombard.vala"
1788 app_scroll_toward_center (self, model_time_system_time_to_xpos (MODEL_TIME_SYSTEM (self->priv->project->time_provider), MODEL_PROJECT (self->priv->project)->media_engine->position));
1789 #line 1727 "lombard.c"
1791 #line 572 "lombard.vala"
1792 gtk_widget_queue_draw (GTK_WIDGET (self->priv->timeline));
1793 #line 1731 "lombard.c"
1797 #line 575 "lombard.vala"
1798 void app_on_track_changed (App* self) {
1799 #line 575 "lombard.vala"
1800 g_return_if_fail (IS_APP (self));
1801 #line 576 "lombard.vala"
1802 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_track_changed");
1803 #line 577 "lombard.vala"
1804 app_update_menu (self);
1805 #line 1743 "lombard.c"
1809 #line 580 "lombard.vala"
1810 static void app_update_menu (App* self) {
1811 #line 1749 "lombard.c"
1812 gboolean library_selected;
1813 gboolean clip_selected;
1815 gboolean clip_is_trimmed;
1816 gboolean playhead_on_clip;
1817 gboolean dir = FALSE;
1819 gboolean one_selected;
1820 gboolean _tmp1_ = FALSE;
1821 gboolean _tmp2_ = FALSE;
1822 gboolean _tmp4_ = FALSE;
1823 gboolean _tmp5_ = FALSE;
1824 gboolean _tmp6_ = FALSE;
1825 gboolean _tmp7_ = FALSE;
1826 gboolean _tmp8_ = FALSE;
1827 #line 580 "lombard.vala"
1828 g_return_if_fail (IS_APP (self));
1829 #line 581 "lombard.vala"
1830 library_selected = clip_library_view_has_selection (self->priv->library);
1831 #line 582 "lombard.vala"
1832 clip_selected = time_line_is_clip_selected (self->priv->timeline);
1833 #line 583 "lombard.vala"
1834 stopped = transport_delegate_is_stopped (TRANSPORT_DELEGATE (self));
1835 #line 584 "lombard.vala"
1836 clip_is_trimmed = FALSE;
1837 #line 585 "lombard.vala"
1838 playhead_on_clip = model_project_playhead_on_clip (MODEL_PROJECT (self->priv->project));
1839 #line 587 "lombard.vala"
1840 can_trim = model_project_can_trim (MODEL_PROJECT (self->priv->project), &dir);
1841 #line 588 "lombard.vala"
1842 one_selected = FALSE;
1843 #line 589 "lombard.vala"
1844 if (library_selected) {
1845 #line 1783 "lombard.c"
1846 GeeArrayList* _tmp0_;
1847 #line 590 "lombard.vala"
1848 one_selected = gee_collection_get_size (GEE_COLLECTION (_tmp0_ = clip_library_view_get_selected_files (self->priv->library))) == 1;
1849 #line 1787 "lombard.c"
1850 _g_object_unref0 (_tmp0_);
1852 #line 591 "lombard.vala"
1853 if (clip_selected) {
1854 #line 592 "lombard.vala"
1855 one_selected = gee_collection_get_size (GEE_COLLECTION (self->priv->timeline->selected_clips)) == 1;
1856 #line 1794 "lombard.c"
1859 #line 595 "lombard.vala"
1860 if (clip_selected) {
1861 #line 1799 "lombard.c"
1863 GeeIterator* _clip_view_it;
1864 _clip_view_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->priv->timeline->selected_clips));
1865 #line 596 "lombard.vala"
1867 #line 1805 "lombard.c"
1868 ClipView* clip_view;
1869 #line 596 "lombard.vala"
1870 if (!gee_iterator_next (_clip_view_it)) {
1871 #line 596 "lombard.vala"
1873 #line 1811 "lombard.c"
1875 #line 596 "lombard.vala"
1876 clip_view = (ClipView*) gee_iterator_get (_clip_view_it);
1877 #line 597 "lombard.vala"
1878 clip_is_trimmed = model_clip_is_trimmed (clip_view->clip);
1879 #line 598 "lombard.vala"
1880 if (clip_is_trimmed) {
1881 #line 1819 "lombard.c"
1882 _g_object_unref0 (clip_view);
1883 #line 599 "lombard.vala"
1885 #line 1823 "lombard.c"
1887 _g_object_unref0 (clip_view);
1889 _g_object_unref0 (_clip_view_it);
1892 #line 604 "lombard.vala"
1893 app_set_sensitive_group (self, self->priv->main_group, "Open", stopped);
1894 #line 605 "lombard.vala"
1895 app_set_sensitive_group (self, self->priv->main_group, "Save", stopped);
1896 #line 606 "lombard.vala"
1897 app_set_sensitive_group (self, self->priv->main_group, "SaveAs", stopped);
1898 #line 607 "lombard.vala"
1899 app_set_sensitive_group (self, self->priv->main_group, "Export", model_project_can_export (MODEL_PROJECT (self->priv->project)));
1900 #line 610 "lombard.vala"
1902 #line 610 "lombard.vala"
1903 _tmp1_ = model_undo_manager_get_can_undo (MODEL_PROJECT (self->priv->project)->undo_manager);
1904 #line 1842 "lombard.c"
1906 #line 610 "lombard.vala"
1908 #line 1846 "lombard.c"
1910 #line 610 "lombard.vala"
1911 app_set_sensitive_group (self, self->priv->main_group, "Undo", _tmp1_);
1912 #line 611 "lombard.vala"
1914 #line 1852 "lombard.c"
1915 gboolean _tmp3_ = FALSE;
1916 #line 611 "lombard.vala"
1917 if (clip_selected) {
1918 #line 611 "lombard.vala"
1920 #line 1858 "lombard.c"
1922 #line 611 "lombard.vala"
1923 _tmp3_ = library_selected;
1924 #line 1862 "lombard.c"
1926 #line 611 "lombard.vala"
1928 #line 1866 "lombard.c"
1930 #line 611 "lombard.vala"
1932 #line 1870 "lombard.c"
1934 #line 611 "lombard.vala"
1935 app_set_sensitive_group (self, self->priv->main_group, "Delete", _tmp2_);
1936 #line 612 "lombard.vala"
1938 #line 612 "lombard.vala"
1939 _tmp4_ = clip_selected;
1940 #line 1878 "lombard.c"
1942 #line 612 "lombard.vala"
1944 #line 1882 "lombard.c"
1946 #line 612 "lombard.vala"
1947 app_set_sensitive_group (self, self->priv->main_group, "Cut", _tmp4_);
1948 #line 613 "lombard.vala"
1950 #line 613 "lombard.vala"
1951 _tmp5_ = clip_selected;
1952 #line 1890 "lombard.c"
1954 #line 613 "lombard.vala"
1956 #line 1894 "lombard.c"
1958 #line 613 "lombard.vala"
1959 app_set_sensitive_group (self, self->priv->main_group, "Copy", _tmp5_);
1960 #line 614 "lombard.vala"
1962 #line 614 "lombard.vala"
1963 _tmp6_ = gee_collection_get_size (GEE_COLLECTION (self->priv->timeline->clipboard->clips)) > 0;
1964 #line 1902 "lombard.c"
1966 #line 614 "lombard.vala"
1968 #line 1906 "lombard.c"
1970 #line 614 "lombard.vala"
1971 app_set_sensitive_group (self, self->priv->main_group, "Paste", _tmp6_);
1972 #line 615 "lombard.vala"
1973 app_set_sensitive_group (self, self->priv->main_group, "ClipProperties", one_selected);
1974 #line 617 "lombard.vala"
1976 #line 617 "lombard.vala"
1977 _tmp7_ = playhead_on_clip;
1978 #line 1916 "lombard.c"
1980 #line 617 "lombard.vala"
1982 #line 1920 "lombard.c"
1984 #line 617 "lombard.vala"
1985 app_set_sensitive_group (self, self->priv->main_group, "SplitAtPlayhead", _tmp7_);
1986 #line 618 "lombard.vala"
1988 #line 618 "lombard.vala"
1990 #line 1928 "lombard.c"
1992 #line 618 "lombard.vala"
1994 #line 1932 "lombard.c"
1996 #line 618 "lombard.vala"
1997 app_set_sensitive_group (self, self->priv->main_group, "TrimToPlayhead", _tmp8_);
1998 #line 621 "lombard.vala"
1999 app_set_sensitive_group (self, self->priv->main_group, "ZoomProject", model_project_get_length (MODEL_PROJECT (self->priv->project)) != 0);
2000 #line 1938 "lombard.c"
2004 #line 625 "lombard.vala"
2005 void app_on_timeline_selection_changed (App* self, gboolean selected) {
2006 #line 625 "lombard.vala"
2007 g_return_if_fail (IS_APP (self));
2008 #line 626 "lombard.vala"
2009 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_timeline_selection_changed");
2010 #line 627 "lombard.vala"
2012 #line 628 "lombard.vala"
2013 clip_library_view_unselect_all (self->priv->library);
2014 #line 1952 "lombard.c"
2016 #line 629 "lombard.vala"
2017 app_update_menu (self);
2018 #line 1956 "lombard.c"
2022 #line 632 "lombard.vala"
2023 void app_on_library_selection_changed (App* self, gboolean selected) {
2024 #line 632 "lombard.vala"
2025 g_return_if_fail (IS_APP (self));
2026 #line 633 "lombard.vala"
2027 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_library_selection_changed");
2028 #line 634 "lombard.vala"
2030 #line 635 "lombard.vala"
2031 time_line_deselect_all_clips (self->priv->timeline);
2032 #line 636 "lombard.vala"
2033 gtk_widget_queue_draw (GTK_WIDGET (self->priv->timeline));
2034 #line 1972 "lombard.c"
2036 #line 638 "lombard.vala"
2037 app_update_menu (self);
2038 #line 1976 "lombard.c"
2042 #line 643 "lombard.vala"
2043 static gboolean app_real_key_press_event (GtkWidget* base, GdkEventKey* event) {
2044 #line 1982 "lombard.c"
2046 gboolean result = FALSE;
2048 #line 644 "lombard.vala"
2049 switch ((*event).keyval) {
2050 #line 1988 "lombard.c"
2054 #line 647 "lombard.vala"
2055 if (((*event).state & GDK_SHIFT_ALT_CONTROL_MASK) != 0) {
2056 #line 1994 "lombard.c"
2057 result = GTK_WIDGET_CLASS (app_parent_class)->key_press_event (GTK_WIDGET (GTK_WINDOW (self)), event);
2058 #line 648 "lombard.vala"
2060 #line 1998 "lombard.c"
2062 #line 649 "lombard.vala"
2063 app_on_go_start (self);
2064 #line 650 "lombard.vala"
2066 #line 2004 "lombard.c"
2070 #line 652 "lombard.vala"
2071 if (((*event).state & GDK_CONTROL_MASK) != 0) {
2072 #line 653 "lombard.vala"
2073 model_project_go_previous (MODEL_PROJECT (self->priv->project));
2074 #line 2012 "lombard.c"
2076 #line 655 "lombard.vala"
2077 model_video_project_go_previous_frame (self->priv->project);
2078 #line 2016 "lombard.c"
2080 #line 657 "lombard.vala"
2082 #line 2020 "lombard.c"
2086 #line 659 "lombard.vala"
2087 if (((*event).state & GDK_CONTROL_MASK) != 0) {
2088 #line 660 "lombard.vala"
2089 model_project_go_next (MODEL_PROJECT (self->priv->project));
2090 #line 2028 "lombard.c"
2092 #line 662 "lombard.vala"
2093 model_video_project_go_next_frame (self->priv->project);
2094 #line 2032 "lombard.c"
2096 #line 664 "lombard.vala"
2098 #line 2036 "lombard.c"
2104 #line 668 "lombard.vala"
2105 app_on_zoom_in (self);
2106 #line 669 "lombard.vala"
2108 #line 2046 "lombard.c"
2110 case GDK_KP_Subtract:
2112 case GDK_underscore:
2114 #line 673 "lombard.vala"
2115 app_on_zoom_out (self);
2116 #line 674 "lombard.vala"
2118 #line 2056 "lombard.c"
2122 result = GTK_WIDGET_CLASS (app_parent_class)->key_press_event (GTK_WIDGET (GTK_WINDOW (self)), event);
2123 #line 676 "lombard.vala"
2125 #line 2063 "lombard.c"
2129 #line 678 "lombard.vala"
2131 #line 2069 "lombard.c"
2135 #line 681 "lombard.vala"
2136 static void app_on_snap (App* self) {
2137 #line 681 "lombard.vala"
2138 g_return_if_fail (IS_APP (self));
2139 #line 682 "lombard.vala"
2140 MODEL_PROJECT (self->priv->project)->snap_to_clip = !MODEL_PROJECT (self->priv->project)->snap_to_clip;
2141 #line 2079 "lombard.c"
2145 #line 685 "lombard.vala"
2146 static void app_on_view_library (App* self) {
2147 #line 2085 "lombard.c"
2149 GtkToggleAction* action;
2150 #line 685 "lombard.vala"
2151 g_return_if_fail (IS_APP (self));
2152 #line 686 "lombard.vala"
2153 action = _g_object_ref0 ((_tmp0_ = gtk_action_group_get_action (self->priv->main_group, APP_LibraryToggle), GTK_IS_TOGGLE_ACTION (_tmp0_) ? ((GtkToggleAction*) _tmp0_) : NULL));
2154 #line 687 "lombard.vala"
2155 app_toggle_library (self, gtk_toggle_action_get_active (action));
2156 #line 2094 "lombard.c"
2157 _g_object_unref0 (action);
2161 #line 690 "lombard.vala"
2162 static gint64 app_get_zoom_center_time (App* self) {
2163 #line 2101 "lombard.c"
2164 gint64 result = 0LL;
2165 #line 690 "lombard.vala"
2166 g_return_val_if_fail (IS_APP (self), 0LL);
2167 #line 2105 "lombard.c"
2168 result = model_project_transport_get_position (MODEL_PROJECT (self->priv->project));
2169 #line 691 "lombard.vala"
2171 #line 2109 "lombard.c"
2175 #line 694 "lombard.vala"
2176 static void app_do_zoom (App* self, float increment) {
2177 #line 694 "lombard.vala"
2178 g_return_if_fail (IS_APP (self));
2179 #line 695 "lombard.vala"
2180 self->priv->center_time = app_get_zoom_center_time (self);
2181 #line 696 "lombard.vala"
2182 time_line_zoom (self->priv->timeline, increment);
2183 #line 2121 "lombard.c"
2187 #line 699 "lombard.vala"
2188 static void app_on_zoom_in (App* self) {
2189 #line 699 "lombard.vala"
2190 g_return_if_fail (IS_APP (self));
2191 #line 700 "lombard.vala"
2192 app_do_zoom (self, 0.1f);
2193 #line 2131 "lombard.c"
2197 #line 703 "lombard.vala"
2198 static void app_on_zoom_out (App* self) {
2199 #line 703 "lombard.vala"
2200 g_return_if_fail (IS_APP (self));
2201 #line 704 "lombard.vala"
2202 app_do_zoom (self, -0.1f);
2203 #line 2141 "lombard.c"
2207 #line 707 "lombard.vala"
2208 static void app_on_zoom_to_project (App* self) {
2209 #line 707 "lombard.vala"
2210 g_return_if_fail (IS_APP (self));
2211 #line 708 "lombard.vala"
2212 time_line_zoom_to_project (self->priv->timeline, gtk_adjustment_get_page_size (self->priv->h_adjustment));
2213 #line 2151 "lombard.c"
2217 #line 711 "lombard.vala"
2218 static void app_on_timeline_size_allocate (App* self, GdkRectangle* rectangle) {
2219 #line 711 "lombard.vala"
2220 g_return_if_fail (IS_APP (self));
2221 #line 712 "lombard.vala"
2222 if (self->priv->center_time != (-1)) {
2223 #line 2161 "lombard.c"
2224 gint new_center_pixel;
2226 #line 713 "lombard.vala"
2227 new_center_pixel = model_time_system_time_to_xpos (MODEL_TIME_SYSTEM (self->priv->project->time_provider), self->priv->center_time);
2228 #line 714 "lombard.vala"
2229 page_size = (gint) (gtk_adjustment_get_page_size (self->priv->h_adjustment) / 2);
2230 #line 715 "lombard.vala"
2231 gtk_adjustment_clamp_page (self->priv->h_adjustment, (double) (new_center_pixel - page_size), (double) (new_center_pixel + page_size));
2232 #line 716 "lombard.vala"
2233 self->priv->center_time = (gint64) (-1);
2234 #line 2172 "lombard.c"
2239 #line 720 "lombard.vala"
2240 static void app_set_sensitive_group (App* self, GtkActionGroup* group, const char* group_path, gboolean sensitive) {
2241 #line 2179 "lombard.c"
2243 #line 720 "lombard.vala"
2244 g_return_if_fail (IS_APP (self));
2245 #line 720 "lombard.vala"
2246 g_return_if_fail (GTK_IS_ACTION_GROUP (group));
2247 #line 720 "lombard.vala"
2248 g_return_if_fail (group_path != NULL);
2249 #line 721 "lombard.vala"
2250 action = _g_object_ref0 (gtk_action_group_get_action (group, group_path));
2251 #line 722 "lombard.vala"
2252 gtk_action_set_sensitive (action, sensitive);
2253 #line 2191 "lombard.c"
2254 _g_object_unref0 (action);
2258 #line 727 "lombard.vala"
2259 static void app_on_play_pause (App* self) {
2260 #line 727 "lombard.vala"
2261 g_return_if_fail (IS_APP (self));
2262 #line 728 "lombard.vala"
2263 if (model_project_transport_is_playing (MODEL_PROJECT (self->priv->project))) {
2264 #line 729 "lombard.vala"
2265 view_media_engine_pause (MODEL_PROJECT (self->priv->project)->media_engine);
2266 #line 2204 "lombard.c"
2268 #line 735 "lombard.vala"
2269 view_media_engine_do_play (MODEL_PROJECT (self->priv->project)->media_engine, PLAY_STATE_PLAYING);
2270 #line 2208 "lombard.c"
2275 #line 739 "lombard.vala"
2276 static void app_on_export (App* self) {
2277 #line 2215 "lombard.c"
2278 GError * _inner_error_;
2280 #line 739 "lombard.vala"
2281 g_return_if_fail (IS_APP (self));
2282 #line 2220 "lombard.c"
2283 _inner_error_ = NULL;
2284 #line 740 "lombard.vala"
2286 #line 741 "lombard.vala"
2287 if (dialog_utils_save (GTK_WINDOW (self), "Export", FALSE, APP_export_filters, G_N_ELEMENTS (APP_export_filters), &filename)) {
2288 #line 2226 "lombard.c"
2289 MultiFileProgress* _tmp0_;
2290 #line 742 "lombard.vala"
2291 _tmp0_ = g_object_ref_sink (multi_file_progress_new (GTK_WINDOW (self), 1, "Export", MULTI_FILE_PROGRESS_INTERFACE (MODEL_PROJECT (self->priv->project)->media_engine)));
2292 #line 2230 "lombard.c"
2293 _g_object_unref0 (_tmp0_);
2294 #line 743 "lombard.vala"
2295 view_media_engine_disconnect_output (MODEL_PROJECT (self->priv->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->audio_output));
2296 #line 744 "lombard.vala"
2297 view_media_engine_disconnect_output (MODEL_PROJECT (self->priv->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->video_output));
2298 #line 2236 "lombard.c"
2301 ViewOggVorbisExport* _tmp2_;
2302 ViewOggVorbisExport* _tmp3_;
2303 ViewOggVorbisExport* _tmp4_;
2304 #line 746 "lombard.vala"
2305 _tmp3_ = (_tmp2_ = view_ogg_vorbis_export_new (VIEW_MEDIA_CONNECTOR_MEDIA_TYPES_Audio | VIEW_MEDIA_CONNECTOR_MEDIA_TYPES_Video, filename, _tmp1_ = view_media_engine_get_project_audio_export_caps (MODEL_PROJECT (self->priv->project)->media_engine), &_inner_error_), _gst_caps_unref0 (_tmp1_), _tmp2_);
2306 #line 2244 "lombard.c"
2307 if (_inner_error_ != NULL) {
2308 goto __catch7_g_error;
2310 #line 746 "lombard.vala"
2311 self->priv->export_connector = (_tmp4_ = _tmp3_, _g_object_unref0 (self->priv->export_connector), _tmp4_);
2312 #line 749 "lombard.vala"
2313 view_media_engine_connect_output (MODEL_PROJECT (self->priv->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->export_connector));
2314 #line 750 "lombard.vala"
2315 view_media_engine_start_export (MODEL_PROJECT (self->priv->project)->media_engine, filename);
2316 #line 2254 "lombard.c"
2323 _inner_error_ = NULL;
2325 #line 752 "lombard.vala"
2326 app_do_error_dialog ("Could not export file", e->message);
2327 #line 2265 "lombard.c"
2332 if (_inner_error_ != NULL) {
2333 _g_free0 (filename);
2334 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);
2335 g_clear_error (&_inner_error_);
2339 _g_free0 (filename);
2343 #line 757 "lombard.vala"
2344 static void app_on_post_export (App* self, gboolean canceled) {
2345 #line 2283 "lombard.c"
2346 ViewOggVorbisExport* _tmp1_;
2347 #line 757 "lombard.vala"
2348 g_return_if_fail (IS_APP (self));
2349 #line 758 "lombard.vala"
2350 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_post_export");
2351 #line 759 "lombard.vala"
2352 view_media_engine_disconnect_output (MODEL_PROJECT (self->priv->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->export_connector));
2353 #line 760 "lombard.vala"
2354 view_media_engine_connect_output (MODEL_PROJECT (self->priv->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->audio_output));
2355 #line 761 "lombard.vala"
2356 view_media_engine_connect_output (MODEL_PROJECT (self->priv->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->video_output));
2357 #line 762 "lombard.vala"
2359 #line 2297 "lombard.c"
2361 #line 763 "lombard.vala"
2362 g_remove (_tmp0_ = view_ogg_vorbis_export_get_filename (self->priv->export_connector));
2363 #line 2301 "lombard.c"
2366 #line 765 "lombard.vala"
2367 self->priv->export_connector = (_tmp1_ = NULL, _g_object_unref0 (self->priv->export_connector), _tmp1_);
2368 #line 2306 "lombard.c"
2372 #line 770 "lombard.vala"
2373 static void app_on_undo (App* self) {
2374 #line 770 "lombard.vala"
2375 g_return_if_fail (IS_APP (self));
2376 #line 771 "lombard.vala"
2377 model_project_undo (MODEL_PROJECT (self->priv->project));
2378 #line 2316 "lombard.c"
2382 #line 774 "lombard.vala"
2383 static void app_on_delete (App* self) {
2384 #line 774 "lombard.vala"
2385 g_return_if_fail (IS_APP (self));
2386 #line 775 "lombard.vala"
2387 if (clip_library_view_has_selection (self->priv->library)) {
2388 #line 776 "lombard.vala"
2389 clip_library_view_delete_selection (self->priv->library);
2390 #line 2328 "lombard.c"
2392 #line 778 "lombard.vala"
2393 time_line_delete_selection (self->priv->timeline);
2394 #line 2332 "lombard.c"
2399 #line 781 "lombard.vala"
2400 static void app_on_cut (App* self) {
2401 #line 781 "lombard.vala"
2402 g_return_if_fail (IS_APP (self));
2403 #line 782 "lombard.vala"
2404 time_line_do_cut (self->priv->timeline);
2405 #line 2343 "lombard.c"
2409 #line 785 "lombard.vala"
2410 static void app_on_copy (App* self) {
2411 #line 785 "lombard.vala"
2412 g_return_if_fail (IS_APP (self));
2413 #line 786 "lombard.vala"
2414 time_line_do_copy (self->priv->timeline);
2415 #line 2353 "lombard.c"
2419 #line 789 "lombard.vala"
2420 static void app_on_paste (App* self) {
2421 #line 789 "lombard.vala"
2422 g_return_if_fail (IS_APP (self));
2423 #line 790 "lombard.vala"
2424 time_line_paste (self->priv->timeline);
2425 #line 2363 "lombard.c"
2429 #line 793 "lombard.vala"
2430 static void app_on_playstate_changed (App* self, PlayState playstate) {
2431 #line 793 "lombard.vala"
2432 g_return_if_fail (IS_APP (self));
2433 #line 794 "lombard.vala"
2434 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_playstate_changed");
2435 #line 795 "lombard.vala"
2436 if (playstate == PLAY_STATE_STOPPED) {
2437 #line 796 "lombard.vala"
2438 app_update_menu (self);
2439 #line 2377 "lombard.c"
2444 #line 800 "lombard.vala"
2445 static void app_on_undo_changed (App* self, gboolean can_undo) {
2446 #line 2384 "lombard.c"
2448 gboolean _tmp0_ = FALSE;
2449 #line 800 "lombard.vala"
2450 g_return_if_fail (IS_APP (self));
2451 #line 801 "lombard.vala"
2452 logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_undo_changed");
2453 #line 802 "lombard.vala"
2454 undo = GTK_MENU_ITEM (get_widget (self->priv->manager, "/MenuBar/EditMenu/EditUndo"));
2455 #line 803 "lombard.vala"
2456 g_assert (undo != NULL);
2457 #line 805 "lombard.vala"
2458 if (transport_delegate_is_stopped (TRANSPORT_DELEGATE (self))) {
2459 #line 805 "lombard.vala"
2460 _tmp0_ = model_undo_manager_get_can_undo (MODEL_PROJECT (self->priv->project)->undo_manager);
2461 #line 2399 "lombard.c"
2463 #line 805 "lombard.vala"
2465 #line 2403 "lombard.c"
2467 #line 805 "lombard.vala"
2468 app_set_sensitive_group (self, self->priv->main_group, "Undo", _tmp0_);
2469 #line 2407 "lombard.c"
2470 _g_object_unref0 (undo);
2474 #line 808 "lombard.vala"
2475 static void app_on_select_all (App* self) {
2476 #line 808 "lombard.vala"
2477 g_return_if_fail (IS_APP (self));
2478 #line 809 "lombard.vala"
2479 if (clip_library_view_has_selection (self->priv->library)) {
2480 #line 810 "lombard.vala"
2481 clip_library_view_select_all (self->priv->library);
2482 #line 2420 "lombard.c"
2484 #line 812 "lombard.vala"
2485 time_line_select_all (self->priv->timeline);
2486 #line 2424 "lombard.c"
2491 #line 818 "lombard.vala"
2492 static void app_on_go_start (App* self) {
2493 #line 818 "lombard.vala"
2494 g_return_if_fail (IS_APP (self));
2495 #line 818 "lombard.vala"
2496 model_project_go_start (MODEL_PROJECT (self->priv->project));
2497 #line 2435 "lombard.c"
2501 #line 820 "lombard.vala"
2502 static void app_on_go_end (App* self) {
2503 #line 820 "lombard.vala"
2504 g_return_if_fail (IS_APP (self));
2505 #line 820 "lombard.vala"
2506 model_project_go_end (MODEL_PROJECT (self->priv->project));
2507 #line 2445 "lombard.c"
2511 #line 824 "lombard.vala"
2512 static void app_on_help_contents (App* self) {
2513 #line 2451 "lombard.c"
2514 GError * _inner_error_;
2515 #line 824 "lombard.vala"
2516 g_return_if_fail (IS_APP (self));
2517 #line 2455 "lombard.c"
2518 _inner_error_ = NULL;
2520 #line 826 "lombard.vala"
2521 gtk_show_uri (NULL, "http://trac.yorba.org/wiki/UsingLombard0.1", (guint32) 0, &_inner_error_);
2522 #line 2460 "lombard.c"
2523 if (_inner_error_ != NULL) {
2524 goto __catch8_g_error;
2532 _inner_error_ = NULL;
2538 if (_inner_error_ != NULL) {
2539 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);
2540 g_clear_error (&_inner_error_);
2546 #line 831 "lombard.vala"
2547 static void app_on_about (App* self) {
2548 #line 2486 "lombard.c"
2551 #line 831 "lombard.vala"
2552 g_return_if_fail (IS_APP (self));
2553 #line 832 "lombard.vala"
2554 gtk_show_about_dialog (GTK_WINDOW (self), "version", _tmp0_ = model_project_get_version (MODEL_PROJECT (self->priv->project)), "comments", "A video editor", "copyright", "Copyright 2009-2010 Yorba Foundation", "website", "http://www.yorba.org", "license", _tmp1_ = model_project_get_license (MODEL_PROJECT (self->priv->project)), "website-label", "Visit the Yorba web site", "authors", MODEL_PROJECT_authors, NULL);
2555 #line 2493 "lombard.c"
2561 #line 843 "lombard.vala"
2562 static void app_on_save_graph (App* self) {
2563 #line 843 "lombard.vala"
2564 g_return_if_fail (IS_APP (self));
2565 #line 844 "lombard.vala"
2566 model_project_print_graph (MODEL_PROJECT (self->priv->project), GST_BIN (MODEL_PROJECT (self->priv->project)->media_engine->pipeline), "save_graph");
2567 #line 2505 "lombard.c"
2571 #line 848 "lombard.vala"
2572 static gboolean app_real_is_recording (TransportDelegate* base) {
2573 #line 2511 "lombard.c"
2575 gboolean result = FALSE;
2577 result = model_project_transport_is_recording (MODEL_PROJECT (self->priv->project));
2578 #line 849 "lombard.vala"
2580 #line 2518 "lombard.c"
2584 #line 852 "lombard.vala"
2585 static gboolean app_real_is_playing (TransportDelegate* base) {
2586 #line 2524 "lombard.c"
2588 gboolean result = FALSE;
2590 result = model_project_transport_is_playing (MODEL_PROJECT (self->priv->project));
2591 #line 853 "lombard.vala"
2593 #line 2531 "lombard.c"
2597 #line 856 "lombard.vala"
2598 static gboolean app_real_is_stopped (TransportDelegate* base) {
2599 #line 2537 "lombard.c"
2601 gboolean result = FALSE;
2602 gboolean _tmp0_ = FALSE;
2604 #line 857 "lombard.vala"
2605 if (transport_delegate_is_playing (TRANSPORT_DELEGATE (self))) {
2606 #line 857 "lombard.vala"
2608 #line 2546 "lombard.c"
2610 #line 857 "lombard.vala"
2611 _tmp0_ = transport_delegate_is_recording (TRANSPORT_DELEGATE (self));
2612 #line 2550 "lombard.c"
2615 #line 857 "lombard.vala"
2617 #line 2555 "lombard.c"
2621 static void app_class_init (AppClass * klass) {
2622 app_parent_class = g_type_class_peek_parent (klass);
2623 g_type_class_add_private (klass, sizeof (AppPrivate));
2624 GTK_WIDGET_CLASS (klass)->key_press_event = app_real_key_press_event;
2625 G_OBJECT_CLASS (klass)->finalize = app_finalize;
2629 static void app_transport_delegate_interface_init (TransportDelegateIface * iface) {
2630 app_transport_delegate_parent_iface = g_type_interface_peek_parent (iface);
2631 iface->is_recording = app_real_is_recording;
2632 iface->is_playing = app_real_is_playing;
2633 iface->is_stopped = app_real_is_stopped;
2637 static void app_instance_init (App * self) {
2638 self->priv = APP_GET_PRIVATE (self);
2639 self->priv->center_time = (gint64) (-1);
2640 self->priv->vbox = NULL;
2644 static void app_finalize (GObject* obj) {
2647 _g_object_unref0 (self->priv->drawing_area);
2648 _g_object_unref0 (self->priv->project);
2649 _g_object_unref0 (self->priv->video_output);
2650 _g_object_unref0 (self->priv->audio_output);
2651 _g_object_unref0 (self->priv->export_connector);
2652 _g_object_unref0 (self->priv->timeline);
2653 _g_object_unref0 (self->priv->library);
2654 _g_object_unref0 (self->priv->status_bar);
2655 _g_object_unref0 (self->priv->h_pane);
2656 _g_object_unref0 (self->priv->library_scrolled);
2657 _g_object_unref0 (self->priv->timeline_scrolled);
2658 _g_object_unref0 (self->priv->h_adjustment);
2659 _g_object_unref0 (self->priv->main_group);
2660 _g_object_unref0 (self->priv->vbox);
2661 _g_object_unref0 (self->priv->menubar);
2662 _g_object_unref0 (self->priv->manager);
2663 _g_free0 (self->priv->project_filename);
2664 _g_object_unref0 (self->priv->load_errors);
2665 G_OBJECT_CLASS (app_parent_class)->finalize (obj);
2669 GType app_get_type (void) {
2670 static volatile gsize app_type_id__volatile = 0;
2671 if (g_once_init_enter (&app_type_id__volatile)) {
2672 static const GTypeInfo g_define_type_info = { sizeof (AppClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) app_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (App), 0, (GInstanceInitFunc) app_instance_init, NULL };
2673 static const GInterfaceInfo transport_delegate_info = { (GInterfaceInitFunc) app_transport_delegate_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2675 app_type_id = g_type_register_static (GTK_TYPE_WINDOW, "App", &g_define_type_info, 0);
2676 g_type_add_interface_static (app_type_id, TYPE_TRANSPORT_DELEGATE, &transport_delegate_info);
2677 g_once_init_leave (&app_type_id__volatile, app_type_id);
2679 return app_type_id__volatile;
2683 #line 863 "lombard.vala"
2684 void _vala_main (char** args, int args_length1) {
2685 #line 2623 "lombard.c"
2686 GError * _inner_error_;
2687 GOptionContext* context;
2688 _inner_error_ = NULL;
2689 #line 864 "lombard.vala"
2691 #line 865 "lombard.vala"
2692 context = g_option_context_new (" [project file] - Create and edit movies");
2693 #line 867 "lombard.vala"
2694 g_option_context_add_main_entries (context, options, NULL);
2695 #line 868 "lombard.vala"
2696 g_option_context_add_group (context, gst_init_get_option_group ());
2697 #line 2635 "lombard.c"
2699 #line 871 "lombard.vala"
2700 g_option_context_parse (context, &args_length1, &args, &_inner_error_);
2701 #line 2639 "lombard.c"
2702 if (_inner_error_ != NULL) {
2703 goto __catch9_g_error;
2710 arg_error = _inner_error_;
2711 _inner_error_ = NULL;
2713 #line 873 "lombard.vala"
2714 fprintf (stderr, "%s\n" \
2715 "Run 'lombard --help' for a full list of available command line options" \
2716 ".", arg_error->message);
2717 #line 2653 "lombard.c"
2718 _g_error_free0 (arg_error);
2719 _g_option_context_free0 (context);
2720 #line 875 "lombard.vala"
2722 #line 2658 "lombard.c"
2726 if (_inner_error_ != NULL) {
2727 _g_option_context_free0 (context);
2728 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);
2729 g_clear_error (&_inner_error_);
2732 #line 877 "lombard.vala"
2733 gtk_init (&args_length1, &args);
2734 #line 2670 "lombard.c"
2738 gboolean _tmp3_ = FALSE;
2739 ClassFactory* _tmp4_;
2741 #line 880 "lombard.vala"
2742 g_set_application_name ("Lombard");
2743 #line 882 "lombard.vala"
2744 app_dirs_init (args[0], _PROGRAM_NAME);
2745 #line 883 "lombard.vala"
2746 gst_init (&args_length1, &args);
2747 #line 885 "lombard.vala"
2748 if (args_length1 > 2) {
2749 #line 886 "lombard.vala"
2750 fprintf (stderr, "usage: %s [project-file]\n", args[0]);
2751 #line 2687 "lombard.c"
2752 _g_option_context_free0 (context);
2753 #line 887 "lombard.vala"
2755 #line 2691 "lombard.c"
2757 #line 890 "lombard.vala"
2758 project_file = NULL;
2759 #line 891 "lombard.vala"
2760 if (args_length1 > 1) {
2761 #line 2697 "lombard.c"
2763 #line 892 "lombard.vala"
2764 project_file = (_tmp0_ = g_strdup (args[1]), _g_free0 (project_file), _tmp0_);
2765 #line 2701 "lombard.c"
2769 #line 894 "lombard.vala"
2770 _tmp1_ = g_filename_from_uri (project_file, NULL, &_inner_error_);
2771 #line 2707 "lombard.c"
2772 if (_inner_error_ != NULL) {
2773 goto __catch11_g_error;
2775 #line 894 "lombard.vala"
2776 project_file = (_tmp2_ = _tmp1_, _g_free0 (project_file), _tmp2_);
2777 #line 2713 "lombard.c"
2784 _inner_error_ = NULL;
2790 if (_inner_error_ != NULL) {
2791 _g_free0 (project_file);
2792 goto __catch10_g_error;
2795 #line 898 "lombard.vala"
2796 str = g_strdup (g_getenv ("LOMBARD_DEBUG"));
2797 #line 899 "lombard.vala"
2799 #line 899 "lombard.vala"
2800 _tmp3_ = g_utf8_get_char (g_utf8_offset_to_pointer (str, 0)) >= '1';
2801 #line 2737 "lombard.c"
2803 #line 899 "lombard.vala"
2805 #line 2741 "lombard.c"
2807 #line 899 "lombard.vala"
2808 debug_enabled = _tmp3_;
2809 #line 900 "lombard.vala"
2810 class_factory_set_class_factory (_tmp4_ = class_factory_new ());
2811 #line 2747 "lombard.c"
2812 _class_factory_unref0 (_tmp4_);
2813 #line 901 "lombard.vala"
2814 view_media_engine_can_run (&_inner_error_);
2815 #line 2751 "lombard.c"
2816 if (_inner_error_ != NULL) {
2817 _g_free0 (project_file);
2819 goto __catch10_g_error;
2821 #line 903 "lombard.vala"
2822 _tmp5_ = g_object_ref_sink (app_new (project_file, &_inner_error_));
2823 #line 2759 "lombard.c"
2824 _g_object_unref0 (_tmp5_);
2825 if (_inner_error_ != NULL) {
2826 _g_free0 (project_file);
2828 goto __catch10_g_error;
2830 #line 904 "lombard.vala"
2832 #line 2768 "lombard.c"
2833 _g_free0 (project_file);
2841 _inner_error_ = NULL;
2844 #line 906 "lombard.vala"
2845 app_do_error_dialog ("Could not launch application", _tmp6_ = g_strdup_printf ("%s.", e->message));
2846 #line 2782 "lombard.c"
2852 if (_inner_error_ != NULL) {
2853 _g_option_context_free0 (context);
2854 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);
2855 g_clear_error (&_inner_error_);
2858 _g_option_context_free0 (context);
2862 #line 863 "lombard.vala"
2863 int main (int argc, char ** argv) {
2864 #line 2800 "lombard.c"
2865 g_thread_init (NULL);
2866 #line 863 "lombard.vala"
2868 #line 863 "lombard.vala"
2869 _vala_main (argv, argc);
2870 #line 863 "lombard.vala"
2872 #line 2808 "lombard.c"
2876 static int _vala_strcmp0 (const char * str1, const char * str2) {
2878 return -(str1 != str2);
2881 return str1 != str2;
2883 return strcmp (str1, str2);