X-Git-Url: http://git.maemo.org/git/?p=fillmore;a=blobdiff_plain;f=src%2Ffillmore%2Ffillmore%2Ffillmore.c;fp=src%2Ffillmore%2Ffillmore%2Ffillmore.c;h=1a52adf437cbdb64dcbfd3bb5ca6bba599d27f96;hp=0000000000000000000000000000000000000000;hb=a712cd772f4f3db8bed7037bb95c4de94767b230;hpb=2f0296582bf5d3f51db40d299f434fc8240ca6a5 diff --git a/src/fillmore/fillmore/fillmore.c b/src/fillmore/fillmore/fillmore.c new file mode 100644 index 0000000..1a52adf --- /dev/null +++ b/src/fillmore/fillmore/fillmore.c @@ -0,0 +1,4473 @@ +/* fillmore.c generated by valac, the Vala compiler + * generated from fillmore.vala, do not modify */ + +/* Copyright 2009-2010 Yorba Foundation + * + * This software is licensed under the GNU Lesser General Public License + * (version 2.1 or later). See the COPYING file in this distribution. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define TYPE_RECORDER (recorder_get_type ()) +#define RECORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RECORDER, Recorder)) +#define RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RECORDER, RecorderClass)) +#define IS_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RECORDER)) +#define IS_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_RECORDER)) +#define RECORDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_RECORDER, RecorderClass)) + +typedef struct _Recorder Recorder; +typedef struct _RecorderClass RecorderClass; +typedef struct _RecorderPrivate RecorderPrivate; + +#define MODEL_TYPE_AUDIO_PROJECT (model_audio_project_get_type ()) +#define MODEL_AUDIO_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MODEL_TYPE_AUDIO_PROJECT, ModelAudioProject)) +#define MODEL_AUDIO_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MODEL_TYPE_AUDIO_PROJECT, ModelAudioProjectClass)) +#define MODEL_IS_AUDIO_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEL_TYPE_AUDIO_PROJECT)) +#define MODEL_IS_AUDIO_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEL_TYPE_AUDIO_PROJECT)) +#define MODEL_AUDIO_PROJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MODEL_TYPE_AUDIO_PROJECT, ModelAudioProjectClass)) + +typedef struct _ModelAudioProject ModelAudioProject; +typedef struct _ModelAudioProjectClass ModelAudioProjectClass; + +#define TYPE_HEADER_AREA (header_area_get_type ()) +#define HEADER_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HEADER_AREA, HeaderArea)) +#define HEADER_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HEADER_AREA, HeaderAreaClass)) +#define IS_HEADER_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HEADER_AREA)) +#define IS_HEADER_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HEADER_AREA)) +#define HEADER_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HEADER_AREA, HeaderAreaClass)) + +typedef struct _HeaderArea HeaderArea; +typedef struct _HeaderAreaClass HeaderAreaClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) +#define _gst_caps_unref0(var) ((var == NULL) ? NULL : (var = (gst_caps_unref (var), NULL))) +#define __g_list_free_g_free0(var) ((var == NULL) ? NULL : (var = (_g_list_free_g_free (var), NULL))) +#define __g_slist_free_g_free0(var) ((var == NULL) ? NULL : (var = (_g_slist_free_g_free (var), NULL))) + +#define TYPE_PROJECT_PROPERTIES (project_properties_get_type ()) +#define PROJECT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROJECT_PROPERTIES, ProjectProperties)) +#define PROJECT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROJECT_PROPERTIES, ProjectPropertiesClass)) +#define IS_PROJECT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROJECT_PROPERTIES)) +#define IS_PROJECT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROJECT_PROPERTIES)) +#define PROJECT_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROJECT_PROPERTIES, ProjectPropertiesClass)) + +typedef struct _ProjectProperties ProjectProperties; +typedef struct _ProjectPropertiesClass ProjectPropertiesClass; + +#define UI_TYPE_TRACK_INFORMATION (ui_track_information_get_type ()) +#define UI_TRACK_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UI_TYPE_TRACK_INFORMATION, UITrackInformation)) +#define UI_TRACK_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UI_TYPE_TRACK_INFORMATION, UITrackInformationClass)) +#define UI_IS_TRACK_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UI_TYPE_TRACK_INFORMATION)) +#define UI_IS_TRACK_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UI_TYPE_TRACK_INFORMATION)) +#define UI_TRACK_INFORMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UI_TYPE_TRACK_INFORMATION, UITrackInformationClass)) + +typedef struct _UITrackInformation UITrackInformation; +typedef struct _UITrackInformationClass UITrackInformationClass; + +#define TYPE_FILLMORE (fillmore_get_type ()) +#define FILLMORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FILLMORE, Fillmore)) +#define FILLMORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FILLMORE, FillmoreClass)) +#define IS_FILLMORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FILLMORE)) +#define IS_FILLMORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FILLMORE)) +#define FILLMORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FILLMORE, FillmoreClass)) + +typedef struct _Fillmore Fillmore; +typedef struct _FillmoreClass FillmoreClass; +typedef struct _FillmorePrivate FillmorePrivate; +#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL))) + +#define TYPE_FILLMORE_CLASS_FACTORY (fillmore_class_factory_get_type ()) +#define FILLMORE_CLASS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FILLMORE_CLASS_FACTORY, FillmoreClassFactory)) +#define FILLMORE_CLASS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FILLMORE_CLASS_FACTORY, FillmoreClassFactoryClass)) +#define IS_FILLMORE_CLASS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FILLMORE_CLASS_FACTORY)) +#define IS_FILLMORE_CLASS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FILLMORE_CLASS_FACTORY)) +#define FILLMORE_CLASS_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FILLMORE_CLASS_FACTORY, FillmoreClassFactoryClass)) + +typedef struct _FillmoreClassFactory FillmoreClassFactory; +typedef struct _FillmoreClassFactoryClass FillmoreClassFactoryClass; +#define _class_factory_unref0(var) ((var == NULL) ? NULL : (var = (class_factory_unref (var), NULL))) + +struct _Recorder { + GtkWindow parent_instance; + RecorderPrivate * priv; + ModelAudioProject* project; + TimeLine* timeline; +}; + +struct _RecorderClass { + GtkWindowClass parent_class; +}; + +struct _RecorderPrivate { + ViewClickTrack* click_track; + HeaderArea* header_area; + ClipLibraryView* library; + ModelTimeSystem* provider; + GtkAdjustment* h_adjustment; + GtkHPaned* timeline_library_pane; + GtkScrolledWindow* library_scrolled; + GtkScrolledWindow* timeline_scrolled; + gint cursor_pos; + gint64 center_time; + gboolean loading; + GtkActionGroup* main_group; + GtkToggleButton* play_button; + GtkToggleButton* record_button; + GtkButton* addnew_button; + GtkButton* rewind_button; + GtkButton* forward_button; + GtkButton* zoomin_button; + GtkButton* zoomout_button; + GtkButton* volume_button; + HildonPannableArea* scrollwin; + gint scrollwin_pos_y; + GtkUIManager* manager; + ViewOggVorbisExport* audio_export; + ViewAudioOutput* audio_output; + GeeArrayList* load_errors; +}; + +struct _Fillmore { + HildonProgram parent_instance; + FillmorePrivate * priv; +}; + +struct _FillmoreClass { + HildonProgramClass parent_class; +}; + + +extern gboolean do_print_graph; +gboolean do_print_graph = FALSE; +extern gint debug_level; +gint debug_level = 0; +static gpointer recorder_parent_class = NULL; +static TransportDelegateIface* recorder_transport_delegate_parent_iface = NULL; +static gpointer fillmore_parent_class = NULL; + +GType recorder_get_type (void); +GType model_audio_project_get_type (void); +GType header_area_get_type (void); +#define RECORDER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_RECORDER, RecorderPrivate)) +enum { + RECORDER_DUMMY_PROPERTY +}; +#define RECORDER_scroll_speed 8 +#define RECORDER_NAME "Fillmore" +static void recorder_on_project_open (Recorder* self); +static void _recorder_on_project_open_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_project_new (Recorder* self); +static void _recorder_on_project_new_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_project_save (Recorder* self); +static void _recorder_on_project_save_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_project_save_as (Recorder* self); +static void _recorder_on_project_save_as_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_export (Recorder* self); +static void _recorder_on_export_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_properties (Recorder* self); +static void _recorder_on_properties_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_quit (Recorder* self); +static void _recorder_on_quit_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_undo (Recorder* self); +static void _recorder_on_undo_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_cut (Recorder* self); +static void _recorder_on_cut_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_copy (Recorder* self); +static void _recorder_on_copy_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_paste (Recorder* self); +static void _recorder_on_paste_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_delete (Recorder* self); +static void _recorder_on_delete_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_select_all (Recorder* self); +static void _recorder_on_select_all_gtk_action_callback (GtkAction* action, gpointer self); +void recorder_on_split_at_playhead (Recorder* self); +static void _recorder_on_split_at_playhead_gtk_action_callback (GtkAction* action, gpointer self); +void recorder_on_trim_to_playhead (Recorder* self); +static void _recorder_on_trim_to_playhead_gtk_action_callback (GtkAction* action, gpointer self); +void recorder_on_clip_properties (Recorder* self); +static void _recorder_on_clip_properties_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_zoom_in (Recorder* self); +static void _recorder_on_zoom_in_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_zoom_out (Recorder* self); +static void _recorder_on_zoom_out_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_zoom_to_project (Recorder* self); +static void _recorder_on_zoom_to_project_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_track_new (Recorder* self); +static void _recorder_on_track_new_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_track_rename (Recorder* self); +static void _recorder_on_track_rename_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_track_remove (Recorder* self); +static void _recorder_on_track_remove_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_track_move_up (Recorder* self); +static void _recorder_on_track_move_up_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_track_move_down (Recorder* self); +static void _recorder_on_track_move_down_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_tracks_scroll_up (Recorder* self); +static void _recorder_on_tracks_scroll_up_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_tracks_scroll_down (Recorder* self); +static void _recorder_on_tracks_scroll_down_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_help_contents (Recorder* self); +static void _recorder_on_help_contents_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_about (Recorder* self); +static void _recorder_on_about_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_save_graph (Recorder* self); +static void _recorder_on_save_graph_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_rewind (Recorder* self); +static void _recorder_on_rewind_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_end (Recorder* self); +static void _recorder_on_end_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_play (Recorder* self); +static void _recorder_on_play_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_record (Recorder* self); +static void _recorder_on_record_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_view_library (Recorder* self); +static void _recorder_on_view_library_gtk_action_callback (GtkAction* action, gpointer self); +static void recorder_on_snap (Recorder* self); +static void _recorder_on_snap_gtk_action_callback (GtkAction* action, gpointer self); +#define RECORDER_ui "\n" \ +"\n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" " \ +"\n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +" \n" \ +"\n" +static char* recorder_get_fillmore_directory (Recorder* self); +ModelAudioProject* model_audio_project_new (const char* filename, GError** error); +ModelAudioProject* model_audio_project_construct (GType object_type, const char* filename, GError** error); +static void recorder_on_callback_pulse (Recorder* self); +static void _recorder_on_callback_pulse_view_media_engine_callback_pulse (ViewMediaEngine* _sender, gpointer self); +static void recorder_on_post_export (Recorder* self, gboolean canceled); +static void _recorder_on_post_export_view_media_engine_post_export (ViewMediaEngine* _sender, gboolean canceled, gpointer self); +static void recorder_on_position_changed (Recorder* self); +static void _recorder_on_position_changed_view_media_engine_position_changed (ViewMediaEngine* _sender, gint64 position, gpointer self); +void recorder_on_load_error (Recorder* self, const char* message); +static void _recorder_on_load_error_model_project_load_error (ModelProject* _sender, const char* _error_, gpointer self); +static void recorder_on_name_changed (Recorder* self); +static void _recorder_on_name_changed_model_project_name_changed (ModelProject* _sender, const char* project_file, gpointer self); +static void recorder_on_dirty_changed (Recorder* self, gboolean isDirty); +static void _recorder_on_dirty_changed_model_undo_manager_dirty_changed (ModelUndoManager* _sender, gboolean is_dirty, gpointer self); +static void recorder_on_undo_changed (Recorder* self, gboolean can_undo); +static void _recorder_on_undo_changed_model_undo_manager_undo_changed (ModelUndoManager* _sender, gboolean can_undo, gpointer self); +static void recorder_on_error_occurred (Recorder* self, const char* major_message, const char* minor_message); +static void _recorder_on_error_occurred_model_project_error_occurred (ModelProject* _sender, const char* major_message, const char* minor_message, gpointer self); +static void recorder_on_playstate_changed (Recorder* self, PlayState playstate); +static void _recorder_on_playstate_changed_model_project_playstate_changed (ModelProject* _sender, PlayState playstate, gpointer self); +static void recorder_on_track_added (Recorder* self, ModelTrack* track); +static void _recorder_on_track_added_model_project_track_added (ModelProject* _sender, ModelTrack* track, gpointer self); +static void recorder_on_track_removed (Recorder* self, ModelTrack* unused); +static void _recorder_on_track_removed_model_project_track_removed (ModelProject* _sender, ModelTrack* track, gpointer self); +void recorder_on_load_complete (Recorder* self); +static void _recorder_on_load_complete_model_project_load_complete (ModelProject* _sender, gpointer self); +static void recorder_on_project_close (Recorder* self); +static void _recorder_on_project_close_model_project_closed (ModelProject* _sender, gpointer self); +static GtkWidget* recorder_get_widget (Recorder* self, GtkUIManager* manager, const char* name); +void recorder_on_library_selection_changed (Recorder* self, gboolean selected); +static void _recorder_on_library_selection_changed_clip_library_view_selection_changed (ClipLibraryView* _sender, gboolean selected, gpointer self); +static void recorder_on_drag_data_received (Recorder* self, GtkWidget* w, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint drag_info, guint time); +static void _recorder_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); +static void recorder_on_track_changed (Recorder* self); +static void _recorder_on_track_changed_time_line_track_changed (TimeLine* _sender, gpointer self); +static void recorder_on_timeline_size_allocate (Recorder* self, GdkRectangle* rectangle); +static void _recorder_on_timeline_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self); +static void recorder_on_timeline_selection_changed (Recorder* self, gboolean selected); +static void _recorder_on_timeline_selection_changed_time_line_selection_changed (TimeLine* _sender, gboolean selected, gpointer self); +static void recorder_update_menu (Recorder* self); +HeaderArea* header_area_new (Recorder* recorder, ModelTimeSystem* provider, gint height); +HeaderArea* header_area_construct (GType object_type, Recorder* recorder, ModelTimeSystem* provider, gint height); +static void _recorder_on_track_new_gtk_button_clicked (GtkButton* _sender, gpointer self); +static void _recorder_on_play_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self); +static void _recorder_on_record_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self); +static void _recorder_on_rewind_gtk_button_clicked (GtkButton* _sender, gpointer self); +static void _recorder_on_end_gtk_button_clicked (GtkButton* _sender, gpointer self); +static void _recorder_on_zoom_in_gtk_button_clicked (GtkButton* _sender, gpointer self); +static void _recorder_on_zoom_out_gtk_button_clicked (GtkButton* _sender, gpointer self); +static void recorder_on_volume (Recorder* self); +static void _recorder_on_volume_gtk_button_clicked (GtkButton* _sender, gpointer self); +static void recorder_on_library_size_allocate (Recorder* self, GdkRectangle* rectangle); +static void _recorder_on_library_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self); +static gboolean recorder_on_delete_event (Recorder* self); +static gboolean _recorder_on_delete_event_gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self); +static void recorder_default_track_set (Recorder* self); +Recorder* recorder_new (const char* project_file, GError** error); +Recorder* recorder_construct (GType object_type, const char* project_file, GError** error); +char* recorder_get_default_track_name (Recorder* self); +static gint recorder_default_track_number_compare (void* a, void* b); +static gint _recorder_default_track_number_compare_gcompare_func (void* a, void* b); +static void _g_list_free_g_free (GList* self); +ModelTrack* recorder_selected_track (Recorder* self); +static void recorder_set_sensitive_group (Recorder* self, GtkActionGroup* group, const char* group_path, gboolean sensitive); +static void recorder_on_clip_added (Recorder* self, ModelClip* clip); +static void _recorder_on_clip_added_model_track_clip_added (ModelTrack* _sender, ModelClip* clip, gboolean select, gpointer self); +static void recorder_on_clip_removed (Recorder* self, ModelClip* clip); +static void _recorder_on_clip_removed_model_track_clip_removed (ModelTrack* _sender, ModelClip* clip, gpointer self); +static void recorder_on_track_selection_changed (Recorder* self, ModelTrack* track); +static void _recorder_on_track_selection_changed_model_track_track_selection_changed (ModelTrack* _sender, ModelTrack* track, gpointer self); +static void recorder_on_clip_moved (Recorder* self, ModelClip* clip); +static void _recorder_on_clip_moved_model_clip_moved (ModelClip* _sender, ModelClip* clip, gpointer self); +void recorder_scroll_to_beginning (Recorder* self); +void recorder_scroll_to_time (Recorder* self, gint64 time); +void recorder_page_to_time (Recorder* self, gint64 time); +void recorder_scroll_to_end (Recorder* self); +static gint recorder_sgn (gint x); +void recorder_scroll_toward_center (Recorder* self, gint xpos); +static gboolean recorder_real_key_press_event (GtkWidget* base, GdkEventKey* event); +void recorder_do_error_dialog (const char* major_message, const char* minor_message); +static void recorder_on_project_new_finished_closing (Recorder* self, gboolean project_did_close); +static void _recorder_on_project_new_finished_closing_recorder_finished_closing (Recorder* _sender, gboolean project_did_close, gpointer self); +static void recorder_on_project_open_finished_closing (Recorder* self, gboolean project_did_close); +static void _recorder_on_project_open_finished_closing_recorder_finished_closing (Recorder* _sender, gboolean project_did_close, gpointer self); +static void _g_slist_free_g_free (GSList* self); +static gboolean recorder_save_dialog (Recorder* self); +static gboolean recorder_do_save (Recorder* self); +static void recorder_on_save_new_file_finished_closing (Recorder* self, gboolean did_close); +static void _recorder_on_save_new_file_finished_closing_recorder_finished_closing (Recorder* _sender, gboolean project_did_close, gpointer self); +GType project_properties_get_type (void); +void project_properties_setup (ProjectProperties* self, ModelProject* project, GtkBuilder* builder); +gint project_properties_get_tempo (ProjectProperties* self); +void project_properties_get_time_signature (ProjectProperties* self, Fraction* result); +gboolean project_properties_during_record (ProjectProperties* self); +gboolean project_properties_during_play (ProjectProperties* self); +double project_properties_get_click_volume (ProjectProperties* self); +static void recorder_on_quit_finished_closing (Recorder* self, gboolean project_did_close); +static void _recorder_on_quit_finished_closing_recorder_finished_closing (Recorder* _sender, gboolean project_did_close, gpointer self); +UITrackInformation* ui_track_information_new (void); +UITrackInformation* ui_track_information_construct (GType object_type); +GType ui_track_information_get_type (void); +void ui_track_information_set_track_name (UITrackInformation* self, const char* new_name); +static gboolean recorder_track_name_dialog (Recorder* self, UITrackInformation* dialog, ModelTrack* track); +char* ui_track_information_get_track_name (UITrackInformation* self); +static void recorder_do_zoom (Recorder* self, float increment); +void model_audio_project_record (ModelAudioProject* self, ModelAudioTrack* track); +static gint64 recorder_get_zoom_center_time (Recorder* self); +static gboolean recorder_real_is_playing (TransportDelegate* base); +static gboolean recorder_real_is_recording (TransportDelegate* base); +static gboolean recorder_real_is_stopped (TransportDelegate* base); +static void recorder_finalize (GObject* obj); +GType fillmore_get_type (void); +enum { + FILLMORE_DUMMY_PROPERTY +}; +FillmoreClassFactory* fillmore_class_factory_new (void); +FillmoreClassFactory* fillmore_class_factory_construct (GType object_type); +GType fillmore_class_factory_get_type (void); +void fillmore_run (Fillmore* self, char** args, int args_length1); +Fillmore* fillmore_new (void); +Fillmore* fillmore_construct (GType object_type); +static GObject * fillmore_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); +gint _vala_main (char** args, int args_length1); +void NO_main (char** args, int args_length1); +static int _vala_strcmp0 (const char * str1, const char * str2); + +const GOptionEntry options[3] = {{"print-graph", (gchar) 0, 0, G_OPTION_ARG_NONE, &do_print_graph, "Show Print Graph in help menu", NULL}, {"debug-level", (gchar) 0, 0, G_OPTION_ARG_INT, &debug_level, "Control amount of diagnostic information", "[0 (minimal),5 (maximum)]"}, {NULL}}; +static const GtkActionEntry RECORDER_entries[36] = {{"Project", NULL, "_Project", NULL, NULL, (GCallback) NULL}, {"Open", GTK_STOCK_OPEN, "_Open...", NULL, "Open a project", (GCallback) _recorder_on_project_open_gtk_action_callback}, {"NewProject", GTK_STOCK_NEW, "_New", NULL, "Create new project", (GCallback) _recorder_on_project_new_gtk_action_callback}, {"Save", GTK_STOCK_SAVE, "_Save", "S", "Save project", (GCallback) _recorder_on_project_save_gtk_action_callback}, {"SaveAs", GTK_STOCK_SAVE_AS, "Save _As...", "S", "Save project with new name", (GCallback) _recorder_on_project_save_as_gtk_action_callback}, {"Export", GTK_STOCK_JUMP_TO, "_Export...", "E", NULL, (GCallback) _recorder_on_export_gtk_action_callback}, {"Settings", GTK_STOCK_PROPERTIES, "Se_ttings", "Return", NULL, (GCallback) _recorder_on_properties_gtk_action_callback}, {"Quit", GTK_STOCK_QUIT, NULL, NULL, NULL, (GCallback) _recorder_on_quit_gtk_action_callback}, {"Edit", NULL, "_Edit", NULL, NULL, (GCallback) NULL}, {"Undo", GTK_STOCK_UNDO, NULL, "Z", NULL, (GCallback) _recorder_on_undo_gtk_action_callback}, {"Cut", GTK_STOCK_CUT, NULL, NULL, NULL, (GCallback) _recorder_on_cut_gtk_action_callback}, {"Copy", GTK_STOCK_COPY, NULL, NULL, NULL, (GCallback) _recorder_on_copy_gtk_action_callback}, {"Paste", GTK_STOCK_PASTE, NULL, NULL, NULL, (GCallback) _recorder_on_paste_gtk_action_callback}, {"Delete", GTK_STOCK_DELETE, NULL, "Delete", NULL, (GCallback) _recorder_on_delete_gtk_action_callback}, {"SelectAll", GTK_STOCK_SELECT_ALL, NULL, "A", NULL, (GCallback) _recorder_on_select_all_gtk_action_callback}, {"SplitAtPlayhead", NULL, "_Split at Playhead", "P", NULL, (GCallback) _recorder_on_split_at_playhead_gtk_action_callback}, {"TrimToPlayhead", NULL, "Trim to Play_head", "H", NULL, (GCallback) _recorder_on_trim_to_playhead_gtk_action_callback}, {"ClipProperties", GTK_STOCK_PROPERTIES, "Properti_es", "Return", NULL, (GCallback) _recorder_on_clip_properties_gtk_action_callback}, {"View", NULL, "_View", NULL, NULL, (GCallback) NULL}, {"ZoomIn", GTK_STOCK_ZOOM_IN, "Zoom _In", "plus", NULL, (GCallback) _recorder_on_zoom_in_gtk_action_callback}, {"ZoomOut", GTK_STOCK_ZOOM_OUT, "Zoom _Out", "minus", NULL, (GCallback) _recorder_on_zoom_out_gtk_action_callback}, {"ZoomProject", NULL, "Fit to _Window", "Z", NULL, (GCallback) _recorder_on_zoom_to_project_gtk_action_callback}, {"Track", NULL, "_Track", NULL, NULL, (GCallback) NULL}, {"NewTrack", GTK_STOCK_ADD, "_New...", "N", "Create new track", (GCallback) _recorder_on_track_new_gtk_action_callback}, {"Rename", NULL, "_Rename...", NULL, "Rename Track", (GCallback) _recorder_on_track_rename_gtk_action_callback}, {"DeleteTrack", NULL, "_Delete", "Delete", "Delete track", (GCallback) _recorder_on_track_remove_gtk_action_callback}, {"MoveTrackUp", NULL, "Move Track Up", "Up", NULL, (GCallback) _recorder_on_track_move_up_gtk_action_callback}, {"MoveTrackDown", NULL, "Move Track Down", "Down", NULL, (GCallback) _recorder_on_track_move_down_gtk_action_callback}, {"ScrollTracksUp", NULL, "Scroll Tracks Up", "Up", NULL, (GCallback) _recorder_on_tracks_scroll_up_gtk_action_callback}, {"ScrollTracksDown", NULL, "Scroll Tracks Down", "Down", NULL, (GCallback) _recorder_on_tracks_scroll_down_gtk_action_callback}, {"Help", NULL, "_Help", NULL, NULL, (GCallback) NULL}, {"Contents", GTK_STOCK_HELP, "_Contents", "F1", "More information on Fillmore", (GCallback) _recorder_on_help_contents_gtk_action_callback}, {"About", GTK_STOCK_ABOUT, NULL, NULL, NULL, (GCallback) _recorder_on_about_gtk_action_callback}, {"SaveGraph", NULL, "Save _Graph", NULL, "Save graph", (GCallback) _recorder_on_save_graph_gtk_action_callback}, {"Rewind", GTK_STOCK_MEDIA_PREVIOUS, "Rewind", "Home", "Go to beginning", (GCallback) _recorder_on_rewind_gtk_action_callback}, {"End", GTK_STOCK_MEDIA_NEXT, "End", "End", "Go to end", (GCallback) _recorder_on_end_gtk_action_callback}}; +static const GtkToggleActionEntry RECORDER_toggle_entries[4] = {{"Play", GTK_STOCK_MEDIA_PLAY, NULL, "space", "Play", (GCallback) _recorder_on_play_gtk_action_callback}, {"Record", GTK_STOCK_MEDIA_RECORD, NULL, "r", "Record", (GCallback) _recorder_on_record_gtk_action_callback}, {"Library", NULL, "_Library", "F9", NULL, (GCallback) _recorder_on_view_library_gtk_action_callback, FALSE}, {"Snap", NULL, "_Snap to Clip Edges", NULL, NULL, (GCallback) _recorder_on_snap_gtk_action_callback, FALSE}}; +static const DialogUtilsfilter_description_struct RECORDER_filters[2] = {{"Fillmore Project Files", MODEL_PROJECT_FILLMORE_FILE_EXTENSION}, {"Lombard Project Files", MODEL_PROJECT_LOMBARD_FILE_EXTENSION}}; +static const DialogUtilsfilter_description_struct RECORDER_export_filters[1] = {{"Ogg Files", "ogg"}}; + + +#line 774 "fillmore.vala" +static void _recorder_on_project_open_gtk_action_callback (GtkAction* action, gpointer self) { +#line 383 "fillmore.c" + recorder_on_project_open (self); +} + + +#line 755 "fillmore.vala" +static void _recorder_on_project_new_gtk_action_callback (GtkAction* action, gpointer self) { +#line 390 "fillmore.c" + recorder_on_project_new (self); +} + + +#line 785 "fillmore.vala" +static void _recorder_on_project_save_gtk_action_callback (GtkAction* action, gpointer self) { +#line 397 "fillmore.c" + recorder_on_project_save (self); +} + + +#line 781 "fillmore.vala" +static void _recorder_on_project_save_as_gtk_action_callback (GtkAction* action, gpointer self) { +#line 404 "fillmore.c" + recorder_on_project_save_as (self); +} + + +#line 714 "fillmore.vala" +static void _recorder_on_export_gtk_action_callback (GtkAction* action, gpointer self) { +#line 411 "fillmore.c" + recorder_on_export (self); +} + + +#line 822 "fillmore.vala" +static void _recorder_on_properties_gtk_action_callback (GtkAction* action, gpointer self) { +#line 418 "fillmore.c" + recorder_on_properties (self); +} + + +#line 858 "fillmore.vala" +static void _recorder_on_quit_gtk_action_callback (GtkAction* action, gpointer self) { +#line 425 "fillmore.c" + recorder_on_quit (self); +} + + +#line 913 "fillmore.vala" +static void _recorder_on_undo_gtk_action_callback (GtkAction* action, gpointer self) { +#line 432 "fillmore.c" + recorder_on_undo (self); +} + + +#line 901 "fillmore.vala" +static void _recorder_on_cut_gtk_action_callback (GtkAction* action, gpointer self) { +#line 439 "fillmore.c" + recorder_on_cut (self); +} + + +#line 905 "fillmore.vala" +static void _recorder_on_copy_gtk_action_callback (GtkAction* action, gpointer self) { +#line 446 "fillmore.c" + recorder_on_copy (self); +} + + +#line 909 "fillmore.vala" +static void _recorder_on_paste_gtk_action_callback (GtkAction* action, gpointer self) { +#line 453 "fillmore.c" + recorder_on_paste (self); +} + + +#line 917 "fillmore.vala" +static void _recorder_on_delete_gtk_action_callback (GtkAction* action, gpointer self) { +#line 460 "fillmore.c" + recorder_on_delete (self); +} + + +#line 925 "fillmore.vala" +static void _recorder_on_select_all_gtk_action_callback (GtkAction* action, gpointer self) { +#line 467 "fillmore.c" + recorder_on_select_all (self); +} + + +#line 933 "fillmore.vala" +static void _recorder_on_split_at_playhead_gtk_action_callback (GtkAction* action, gpointer self) { +#line 474 "fillmore.c" + recorder_on_split_at_playhead (self); +} + + +#line 937 "fillmore.vala" +static void _recorder_on_trim_to_playhead_gtk_action_callback (GtkAction* action, gpointer self) { +#line 481 "fillmore.c" + recorder_on_trim_to_playhead (self); +} + + +#line 941 "fillmore.vala" +static void _recorder_on_clip_properties_gtk_action_callback (GtkAction* action, gpointer self) { +#line 488 "fillmore.c" + recorder_on_clip_properties (self); +} + + +#line 1008 "fillmore.vala" +static void _recorder_on_zoom_in_gtk_action_callback (GtkAction* action, gpointer self) { +#line 495 "fillmore.c" + recorder_on_zoom_in (self); +} + + +#line 1012 "fillmore.vala" +static void _recorder_on_zoom_out_gtk_action_callback (GtkAction* action, gpointer self) { +#line 502 "fillmore.c" + recorder_on_zoom_out (self); +} + + +#line 1016 "fillmore.vala" +static void _recorder_on_zoom_to_project_gtk_action_callback (GtkAction* action, gpointer self) { +#line 509 "fillmore.c" + recorder_on_zoom_to_project (self); +} + + +#line 960 "fillmore.vala" +static void _recorder_on_track_new_gtk_action_callback (GtkAction* action, gpointer self) { +#line 516 "fillmore.c" + recorder_on_track_new (self); +} + + +#line 969 "fillmore.vala" +static void _recorder_on_track_rename_gtk_action_callback (GtkAction* action, gpointer self) { +#line 523 "fillmore.c" + recorder_on_track_rename (self); +} + + +#line 1003 "fillmore.vala" +static void _recorder_on_track_remove_gtk_action_callback (GtkAction* action, gpointer self) { +#line 530 "fillmore.c" + recorder_on_track_remove (self); +} + + +#line 426 "fillmore.vala" +static void _recorder_on_track_move_up_gtk_action_callback (GtkAction* action, gpointer self) { +#line 537 "fillmore.c" + recorder_on_track_move_up (self); +} + + +#line 444 "fillmore.vala" +static void _recorder_on_track_move_down_gtk_action_callback (GtkAction* action, gpointer self) { +#line 544 "fillmore.c" + recorder_on_track_move_down (self); +} + + +#line 463 "fillmore.vala" +static void _recorder_on_tracks_scroll_up_gtk_action_callback (GtkAction* action, gpointer self) { +#line 551 "fillmore.c" + recorder_on_tracks_scroll_up (self); +} + + +#line 475 "fillmore.vala" +static void _recorder_on_tracks_scroll_down_gtk_action_callback (GtkAction* action, gpointer self) { +#line 558 "fillmore.c" + recorder_on_tracks_scroll_down (self); +} + + +#line 1043 "fillmore.vala" +static void _recorder_on_help_contents_gtk_action_callback (GtkAction* action, gpointer self) { +#line 565 "fillmore.c" + recorder_on_help_contents (self); +} + + +#line 1050 "fillmore.vala" +static void _recorder_on_about_gtk_action_callback (GtkAction* action, gpointer self) { +#line 572 "fillmore.c" + recorder_on_about (self); +} + + +#line 1062 "fillmore.vala" +static void _recorder_on_save_graph_gtk_action_callback (GtkAction* action, gpointer self) { +#line 579 "fillmore.c" + recorder_on_save_graph (self); +} + + +#line 1072 "fillmore.vala" +static void _recorder_on_rewind_gtk_action_callback (GtkAction* action, gpointer self) { +#line 586 "fillmore.c" + recorder_on_rewind (self); +} + + +#line 1077 "fillmore.vala" +static void _recorder_on_end_gtk_action_callback (GtkAction* action, gpointer self) { +#line 593 "fillmore.c" + recorder_on_end (self); +} + + +#line 1082 "fillmore.vala" +static void _recorder_on_play_gtk_action_callback (GtkAction* action, gpointer self) { +#line 600 "fillmore.c" + recorder_on_play (self); +} + + +#line 1094 "fillmore.vala" +static void _recorder_on_record_gtk_action_callback (GtkAction* action, gpointer self) { +#line 607 "fillmore.c" + recorder_on_record (self); +} + + +#line 1024 "fillmore.vala" +static void _recorder_on_view_library_gtk_action_callback (GtkAction* action, gpointer self) { +#line 614 "fillmore.c" + recorder_on_view_library (self); +} + + +#line 1020 "fillmore.vala" +static void _recorder_on_snap_gtk_action_callback (GtkAction* action, gpointer self) { +#line 621 "fillmore.c" + recorder_on_snap (self); +} + + +#line 1114 "fillmore.vala" +static void _recorder_on_callback_pulse_view_media_engine_callback_pulse (ViewMediaEngine* _sender, gpointer self) { +#line 628 "fillmore.c" + recorder_on_callback_pulse (self); +} + + +#line 730 "fillmore.vala" +static void _recorder_on_post_export_view_media_engine_post_export (ViewMediaEngine* _sender, gboolean canceled, gpointer self) { +#line 635 "fillmore.c" + recorder_on_post_export (self, canceled); +} + + +#line 498 "fillmore.vala" +static void _recorder_on_position_changed_view_media_engine_position_changed (ViewMediaEngine* _sender, gint64 position, gpointer self) { +#line 642 "fillmore.c" + recorder_on_position_changed (self); +} + + +#line 1210 "fillmore.vala" +static void _recorder_on_load_error_model_project_load_error (ModelProject* _sender, const char* _error_, gpointer self) { +#line 649 "fillmore.c" + recorder_on_load_error (self, _error_); +} + + +#line 1251 "fillmore.vala" +static void _recorder_on_name_changed_model_project_name_changed (ModelProject* _sender, const char* project_file, gpointer self) { +#line 656 "fillmore.c" + recorder_on_name_changed (self); +} + + +#line 1256 "fillmore.vala" +static void _recorder_on_dirty_changed_model_undo_manager_dirty_changed (ModelUndoManager* _sender, gboolean is_dirty, gpointer self) { +#line 663 "fillmore.c" + recorder_on_dirty_changed (self, is_dirty); +} + + +#line 1263 "fillmore.vala" +static void _recorder_on_undo_changed_model_undo_manager_undo_changed (ModelUndoManager* _sender, gboolean can_undo, gpointer self) { +#line 670 "fillmore.c" + recorder_on_undo_changed (self, can_undo); +} + + +#line 1281 "fillmore.vala" +static void _recorder_on_error_occurred_model_project_error_occurred (ModelProject* _sender, const char* major_message, const char* minor_message, gpointer self) { +#line 677 "fillmore.c" + recorder_on_error_occurred (self, major_message, minor_message); +} + + +#line 1271 "fillmore.vala" +static void _recorder_on_playstate_changed_model_project_playstate_changed (ModelProject* _sender, PlayState playstate, gpointer self) { +#line 684 "fillmore.c" + recorder_on_playstate_changed (self, playstate); +} + + +#line 503 "fillmore.vala" +static void _recorder_on_track_added_model_project_track_added (ModelProject* _sender, ModelTrack* track, gpointer self) { +#line 691 "fillmore.c" + recorder_on_track_added (self, track); +} + + +#line 511 "fillmore.vala" +static void _recorder_on_track_removed_model_project_track_removed (ModelProject* _sender, ModelTrack* track, gpointer self) { +#line 698 "fillmore.c" + recorder_on_track_removed (self, track); +} + + +#line 1215 "fillmore.vala" +static void _recorder_on_load_complete_model_project_load_complete (ModelProject* _sender, gpointer self) { +#line 705 "fillmore.c" + recorder_on_load_complete (self); +} + + +#line 872 "fillmore.vala" +static void _recorder_on_project_close_model_project_closed (ModelProject* _sender, gpointer self) { +#line 712 "fillmore.c" + recorder_on_project_close (self); +} + + +#line 1148 "fillmore.vala" +static void _recorder_on_library_selection_changed_clip_library_view_selection_changed (ClipLibraryView* _sender, gboolean selected, gpointer self) { +#line 719 "fillmore.c" + recorder_on_library_selection_changed (self, selected); +} + + +#line 543 "fillmore.vala" +static void _recorder_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) { +#line 726 "fillmore.c" + recorder_on_drag_data_received (self, _sender, context, x, y, selection_data, info, time_); +} + + +#line 493 "fillmore.vala" +static void _recorder_on_track_changed_time_line_track_changed (TimeLine* _sender, gpointer self) { +#line 733 "fillmore.c" + recorder_on_track_changed (self); +} + + +#line 1131 "fillmore.vala" +static void _recorder_on_timeline_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self) { +#line 740 "fillmore.c" + recorder_on_timeline_size_allocate (self, allocation); +} + + +#line 1140 "fillmore.vala" +static void _recorder_on_timeline_selection_changed_time_line_selection_changed (TimeLine* _sender, gboolean selected, gpointer self) { +#line 747 "fillmore.c" + recorder_on_timeline_selection_changed (self, selected); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +#line 960 "fillmore.vala" +static void _recorder_on_track_new_gtk_button_clicked (GtkButton* _sender, gpointer self) { +#line 759 "fillmore.c" + recorder_on_track_new (self); +} + + +#line 1082 "fillmore.vala" +static void _recorder_on_play_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) { +#line 766 "fillmore.c" + recorder_on_play (self); +} + + +#line 1094 "fillmore.vala" +static void _recorder_on_record_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) { +#line 773 "fillmore.c" + recorder_on_record (self); +} + + +#line 1072 "fillmore.vala" +static void _recorder_on_rewind_gtk_button_clicked (GtkButton* _sender, gpointer self) { +#line 780 "fillmore.c" + recorder_on_rewind (self); +} + + +#line 1077 "fillmore.vala" +static void _recorder_on_end_gtk_button_clicked (GtkButton* _sender, gpointer self) { +#line 787 "fillmore.c" + recorder_on_end (self); +} + + +#line 1008 "fillmore.vala" +static void _recorder_on_zoom_in_gtk_button_clicked (GtkButton* _sender, gpointer self) { +#line 794 "fillmore.c" + recorder_on_zoom_in (self); +} + + +#line 1012 "fillmore.vala" +static void _recorder_on_zoom_out_gtk_button_clicked (GtkButton* _sender, gpointer self) { +#line 801 "fillmore.c" + recorder_on_zoom_out (self); +} + + +#line 1068 "fillmore.vala" +static void _recorder_on_volume_gtk_button_clicked (GtkButton* _sender, gpointer self) { +#line 808 "fillmore.c" + recorder_on_volume (self); +} + + +#line 1035 "fillmore.vala" +static void _recorder_on_library_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self) { +#line 815 "fillmore.c" + recorder_on_library_size_allocate (self, allocation); +} + + +#line 866 "fillmore.vala" +static gboolean _recorder_on_delete_event_gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self) { +#line 822 "fillmore.c" + gboolean result; + result = recorder_on_delete_event (self); + return result; +} + + +#line 207 "fillmore.vala" +Recorder* recorder_construct (GType object_type, const char* project_file, GError** error) { +#line 831 "fillmore.c" + GError * _inner_error_; + Recorder * self; + char* _tmp0_; + GeeArrayList* _tmp1_; + ModelAudioProject* _tmp5_; + ModelAudioProject* _tmp6_; + ModelTimeSystem* _tmp7_; + GstCaps* _tmp8_; + ViewAudioOutput* _tmp9_; + ViewAudioOutput* _tmp10_; + ViewAudioOutput* _tmp11_; + ViewClickTrack* _tmp12_; + ViewClickTrack* _tmp13_; + GtkActionGroup* _tmp14_; + GtkUIManager* _tmp15_; + GtkMenuBar* menubar; + GtkToolbar* toolbar; + ClipLibraryView* _tmp16_; + TimeLine* _tmp17_; + GtkMenu* _tmp18_; + GtkMenu* _tmp19_; + GtkScrolledWindow* _tmp20_; + GtkHBox* hbox; + HeaderArea* _tmp21_; + GtkScrolledWindow* _tmp22_; + GtkAdjustment* _tmp23_; + GtkHButtonBox* buttons; + GtkButton* _tmp24_; + GtkImage* _tmp25_; + GtkToggleButton* _tmp26_; + GtkImage* _tmp27_; + GtkToggleButton* _tmp28_; + GtkImage* _tmp29_; + GtkButton* _tmp30_; + GtkImage* _tmp31_; + GtkButton* _tmp32_; + GtkImage* _tmp33_; + GtkButton* _tmp34_; + GtkImage* _tmp35_; + GtkButton* _tmp36_; + GtkImage* _tmp37_; + GtkButton* _tmp38_; + GtkImage* _tmp39_; + GtkVBox* vbox; + GtkVBox* main_view; + GtkHPaned* _tmp40_; + HildonPannableArea* _tmp41_; + GtkMenuItem* save_graph; + gboolean _tmp42_ = FALSE; + _inner_error_ = NULL; + self = g_object_newv (object_type, 0, NULL); +#line 208 "fillmore.vala" + class_factory_set_transport_delegate (TRANSPORT_DELEGATE (self)); +#line 209 "fillmore.vala" + g_mkdir (_tmp0_ = recorder_get_fillmore_directory (self), 0777); +#line 887 "fillmore.c" + _g_free0 (_tmp0_); +#line 210 "fillmore.vala" + self->priv->load_errors = (_tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL), _g_object_unref0 (self->priv->load_errors), _tmp1_); +#line 891 "fillmore.c" + { + char* _tmp4_; + GFile* _tmp3_; + GFile* _tmp2_; +#line 212 "fillmore.vala" + gtk_window_set_icon_from_file (GTK_WINDOW (self), _tmp4_ = g_file_get_path (_tmp3_ = g_file_get_child (_tmp2_ = app_dirs_get_resources_dir (), "fillmore_icon.png")), &_inner_error_); +#line 898 "fillmore.c" + _g_free0 (_tmp4_); + _g_object_unref0 (_tmp3_); + _g_object_unref0 (_tmp2_); + if (_inner_error_ != NULL) { + goto __catch3_g_error; + } + } + goto __finally3; + __catch3_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { +#line 215 "fillmore.vala" + g_warning ("fillmore.vala:215: Could not load application icon: %s", e->message); +#line 915 "fillmore.c" + _g_error_free0 (e); + } + } + __finally3: + if (_inner_error_ != NULL) { + g_propagate_error (error, _inner_error_); + g_object_unref (self); + return NULL; + } +#line 219 "fillmore.vala" + _tmp5_ = model_audio_project_new (project_file, &_inner_error_); +#line 927 "fillmore.c" + if (_inner_error_ != NULL) { + g_propagate_error (error, _inner_error_); + g_object_unref (self); + return NULL; + } +#line 219 "fillmore.vala" + self->project = (_tmp6_ = _tmp5_, _g_object_unref0 (self->project), _tmp6_); +#line 220 "fillmore.vala" + MODEL_PROJECT (self->project)->snap_to_clip = FALSE; +#line 221 "fillmore.vala" + self->priv->provider = (_tmp7_ = MODEL_TIME_SYSTEM (model_bar_beat_time_system_new (MODEL_TEMPO_INFORMATION (self->project))), _g_object_unref0 (self->priv->provider), _tmp7_); +#line 223 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project)->media_engine, "callback-pulse", (GCallback) _recorder_on_callback_pulse_view_media_engine_callback_pulse, self, 0); +#line 224 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project)->media_engine, "post-export", (GCallback) _recorder_on_post_export_view_media_engine_post_export, self, 0); +#line 225 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project)->media_engine, "position-changed", (GCallback) _recorder_on_position_changed_view_media_engine_position_changed, self, 0); +#line 227 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "load-error", (GCallback) _recorder_on_load_error_model_project_load_error, self, 0); +#line 228 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "name-changed", (GCallback) _recorder_on_name_changed_model_project_name_changed, self, 0); +#line 229 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project)->undo_manager, "dirty-changed", (GCallback) _recorder_on_dirty_changed_model_undo_manager_dirty_changed, self, 0); +#line 230 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project)->undo_manager, "undo-changed", (GCallback) _recorder_on_undo_changed_model_undo_manager_undo_changed, self, 0); +#line 231 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "error-occurred", (GCallback) _recorder_on_error_occurred_model_project_error_occurred, self, 0); +#line 232 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "playstate-changed", (GCallback) _recorder_on_playstate_changed_model_project_playstate_changed, self, 0); +#line 233 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "track-added", (GCallback) _recorder_on_track_added_model_project_track_added, self, 0); +#line 234 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "track-removed", (GCallback) _recorder_on_track_removed_model_project_track_removed, self, 0); +#line 235 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "load-complete", (GCallback) _recorder_on_load_complete_model_project_load_complete, self, 0); +#line 236 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "closed", (GCallback) _recorder_on_project_close_model_project_closed, self, 0); +#line 238 "fillmore.vala" + _tmp10_ = (_tmp9_ = view_audio_output_new (_tmp8_ = view_media_engine_get_project_audio_caps (MODEL_PROJECT (self->project)->media_engine), &_inner_error_), _gst_caps_unref0 (_tmp8_), _tmp9_); +#line 967 "fillmore.c" + if (_inner_error_ != NULL) { + g_propagate_error (error, _inner_error_); + g_object_unref (self); + return NULL; + } +#line 238 "fillmore.vala" + self->priv->audio_output = (_tmp11_ = _tmp10_, _g_object_unref0 (self->priv->audio_output), _tmp11_); +#line 239 "fillmore.vala" + view_media_engine_connect_output (MODEL_PROJECT (self->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->audio_output)); +#line 240 "fillmore.vala" + _tmp12_ = view_click_track_new (MODEL_PROJECT (self->project)->media_engine, MODEL_PROJECT (self->project), &_inner_error_); +#line 979 "fillmore.c" + if (_inner_error_ != NULL) { + g_propagate_error (error, _inner_error_); + g_object_unref (self); + return NULL; + } +#line 240 "fillmore.vala" + self->priv->click_track = (_tmp13_ = _tmp12_, _g_object_unref0 (self->priv->click_track), _tmp13_); +#line 241 "fillmore.vala" + gtk_window_set_position (GTK_WINDOW (self), GTK_WIN_POS_CENTER); +#line 242 "fillmore.vala" + gtk_window_set_title (GTK_WINDOW (self), "Fillmore"); +#line 243 "fillmore.vala" + gtk_window_set_default_size (GTK_WINDOW (self), 800, 1200); +#line 245 "fillmore.vala" + self->priv->main_group = (_tmp14_ = gtk_action_group_new ("main"), _g_object_unref0 (self->priv->main_group), _tmp14_); +#line 246 "fillmore.vala" + gtk_action_group_add_actions (self->priv->main_group, RECORDER_entries, G_N_ELEMENTS (RECORDER_entries), self); +#line 247 "fillmore.vala" + gtk_action_group_add_toggle_actions (self->priv->main_group, RECORDER_toggle_entries, G_N_ELEMENTS (RECORDER_toggle_entries), self); +#line 249 "fillmore.vala" + self->priv->manager = (_tmp15_ = gtk_ui_manager_new (), _g_object_unref0 (self->priv->manager), _tmp15_); +#line 250 "fillmore.vala" + gtk_ui_manager_insert_action_group (self->priv->manager, self->priv->main_group, 0); +#line 1003 "fillmore.c" + { +#line 252 "fillmore.vala" + gtk_ui_manager_add_ui_from_string (self->priv->manager, RECORDER_ui, (gssize) (-1), &_inner_error_); +#line 1007 "fillmore.c" + if (_inner_error_ != NULL) { + goto __catch4_g_error; + } + } + goto __finally4; + __catch4_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { +#line 253 "fillmore.vala" + g_error ("fillmore.vala:253: %s", e->message); +#line 1021 "fillmore.c" + _g_error_free0 (e); + } + } + __finally4: + if (_inner_error_ != NULL) { + g_propagate_error (error, _inner_error_); + g_object_unref (self); + return NULL; + } +#line 255 "fillmore.vala" + menubar = GTK_MENU_BAR (recorder_get_widget (self, self->priv->manager, "/MenuBar")); +#line 256 "fillmore.vala" + toolbar = GTK_TOOLBAR (recorder_get_widget (self, self->priv->manager, "/Toolbar")); +#line 262 "fillmore.vala" + recorder_on_undo_changed (self, FALSE); +#line 264 "fillmore.vala" + self->priv->library = (_tmp16_ = g_object_ref_sink (clip_library_view_new (MODEL_PROJECT (self->project), self->priv->provider, NULL, GDK_ACTION_COPY)), _g_object_unref0 (self->priv->library), _tmp16_); +#line 265 "fillmore.vala" + g_signal_connect_object (self->priv->library, "selection-changed", (GCallback) _recorder_on_library_selection_changed_clip_library_view_selection_changed, self, 0); +#line 266 "fillmore.vala" + g_signal_connect_object (GTK_WIDGET (self->priv->library), "drag-data-received", (GCallback) _recorder_on_drag_data_received_gtk_widget_drag_data_received, self, 0); +#line 268 "fillmore.vala" + self->timeline = (_tmp17_ = g_object_ref_sink (time_line_new (MODEL_PROJECT (self->project), self->priv->provider, GDK_ACTION_COPY)), _g_object_unref0 (self->timeline), _tmp17_); +#line 269 "fillmore.vala" + g_signal_connect_object (self->timeline, "track-changed", (GCallback) _recorder_on_track_changed_time_line_track_changed, self, 0); +#line 270 "fillmore.vala" + g_signal_connect_object (GTK_WIDGET (self->timeline), "drag-data-received", (GCallback) _recorder_on_drag_data_received_gtk_widget_drag_data_received, self, 0); +#line 271 "fillmore.vala" + g_signal_connect_object (GTK_WIDGET (self->timeline), "size-allocate", (GCallback) _recorder_on_timeline_size_allocate_gtk_widget_size_allocate, self, 0); +#line 272 "fillmore.vala" + g_signal_connect_object (self->timeline, "selection-changed", (GCallback) _recorder_on_timeline_selection_changed_time_line_selection_changed, self, 0); +#line 274 "fillmore.vala" + 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_); +#line 275 "fillmore.vala" + 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_); +#line 276 "fillmore.vala" + recorder_update_menu (self); +#line 278 "fillmore.vala" + self->priv->library_scrolled = (_tmp20_ = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL)), _g_object_unref0 (self->priv->library_scrolled), _tmp20_); +#line 279 "fillmore.vala" + gtk_scrolled_window_set_policy (self->priv->library_scrolled, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); +#line 280 "fillmore.vala" + gtk_scrolled_window_add_with_viewport (self->priv->library_scrolled, GTK_WIDGET (self->priv->library)); +#line 282 "fillmore.vala" + hbox = g_object_ref_sink ((GtkHBox*) gtk_hbox_new (FALSE, 0)); +#line 283 "fillmore.vala" + self->priv->header_area = (_tmp21_ = g_object_ref_sink (header_area_new (self, self->priv->provider, TIME_LINE_RULER_HEIGHT)), _g_object_unref0 (self->priv->header_area), _tmp21_); +#line 284 "fillmore.vala" + gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (self->priv->header_area), FALSE, FALSE, (guint) 0); +#line 287 "fillmore.vala" + self->priv->timeline_scrolled = (_tmp22_ = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL)), _g_object_unref0 (self->priv->timeline_scrolled), _tmp22_); +#line 288 "fillmore.vala" + gtk_scrolled_window_set_policy (self->priv->timeline_scrolled, GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); +#line 289 "fillmore.vala" + gtk_scrolled_window_add_with_viewport (self->priv->timeline_scrolled, GTK_WIDGET (self->timeline)); +#line 290 "fillmore.vala" + gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (self->priv->timeline_scrolled), TRUE, TRUE, (guint) 0); +#line 291 "fillmore.vala" + self->priv->h_adjustment = (_tmp23_ = _g_object_ref0 (gtk_scrolled_window_get_hadjustment (self->priv->timeline_scrolled)), _g_object_unref0 (self->priv->h_adjustment), _tmp23_); +#line 295 "fillmore.vala" + buttons = g_object_ref_sink ((GtkHButtonBox*) gtk_hbutton_box_new ()); +#line 296 "fillmore.vala" + self->priv->addnew_button = (_tmp24_ = g_object_ref_sink ((GtkButton*) gtk_button_new ()), _g_object_unref0 (self->priv->addnew_button), _tmp24_); +#line 297 "fillmore.vala" + gtk_button_set_image (self->priv->addnew_button, GTK_WIDGET (_tmp25_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_icon_name ("general_add", GTK_ICON_SIZE_BUTTON)))); +#line 1087 "fillmore.c" + _g_object_unref0 (_tmp25_); +#line 298 "fillmore.vala" + g_signal_connect_object (self->priv->addnew_button, "clicked", (GCallback) _recorder_on_track_new_gtk_button_clicked, self, 0); +#line 299 "fillmore.vala" + gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (self->priv->addnew_button)); +#line 300 "fillmore.vala" + self->priv->play_button = (_tmp26_ = g_object_ref_sink ((GtkToggleButton*) gtk_toggle_button_new ()), _g_object_unref0 (self->priv->play_button), _tmp26_); +#line 301 "fillmore.vala" + gtk_button_set_image (GTK_BUTTON (self->priv->play_button), GTK_WIDGET (_tmp27_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_icon_name ("camera_playback", GTK_ICON_SIZE_BUTTON)))); +#line 1097 "fillmore.c" + _g_object_unref0 (_tmp27_); +#line 302 "fillmore.vala" + g_signal_connect_object (self->priv->play_button, "toggled", (GCallback) _recorder_on_play_gtk_toggle_button_toggled, self, 0); +#line 303 "fillmore.vala" + gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (self->priv->play_button)); +#line 304 "fillmore.vala" + self->priv->record_button = (_tmp28_ = g_object_ref_sink ((GtkToggleButton*) gtk_toggle_button_new ()), _g_object_unref0 (self->priv->record_button), _tmp28_); +#line 305 "fillmore.vala" + gtk_button_set_image (GTK_BUTTON (self->priv->record_button), GTK_WIDGET (_tmp29_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_icon_name ("camera_video_recording", GTK_ICON_SIZE_BUTTON)))); +#line 1107 "fillmore.c" + _g_object_unref0 (_tmp29_); +#line 306 "fillmore.vala" + g_signal_connect_object (self->priv->record_button, "toggled", (GCallback) _recorder_on_record_gtk_toggle_button_toggled, self, 0); +#line 307 "fillmore.vala" + gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (self->priv->record_button)); +#line 308 "fillmore.vala" + self->priv->rewind_button = (_tmp30_ = g_object_ref_sink ((GtkButton*) gtk_button_new ()), _g_object_unref0 (self->priv->rewind_button), _tmp30_); +#line 309 "fillmore.vala" + gtk_button_set_image (self->priv->rewind_button, GTK_WIDGET (_tmp31_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_icon_name ("pdf_viewer_first_page", GTK_ICON_SIZE_BUTTON)))); +#line 1117 "fillmore.c" + _g_object_unref0 (_tmp31_); +#line 310 "fillmore.vala" + g_signal_connect_object (self->priv->rewind_button, "clicked", (GCallback) _recorder_on_rewind_gtk_button_clicked, self, 0); +#line 311 "fillmore.vala" + gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (self->priv->rewind_button)); +#line 312 "fillmore.vala" + self->priv->forward_button = (_tmp32_ = g_object_ref_sink ((GtkButton*) gtk_button_new ()), _g_object_unref0 (self->priv->forward_button), _tmp32_); +#line 313 "fillmore.vala" + gtk_button_set_image (self->priv->forward_button, GTK_WIDGET (_tmp33_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_icon_name ("pdf_viewer_last_page", GTK_ICON_SIZE_BUTTON)))); +#line 1127 "fillmore.c" + _g_object_unref0 (_tmp33_); +#line 314 "fillmore.vala" + g_signal_connect_object (self->priv->forward_button, "clicked", (GCallback) _recorder_on_end_gtk_button_clicked, self, 0); +#line 315 "fillmore.vala" + gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (self->priv->forward_button)); +#line 316 "fillmore.vala" + self->priv->zoomin_button = (_tmp34_ = g_object_ref_sink ((GtkButton*) gtk_button_new ()), _g_object_unref0 (self->priv->zoomin_button), _tmp34_); +#line 317 "fillmore.vala" + gtk_button_set_image (self->priv->zoomin_button, GTK_WIDGET (_tmp35_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_icon_name ("pdf_zoomin", GTK_ICON_SIZE_BUTTON)))); +#line 1137 "fillmore.c" + _g_object_unref0 (_tmp35_); +#line 318 "fillmore.vala" + g_signal_connect_object (self->priv->zoomin_button, "clicked", (GCallback) _recorder_on_zoom_in_gtk_button_clicked, self, 0); +#line 319 "fillmore.vala" + gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (self->priv->zoomin_button)); +#line 320 "fillmore.vala" + self->priv->zoomout_button = (_tmp36_ = g_object_ref_sink ((GtkButton*) gtk_button_new ()), _g_object_unref0 (self->priv->zoomout_button), _tmp36_); +#line 321 "fillmore.vala" + gtk_button_set_image (self->priv->zoomout_button, GTK_WIDGET (_tmp37_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_icon_name ("pdf_zoomout", GTK_ICON_SIZE_BUTTON)))); +#line 1147 "fillmore.c" + _g_object_unref0 (_tmp37_); +#line 322 "fillmore.vala" + g_signal_connect_object (self->priv->zoomout_button, "clicked", (GCallback) _recorder_on_zoom_out_gtk_button_clicked, self, 0); +#line 323 "fillmore.vala" + gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (self->priv->zoomout_button)); +#line 324 "fillmore.vala" + self->priv->volume_button = (_tmp38_ = g_object_ref_sink ((GtkButton*) gtk_button_new ()), _g_object_unref0 (self->priv->volume_button), _tmp38_); +#line 325 "fillmore.vala" + gtk_button_set_image (self->priv->volume_button, GTK_WIDGET (_tmp39_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_icon_name ("statusarea_volumelevel4", GTK_ICON_SIZE_BUTTON)))); +#line 1157 "fillmore.c" + _g_object_unref0 (_tmp39_); +#line 326 "fillmore.vala" + g_signal_connect_object (self->priv->volume_button, "clicked", (GCallback) _recorder_on_volume_gtk_button_clicked, self, 0); +#line 327 "fillmore.vala" + gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (self->priv->volume_button)); +#line 330 "fillmore.vala" + vbox = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0)); +#line 331 "fillmore.vala" + gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (menubar), FALSE, FALSE, (guint) 0); +#line 333 "fillmore.vala" + gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (buttons), FALSE, FALSE, (guint) 0); +#line 335 "fillmore.vala" + main_view = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0)); +#line 337 "fillmore.vala" + self->priv->timeline_library_pane = (_tmp40_ = g_object_ref_sink ((GtkHPaned*) gtk_hpaned_new ()), _g_object_unref0 (self->priv->timeline_library_pane), _tmp40_); +#line 338 "fillmore.vala" + gtk_paned_set_position (GTK_PANED (self->priv->timeline_library_pane), MODEL_PROJECT (self->project)->library_width); +#line 339 "fillmore.vala" + gtk_paned_add1 (GTK_PANED (self->priv->timeline_library_pane), GTK_WIDGET (hbox)); +#line 340 "fillmore.vala" + GTK_PANED (self->priv->timeline_library_pane)->child1_resize = (guint) 1; +#line 341 "fillmore.vala" + gtk_paned_add2 (GTK_PANED (self->priv->timeline_library_pane), GTK_WIDGET (self->priv->library_scrolled)); +#line 342 "fillmore.vala" + GTK_PANED (self->priv->timeline_library_pane)->child2_resize = (guint) 0; +#line 343 "fillmore.vala" + g_signal_connect_object (GTK_PANED (self->priv->timeline_library_pane)->child1, "size-allocate", (GCallback) _recorder_on_library_size_allocate_gtk_widget_size_allocate, self, 0); +#line 346 "fillmore.vala" + gtk_box_pack_start (GTK_BOX (main_view), GTK_WIDGET (self->priv->timeline_library_pane), TRUE, TRUE, (guint) 0); +#line 349 "fillmore.vala" + self->priv->scrollwin = (_tmp41_ = g_object_ref_sink ((HildonPannableArea*) hildon_pannable_area_new ()), _g_object_unref0 (self->priv->scrollwin), _tmp41_); +#line 350 "fillmore.vala" + hildon_pannable_area_add_with_viewport (self->priv->scrollwin, GTK_WIDGET (main_view)); +#line 351 "fillmore.vala" + gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (self->priv->scrollwin)); +#line 353 "fillmore.vala" + gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (vbox)); +#line 355 "fillmore.vala" + recorder_on_view_library (self); +#line 357 "fillmore.vala" + save_graph = GTK_MENU_ITEM (recorder_get_widget (self, self->priv->manager, "/MenuBar/HelpMenu/SaveGraph")); +#line 360 "fillmore.vala" + if (!do_print_graph) { +#line 360 "fillmore.vala" + _tmp42_ = save_graph != NULL; +#line 1203 "fillmore.c" + } else { +#line 360 "fillmore.vala" + _tmp42_ = FALSE; +#line 1207 "fillmore.c" + } +#line 360 "fillmore.vala" + if (_tmp42_) { +#line 361 "fillmore.vala" + gtk_object_destroy (GTK_OBJECT (save_graph)); +#line 1213 "fillmore.c" + } +#line 364 "fillmore.vala" + gtk_window_add_accel_group (GTK_WINDOW (self), gtk_ui_manager_get_accel_group (self->priv->manager)); +#line 365 "fillmore.vala" + gtk_widget_grab_focus (GTK_WIDGET (self->timeline)); +#line 366 "fillmore.vala" + g_signal_connect_object (GTK_WIDGET (self), "delete-event", (GCallback) _recorder_on_delete_event_gtk_widget_delete_event, self, 0); +#line 367 "fillmore.vala" + self->priv->loading = TRUE; +#line 368 "fillmore.vala" + model_project_load (MODEL_PROJECT (self->project), project_file); +#line 369 "fillmore.vala" + if (project_file == NULL) { +#line 370 "fillmore.vala" + recorder_default_track_set (self); +#line 371 "fillmore.vala" + self->priv->loading = FALSE; +#line 1231 "fillmore.c" + } +#line 373 "fillmore.vala" + gst_element_set_state (GST_ELEMENT (MODEL_PROJECT (self->project)->media_engine->pipeline), GST_STATE_PAUSED); +#line 1235 "fillmore.c" + _g_object_unref0 (menubar); + _g_object_unref0 (toolbar); + _g_object_unref0 (hbox); + _g_object_unref0 (buttons); + _g_object_unref0 (vbox); + _g_object_unref0 (main_view); + _g_object_unref0 (save_graph); + return self; +} + + +#line 207 "fillmore.vala" +Recorder* recorder_new (const char* project_file, GError** error) { +#line 207 "fillmore.vala" + return recorder_construct (TYPE_RECORDER, project_file, error); +#line 1251 "fillmore.c" +} + + +#line 376 "fillmore.vala" +static void recorder_default_track_set (Recorder* self) { +#line 1257 "fillmore.c" + ModelAudioTrack* _tmp1_; + char* _tmp0_; + ModelTrack* _tmp2_; +#line 376 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 377 "fillmore.vala" + model_project_add_track (MODEL_PROJECT (self->project), MODEL_TRACK (_tmp1_ = model_audio_track_new (MODEL_PROJECT (self->project), _tmp0_ = recorder_get_default_track_name (self)))); +#line 1265 "fillmore.c" + _g_object_unref0 (_tmp1_); + _g_free0 (_tmp0_); +#line 378 "fillmore.vala" + model_track_set_selected (_tmp2_ = (ModelTrack*) gee_abstract_list_get (GEE_ABSTRACT_LIST (MODEL_PROJECT (self->project)->tracks), 0), TRUE); +#line 1270 "fillmore.c" + _g_object_unref0 (_tmp2_); +} + + +#line 381 "fillmore.vala" +static gint recorder_default_track_number_compare (void* a, void* b) { +#line 1277 "fillmore.c" + gint result = 0; + const char* s1; + const char* s2; + gint i; + gint j; +#line 382 "fillmore.vala" + s1 = (const char*) a; +#line 383 "fillmore.vala" + s2 = (const char*) b; +#line 384 "fillmore.vala" + i = -1; +#line 385 "fillmore.vala" + j = -1; +#line 386 "fillmore.vala" + sscanf (s1, "track %d", &i); +#line 387 "fillmore.vala" + sscanf (s2, "track %d", &j); +#line 388 "fillmore.vala" + g_assert (i > 0); +#line 389 "fillmore.vala" + g_assert (j > 0); +#line 390 "fillmore.vala" + if (i == j) { +#line 1301 "fillmore.c" + result = 0; +#line 391 "fillmore.vala" + return result; +#line 1305 "fillmore.c" + } else { +#line 392 "fillmore.vala" + if (i < j) { +#line 1309 "fillmore.c" + result = -1; +#line 393 "fillmore.vala" + return result; +#line 1313 "fillmore.c" + } else { + result = 1; +#line 395 "fillmore.vala" + return result; +#line 1318 "fillmore.c" + } + } +} + + +#line 381 "fillmore.vala" +static gint _recorder_default_track_number_compare_gcompare_func (void* a, void* b) { +#line 1326 "fillmore.c" + gint result; + result = recorder_default_track_number_compare (a, b); + return result; +} + + +static void _g_list_free_g_free (GList* self) { + g_list_foreach (self, (GFunc) g_free, NULL); + g_list_free (self); +} + + +#line 399 "fillmore.vala" +char* recorder_get_default_track_name (Recorder* self) { +#line 1341 "fillmore.c" + char* result = NULL; + GList* default_track_names; + gint i; +#line 399 "fillmore.vala" + g_return_val_if_fail (IS_RECORDER (self), NULL); +#line 400 "fillmore.vala" + default_track_names = NULL; +#line 1349 "fillmore.c" + { + GeeIterator* _track_it; + _track_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (MODEL_PROJECT (self->project)->tracks)); +#line 401 "fillmore.vala" + while (TRUE) { +#line 1355 "fillmore.c" + ModelTrack* track; +#line 401 "fillmore.vala" + if (!gee_iterator_next (_track_it)) { +#line 401 "fillmore.vala" + break; +#line 1361 "fillmore.c" + } +#line 401 "fillmore.vala" + track = (ModelTrack*) gee_iterator_get (_track_it); +#line 402 "fillmore.vala" + if (g_str_has_prefix (track->display_name, "track ")) { +#line 403 "fillmore.vala" + default_track_names = g_list_append (default_track_names, g_strdup (track->display_name)); +#line 1369 "fillmore.c" + } + _g_object_unref0 (track); + } + _g_object_unref0 (_track_it); + } +#line 406 "fillmore.vala" + default_track_names = g_list_sort (default_track_names, _recorder_default_track_number_compare_gcompare_func); +#line 408 "fillmore.vala" + i = 1; +#line 1379 "fillmore.c" + { + GList* s_collection; + GList* s_it; +#line 409 "fillmore.vala" + s_collection = default_track_names; +#line 1385 "fillmore.c" + for (s_it = s_collection; s_it != NULL; s_it = s_it->next) { + char* s; +#line 409 "fillmore.vala" + s = g_strdup ((const char*) s_it->data); +#line 1390 "fillmore.c" + { + char* track_name; +#line 410 "fillmore.vala" + track_name = g_strdup_printf ("track %d", i); +#line 411 "fillmore.vala" + if (_vala_strcmp0 (s, track_name) != 0) { +#line 1397 "fillmore.c" + result = track_name; + _g_free0 (s); + __g_list_free_g_free0 (default_track_names); +#line 412 "fillmore.vala" + return result; +#line 1403 "fillmore.c" + } +#line 414 "fillmore.vala" + i = i + 1; +#line 1407 "fillmore.c" + _g_free0 (s); + _g_free0 (track_name); + } + } + } + result = g_strdup_printf ("track %d", i); + __g_list_free_g_free0 (default_track_names); +#line 416 "fillmore.vala" + return result; +#line 1417 "fillmore.c" +} + + +#line 419 "fillmore.vala" +static GtkWidget* recorder_get_widget (Recorder* self, GtkUIManager* manager, const char* name) { +#line 1423 "fillmore.c" + GtkWidget* result = NULL; + GtkWidget* widget; +#line 419 "fillmore.vala" + g_return_val_if_fail (IS_RECORDER (self), NULL); +#line 419 "fillmore.vala" + g_return_val_if_fail (GTK_IS_UI_MANAGER (manager), NULL); +#line 419 "fillmore.vala" + g_return_val_if_fail (name != NULL, NULL); +#line 420 "fillmore.vala" + widget = _g_object_ref0 (gtk_ui_manager_get_widget (manager, name)); +#line 421 "fillmore.vala" + if (widget == NULL) { +#line 422 "fillmore.vala" + g_error ("fillmore.vala:422: can't find widget"); +#line 1438 "fillmore.c" + } + result = widget; +#line 423 "fillmore.vala" + return result; +#line 1443 "fillmore.c" +} + + +#line 426 "fillmore.vala" +static void recorder_on_track_move_up (Recorder* self) { +#line 1449 "fillmore.c" + gint index; + gint position; + gint track_ct; +#line 426 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 427 "fillmore.vala" + index = -1; +#line 428 "fillmore.vala" + position = 0; +#line 429 "fillmore.vala" + track_ct = gee_collection_get_size (GEE_COLLECTION (MODEL_PROJECT (self->project)->tracks)); +#line 430 "fillmore.vala" + if (0 < track_ct) { +#line 1463 "fillmore.c" + { + GeeIterator* _track_it; + _track_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (MODEL_PROJECT (self->project)->tracks)); +#line 431 "fillmore.vala" + while (TRUE) { +#line 1469 "fillmore.c" + ModelTrack* track; + ModelTrack* _tmp0_; + gboolean _tmp1_; +#line 431 "fillmore.vala" + if (!gee_iterator_next (_track_it)) { +#line 431 "fillmore.vala" + break; +#line 1477 "fillmore.c" + } +#line 431 "fillmore.vala" + track = (ModelTrack*) gee_iterator_get (_track_it); +#line 432 "fillmore.vala" + index = index + 1; +#line 433 "fillmore.vala" + if ((_tmp1_ = (_tmp0_ = recorder_selected_track (self)) == track, _g_object_unref0 (_tmp0_), _tmp1_)) { +#line 434 "fillmore.vala" + position = index; +#line 1487 "fillmore.c" + } + _g_object_unref0 (track); + } + _g_object_unref0 (_track_it); + } +#line 437 "fillmore.vala" + if (0 < position) { +#line 1495 "fillmore.c" + ModelTrack* _tmp2_; + ModelAudioTrack* track; +#line 438 "fillmore.vala" + track = (_tmp2_ = recorder_selected_track (self), MODEL_IS_AUDIO_TRACK (_tmp2_) ? ((ModelAudioTrack*) _tmp2_) : NULL); +#line 439 "fillmore.vala" + gee_abstract_collection_remove (GEE_ABSTRACT_COLLECTION (MODEL_PROJECT (self->project)->tracks), MODEL_TRACK (track)); +#line 440 "fillmore.vala" + gee_abstract_list_insert (GEE_ABSTRACT_LIST (MODEL_PROJECT (self->project)->tracks), position - 1, MODEL_TRACK (track)); +#line 1504 "fillmore.c" + _g_object_unref0 (track); + } + } +} + + +#line 444 "fillmore.vala" +static void recorder_on_track_move_down (Recorder* self) { +#line 1513 "fillmore.c" + gint index; + gint position; + gint track_ct; +#line 444 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 446 "fillmore.vala" + index = -1; +#line 447 "fillmore.vala" + position = 0; +#line 448 "fillmore.vala" + track_ct = gee_collection_get_size (GEE_COLLECTION (MODEL_PROJECT (self->project)->tracks)); +#line 449 "fillmore.vala" + if (0 < track_ct) { +#line 1527 "fillmore.c" + { + GeeIterator* _track_it; + _track_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (MODEL_PROJECT (self->project)->tracks)); +#line 450 "fillmore.vala" + while (TRUE) { +#line 1533 "fillmore.c" + ModelTrack* track; + ModelTrack* _tmp0_; + gboolean _tmp1_; +#line 450 "fillmore.vala" + if (!gee_iterator_next (_track_it)) { +#line 450 "fillmore.vala" + break; +#line 1541 "fillmore.c" + } +#line 450 "fillmore.vala" + track = (ModelTrack*) gee_iterator_get (_track_it); +#line 451 "fillmore.vala" + index = index + 1; +#line 452 "fillmore.vala" + if ((_tmp1_ = (_tmp0_ = recorder_selected_track (self)) == track, _g_object_unref0 (_tmp0_), _tmp1_)) { +#line 453 "fillmore.vala" + position = index; +#line 1551 "fillmore.c" + } + _g_object_unref0 (track); + } + _g_object_unref0 (_track_it); + } +#line 456 "fillmore.vala" + if ((track_ct - 1) > position) { +#line 1559 "fillmore.c" + ModelTrack* _tmp2_; + ModelAudioTrack* audio_track; +#line 457 "fillmore.vala" + audio_track = (_tmp2_ = recorder_selected_track (self), MODEL_IS_AUDIO_TRACK (_tmp2_) ? ((ModelAudioTrack*) _tmp2_) : NULL); +#line 458 "fillmore.vala" + gee_abstract_collection_remove (GEE_ABSTRACT_COLLECTION (MODEL_PROJECT (self->project)->tracks), MODEL_TRACK (audio_track)); +#line 459 "fillmore.vala" + gee_abstract_list_insert (GEE_ABSTRACT_LIST (MODEL_PROJECT (self->project)->tracks), position + 1, MODEL_TRACK (audio_track)); +#line 1568 "fillmore.c" + _g_object_unref0 (audio_track); + } + } +} + + +#line 463 "fillmore.vala" +static void recorder_on_tracks_scroll_up (Recorder* self) { +#line 1577 "fillmore.c" + gint _tmp0_ = 0; +#line 463 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 472 "fillmore.vala" + if (self->priv->scrollwin_pos_y < 4) { +#line 472 "fillmore.vala" + _tmp0_ = 0; +#line 1585 "fillmore.c" + } else { +#line 472 "fillmore.vala" + _tmp0_ = 64; +#line 1589 "fillmore.c" + } +#line 472 "fillmore.vala" + self->priv->scrollwin_pos_y = self->priv->scrollwin_pos_y - _tmp0_; +#line 473 "fillmore.vala" + hildon_pannable_area_scroll_to (self->priv->scrollwin, 0, self->priv->scrollwin_pos_y); +#line 1595 "fillmore.c" +} + + +#line 475 "fillmore.vala" +static void recorder_on_tracks_scroll_down (Recorder* self) { +#line 475 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 484 "fillmore.vala" + self->priv->scrollwin_pos_y = self->priv->scrollwin_pos_y + 64; +#line 485 "fillmore.vala" + hildon_pannable_area_scroll_to (self->priv->scrollwin, 0, self->priv->scrollwin_pos_y); +#line 1607 "fillmore.c" +} + + +#line 488 "fillmore.vala" +static void recorder_set_sensitive_group (Recorder* self, GtkActionGroup* group, const char* group_path, gboolean sensitive) { +#line 1613 "fillmore.c" + GtkAction* action; +#line 488 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 488 "fillmore.vala" + g_return_if_fail (GTK_IS_ACTION_GROUP (group)); +#line 488 "fillmore.vala" + g_return_if_fail (group_path != NULL); +#line 489 "fillmore.vala" + action = _g_object_ref0 (gtk_action_group_get_action (group, group_path)); +#line 490 "fillmore.vala" + gtk_action_set_sensitive (action, sensitive); +#line 1625 "fillmore.c" + _g_object_unref0 (action); +} + + +#line 493 "fillmore.vala" +static void recorder_on_track_changed (Recorder* self) { +#line 493 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 494 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_track_changed"); +#line 495 "fillmore.vala" + recorder_update_menu (self); +#line 1638 "fillmore.c" +} + + +#line 498 "fillmore.vala" +static void recorder_on_position_changed (Recorder* self) { +#line 498 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 499 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_position_changed"); +#line 500 "fillmore.vala" + recorder_update_menu (self); +#line 1650 "fillmore.c" +} + + +#line 516 "fillmore.vala" +static void _recorder_on_clip_added_model_track_clip_added (ModelTrack* _sender, ModelClip* clip, gboolean select, gpointer self) { +#line 1656 "fillmore.c" + recorder_on_clip_added (self, clip); +} + + +#line 522 "fillmore.vala" +static void _recorder_on_clip_removed_model_track_clip_removed (ModelTrack* _sender, ModelClip* clip, gpointer self) { +#line 1663 "fillmore.c" + recorder_on_clip_removed (self, clip); +} + + +#line 528 "fillmore.vala" +static void _recorder_on_track_selection_changed_model_track_track_selection_changed (ModelTrack* _sender, ModelTrack* track, gpointer self) { +#line 1670 "fillmore.c" + recorder_on_track_selection_changed (self, track); +} + + +#line 503 "fillmore.vala" +static void recorder_on_track_added (Recorder* self, ModelTrack* track) { +#line 503 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 503 "fillmore.vala" + g_return_if_fail (MODEL_IS_TRACK (track)); +#line 504 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_track_added"); +#line 505 "fillmore.vala" + recorder_update_menu (self); +#line 506 "fillmore.vala" + g_signal_connect_object (track, "clip-added", (GCallback) _recorder_on_clip_added_model_track_clip_added, self, 0); +#line 507 "fillmore.vala" + g_signal_connect_object (track, "clip-removed", (GCallback) _recorder_on_clip_removed_model_track_clip_removed, self, 0); +#line 508 "fillmore.vala" + g_signal_connect_object (track, "track-selection-changed", (GCallback) _recorder_on_track_selection_changed_model_track_track_selection_changed, self, 0); +#line 1691 "fillmore.c" +} + + +#line 511 "fillmore.vala" +static void recorder_on_track_removed (Recorder* self, ModelTrack* unused) { +#line 511 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 511 "fillmore.vala" + g_return_if_fail (MODEL_IS_TRACK (unused)); +#line 512 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_track_removed"); +#line 513 "fillmore.vala" + recorder_update_menu (self); +#line 1705 "fillmore.c" +} + + +#line 538 "fillmore.vala" +static void _recorder_on_clip_moved_model_clip_moved (ModelClip* _sender, ModelClip* clip, gpointer self) { +#line 1711 "fillmore.c" + recorder_on_clip_moved (self, clip); +} + + +#line 516 "fillmore.vala" +static void recorder_on_clip_added (Recorder* self, ModelClip* clip) { +#line 516 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 516 "fillmore.vala" + g_return_if_fail (MODEL_IS_CLIP (clip)); +#line 517 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_clip_added"); +#line 518 "fillmore.vala" + g_signal_connect_object (clip, "moved", (GCallback) _recorder_on_clip_moved_model_clip_moved, self, 0); +#line 519 "fillmore.vala" + recorder_update_menu (self); +#line 1728 "fillmore.c" +} + + +#line 522 "fillmore.vala" +static void recorder_on_clip_removed (Recorder* self, ModelClip* clip) { +#line 1734 "fillmore.c" + guint _tmp0_; +#line 522 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 522 "fillmore.vala" + g_return_if_fail (MODEL_IS_CLIP (clip)); +#line 523 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_clip_removed"); +#line 524 "fillmore.vala" + g_signal_parse_name ("moved", MODEL_TYPE_CLIP, &_tmp0_, NULL, FALSE); +#line 524 "fillmore.vala" + g_signal_handlers_disconnect_matched (clip, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _recorder_on_clip_moved_model_clip_moved, self); +#line 525 "fillmore.vala" + recorder_update_menu (self); +#line 1748 "fillmore.c" +} + + +#line 528 "fillmore.vala" +static void recorder_on_track_selection_changed (Recorder* self, ModelTrack* track) { +#line 528 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 528 "fillmore.vala" + g_return_if_fail (MODEL_IS_TRACK (track)); +#line 529 "fillmore.vala" + if (model_track_get_is_selected (track)) { +#line 1760 "fillmore.c" + { + GeeIterator* _t_it; + _t_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (MODEL_PROJECT (self->project)->tracks)); +#line 530 "fillmore.vala" + while (TRUE) { +#line 1766 "fillmore.c" + ModelTrack* t; +#line 530 "fillmore.vala" + if (!gee_iterator_next (_t_it)) { +#line 530 "fillmore.vala" + break; +#line 1772 "fillmore.c" + } +#line 530 "fillmore.vala" + t = (ModelTrack*) gee_iterator_get (_t_it); +#line 531 "fillmore.vala" + if (t != track) { +#line 532 "fillmore.vala" + model_track_set_selected (t, FALSE); +#line 1780 "fillmore.c" + } + _g_object_unref0 (t); + } + _g_object_unref0 (_t_it); + } + } +} + + +#line 538 "fillmore.vala" +static void recorder_on_clip_moved (Recorder* self, ModelClip* clip) { +#line 538 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 538 "fillmore.vala" + g_return_if_fail (MODEL_IS_CLIP (clip)); +#line 539 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_clip_moved"); +#line 540 "fillmore.vala" + recorder_update_menu (self); +#line 1800 "fillmore.c" +} + + +#line 543 "fillmore.vala" +static void recorder_on_drag_data_received (Recorder* self, GtkWidget* w, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint drag_info, guint time) { +#line 543 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 543 "fillmore.vala" + g_return_if_fail (GTK_IS_WIDGET (w)); +#line 543 "fillmore.vala" + g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); +#line 543 "fillmore.vala" + g_return_if_fail (selection_data != NULL); +#line 545 "fillmore.vala" + gtk_window_present (GTK_WINDOW (self)); +#line 1816 "fillmore.c" +} + + +#line 548 "fillmore.vala" +static void recorder_update_menu (Recorder* self) { +#line 1822 "fillmore.c" + gboolean library_selected; + gboolean selected; + gboolean playhead_on_clip; + gint number_of_tracks; + gboolean is_stopped; + gboolean one_selected; + gboolean _tmp1_ = FALSE; + gboolean _tmp2_ = FALSE; + gboolean _tmp3_ = FALSE; + gboolean _tmp4_ = FALSE; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_ = FALSE; + gboolean _tmp7_ = FALSE; + gboolean _tmp8_ = FALSE; + gboolean _tmp9_ = FALSE; + gboolean _tmp10_ = FALSE; + gboolean _tmp11_ = FALSE; + gboolean _tmp12_ = FALSE; + gboolean _tmp13_ = FALSE; +#line 548 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 549 "fillmore.vala" + library_selected = clip_library_view_has_selection (self->priv->library); +#line 550 "fillmore.vala" + selected = time_line_is_clip_selected (self->timeline); +#line 551 "fillmore.vala" + playhead_on_clip = model_project_playhead_on_clip (MODEL_PROJECT (self->project)); +#line 552 "fillmore.vala" + number_of_tracks = gee_collection_get_size (GEE_COLLECTION (MODEL_PROJECT (self->project)->tracks)); +#line 553 "fillmore.vala" + is_stopped = transport_delegate_is_stopped (TRANSPORT_DELEGATE (self)); +#line 554 "fillmore.vala" + one_selected = FALSE; +#line 555 "fillmore.vala" + if (library_selected) { +#line 1858 "fillmore.c" + GeeArrayList* _tmp0_; +#line 556 "fillmore.vala" + one_selected = gee_collection_get_size (GEE_COLLECTION (_tmp0_ = clip_library_view_get_selected_files (self->priv->library))) == 1; +#line 1862 "fillmore.c" + _g_object_unref0 (_tmp0_); + } else { +#line 557 "fillmore.vala" + if (selected) { +#line 558 "fillmore.vala" + one_selected = gee_collection_get_size (GEE_COLLECTION (self->timeline->selected_clips)) == 1; +#line 1869 "fillmore.c" + } + } +#line 562 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "NewProject", is_stopped); +#line 563 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Open", is_stopped); +#line 564 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Save", is_stopped); +#line 565 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "SaveAs", is_stopped); +#line 566 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Settings", is_stopped); +#line 567 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Export", model_project_can_export (MODEL_PROJECT (self->project))); +#line 568 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Quit", !model_project_transport_is_recording (MODEL_PROJECT (self->project))); +#line 571 "fillmore.vala" + if (is_stopped) { +#line 571 "fillmore.vala" + _tmp1_ = model_undo_manager_get_can_undo (MODEL_PROJECT (self->project)->undo_manager); +#line 1890 "fillmore.c" + } else { +#line 571 "fillmore.vala" + _tmp1_ = FALSE; +#line 1894 "fillmore.c" + } +#line 571 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Undo", _tmp1_); +#line 572 "fillmore.vala" + if (is_stopped) { +#line 572 "fillmore.vala" + _tmp2_ = selected; +#line 1902 "fillmore.c" + } else { +#line 572 "fillmore.vala" + _tmp2_ = FALSE; +#line 1906 "fillmore.c" + } +#line 572 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Copy", _tmp2_); +#line 573 "fillmore.vala" + if (is_stopped) { +#line 573 "fillmore.vala" + _tmp3_ = selected; +#line 1914 "fillmore.c" + } else { +#line 573 "fillmore.vala" + _tmp3_ = FALSE; +#line 1918 "fillmore.c" + } +#line 573 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Cut", _tmp3_); +#line 574 "fillmore.vala" + if (gee_collection_get_size (GEE_COLLECTION (self->timeline->clipboard->clips)) != 0) { +#line 574 "fillmore.vala" + _tmp4_ = is_stopped; +#line 1926 "fillmore.c" + } else { +#line 574 "fillmore.vala" + _tmp4_ = FALSE; +#line 1930 "fillmore.c" + } +#line 574 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Paste", _tmp4_); +#line 575 "fillmore.vala" + if (selected) { +#line 575 "fillmore.vala" + _tmp6_ = TRUE; +#line 1938 "fillmore.c" + } else { +#line 575 "fillmore.vala" + _tmp6_ = library_selected; +#line 1942 "fillmore.c" + } +#line 575 "fillmore.vala" + if (_tmp6_) { +#line 575 "fillmore.vala" + _tmp5_ = is_stopped; +#line 1948 "fillmore.c" + } else { +#line 575 "fillmore.vala" + _tmp5_ = FALSE; +#line 1952 "fillmore.c" + } +#line 575 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Delete", _tmp5_); +#line 577 "fillmore.vala" + if (selected) { +#line 577 "fillmore.vala" + _tmp8_ = playhead_on_clip; +#line 1960 "fillmore.c" + } else { +#line 577 "fillmore.vala" + _tmp8_ = FALSE; +#line 1964 "fillmore.c" + } +#line 577 "fillmore.vala" + if (_tmp8_) { +#line 577 "fillmore.vala" + _tmp7_ = is_stopped; +#line 1970 "fillmore.c" + } else { +#line 577 "fillmore.vala" + _tmp7_ = FALSE; +#line 1974 "fillmore.c" + } +#line 576 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "SplitAtPlayhead", _tmp7_); +#line 579 "fillmore.vala" + if (selected) { +#line 579 "fillmore.vala" + _tmp10_ = playhead_on_clip; +#line 1982 "fillmore.c" + } else { +#line 579 "fillmore.vala" + _tmp10_ = FALSE; +#line 1986 "fillmore.c" + } +#line 579 "fillmore.vala" + if (_tmp10_) { +#line 579 "fillmore.vala" + _tmp9_ = is_stopped; +#line 1992 "fillmore.c" + } else { +#line 579 "fillmore.vala" + _tmp9_ = FALSE; +#line 1996 "fillmore.c" + } +#line 578 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "TrimToPlayhead", _tmp9_); +#line 580 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "ClipProperties", one_selected); +#line 583 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "ZoomProject", model_project_get_length (MODEL_PROJECT (self->project)) != 0); +#line 586 "fillmore.vala" + if (number_of_tracks > 0) { +#line 586 "fillmore.vala" + _tmp11_ = is_stopped; +#line 2008 "fillmore.c" + } else { +#line 586 "fillmore.vala" + _tmp11_ = FALSE; +#line 2012 "fillmore.c" + } +#line 586 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Rename", _tmp11_); +#line 587 "fillmore.vala" + if (number_of_tracks > 0) { +#line 587 "fillmore.vala" + _tmp12_ = is_stopped; +#line 2020 "fillmore.c" + } else { +#line 587 "fillmore.vala" + _tmp12_ = FALSE; +#line 2024 "fillmore.c" + } +#line 587 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "DeleteTrack", _tmp12_); +#line 588 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "NewTrack", is_stopped); +#line 591 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Play", TRUE); +#line 592 "fillmore.vala" + if (number_of_tracks > 0) { +#line 592 "fillmore.vala" + _tmp13_ = is_stopped; +#line 2036 "fillmore.c" + } else { +#line 592 "fillmore.vala" + _tmp13_ = FALSE; +#line 2040 "fillmore.c" + } +#line 592 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Record", _tmp13_); +#line 2044 "fillmore.c" +} + + +#line 595 "fillmore.vala" +ModelTrack* recorder_selected_track (Recorder* self) { +#line 2050 "fillmore.c" + ModelTrack* result = NULL; +#line 595 "fillmore.vala" + g_return_val_if_fail (IS_RECORDER (self), NULL); +#line 2054 "fillmore.c" + { + GeeIterator* _track_it; + _track_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (MODEL_PROJECT (self->project)->tracks)); +#line 596 "fillmore.vala" + while (TRUE) { +#line 2060 "fillmore.c" + ModelTrack* track; +#line 596 "fillmore.vala" + if (!gee_iterator_next (_track_it)) { +#line 596 "fillmore.vala" + break; +#line 2066 "fillmore.c" + } +#line 596 "fillmore.vala" + track = (ModelTrack*) gee_iterator_get (_track_it); +#line 597 "fillmore.vala" + if (model_track_get_is_selected (track)) { +#line 2072 "fillmore.c" + result = track; + _g_object_unref0 (_track_it); +#line 598 "fillmore.vala" + return result; +#line 2077 "fillmore.c" + } + _g_object_unref0 (track); + } + _g_object_unref0 (_track_it); + } +#line 601 "fillmore.vala" + g_error ("fillmore.vala:601: can't find selected track"); +#line 2085 "fillmore.c" + result = NULL; +#line 602 "fillmore.vala" + return result; +#line 2089 "fillmore.c" +} + + +#line 605 "fillmore.vala" +void recorder_scroll_to_beginning (Recorder* self) { +#line 605 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 606 "fillmore.vala" + gtk_adjustment_set_value (self->priv->h_adjustment, 0.0); +#line 2099 "fillmore.c" +} + + +#line 609 "fillmore.vala" +void recorder_page_to_time (Recorder* self, gint64 time) { +#line 2105 "fillmore.c" + double location_in_window; + gint window_width; + gboolean _tmp0_ = FALSE; +#line 609 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 610 "fillmore.vala" + location_in_window = model_time_system_time_to_xpos (self->timeline->provider, time) - gtk_adjustment_get_value (self->priv->h_adjustment); +#line 611 "fillmore.vala" + window_width = GTK_WIDGET (gtk_widget_get_parent (GTK_WIDGET (self->timeline)))->allocation.width; +#line 612 "fillmore.vala" + if (location_in_window > (0.9 * window_width)) { +#line 612 "fillmore.vala" + _tmp0_ = TRUE; +#line 2119 "fillmore.c" + } else { +#line 613 "fillmore.vala" + _tmp0_ = location_in_window < (0.1 * window_width); +#line 2123 "fillmore.c" + } +#line 612 "fillmore.vala" + if (_tmp0_) { +#line 614 "fillmore.vala" + recorder_scroll_to_time (self, time); +#line 2129 "fillmore.c" + } +} + + +#line 618 "fillmore.vala" +void recorder_scroll_to_time (Recorder* self, gint64 time) { +#line 2136 "fillmore.c" + gint new_adjustment; + gint window_width; + gint max_value; +#line 618 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 619 "fillmore.vala" + new_adjustment = model_time_system_time_to_xpos (self->timeline->provider, time); +#line 620 "fillmore.vala" + window_width = GTK_WIDGET (gtk_widget_get_parent (GTK_WIDGET (self->timeline)))->allocation.width; +#line 621 "fillmore.vala" + if (new_adjustment < GTK_WIDGET (gtk_widget_get_parent (GTK_WIDGET (self->timeline)))->allocation.width) { +#line 622 "fillmore.vala" + new_adjustment = 0; +#line 2150 "fillmore.c" + } else { +#line 624 "fillmore.vala" + new_adjustment = new_adjustment - (window_width / 2); +#line 2154 "fillmore.c" + } +#line 627 "fillmore.vala" + max_value = (gint) (gtk_adjustment_get_upper (self->priv->h_adjustment) - GTK_WIDGET (self->priv->timeline_scrolled)->allocation.width); +#line 628 "fillmore.vala" + if (new_adjustment > max_value) { +#line 629 "fillmore.vala" + new_adjustment = max_value; +#line 2162 "fillmore.c" + } +#line 632 "fillmore.vala" + gtk_adjustment_set_value (self->priv->h_adjustment, (double) new_adjustment); +#line 2166 "fillmore.c" +} + + +#line 635 "fillmore.vala" +void recorder_scroll_to_end (Recorder* self) { +#line 635 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 636 "fillmore.vala" + recorder_scroll_to_time (self, model_project_get_length (MODEL_PROJECT (self->project))); +#line 2176 "fillmore.c" +} + + +#line 639 "fillmore.vala" +static gint recorder_sgn (gint x) { +#line 2182 "fillmore.c" + gint result = 0; + gint _tmp0_ = 0; +#line 640 "fillmore.vala" + if (x == 0) { +#line 2187 "fillmore.c" + result = 0; +#line 641 "fillmore.vala" + return result; +#line 2191 "fillmore.c" + } +#line 642 "fillmore.vala" + if (x < 0) { +#line 642 "fillmore.vala" + _tmp0_ = -1; +#line 2197 "fillmore.c" + } else { +#line 642 "fillmore.vala" + _tmp0_ = 1; +#line 2201 "fillmore.c" + } + result = _tmp0_; +#line 642 "fillmore.vala" + return result; +#line 2206 "fillmore.c" +} + + +#line 645 "fillmore.vala" +void recorder_scroll_toward_center (Recorder* self, gint xpos) { +#line 2212 "fillmore.c" + gint page_size; + gint diff; + gint d; + gint x; + gint max_value; +#line 645 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 646 "fillmore.vala" + if (self->priv->cursor_pos == (-1)) { +#line 647 "fillmore.vala" + self->priv->cursor_pos = xpos - ((gint) gtk_adjustment_get_value (self->priv->h_adjustment)); +#line 2224 "fillmore.c" + } +#line 652 "fillmore.vala" + page_size = (gint) gtk_adjustment_get_page_size (self->priv->h_adjustment); +#line 653 "fillmore.vala" + diff = (page_size / 2) - self->priv->cursor_pos; +#line 654 "fillmore.vala" + d = recorder_sgn (diff) * ((gint) sqrt ((double) abs (diff))); +#line 655 "fillmore.vala" + self->priv->cursor_pos = self->priv->cursor_pos + d; +#line 656 "fillmore.vala" + x = MAX (0, xpos - self->priv->cursor_pos); +#line 657 "fillmore.vala" + max_value = (gint) (gtk_adjustment_get_upper (self->priv->h_adjustment) - GTK_WIDGET (self->priv->timeline_scrolled)->allocation.width); +#line 658 "fillmore.vala" + if (x > max_value) { +#line 659 "fillmore.vala" + x = max_value; +#line 2242 "fillmore.c" + } +#line 661 "fillmore.vala" + gtk_adjustment_set_value (self->priv->h_adjustment, (double) x); +#line 2246 "fillmore.c" +} + + +#line 664 "fillmore.vala" +static gboolean recorder_real_key_press_event (GtkWidget* base, GdkEventKey* event) { +#line 2252 "fillmore.c" + Recorder * self; + gboolean result = FALSE; + self = RECORDER (base); +#line 665 "fillmore.vala" + switch ((*event).keyval) { +#line 2258 "fillmore.c" + case GDK_KP_Enter: + case GDK_Return: + { +#line 668 "fillmore.vala" + if (model_project_transport_is_recording (MODEL_PROJECT (self->project))) { +#line 669 "fillmore.vala" + break; +#line 2266 "fillmore.c" + } +#line 671 "fillmore.vala" + if (((*event).state & GDK_SHIFT_ALT_CONTROL_MASK) != 0) { +#line 2270 "fillmore.c" + result = GTK_WIDGET_CLASS (recorder_parent_class)->key_press_event (GTK_WIDGET (GTK_WINDOW (self)), event); +#line 672 "fillmore.vala" + return result; +#line 2274 "fillmore.c" + } +#line 673 "fillmore.vala" + recorder_on_rewind (self); +#line 674 "fillmore.vala" + break; +#line 2280 "fillmore.c" + } + case GDK_Left: + { +#line 676 "fillmore.vala" + if (model_project_transport_is_recording (MODEL_PROJECT (self->project))) { +#line 677 "fillmore.vala" + break; +#line 2288 "fillmore.c" + } +#line 679 "fillmore.vala" + if (((*event).state & GDK_CONTROL_MASK) != 0) { +#line 680 "fillmore.vala" + model_project_go_previous (MODEL_PROJECT (self->project)); +#line 2294 "fillmore.c" + } else { +#line 682 "fillmore.vala" + view_media_engine_go (MODEL_PROJECT (self->project)->media_engine, model_project_transport_get_position (MODEL_PROJECT (self->project)) - GST_SECOND); +#line 2298 "fillmore.c" + } +#line 684 "fillmore.vala" + recorder_page_to_time (self, model_project_transport_get_position (MODEL_PROJECT (self->project))); +#line 685 "fillmore.vala" + break; +#line 2304 "fillmore.c" + } + case GDK_Right: + { +#line 687 "fillmore.vala" + if (model_project_transport_is_recording (MODEL_PROJECT (self->project))) { +#line 688 "fillmore.vala" + break; +#line 2312 "fillmore.c" + } +#line 690 "fillmore.vala" + if (((*event).state & GDK_CONTROL_MASK) != 0) { +#line 691 "fillmore.vala" + model_project_go_next (MODEL_PROJECT (self->project)); +#line 2318 "fillmore.c" + } else { +#line 693 "fillmore.vala" + view_media_engine_go (MODEL_PROJECT (self->project)->media_engine, model_project_transport_get_position (MODEL_PROJECT (self->project)) + GST_SECOND); +#line 2322 "fillmore.c" + } +#line 695 "fillmore.vala" + recorder_page_to_time (self, model_project_transport_get_position (MODEL_PROJECT (self->project))); +#line 696 "fillmore.vala" + break; +#line 2328 "fillmore.c" + } + case GDK_KP_Add: + case GDK_equal: + case GDK_plus: + { +#line 700 "fillmore.vala" + recorder_on_zoom_in (self); +#line 701 "fillmore.vala" + break; +#line 2338 "fillmore.c" + } + case GDK_KP_Subtract: + case GDK_minus: + case GDK_underscore: + { +#line 705 "fillmore.vala" + recorder_on_zoom_out (self); +#line 706 "fillmore.vala" + break; +#line 2348 "fillmore.c" + } + default: + { + result = GTK_WIDGET_CLASS (recorder_parent_class)->key_press_event (GTK_WIDGET (GTK_WINDOW (self)), event); +#line 708 "fillmore.vala" + return result; +#line 2355 "fillmore.c" + } + } + result = TRUE; +#line 710 "fillmore.vala" + return result; +#line 2361 "fillmore.c" +} + + +#line 714 "fillmore.vala" +static void recorder_on_export (Recorder* self) { +#line 2367 "fillmore.c" + GError * _inner_error_; + char* filename; +#line 714 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 2372 "fillmore.c" + _inner_error_ = NULL; +#line 715 "fillmore.vala" + filename = NULL; +#line 716 "fillmore.vala" + if (dialog_utils_save (GTK_WINDOW (self), "Export", FALSE, RECORDER_export_filters, G_N_ELEMENTS (RECORDER_export_filters), &filename)) { +#line 2378 "fillmore.c" + { + MultiFileProgress* _tmp0_; + GstCaps* _tmp1_; + ViewOggVorbisExport* _tmp2_; + ViewOggVorbisExport* _tmp3_; + ViewOggVorbisExport* _tmp4_; +#line 718 "fillmore.vala" + _tmp0_ = g_object_ref_sink (multi_file_progress_new (GTK_WINDOW (self), 1, "Export", MULTI_FILE_PROGRESS_INTERFACE (MODEL_PROJECT (self->project)->media_engine))); +#line 2387 "fillmore.c" + _g_object_unref0 (_tmp0_); +#line 719 "fillmore.vala" + view_media_engine_disconnect_output (MODEL_PROJECT (self->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->audio_output)); +#line 720 "fillmore.vala" + _tmp3_ = (_tmp2_ = view_ogg_vorbis_export_new (VIEW_MEDIA_CONNECTOR_MEDIA_TYPES_Audio, filename, _tmp1_ = view_media_engine_get_project_audio_export_caps (MODEL_PROJECT (self->project)->media_engine), &_inner_error_), _gst_caps_unref0 (_tmp1_), _tmp2_); +#line 2393 "fillmore.c" + if (_inner_error_ != NULL) { + goto __catch5_g_error; + } +#line 720 "fillmore.vala" + self->priv->audio_export = (_tmp4_ = _tmp3_, _g_object_unref0 (self->priv->audio_export), _tmp4_); +#line 722 "fillmore.vala" + view_media_engine_connect_output (MODEL_PROJECT (self->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->audio_export)); +#line 723 "fillmore.vala" + view_media_engine_start_export (MODEL_PROJECT (self->project)->media_engine, filename); +#line 2403 "fillmore.c" + } + goto __finally5; + __catch5_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { +#line 725 "fillmore.vala" + recorder_do_error_dialog ("Could not export file", e->message); +#line 2414 "fillmore.c" + _g_error_free0 (e); + } + } + __finally5: + if (_inner_error_ != NULL) { + _g_free0 (filename); + 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); + g_clear_error (&_inner_error_); + return; + } + } + _g_free0 (filename); +} + + +#line 730 "fillmore.vala" +static void recorder_on_post_export (Recorder* self, gboolean canceled) { +#line 2432 "fillmore.c" + ViewOggVorbisExport* _tmp1_; +#line 730 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 731 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_post_export"); +#line 732 "fillmore.vala" + view_media_engine_disconnect_output (MODEL_PROJECT (self->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->audio_export)); +#line 733 "fillmore.vala" + view_media_engine_connect_output (MODEL_PROJECT (self->project)->media_engine, VIEW_MEDIA_CONNECTOR (self->priv->audio_output)); +#line 735 "fillmore.vala" + if (canceled) { +#line 2444 "fillmore.c" + char* _tmp0_; +#line 736 "fillmore.vala" + g_remove (_tmp0_ = view_ogg_vorbis_export_get_filename (self->priv->audio_export)); +#line 2448 "fillmore.c" + _g_free0 (_tmp0_); + } +#line 739 "fillmore.vala" + self->priv->audio_export = (_tmp1_ = NULL, _g_object_unref0 (self->priv->audio_export), _tmp1_); +#line 2453 "fillmore.c" +} + + +#line 742 "fillmore.vala" +static void _recorder_on_project_new_finished_closing_recorder_finished_closing (Recorder* _sender, gboolean project_did_close, gpointer self) { +#line 2459 "fillmore.c" + recorder_on_project_new_finished_closing (self, project_did_close); +} + + +#line 742 "fillmore.vala" +static void recorder_on_project_new_finished_closing (Recorder* self, gboolean project_did_close) { +#line 2466 "fillmore.c" + guint _tmp0_; + guint _tmp1_; +#line 742 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 743 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_project_new_finished_closing"); +#line 744 "fillmore.vala" + g_signal_parse_name ("closed", MODEL_TYPE_PROJECT, &_tmp0_, NULL, FALSE); +#line 744 "fillmore.vala" + g_signal_handlers_disconnect_matched (MODEL_PROJECT (self->project), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _recorder_on_project_close_model_project_closed, self); +#line 745 "fillmore.vala" + g_signal_parse_name ("finished-closing", TYPE_RECORDER, &_tmp1_, NULL, FALSE); +#line 745 "fillmore.vala" + g_signal_handlers_disconnect_matched (self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _recorder_on_project_new_finished_closing_recorder_finished_closing, self); +#line 746 "fillmore.vala" + if (project_did_close) { +#line 747 "fillmore.vala" + view_media_engine_set_play_state (MODEL_PROJECT (self->project)->media_engine, PLAY_STATE_LOADING); +#line 748 "fillmore.vala" + model_project_load (MODEL_PROJECT (self->project), NULL); +#line 749 "fillmore.vala" + recorder_default_track_set (self); +#line 750 "fillmore.vala" + gst_element_set_state (GST_ELEMENT (MODEL_PROJECT (self->project)->media_engine->pipeline), GST_STATE_PAUSED); +#line 751 "fillmore.vala" + model_undo_manager_reset (MODEL_PROJECT (self->project)->undo_manager); +#line 2493 "fillmore.c" + } +} + + +#line 755 "fillmore.vala" +static void recorder_on_project_new (Recorder* self) { +#line 755 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 756 "fillmore.vala" + gee_abstract_collection_clear (GEE_ABSTRACT_COLLECTION (self->priv->load_errors)); +#line 757 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "closed", (GCallback) _recorder_on_project_close_model_project_closed, self, 0); +#line 758 "fillmore.vala" + g_signal_connect_object (self, "finished-closing", (GCallback) _recorder_on_project_new_finished_closing_recorder_finished_closing, self, 0); +#line 759 "fillmore.vala" + model_project_close (MODEL_PROJECT (self->project)); +#line 2510 "fillmore.c" +} + + +#line 762 "fillmore.vala" +static void _recorder_on_project_open_finished_closing_recorder_finished_closing (Recorder* _sender, gboolean project_did_close, gpointer self) { +#line 2516 "fillmore.c" + recorder_on_project_open_finished_closing (self, project_did_close); +} + + +static void _g_slist_free_g_free (GSList* self) { + g_slist_foreach (self, (GFunc) g_free, NULL); + g_slist_free (self); +} + + +#line 762 "fillmore.vala" +static void recorder_on_project_open_finished_closing (Recorder* self, gboolean project_did_close) { +#line 2529 "fillmore.c" + guint _tmp0_; + guint _tmp1_; +#line 762 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 763 "fillmore.vala" + g_signal_parse_name ("closed", MODEL_TYPE_PROJECT, &_tmp0_, NULL, FALSE); +#line 763 "fillmore.vala" + g_signal_handlers_disconnect_matched (MODEL_PROJECT (self->project), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _recorder_on_project_close_model_project_closed, self); +#line 764 "fillmore.vala" + g_signal_parse_name ("finished-closing", TYPE_RECORDER, &_tmp1_, NULL, FALSE); +#line 764 "fillmore.vala" + g_signal_handlers_disconnect_matched (self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _recorder_on_project_open_finished_closing_recorder_finished_closing, self); +#line 765 "fillmore.vala" + if (project_did_close) { +#line 2544 "fillmore.c" + GSList* filenames; + GSList* _tmp4_; + gboolean _tmp3_; + GSList* _tmp2_ = NULL; + filenames = NULL; +#line 767 "fillmore.vala" + if ((_tmp3_ = dialog_utils_open (GTK_WINDOW (self), RECORDER_filters, G_N_ELEMENTS (RECORDER_filters), FALSE, FALSE, &_tmp2_), filenames = (_tmp4_ = _tmp2_, __g_slist_free_g_free0 (filenames), _tmp4_), _tmp3_)) { +#line 768 "fillmore.vala" + self->priv->loading = TRUE; +#line 769 "fillmore.vala" + model_project_load (MODEL_PROJECT (self->project), (const char*) filenames->data); +#line 2556 "fillmore.c" + } + __g_slist_free_g_free0 (filenames); + } +} + + +#line 774 "fillmore.vala" +static void recorder_on_project_open (Recorder* self) { +#line 774 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 775 "fillmore.vala" + gee_abstract_collection_clear (GEE_ABSTRACT_COLLECTION (self->priv->load_errors)); +#line 776 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "closed", (GCallback) _recorder_on_project_close_model_project_closed, self, 0); +#line 777 "fillmore.vala" + g_signal_connect_object (self, "finished-closing", (GCallback) _recorder_on_project_open_finished_closing_recorder_finished_closing, self, 0); +#line 778 "fillmore.vala" + model_project_close (MODEL_PROJECT (self->project)); +#line 2575 "fillmore.c" +} + + +#line 781 "fillmore.vala" +static void recorder_on_project_save_as (Recorder* self) { +#line 781 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 782 "fillmore.vala" + recorder_save_dialog (self); +#line 2585 "fillmore.c" +} + + +#line 785 "fillmore.vala" +static void recorder_on_project_save (Recorder* self) { +#line 785 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 786 "fillmore.vala" + recorder_do_save (self); +#line 2595 "fillmore.c" +} + + +#line 789 "fillmore.vala" +static void _recorder_on_save_new_file_finished_closing_recorder_finished_closing (Recorder* _sender, gboolean project_did_close, gpointer self) { +#line 2601 "fillmore.c" + recorder_on_save_new_file_finished_closing (self, project_did_close); +} + + +#line 789 "fillmore.vala" +static void recorder_on_save_new_file_finished_closing (Recorder* self, gboolean did_close) { +#line 2608 "fillmore.c" + guint _tmp0_; + guint _tmp1_; + char* _tmp2_; +#line 789 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 790 "fillmore.vala" + g_signal_parse_name ("closed", MODEL_TYPE_PROJECT, &_tmp0_, NULL, FALSE); +#line 790 "fillmore.vala" + g_signal_handlers_disconnect_matched (MODEL_PROJECT (self->project), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _recorder_on_project_close_model_project_closed, self); +#line 791 "fillmore.vala" + g_signal_parse_name ("finished-closing", TYPE_RECORDER, &_tmp1_, NULL, FALSE); +#line 791 "fillmore.vala" + g_signal_handlers_disconnect_matched (self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _recorder_on_save_new_file_finished_closing_recorder_finished_closing, self); +#line 792 "fillmore.vala" + model_project_load (MODEL_PROJECT (self->project), _tmp2_ = model_project_get_project_file (MODEL_PROJECT (self->project))); +#line 2624 "fillmore.c" + _g_free0 (_tmp2_); +} + + +#line 795 "fillmore.vala" +static gboolean recorder_do_save (Recorder* self) { +#line 2631 "fillmore.c" + gboolean result = FALSE; + char* _tmp0_; + gboolean _tmp1_; +#line 795 "fillmore.vala" + g_return_val_if_fail (IS_RECORDER (self), FALSE); +#line 796 "fillmore.vala" + if ((_tmp1_ = (_tmp0_ = model_project_get_project_file (MODEL_PROJECT (self->project))) != NULL, _g_free0 (_tmp0_), _tmp1_)) { +#line 797 "fillmore.vala" + model_project_save (MODEL_PROJECT (self->project), NULL); +#line 2641 "fillmore.c" + result = TRUE; +#line 798 "fillmore.vala" + return result; +#line 2645 "fillmore.c" + } else { + result = recorder_save_dialog (self); +#line 801 "fillmore.vala" + return result; +#line 2650 "fillmore.c" + } +} + + +#line 805 "fillmore.vala" +static gboolean recorder_save_dialog (Recorder* self) { +#line 2657 "fillmore.c" + gboolean result = FALSE; + char* _tmp0_; + gboolean _tmp1_; + gboolean saving_new_file; + char* filename; + char* _tmp2_; + gboolean _tmp3_; + gboolean create_directory; +#line 805 "fillmore.vala" + g_return_val_if_fail (IS_RECORDER (self), FALSE); +#line 806 "fillmore.vala" + saving_new_file = (_tmp1_ = (_tmp0_ = model_project_get_project_file (MODEL_PROJECT (self->project))) == NULL, _g_free0 (_tmp0_), _tmp1_); +#line 808 "fillmore.vala" + filename = model_project_get_project_file (MODEL_PROJECT (self->project)); +#line 809 "fillmore.vala" + create_directory = (_tmp3_ = (_tmp2_ = model_project_get_project_file (MODEL_PROJECT (self->project))) == NULL, _g_free0 (_tmp2_), _tmp3_); +#line 810 "fillmore.vala" + if (dialog_utils_save (GTK_WINDOW (self), "Save Project", create_directory, RECORDER_filters, G_N_ELEMENTS (RECORDER_filters), &filename)) { +#line 2676 "fillmore.c" + gboolean _tmp4_ = FALSE; +#line 811 "fillmore.vala" + model_project_save (MODEL_PROJECT (self->project), filename); +#line 812 "fillmore.vala" + if (saving_new_file) { +#line 2682 "fillmore.c" + char* _tmp5_; +#line 812 "fillmore.vala" + _tmp4_ = (_tmp5_ = model_project_get_project_file (MODEL_PROJECT (self->project))) != NULL; +#line 2686 "fillmore.c" + _g_free0 (_tmp5_); + } else { +#line 812 "fillmore.vala" + _tmp4_ = FALSE; +#line 2691 "fillmore.c" + } +#line 812 "fillmore.vala" + if (_tmp4_) { +#line 813 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "closed", (GCallback) _recorder_on_project_close_model_project_closed, self, 0); +#line 814 "fillmore.vala" + g_signal_connect_object (self, "finished-closing", (GCallback) _recorder_on_save_new_file_finished_closing_recorder_finished_closing, self, 0); +#line 815 "fillmore.vala" + model_project_close (MODEL_PROJECT (self->project)); +#line 2701 "fillmore.c" + } + result = TRUE; + _g_free0 (filename); +#line 817 "fillmore.vala" + return result; +#line 2707 "fillmore.c" + } + result = FALSE; + _g_free0 (filename); +#line 819 "fillmore.vala" + return result; +#line 2713 "fillmore.c" +} + + +#line 822 "fillmore.vala" +static void recorder_on_properties (Recorder* self) { +#line 2719 "fillmore.c" + GError * _inner_error_; + GtkBuilder* builder; + ProjectProperties* properties; + gint response; +#line 822 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 2726 "fillmore.c" + _inner_error_ = NULL; +#line 823 "fillmore.vala" + builder = gtk_builder_new (); +#line 2730 "fillmore.c" + { + char* _tmp2_; + char* _tmp1_; + GFile* _tmp0_; +#line 825 "fillmore.vala" + gtk_builder_add_from_file (builder, _tmp2_ = g_strconcat (_tmp1_ = g_file_get_path (_tmp0_ = app_dirs_get_exec_dir ()), "/resources/fillmore.glade", NULL), &_inner_error_); +#line 2737 "fillmore.c" + _g_free0 (_tmp2_); + _g_free0 (_tmp1_); + _g_object_unref0 (_tmp0_); + if (_inner_error_ != NULL) { + goto __catch6_g_error; + } + } + goto __finally6; + __catch6_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { +#line 829 "fillmore.vala" + fprintf (stdout, "%s\n", e->message); +#line 2754 "fillmore.c" + _g_error_free0 (e); + _g_object_unref0 (builder); +#line 830 "fillmore.vala" + return; +#line 2759 "fillmore.c" + } + } + __finally6: + if (_inner_error_ != NULL) { + _g_object_unref0 (builder); + 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); + g_clear_error (&_inner_error_); + return; + } +#line 832 "fillmore.vala" + gtk_builder_connect_signals (builder, NULL); +#line 833 "fillmore.vala" + properties = _g_object_ref0 (PROJECT_PROPERTIES (gtk_builder_get_object (builder, "projectproperties1"))); +#line 834 "fillmore.vala" + project_properties_setup (properties, MODEL_PROJECT (self->project), builder); +#line 836 "fillmore.vala" + response = gtk_dialog_run (GTK_DIALOG (properties)); +#line 837 "fillmore.vala" + if (response == GTK_RESPONSE_APPLY) { +#line 2779 "fillmore.c" + char* description; + Fraction _tmp4_; + Fraction _tmp3_ = {0}; +#line 838 "fillmore.vala" + description = g_strdup ("Set Project Properties"); +#line 839 "fillmore.vala" + model_undo_manager_start_transaction (MODEL_PROJECT (self->project)->undo_manager, description); +#line 840 "fillmore.vala" + model_project_set_bpm (MODEL_PROJECT (self->project), project_properties_get_tempo (properties)); +#line 841 "fillmore.vala" + model_project_set_time_signature (MODEL_PROJECT (self->project), (_tmp4_ = (project_properties_get_time_signature (properties, &_tmp3_), _tmp3_), &_tmp4_)); +#line 842 "fillmore.vala" + MODEL_PROJECT (self->project)->click_during_record = project_properties_during_record (properties); +#line 843 "fillmore.vala" + MODEL_PROJECT (self->project)->click_during_play = project_properties_during_play (properties); +#line 844 "fillmore.vala" + MODEL_PROJECT (self->project)->click_volume = project_properties_get_click_volume (properties); +#line 845 "fillmore.vala" + model_undo_manager_end_transaction (MODEL_PROJECT (self->project)->undo_manager, description); +#line 2799 "fillmore.c" + _g_free0 (description); + } +#line 847 "fillmore.vala" + gtk_object_destroy (GTK_OBJECT (properties)); +#line 2804 "fillmore.c" + _g_object_unref0 (builder); + _g_object_unref0 (properties); +} + + +#line 850 "fillmore.vala" +static void _recorder_on_quit_finished_closing_recorder_finished_closing (Recorder* _sender, gboolean project_did_close, gpointer self) { +#line 2812 "fillmore.c" + recorder_on_quit_finished_closing (self, project_did_close); +} + + +#line 850 "fillmore.vala" +static void recorder_on_quit_finished_closing (Recorder* self, gboolean project_did_close) { +#line 2819 "fillmore.c" + guint _tmp0_; + guint _tmp1_; +#line 850 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 851 "fillmore.vala" + g_signal_parse_name ("closed", MODEL_TYPE_PROJECT, &_tmp0_, NULL, FALSE); +#line 851 "fillmore.vala" + g_signal_handlers_disconnect_matched (MODEL_PROJECT (self->project), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _recorder_on_project_close_model_project_closed, self); +#line 852 "fillmore.vala" + g_signal_parse_name ("finished-closing", TYPE_RECORDER, &_tmp1_, NULL, FALSE); +#line 852 "fillmore.vala" + g_signal_handlers_disconnect_matched (self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _recorder_on_quit_finished_closing_recorder_finished_closing, self); +#line 853 "fillmore.vala" + if (project_did_close) { +#line 854 "fillmore.vala" + gtk_main_quit (); +#line 2836 "fillmore.c" + } +} + + +#line 858 "fillmore.vala" +static void recorder_on_quit (Recorder* self) { +#line 858 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 859 "fillmore.vala" + if (!model_project_transport_is_recording (MODEL_PROJECT (self->project))) { +#line 860 "fillmore.vala" + g_signal_connect_object (MODEL_PROJECT (self->project), "closed", (GCallback) _recorder_on_project_close_model_project_closed, self, 0); +#line 861 "fillmore.vala" + g_signal_connect_object (self, "finished-closing", (GCallback) _recorder_on_quit_finished_closing_recorder_finished_closing, self, 0); +#line 862 "fillmore.vala" + model_project_close (MODEL_PROJECT (self->project)); +#line 2853 "fillmore.c" + } +} + + +#line 866 "fillmore.vala" +static gboolean recorder_on_delete_event (Recorder* self) { +#line 2860 "fillmore.c" + gboolean result = FALSE; +#line 866 "fillmore.vala" + g_return_val_if_fail (IS_RECORDER (self), FALSE); +#line 867 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_delete_event"); +#line 868 "fillmore.vala" + recorder_on_quit (self); +#line 2868 "fillmore.c" + result = TRUE; +#line 869 "fillmore.vala" + return result; +#line 2872 "fillmore.c" +} + + +#line 872 "fillmore.vala" +static void recorder_on_project_close (Recorder* self) { +#line 872 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 873 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_project_close"); +#line 874 "fillmore.vala" + if (model_undo_manager_get_is_dirty (MODEL_PROJECT (self->project)->undo_manager)) { +#line 875 "fillmore.vala" + switch (dialog_utils_save_close_cancel (GTK_WINDOW (self), NULL, "Save changes before closing?")) { +#line 2886 "fillmore.c" + case GTK_RESPONSE_ACCEPT: + { +#line 877 "fillmore.vala" + if (!recorder_do_save (self)) { +#line 878 "fillmore.vala" + g_signal_emit_by_name (self, "finished-closing", FALSE); +#line 879 "fillmore.vala" + return; +#line 2895 "fillmore.c" + } +#line 881 "fillmore.vala" + break; +#line 2899 "fillmore.c" + } + case GTK_RESPONSE_NO: + { + char* _tmp0_; + gboolean _tmp1_; +#line 884 "fillmore.vala" + if ((_tmp1_ = (_tmp0_ = model_project_get_project_file (MODEL_PROJECT (self->project))) == NULL, _g_free0 (_tmp0_), _tmp1_)) { +#line 885 "fillmore.vala" + model_project_save (MODEL_PROJECT (self->project), NULL); +#line 2909 "fillmore.c" + } +#line 887 "fillmore.vala" + break; +#line 2913 "fillmore.c" + } + case GTK_RESPONSE_DELETE_EVENT: + case GTK_RESPONSE_CANCEL: + { +#line 890 "fillmore.vala" + g_signal_emit_by_name (self, "finished-closing", FALSE); +#line 891 "fillmore.vala" + return; +#line 2922 "fillmore.c" + } + default: + { +#line 893 "fillmore.vala" + g_assert (FALSE); +#line 894 "fillmore.vala" + break; +#line 2930 "fillmore.c" + } + } + } +#line 897 "fillmore.vala" + g_signal_emit_by_name (self, "finished-closing", TRUE); +#line 2936 "fillmore.c" +} + + +#line 901 "fillmore.vala" +static void recorder_on_cut (Recorder* self) { +#line 901 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 902 "fillmore.vala" + time_line_do_cut (self->timeline); +#line 2946 "fillmore.c" +} + + +#line 905 "fillmore.vala" +static void recorder_on_copy (Recorder* self) { +#line 905 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 906 "fillmore.vala" + time_line_do_copy (self->timeline); +#line 2956 "fillmore.c" +} + + +#line 909 "fillmore.vala" +static void recorder_on_paste (Recorder* self) { +#line 909 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 910 "fillmore.vala" + time_line_paste (self->timeline); +#line 2966 "fillmore.c" +} + + +#line 913 "fillmore.vala" +static void recorder_on_undo (Recorder* self) { +#line 913 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 914 "fillmore.vala" + model_project_undo (MODEL_PROJECT (self->project)); +#line 2976 "fillmore.c" +} + + +#line 917 "fillmore.vala" +static void recorder_on_delete (Recorder* self) { +#line 917 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 918 "fillmore.vala" + if (clip_library_view_has_selection (self->priv->library)) { +#line 919 "fillmore.vala" + clip_library_view_delete_selection (self->priv->library); +#line 2988 "fillmore.c" + } else { +#line 921 "fillmore.vala" + time_line_delete_selection (self->timeline); +#line 2992 "fillmore.c" + } +} + + +#line 925 "fillmore.vala" +static void recorder_on_select_all (Recorder* self) { +#line 925 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 926 "fillmore.vala" + if (clip_library_view_has_selection (self->priv->library)) { +#line 927 "fillmore.vala" + clip_library_view_select_all (self->priv->library); +#line 3005 "fillmore.c" + } else { +#line 929 "fillmore.vala" + time_line_select_all (self->timeline); +#line 3009 "fillmore.c" + } +} + + +#line 933 "fillmore.vala" +void recorder_on_split_at_playhead (Recorder* self) { +#line 933 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 934 "fillmore.vala" + model_project_split_at_playhead (MODEL_PROJECT (self->project)); +#line 3020 "fillmore.c" +} + + +#line 937 "fillmore.vala" +void recorder_on_trim_to_playhead (Recorder* self) { +#line 937 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 938 "fillmore.vala" + model_project_trim_to_playhead (MODEL_PROJECT (self->project)); +#line 3030 "fillmore.c" +} + + +#line 941 "fillmore.vala" +void recorder_on_clip_properties (Recorder* self) { +#line 941 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 942 "fillmore.vala" + if (clip_library_view_has_selection (self->priv->library)) { +#line 3040 "fillmore.c" + GeeArrayList* files; +#line 943 "fillmore.vala" + files = clip_library_view_get_selected_files (self->priv->library); +#line 944 "fillmore.vala" + if (gee_collection_get_size (GEE_COLLECTION (files)) == 1) { +#line 3046 "fillmore.c" + char* file_name; + ModelClipFile* clip_file; +#line 945 "fillmore.vala" + file_name = (char*) gee_abstract_list_get (GEE_ABSTRACT_LIST (files), 0); +#line 946 "fillmore.vala" + clip_file = model_project_find_clipfile (MODEL_PROJECT (self->project), file_name); +#line 947 "fillmore.vala" + dialog_utils_show_clip_properties (GTK_WINDOW (self), NULL, clip_file, NULL); +#line 3055 "fillmore.c" + _g_free0 (file_name); + _g_object_unref0 (clip_file); + } + _g_object_unref0 (files); + } else { + GeeArrayList* clips; +#line 950 "fillmore.vala" + clips = _g_object_ref0 (self->timeline->selected_clips); +#line 951 "fillmore.vala" + if (gee_collection_get_size (GEE_COLLECTION (clips)) == 1) { +#line 3066 "fillmore.c" + ClipView* clip_view; +#line 952 "fillmore.vala" + clip_view = (ClipView*) gee_abstract_list_get (GEE_ABSTRACT_LIST (clips), 0); +#line 953 "fillmore.vala" + dialog_utils_show_clip_properties (GTK_WINDOW (self), clip_view, NULL, NULL); +#line 3072 "fillmore.c" + _g_object_unref0 (clip_view); + } + _g_object_unref0 (clips); + } +} + + +#line 960 "fillmore.vala" +static void recorder_on_track_new (Recorder* self) { +#line 3082 "fillmore.c" + UITrackInformation* dialog; + char* _tmp0_; +#line 960 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 961 "fillmore.vala" + dialog = g_object_ref_sink (ui_track_information_new ()); +#line 962 "fillmore.vala" + ui_track_information_set_track_name (dialog, _tmp0_ = recorder_get_default_track_name (self)); +#line 3091 "fillmore.c" + _g_free0 (_tmp0_); +#line 963 "fillmore.vala" + if (recorder_track_name_dialog (self, dialog, NULL)) { +#line 3095 "fillmore.c" + ModelAudioTrack* _tmp2_; + char* _tmp1_; +#line 964 "fillmore.vala" + model_project_add_track (MODEL_PROJECT (self->project), MODEL_TRACK (_tmp2_ = model_audio_track_new (MODEL_PROJECT (self->project), _tmp1_ = ui_track_information_get_track_name (dialog)))); +#line 3100 "fillmore.c" + _g_object_unref0 (_tmp2_); + _g_free0 (_tmp1_); + } +#line 966 "fillmore.vala" + gtk_object_destroy (GTK_OBJECT (dialog)); +#line 3106 "fillmore.c" + _g_object_unref0 (dialog); +} + + +#line 969 "fillmore.vala" +static void recorder_on_track_rename (Recorder* self) { +#line 3113 "fillmore.c" + UITrackInformation* dialog; + ModelTrack* track; + ModelTrack* _tmp0_; +#line 969 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 970 "fillmore.vala" + dialog = g_object_ref_sink (ui_track_information_new ()); +#line 971 "fillmore.vala" + track = recorder_selected_track (self); +#line 972 "fillmore.vala" + gtk_window_set_title (GTK_WINDOW (dialog), "Rename Track"); +#line 973 "fillmore.vala" + ui_track_information_set_track_name (dialog, (_tmp0_ = recorder_selected_track (self))->display_name); +#line 3127 "fillmore.c" + _g_object_unref0 (_tmp0_); +#line 974 "fillmore.vala" + if (recorder_track_name_dialog (self, dialog, track)) { +#line 3131 "fillmore.c" + char* _tmp1_; +#line 975 "fillmore.vala" + model_track_set_display_name (track, _tmp1_ = ui_track_information_get_track_name (dialog)); +#line 3135 "fillmore.c" + _g_free0 (_tmp1_); + } +#line 977 "fillmore.vala" + gtk_object_destroy (GTK_OBJECT (dialog)); +#line 3140 "fillmore.c" + _g_object_unref0 (dialog); + _g_object_unref0 (track); +} + + +#line 980 "fillmore.vala" +static gboolean recorder_track_name_dialog (Recorder* self, UITrackInformation* dialog, ModelTrack* track) { +#line 3148 "fillmore.c" + gboolean result = FALSE; + GtkResponseType _result_; + gboolean is_ok; + gboolean _tmp2_ = FALSE; +#line 980 "fillmore.vala" + g_return_val_if_fail (IS_RECORDER (self), FALSE); +#line 980 "fillmore.vala" + g_return_val_if_fail (UI_IS_TRACK_INFORMATION (dialog), FALSE); +#line 980 "fillmore.vala" + g_return_val_if_fail ((track == NULL) || MODEL_IS_TRACK (track), FALSE); +#line 981 "fillmore.vala" + _result_ = GTK_RESPONSE_OK; +#line 982 "fillmore.vala" + is_ok = TRUE; +#line 3163 "fillmore.c" + { + gboolean _tmp0_; +#line 983 "fillmore.vala" + _tmp0_ = TRUE; +#line 983 "fillmore.vala" + while (TRUE) { +#line 3170 "fillmore.c" + char* new_name; +#line 983 "fillmore.vala" + if (!_tmp0_) { +#line 3174 "fillmore.c" + gboolean _tmp1_ = FALSE; +#line 999 "fillmore.vala" + if (_result_ == GTK_RESPONSE_OK) { +#line 999 "fillmore.vala" + _tmp1_ = !is_ok; +#line 3180 "fillmore.c" + } else { +#line 999 "fillmore.vala" + _tmp1_ = FALSE; +#line 3184 "fillmore.c" + } +#line 999 "fillmore.vala" + if (!_tmp1_) { +#line 999 "fillmore.vala" + break; +#line 3190 "fillmore.c" + } + } +#line 983 "fillmore.vala" + _tmp0_ = FALSE; +#line 984 "fillmore.vala" + _result_ = (GtkResponseType) gtk_dialog_run (GTK_DIALOG (dialog)); +#line 985 "fillmore.vala" + new_name = ui_track_information_get_track_name (dialog); +#line 987 "fillmore.vala" + if (_result_ == GTK_RESPONSE_OK) { +#line 988 "fillmore.vala" + if (_vala_strcmp0 (new_name, "") == 0) { +#line 989 "fillmore.vala" + is_ok = FALSE; +#line 990 "fillmore.vala" + dialog_utils_error ("Invalid track name.", "The track name cannot be empty."); +#line 3207 "fillmore.c" + } else { +#line 992 "fillmore.vala" + is_ok = !model_project_is_duplicate_track_name (MODEL_PROJECT (self->project), track, new_name); +#line 993 "fillmore.vala" + if (!is_ok) { +#line 994 "fillmore.vala" + dialog_utils_error ("Duplicate track name.", "A track with this name already exists."); +#line 3215 "fillmore.c" + } + } + } + _g_free0 (new_name); + } + } +#line 1000 "fillmore.vala" + if (_result_ == GTK_RESPONSE_OK) { +#line 1000 "fillmore.vala" + _tmp2_ = is_ok; +#line 3226 "fillmore.c" + } else { +#line 1000 "fillmore.vala" + _tmp2_ = FALSE; +#line 3230 "fillmore.c" + } + result = _tmp2_; +#line 1000 "fillmore.vala" + return result; +#line 3235 "fillmore.c" +} + + +#line 1003 "fillmore.vala" +static void recorder_on_track_remove (Recorder* self) { +#line 3241 "fillmore.c" + ModelTrack* _tmp0_; +#line 1003 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1004 "fillmore.vala" + model_project_remove_track (MODEL_PROJECT (self->project), _tmp0_ = recorder_selected_track (self)); +#line 3247 "fillmore.c" + _g_object_unref0 (_tmp0_); +} + + +#line 1008 "fillmore.vala" +static void recorder_on_zoom_in (Recorder* self) { +#line 1008 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1009 "fillmore.vala" + recorder_do_zoom (self, 0.1f); +#line 3258 "fillmore.c" +} + + +#line 1012 "fillmore.vala" +static void recorder_on_zoom_out (Recorder* self) { +#line 1012 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1013 "fillmore.vala" + recorder_do_zoom (self, -0.1f); +#line 3268 "fillmore.c" +} + + +#line 1016 "fillmore.vala" +static void recorder_on_zoom_to_project (Recorder* self) { +#line 1016 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1017 "fillmore.vala" + time_line_zoom_to_project (self->timeline, gtk_adjustment_get_page_size (self->priv->h_adjustment)); +#line 3278 "fillmore.c" +} + + +#line 1020 "fillmore.vala" +static void recorder_on_snap (Recorder* self) { +#line 1020 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1021 "fillmore.vala" + MODEL_PROJECT (self->project)->snap_to_clip = !MODEL_PROJECT (self->project)->snap_to_clip; +#line 3288 "fillmore.c" +} + + +#line 1024 "fillmore.vala" +static void recorder_on_view_library (Recorder* self) { +#line 1024 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1025 "fillmore.vala" + if (GTK_PANED (self->priv->timeline_library_pane)->child2 == GTK_WIDGET (self->priv->library_scrolled)) { +#line 1026 "fillmore.vala" + gtk_container_remove (GTK_CONTAINER (self->priv->timeline_library_pane), GTK_WIDGET (self->priv->library_scrolled)); +#line 1027 "fillmore.vala" + MODEL_PROJECT (self->project)->library_visible = FALSE; +#line 3302 "fillmore.c" + } else { +#line 1029 "fillmore.vala" + gtk_paned_add2 (GTK_PANED (self->priv->timeline_library_pane), GTK_WIDGET (self->priv->library_scrolled)); +#line 1030 "fillmore.vala" + gtk_widget_show_all (GTK_WIDGET (self->priv->timeline_library_pane)); +#line 1031 "fillmore.vala" + MODEL_PROJECT (self->project)->library_visible = TRUE; +#line 3310 "fillmore.c" + } +} + + +#line 1035 "fillmore.vala" +static void recorder_on_library_size_allocate (Recorder* self, GdkRectangle* rectangle) { +#line 3317 "fillmore.c" + gboolean _tmp0_ = FALSE; +#line 1035 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1036 "fillmore.vala" + if (!self->priv->loading) { +#line 1036 "fillmore.vala" + _tmp0_ = GTK_PANED (self->priv->timeline_library_pane)->child2 == GTK_WIDGET (self->priv->library_scrolled); +#line 3325 "fillmore.c" + } else { +#line 1036 "fillmore.vala" + _tmp0_ = FALSE; +#line 3329 "fillmore.c" + } +#line 1036 "fillmore.vala" + if (_tmp0_) { +#line 1037 "fillmore.vala" + MODEL_PROJECT (self->project)->library_width = (*rectangle).width; +#line 3335 "fillmore.c" + } +} + + +#line 1043 "fillmore.vala" +static void recorder_on_help_contents (Recorder* self) { +#line 3342 "fillmore.c" + GError * _inner_error_; +#line 1043 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 3346 "fillmore.c" + _inner_error_ = NULL; + { +#line 1045 "fillmore.vala" + gtk_show_uri (NULL, "http://trac.yorba.org/wiki/UsingFillmore0.1", (guint32) 0, &_inner_error_); +#line 3351 "fillmore.c" + if (_inner_error_ != NULL) { + goto __catch7_g_error; + } + } + goto __finally7; + __catch7_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { + _g_error_free0 (e); + } + } + __finally7: + if (_inner_error_ != NULL) { + 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); + g_clear_error (&_inner_error_); + return; + } +} + + +#line 1050 "fillmore.vala" +static void recorder_on_about (Recorder* self) { +#line 3377 "fillmore.c" + char* _tmp1_; + char* _tmp0_; +#line 1050 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1051 "fillmore.vala" + gtk_show_about_dialog (GTK_WINDOW (self), "version", _tmp0_ = model_project_get_version (MODEL_PROJECT (self->project)), "comments", "An audio editor and recorder", "copyright", "Copyright 2009-2010 Yorba Foundation", "website", "http://www.yorba.org", "license", _tmp1_ = model_project_get_license (MODEL_PROJECT (self->project)), "website-label", "Visit the Yorba web site", "authors", MODEL_PROJECT_authors, NULL); +#line 3384 "fillmore.c" + _g_free0 (_tmp1_); + _g_free0 (_tmp0_); +} + + +#line 1062 "fillmore.vala" +static void recorder_on_save_graph (Recorder* self) { +#line 1062 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1063 "fillmore.vala" + model_project_print_graph (MODEL_PROJECT (self->project), GST_BIN (MODEL_PROJECT (self->project)->media_engine->pipeline), "save_graph"); +#line 3396 "fillmore.c" +} + + +#line 1068 "fillmore.vala" +static void recorder_on_volume (Recorder* self) { +#line 1068 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 3404 "fillmore.c" +} + + +#line 1072 "fillmore.vala" +static void recorder_on_rewind (Recorder* self) { +#line 1072 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1073 "fillmore.vala" + view_media_engine_go (MODEL_PROJECT (self->project)->media_engine, (gint64) 0); +#line 1074 "fillmore.vala" + recorder_scroll_to_beginning (self); +#line 3416 "fillmore.c" +} + + +#line 1077 "fillmore.vala" +static void recorder_on_end (Recorder* self) { +#line 1077 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1078 "fillmore.vala" + model_project_go_end (MODEL_PROJECT (self->project)); +#line 1079 "fillmore.vala" + recorder_scroll_to_end (self); +#line 3428 "fillmore.c" +} + + +#line 1082 "fillmore.vala" +static void recorder_on_play (Recorder* self) { +#line 1082 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1083 "fillmore.vala" + if (model_project_transport_is_recording (MODEL_PROJECT (self->project))) { +#line 1084 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Record", TRUE); +#line 1085 "fillmore.vala" + gtk_toggle_button_set_active (self->priv->record_button, FALSE); +#line 1086 "fillmore.vala" + gtk_toggle_button_set_active (self->priv->play_button, FALSE); +#line 1087 "fillmore.vala" + view_media_engine_pause (MODEL_PROJECT (self->project)->media_engine); +#line 3446 "fillmore.c" + } else { +#line 1088 "fillmore.vala" + if (gtk_toggle_button_get_active (self->priv->play_button)) { +#line 1089 "fillmore.vala" + view_media_engine_do_play (MODEL_PROJECT (self->project)->media_engine, PLAY_STATE_PLAYING); +#line 3452 "fillmore.c" + } else { +#line 1091 "fillmore.vala" + view_media_engine_pause (MODEL_PROJECT (self->project)->media_engine); +#line 3456 "fillmore.c" + } + } +} + + +#line 1094 "fillmore.vala" +static void recorder_on_record (Recorder* self) { +#line 1094 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1095 "fillmore.vala" + if (gtk_toggle_button_get_active (self->priv->record_button)) { +#line 3468 "fillmore.c" + ModelTrack* _tmp0_; + ModelAudioTrack* audio_track; + gint number_of_channels = 0; +#line 1096 "fillmore.vala" + audio_track = (_tmp0_ = recorder_selected_track (self), MODEL_IS_AUDIO_TRACK (_tmp0_) ? ((ModelAudioTrack*) _tmp0_) : NULL); +#line 1098 "fillmore.vala" + if (model_audio_track_get_num_channels (audio_track, &number_of_channels)) { +#line 1099 "fillmore.vala" + if (number_of_channels > CHANNELS_PER_TRACK_RECORD) { +#line 1100 "fillmore.vala" + gtk_toggle_button_set_active (self->priv->record_button, FALSE); +#line 1101 "fillmore.vala" + recorder_on_error_occurred (self, "Can not record onto a stereo track", NULL); +#line 3482 "fillmore.c" + _g_object_unref0 (audio_track); +#line 1102 "fillmore.vala" + return; +#line 3486 "fillmore.c" + } + } +#line 1105 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Record", FALSE); +#line 1106 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Play", FALSE); +#line 1107 "fillmore.vala" + model_audio_project_record (self->project, audio_track); +#line 3495 "fillmore.c" + _g_object_unref0 (audio_track); + } else { +#line 1110 "fillmore.vala" + recorder_on_play (self); +#line 3500 "fillmore.c" + } +} + + +#line 1114 "fillmore.vala" +static void recorder_on_callback_pulse (Recorder* self) { +#line 1114 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1115 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_callback_pulse"); +#line 1116 "fillmore.vala" + if (model_project_transport_is_playing (MODEL_PROJECT (self->project))) { +#line 1117 "fillmore.vala" + recorder_scroll_toward_center (self, model_time_system_time_to_xpos (self->priv->provider, MODEL_PROJECT (self->project)->media_engine->position)); +#line 3515 "fillmore.c" + } +#line 1119 "fillmore.vala" + gtk_widget_queue_draw (GTK_WIDGET (self->timeline)); +#line 3519 "fillmore.c" +} + + +#line 1122 "fillmore.vala" +static gint64 recorder_get_zoom_center_time (Recorder* self) { +#line 3525 "fillmore.c" + gint64 result = 0LL; +#line 1122 "fillmore.vala" + g_return_val_if_fail (IS_RECORDER (self), 0LL); +#line 3529 "fillmore.c" + result = model_project_transport_get_position (MODEL_PROJECT (self->project)); +#line 1123 "fillmore.vala" + return result; +#line 3533 "fillmore.c" +} + + +#line 1126 "fillmore.vala" +static void recorder_do_zoom (Recorder* self, float increment) { +#line 1126 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1127 "fillmore.vala" + self->priv->center_time = recorder_get_zoom_center_time (self); +#line 1128 "fillmore.vala" + time_line_zoom (self->timeline, increment); +#line 3545 "fillmore.c" +} + + +#line 1131 "fillmore.vala" +static void recorder_on_timeline_size_allocate (Recorder* self, GdkRectangle* rectangle) { +#line 1131 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1132 "fillmore.vala" + if (self->priv->center_time != (-1)) { +#line 3555 "fillmore.c" + gint new_center_pixel; + gint page_size; +#line 1133 "fillmore.vala" + new_center_pixel = model_time_system_time_to_xpos (self->priv->provider, self->priv->center_time); +#line 1134 "fillmore.vala" + page_size = (gint) (gtk_adjustment_get_page_size (self->priv->h_adjustment) / 2); +#line 1135 "fillmore.vala" + gtk_adjustment_clamp_page (self->priv->h_adjustment, (double) (new_center_pixel - page_size), (double) (new_center_pixel + page_size)); +#line 1136 "fillmore.vala" + self->priv->center_time = (gint64) (-1); +#line 3566 "fillmore.c" + } +} + + +#line 1140 "fillmore.vala" +static void recorder_on_timeline_selection_changed (Recorder* self, gboolean selected) { +#line 1140 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1141 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_timeline_selection_changed"); +#line 1142 "fillmore.vala" + if (selected) { +#line 1143 "fillmore.vala" + clip_library_view_unselect_all (self->priv->library); +#line 3581 "fillmore.c" + } +#line 1145 "fillmore.vala" + recorder_update_menu (self); +#line 3585 "fillmore.c" +} + + +#line 1148 "fillmore.vala" +void recorder_on_library_selection_changed (Recorder* self, gboolean selected) { +#line 1148 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1149 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_library_selection_changed"); +#line 1150 "fillmore.vala" + if (selected) { +#line 1151 "fillmore.vala" + time_line_deselect_all_clips (self->timeline); +#line 1152 "fillmore.vala" + gtk_widget_queue_draw (GTK_WIDGET (self->timeline)); +#line 3601 "fillmore.c" + } +#line 1154 "fillmore.vala" + recorder_update_menu (self); +#line 3605 "fillmore.c" +} + + +#line 1206 "fillmore.vala" +void recorder_do_error_dialog (const char* major_message, const char* minor_message) { +#line 1206 "fillmore.vala" + g_return_if_fail (major_message != NULL); +#line 1207 "fillmore.vala" + dialog_utils_error (major_message, minor_message); +#line 3615 "fillmore.c" +} + + +#line 1210 "fillmore.vala" +void recorder_on_load_error (Recorder* self, const char* message) { +#line 1210 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1210 "fillmore.vala" + g_return_if_fail (message != NULL); +#line 1211 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_load_error"); +#line 1212 "fillmore.vala" + gee_abstract_collection_add (GEE_ABSTRACT_COLLECTION (self->priv->load_errors), message); +#line 3629 "fillmore.c" +} + + +#line 1215 "fillmore.vala" +void recorder_on_load_complete (Recorder* self) { +#line 3635 "fillmore.c" + GtkAction* _tmp0_; + GtkToggleAction* action; + GtkToggleAction* _tmp2_; + GtkAction* _tmp1_; +#line 1215 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1216 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_load_complete"); +#line 1217 "fillmore.vala" + gst_element_set_state (GST_ELEMENT (MODEL_PROJECT (self->project)->media_engine->pipeline), GST_STATE_PAUSED); +#line 1218 "fillmore.vala" + gtk_paned_set_position (GTK_PANED (self->priv->timeline_library_pane), MODEL_PROJECT (self->project)->library_width); +#line 1220 "fillmore.vala" + action = _g_object_ref0 ((_tmp0_ = gtk_action_group_get_action (self->priv->main_group, "Library"), GTK_IS_TOGGLE_ACTION (_tmp0_) ? ((GtkToggleAction*) _tmp0_) : NULL)); +#line 1221 "fillmore.vala" + if (gtk_toggle_action_get_active (action) != MODEL_PROJECT (self->project)->library_visible) { +#line 1222 "fillmore.vala" + gtk_toggle_action_set_active (action, MODEL_PROJECT (self->project)->library_visible); +#line 3654 "fillmore.c" + } +#line 1225 "fillmore.vala" + action = (_tmp2_ = _g_object_ref0 ((_tmp1_ = gtk_action_group_get_action (self->priv->main_group, "Snap"), GTK_IS_TOGGLE_ACTION (_tmp1_) ? ((GtkToggleAction*) _tmp1_) : NULL)), _g_object_unref0 (action), _tmp2_); +#line 1226 "fillmore.vala" + if (gtk_toggle_action_get_active (action) != MODEL_PROJECT (self->project)->snap_to_clip) { +#line 1227 "fillmore.vala" + gtk_toggle_action_set_active (action, MODEL_PROJECT (self->project)->snap_to_clip); +#line 3662 "fillmore.c" + } +#line 1230 "fillmore.vala" + if (MODEL_PROJECT (self->project)->library_visible) { +#line 1231 "fillmore.vala" + if (GTK_PANED (self->priv->timeline_library_pane)->child2 != GTK_WIDGET (self->priv->library_scrolled)) { +#line 1232 "fillmore.vala" + gtk_paned_add2 (GTK_PANED (self->priv->timeline_library_pane), GTK_WIDGET (self->priv->library_scrolled)); +#line 3670 "fillmore.c" + } + } else { +#line 1235 "fillmore.vala" + if (GTK_PANED (self->priv->timeline_library_pane)->child2 == GTK_WIDGET (self->priv->library_scrolled)) { +#line 1236 "fillmore.vala" + gtk_container_remove (GTK_CONTAINER (self->priv->timeline_library_pane), GTK_WIDGET (self->priv->library_scrolled)); +#line 3677 "fillmore.c" + } + } +#line 1240 "fillmore.vala" + if (gee_collection_get_size (GEE_COLLECTION (self->priv->load_errors)) > 0) { +#line 3682 "fillmore.c" + char* message; +#line 1241 "fillmore.vala" + message = g_strdup (""); +#line 3686 "fillmore.c" + { + GeeIterator* _s_it; + _s_it = gee_abstract_collection_iterator (GEE_ABSTRACT_COLLECTION (self->priv->load_errors)); +#line 1242 "fillmore.vala" + while (TRUE) { +#line 3692 "fillmore.c" + char* s; + char* _tmp4_; + char* _tmp3_; +#line 1242 "fillmore.vala" + if (!gee_iterator_next (_s_it)) { +#line 1242 "fillmore.vala" + break; +#line 3700 "fillmore.c" + } +#line 1242 "fillmore.vala" + s = (char*) gee_iterator_get (_s_it); +#line 1243 "fillmore.vala" + message = (_tmp4_ = g_strconcat (_tmp3_ = g_strconcat (message, s, NULL), "\n", NULL), _g_free0 (message), _tmp4_); +#line 3706 "fillmore.c" + _g_free0 (_tmp3_); + _g_free0 (s); + } + _g_object_unref0 (_s_it); + } +#line 1245 "fillmore.vala" + recorder_do_error_dialog ("An error occurred loading the project.", message); +#line 3714 "fillmore.c" + _g_free0 (message); + } +#line 1248 "fillmore.vala" + self->priv->loading = FALSE; +#line 3719 "fillmore.c" + _g_object_unref0 (action); +} + + +#line 1251 "fillmore.vala" +static void recorder_on_name_changed (Recorder* self) { +#line 3726 "fillmore.c" + char* _tmp0_; +#line 1251 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1252 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_name_changed"); +#line 1253 "fillmore.vala" + gtk_window_set_title (GTK_WINDOW (self), _tmp0_ = model_project_get_file_display_name (MODEL_PROJECT (self->project))); +#line 3734 "fillmore.c" + _g_free0 (_tmp0_); +} + + +#line 1256 "fillmore.vala" +static void recorder_on_dirty_changed (Recorder* self, gboolean isDirty) { +#line 3741 "fillmore.c" + GtkMenuItem* file_save; +#line 1256 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1257 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_dirty_changed"); +#line 1258 "fillmore.vala" + file_save = GTK_MENU_ITEM (recorder_get_widget (self, self->priv->manager, "/MenuBar/ProjectMenu/Save")); +#line 1259 "fillmore.vala" + g_assert (file_save != NULL); +#line 1260 "fillmore.vala" + gtk_widget_set_sensitive (GTK_WIDGET (file_save), isDirty); +#line 3753 "fillmore.c" + _g_object_unref0 (file_save); +} + + +#line 1263 "fillmore.vala" +static void recorder_on_undo_changed (Recorder* self, gboolean can_undo) { +#line 3760 "fillmore.c" + GtkMenuItem* undo; + gboolean _tmp0_ = FALSE; +#line 1263 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1264 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_undo_changed"); +#line 1265 "fillmore.vala" + undo = GTK_MENU_ITEM (recorder_get_widget (self, self->priv->manager, "/MenuBar/EditMenu/EditUndo")); +#line 1266 "fillmore.vala" + g_assert (undo != NULL); +#line 1268 "fillmore.vala" + if (transport_delegate_is_stopped (TRANSPORT_DELEGATE (self))) { +#line 1268 "fillmore.vala" + _tmp0_ = model_undo_manager_get_can_undo (MODEL_PROJECT (self->project)->undo_manager); +#line 3775 "fillmore.c" + } else { +#line 1268 "fillmore.vala" + _tmp0_ = FALSE; +#line 3779 "fillmore.c" + } +#line 1268 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Undo", _tmp0_); +#line 3783 "fillmore.c" + _g_object_unref0 (undo); +} + + +#line 1271 "fillmore.vala" +static void recorder_on_playstate_changed (Recorder* self, PlayState playstate) { +#line 1271 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1272 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_playstate_changed"); +#line 1273 "fillmore.vala" + if (playstate == PLAY_STATE_STOPPED) { +#line 1274 "fillmore.vala" + self->priv->cursor_pos = -1; +#line 1275 "fillmore.vala" + gtk_toggle_button_set_active (self->priv->play_button, FALSE); +#line 1276 "fillmore.vala" + recorder_set_sensitive_group (self, self->priv->main_group, "Export", model_project_can_export (MODEL_PROJECT (self->project))); +#line 1277 "fillmore.vala" + recorder_update_menu (self); +#line 3804 "fillmore.c" + } +} + + +#line 1281 "fillmore.vala" +static void recorder_on_error_occurred (Recorder* self, const char* major_message, const char* minor_message) { +#line 1281 "fillmore.vala" + g_return_if_fail (IS_RECORDER (self)); +#line 1281 "fillmore.vala" + g_return_if_fail (major_message != NULL); +#line 1282 "fillmore.vala" + logging_emit (G_OBJECT (self), LOGGING_FACILITY_SIGNAL_HANDLERS, LOGGING_LEVEL_INFO, "on_error_occurred"); +#line 1283 "fillmore.vala" + dialog_utils_error (major_message, minor_message); +#line 3819 "fillmore.c" +} + + +#line 1286 "fillmore.vala" +static char* recorder_get_fillmore_directory (Recorder* self) { +#line 3825 "fillmore.c" + char* result = NULL; +#line 1286 "fillmore.vala" + g_return_val_if_fail (IS_RECORDER (self), NULL); +#line 3829 "fillmore.c" + result = g_build_filename (g_get_home_dir (), ".fillmore", NULL); +#line 1287 "fillmore.vala" + return result; +#line 3833 "fillmore.c" +} + + +#line 1291 "fillmore.vala" +static gboolean recorder_real_is_playing (TransportDelegate* base) { +#line 3839 "fillmore.c" + Recorder * self; + gboolean result = FALSE; + self = RECORDER (base); + result = model_project_transport_is_playing (MODEL_PROJECT (self->project)); +#line 1292 "fillmore.vala" + return result; +#line 3846 "fillmore.c" +} + + +#line 1295 "fillmore.vala" +static gboolean recorder_real_is_recording (TransportDelegate* base) { +#line 3852 "fillmore.c" + Recorder * self; + gboolean result = FALSE; + self = RECORDER (base); + result = model_project_transport_is_recording (MODEL_PROJECT (self->project)); +#line 1296 "fillmore.vala" + return result; +#line 3859 "fillmore.c" +} + + +#line 1299 "fillmore.vala" +static gboolean recorder_real_is_stopped (TransportDelegate* base) { +#line 3865 "fillmore.c" + Recorder * self; + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + self = RECORDER (base); +#line 1300 "fillmore.vala" + if (transport_delegate_is_playing (TRANSPORT_DELEGATE (self))) { +#line 1300 "fillmore.vala" + _tmp0_ = TRUE; +#line 3874 "fillmore.c" + } else { +#line 1300 "fillmore.vala" + _tmp0_ = transport_delegate_is_recording (TRANSPORT_DELEGATE (self)); +#line 3878 "fillmore.c" + } + result = !_tmp0_; +#line 1300 "fillmore.vala" + return result; +#line 3883 "fillmore.c" +} + + +static void recorder_class_init (RecorderClass * klass) { + recorder_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (RecorderPrivate)); + GTK_WIDGET_CLASS (klass)->key_press_event = recorder_real_key_press_event; + G_OBJECT_CLASS (klass)->finalize = recorder_finalize; + g_signal_new ("finished_closing", TYPE_RECORDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); +} + + +static void recorder_transport_delegate_interface_init (TransportDelegateIface * iface) { + recorder_transport_delegate_parent_iface = g_type_interface_peek_parent (iface); + iface->is_playing = recorder_real_is_playing; + iface->is_recording = recorder_real_is_recording; + iface->is_stopped = recorder_real_is_stopped; +} + + +static void recorder_instance_init (Recorder * self) { + self->priv = RECORDER_GET_PRIVATE (self); + self->priv->cursor_pos = -1; + self->priv->center_time = (gint64) (-1); + self->priv->scrollwin_pos_y = 0; +} + + +static void recorder_finalize (GObject* obj) { + Recorder * self; + self = RECORDER (obj); + _g_object_unref0 (self->project); + _g_object_unref0 (self->timeline); + _g_object_unref0 (self->priv->click_track); + _g_object_unref0 (self->priv->header_area); + _g_object_unref0 (self->priv->library); + _g_object_unref0 (self->priv->provider); + _g_object_unref0 (self->priv->h_adjustment); + _g_object_unref0 (self->priv->timeline_library_pane); + _g_object_unref0 (self->priv->library_scrolled); + _g_object_unref0 (self->priv->timeline_scrolled); + _g_object_unref0 (self->priv->main_group); + _g_object_unref0 (self->priv->play_button); + _g_object_unref0 (self->priv->record_button); + _g_object_unref0 (self->priv->addnew_button); + _g_object_unref0 (self->priv->rewind_button); + _g_object_unref0 (self->priv->forward_button); + _g_object_unref0 (self->priv->zoomin_button); + _g_object_unref0 (self->priv->zoomout_button); + _g_object_unref0 (self->priv->volume_button); + _g_object_unref0 (self->priv->scrollwin); + _g_object_unref0 (self->priv->manager); + _g_object_unref0 (self->priv->audio_export); + _g_object_unref0 (self->priv->audio_output); + _g_object_unref0 (self->priv->load_errors); + G_OBJECT_CLASS (recorder_parent_class)->finalize (obj); +} + + +GType recorder_get_type (void) { + static volatile gsize recorder_type_id__volatile = 0; + if (g_once_init_enter (&recorder_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (RecorderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) recorder_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Recorder), 0, (GInstanceInitFunc) recorder_instance_init, NULL }; + static const GInterfaceInfo transport_delegate_info = { (GInterfaceInitFunc) recorder_transport_delegate_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType recorder_type_id; + recorder_type_id = g_type_register_static (GTK_TYPE_WINDOW, "Recorder", &g_define_type_info, 0); + g_type_add_interface_static (recorder_type_id, TYPE_TRANSPORT_DELEGATE, &transport_delegate_info); + g_once_init_leave (&recorder_type_id__volatile, recorder_type_id); + } + return recorder_type_id__volatile; +} + + +#line 1307 "fillmore.vala" +void fillmore_run (Fillmore* self, char** args, int args_length1) { +#line 3959 "fillmore.c" + GError * _inner_error_; + GOptionContext* context; +#line 1307 "fillmore.vala" + g_return_if_fail (IS_FILLMORE (self)); +#line 3964 "fillmore.c" + _inner_error_ = NULL; +#line 1308 "fillmore.vala" + debug_level = -1; +#line 1309 "fillmore.vala" + context = g_option_context_new (" [project file] - Record and edit multitrack audio"); +#line 1311 "fillmore.vala" + g_option_context_add_main_entries (context, options, NULL); +#line 1312 "fillmore.vala" + g_option_context_add_group (context, gst_init_get_option_group ()); +#line 3974 "fillmore.c" + { +#line 1315 "fillmore.vala" + g_option_context_parse (context, &args_length1, &args, &_inner_error_); +#line 3978 "fillmore.c" + if (_inner_error_ != NULL) { + goto __catch8_g_error; + } + } + goto __finally8; + __catch8_g_error: + { + GError * arg_error; + arg_error = _inner_error_; + _inner_error_ = NULL; + { +#line 1317 "fillmore.vala" + fprintf (stderr, "%s\n" \ +"Run 'fillmore --help' for a full list of available command line option" \ +"s.", arg_error->message); +#line 3992 "fillmore.c" + _g_error_free0 (arg_error); + _g_option_context_free0 (context); +#line 1319 "fillmore.vala" + return; +#line 3997 "fillmore.c" + } + } + __finally8: + if (_inner_error_ != NULL) { + _g_option_context_free0 (context); + 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); + g_clear_error (&_inner_error_); + return; + } + { + GFile* _tmp1_; + GFile* _tmp0_; + char* _tmp2_; + char* rc_file; + char* project_file; + FillmoreClassFactory* _tmp6_; + Recorder* recorder; +#line 1323 "fillmore.vala" + g_set_application_name ("Fillmore"); +#line 1324 "fillmore.vala" + if (debug_level > (-1)) { +#line 1325 "fillmore.vala" + logging_set_logging_level ((LoggingLevel) debug_level); +#line 4021 "fillmore.c" + } +#line 1328 "fillmore.vala" + app_dirs_init (args[0], _PROGRAM_NAME); +#line 1329 "fillmore.vala" + rc_file = (_tmp2_ = g_file_get_path (_tmp1_ = g_file_get_child (_tmp0_ = app_dirs_get_resources_dir (), "fillmore.rc")), _g_object_unref0 (_tmp1_), _g_object_unref0 (_tmp0_), _tmp2_); +#line 1331 "fillmore.vala" + gtk_rc_parse (rc_file); +#line 1334 "fillmore.vala" + project_file = NULL; +#line 1335 "fillmore.vala" + if (args_length1 > 1) { +#line 4033 "fillmore.c" + char* _tmp3_; +#line 1336 "fillmore.vala" + project_file = (_tmp3_ = g_strdup (args[1]), _g_free0 (project_file), _tmp3_); +#line 4037 "fillmore.c" + { + char* _tmp4_; + char* _tmp5_; +#line 1338 "fillmore.vala" + _tmp4_ = g_filename_from_uri (project_file, NULL, &_inner_error_); +#line 4043 "fillmore.c" + if (_inner_error_ != NULL) { + goto __catch10_g_error; + } +#line 1338 "fillmore.vala" + project_file = (_tmp5_ = _tmp4_, _g_free0 (project_file), _tmp5_); +#line 4049 "fillmore.c" + } + goto __finally10; + __catch10_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { + _g_error_free0 (e); + } + } + __finally10: + if (_inner_error_ != NULL) { + _g_free0 (rc_file); + _g_free0 (project_file); + goto __catch9_g_error; + } + } +#line 1342 "fillmore.vala" + class_factory_set_class_factory (CLASS_FACTORY (_tmp6_ = fillmore_class_factory_new ())); +#line 4070 "fillmore.c" + _class_factory_unref0 (_tmp6_); +#line 1343 "fillmore.vala" + view_media_engine_can_run (&_inner_error_); +#line 4074 "fillmore.c" + if (_inner_error_ != NULL) { + _g_free0 (rc_file); + _g_free0 (project_file); + goto __catch9_g_error; + } +#line 1345 "fillmore.vala" + recorder = g_object_ref_sink (recorder_new (project_file, &_inner_error_)); +#line 4082 "fillmore.c" + if (_inner_error_ != NULL) { + _g_free0 (rc_file); + _g_free0 (project_file); + goto __catch9_g_error; + } +#line 1346 "fillmore.vala" + gtk_widget_show_all (GTK_WIDGET (recorder)); +#line 1347 "fillmore.vala" + gtk_main (); +#line 4092 "fillmore.c" + _g_free0 (rc_file); + _g_free0 (project_file); + _g_object_unref0 (recorder); + } + goto __finally9; + __catch9_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { +#line 1349 "fillmore.vala" + recorder_do_error_dialog ("Could not start application.", e->message); +#line 4106 "fillmore.c" + _g_error_free0 (e); + } + } + __finally9: + if (_inner_error_ != NULL) { + _g_option_context_free0 (context); + 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); + g_clear_error (&_inner_error_); + return; + } + _g_option_context_free0 (context); +} + + +#line 1304 "fillmore.vala" +Fillmore* fillmore_construct (GType object_type) { +#line 4123 "fillmore.c" + Fillmore * self; + self = g_object_newv (object_type, 0, NULL); + return self; +} + + +#line 1304 "fillmore.vala" +Fillmore* fillmore_new (void) { +#line 1304 "fillmore.vala" + return fillmore_construct (TYPE_FILLMORE); +#line 4134 "fillmore.c" +} + + +static GObject * fillmore_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { + GObject * obj; + GObjectClass * parent_class; + Fillmore * self; + parent_class = G_OBJECT_CLASS (fillmore_parent_class); + obj = parent_class->constructor (type, n_construct_properties, construct_properties); + self = FILLMORE (obj); + { + } + return obj; +} + + +static void fillmore_class_init (FillmoreClass * klass) { + fillmore_parent_class = g_type_class_peek_parent (klass); + G_OBJECT_CLASS (klass)->constructor = fillmore_constructor; +} + + +static void fillmore_instance_init (Fillmore * self) { +} + + +GType fillmore_get_type (void) { + static volatile gsize fillmore_type_id__volatile = 0; + if (g_once_init_enter (&fillmore_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (FillmoreClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) fillmore_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Fillmore), 0, (GInstanceInitFunc) fillmore_instance_init, NULL }; + GType fillmore_type_id; + fillmore_type_id = g_type_register_static (HILDON_TYPE_PROGRAM, "Fillmore", &g_define_type_info, 0); + g_once_init_leave (&fillmore_type_id__volatile, fillmore_type_id); + } + return fillmore_type_id__volatile; +} + + +#line 1354 "fillmore.vala" +gint _vala_main (char** args, int args_length1) { +#line 4175 "fillmore.c" + gint result = 0; + Fillmore* fillmore; +#line 1355 "fillmore.vala" + gtk_init (&args_length1, &args); +#line 1356 "fillmore.vala" + gst_init (&args_length1, &args); +#line 1357 "fillmore.vala" + fillmore = fillmore_new (); +#line 1358 "fillmore.vala" + fillmore_run (fillmore, args, args_length1); +#line 4186 "fillmore.c" + result = 0; + _g_object_unref0 (fillmore); +#line 1359 "fillmore.vala" + return result; +#line 4191 "fillmore.c" +} + + +#line 1354 "fillmore.vala" +int main (int argc, char ** argv) { +#line 4197 "fillmore.c" + g_thread_init (NULL); +#line 1354 "fillmore.vala" + g_type_init (); +#line 1354 "fillmore.vala" + return _vala_main (argv, argc); +#line 4203 "fillmore.c" +} + + +#line 1362 "fillmore.vala" +void NO_main (char** args, int args_length1) { +#line 4209 "fillmore.c" + GError * _inner_error_; + GOptionContext* context; + _inner_error_ = NULL; +#line 1363 "fillmore.vala" + hildon_gtk_init (&args_length1, &args); +#line 1364 "fillmore.vala" + debug_level = -1; +#line 1365 "fillmore.vala" + context = g_option_context_new (" [project file] - Record and edit multitrack audio"); +#line 1367 "fillmore.vala" + g_option_context_add_main_entries (context, options, NULL); +#line 1368 "fillmore.vala" + g_option_context_add_group (context, gst_init_get_option_group ()); +#line 4223 "fillmore.c" + { +#line 1371 "fillmore.vala" + g_option_context_parse (context, &args_length1, &args, &_inner_error_); +#line 4227 "fillmore.c" + if (_inner_error_ != NULL) { + goto __catch11_g_error; + } + } + goto __finally11; + __catch11_g_error: + { + GError * arg_error; + arg_error = _inner_error_; + _inner_error_ = NULL; + { +#line 1373 "fillmore.vala" + fprintf (stderr, "%s\n" \ +"Run 'fillmore --help' for a full list of available command line option" \ +"s.", arg_error->message); +#line 4241 "fillmore.c" + _g_error_free0 (arg_error); + _g_option_context_free0 (context); +#line 1375 "fillmore.vala" + return; +#line 4246 "fillmore.c" + } + } + __finally11: + if (_inner_error_ != NULL) { + _g_option_context_free0 (context); + 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); + g_clear_error (&_inner_error_); + return; + } +#line 1377 "fillmore.vala" + gtk_init (&args_length1, &args); +#line 4258 "fillmore.c" + { + GFile* _tmp1_; + GFile* _tmp0_; + char* _tmp2_; + char* rc_file; + char* project_file; + FillmoreClassFactory* _tmp6_; + Recorder* recorder; +#line 1379 "fillmore.vala" + g_set_application_name ("Fillmore"); +#line 1380 "fillmore.vala" + if (debug_level > (-1)) { +#line 1381 "fillmore.vala" + logging_set_logging_level ((LoggingLevel) debug_level); +#line 4273 "fillmore.c" + } +#line 1384 "fillmore.vala" + app_dirs_init (args[0], _PROGRAM_NAME); +#line 1385 "fillmore.vala" + rc_file = (_tmp2_ = g_file_get_path (_tmp1_ = g_file_get_child (_tmp0_ = app_dirs_get_resources_dir (), "fillmore.rc")), _g_object_unref0 (_tmp1_), _g_object_unref0 (_tmp0_), _tmp2_); +#line 1387 "fillmore.vala" + gtk_rc_parse (rc_file); +#line 1388 "fillmore.vala" + gst_init (&args_length1, &args); +#line 1390 "fillmore.vala" + project_file = NULL; +#line 1391 "fillmore.vala" + if (args_length1 > 1) { +#line 4287 "fillmore.c" + char* _tmp3_; +#line 1392 "fillmore.vala" + project_file = (_tmp3_ = g_strdup (args[1]), _g_free0 (project_file), _tmp3_); +#line 4291 "fillmore.c" + { + char* _tmp4_; + char* _tmp5_; +#line 1394 "fillmore.vala" + _tmp4_ = g_filename_from_uri (project_file, NULL, &_inner_error_); +#line 4297 "fillmore.c" + if (_inner_error_ != NULL) { + goto __catch13_g_error; + } +#line 1394 "fillmore.vala" + project_file = (_tmp5_ = _tmp4_, _g_free0 (project_file), _tmp5_); +#line 4303 "fillmore.c" + } + goto __finally13; + __catch13_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { + _g_error_free0 (e); + } + } + __finally13: + if (_inner_error_ != NULL) { + _g_free0 (rc_file); + _g_free0 (project_file); + goto __catch12_g_error; + } + } +#line 1398 "fillmore.vala" + class_factory_set_class_factory (CLASS_FACTORY (_tmp6_ = fillmore_class_factory_new ())); +#line 4324 "fillmore.c" + _class_factory_unref0 (_tmp6_); +#line 1399 "fillmore.vala" + view_media_engine_can_run (&_inner_error_); +#line 4328 "fillmore.c" + if (_inner_error_ != NULL) { + _g_free0 (rc_file); + _g_free0 (project_file); + goto __catch12_g_error; + } +#line 1401 "fillmore.vala" + recorder = g_object_ref_sink (recorder_new (project_file, &_inner_error_)); +#line 4336 "fillmore.c" + if (_inner_error_ != NULL) { + _g_free0 (rc_file); + _g_free0 (project_file); + goto __catch12_g_error; + } +#line 1402 "fillmore.vala" + gtk_widget_show_all (GTK_WIDGET (recorder)); +#line 1403 "fillmore.vala" + gtk_main (); +#line 4346 "fillmore.c" + _g_free0 (rc_file); + _g_free0 (project_file); + _g_object_unref0 (recorder); + } + goto __finally12; + __catch12_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { +#line 1405 "fillmore.vala" + recorder_do_error_dialog ("Could not start application.", e->message); +#line 4360 "fillmore.c" + _g_error_free0 (e); + } + } + __finally12: + if (_inner_error_ != NULL) { + _g_option_context_free0 (context); + 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); + g_clear_error (&_inner_error_); + return; + } + _g_option_context_free0 (context); +} + + +static int _vala_strcmp0 (const char * str1, const char * str2) { + if (str1 == NULL) { + return -(str1 != str2); + } + if (str2 == NULL) { + return str1 != str2; + } + return strcmp (str1, str2); +} + + + +