get normal GTK accelerators working again
[ardour.git] / gtk2_ardour / ardour_ui.h
1 /*
2     Copyright (C) 1999-2002 Paul Davis
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __ardour_gui_h__
21 #define __ardour_gui_h__
22
23 #include <time.h>
24
25 /* need _BSD_SOURCE to get timersub macros */
26
27 #ifdef _BSD_SOURCE
28 #include <sys/time.h>
29 #else
30 #define _BSD_SOURCE
31 #include <sys/time.h>
32 #undef _BSD_SOURCE
33 #endif
34
35 #include <list>
36 #include <cmath>
37
38
39 #include "pbd/xml++.h"
40 #include "pbd/controllable.h"
41 #include <gtkmm/box.h>
42 #include <gtkmm/frame.h>
43 #include <gtkmm/label.h>
44 #include <gtkmm/table.h>
45 #include <gtkmm/fixed.h>
46 #include <gtkmm/drawingarea.h>
47 #include <gtkmm/eventbox.h>
48 #include <gtkmm/menu.h>
49 #include <gtkmm/menuitem.h>
50 #include <gtkmm/button.h>
51 #include <gtkmm/togglebutton.h>
52 #include <gtkmm/treeview.h>
53 #include <gtkmm/menubar.h>
54 #include <gtkmm/textbuffer.h>
55 #include <gtkmm/adjustment.h>
56
57 #include "gtkmm2ext/gtk_ui.h"
58 #include "gtkmm2ext/click_box.h"
59 #include "gtkmm2ext/stateful_button.h"
60 #include "gtkmm2ext/bindable_button.h"
61 #include "gtkmm2ext/bindings.h"
62
63 #include "ardour/ardour.h"
64 #include "ardour/types.h"
65 #include "ardour/utils.h"
66 #include "ardour/plugin.h"
67 #include "ardour/session_handle.h"
68 #include "ardour/system_exec.h"
69
70 #include "video_timeline.h"
71
72 #include "add_route_dialog.h"
73 #include "ardour_button.h"
74 #include "ardour_dialog.h"
75 #include "ardour_window.h"
76 #include "editing.h"
77 #include "enums.h"
78 #include "visibility_group.h"
79 #include "window_manager.h"
80
81 #ifdef COMPILER_MSVC
82 #include "about.h"
83 #include "add_video_dialog.h"
84 #include "big_clock_window.h"
85 #include "bundle_manager.h"
86 #include "engine_dialog.h"
87 #include "export_video_dialog.h"
88 #include "global_port_matrix.h"
89 #include "keyeditor.h"
90 #include "location_ui.h"
91 #include "rc_option_editor.h"
92 #include "route_params_ui.h"
93 #include "session_option_editor.h"
94 #include "speaker_dialog.h"
95 #else
96 class About;
97 class AddRouteDialog;
98 class AddVideoDialog;
99 class BigClockWindow;
100 class BundleManager;
101 class EngineControl;
102 class ExportVideoDialog;
103 class KeyEditor;
104 class LocationUIWindow;
105 class RCOptionEditor;
106 class RouteParams_UI;
107 class SessionOptionEditor;
108 class SpeakerDialog;
109 class GlobalPortMatrixWindow;
110 #endif
111
112 class VideoTimeLine;
113 class ArdourKeyboard;
114 class AudioClock;
115 class ButtonJoiner;
116 class ConnectionEditor;
117 class DuplicateRouteDialog;
118 class MainClock;
119 class Mixer_UI;
120 class ArdourPrompter;
121 class PublicEditor;
122 class SaveAsDialog;
123 class SessionDialog;
124 class SessionOptionEditor;
125 class ShuttleControl;
126 class Splash;
127 class TimeInfoBox;
128 class Meterbridge;
129 class MidiTracer;
130 class NSM_Client;
131 class LevelMeterHBox;
132 class GUIObjectState;
133
134 namespace ARDOUR {
135         class ControlProtocolInfo;
136         class IO;
137         class Port;
138         class Route;
139         class RouteGroup;
140         class Location;
141         class ProcessThread;
142 }
143
144 namespace Gtkmm2ext {
145         class TearOff;
146 }
147
148 namespace Gtk {
149         class ProgressBar;
150 }
151
152 class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
153 {
154     public:
155         ARDOUR_UI (int *argcp, char **argvp[], const char* localedir);
156         ~ARDOUR_UI();
157
158         bool run_startup (bool should_be_new, std::string load_template);
159
160         void show_splash ();
161         void hide_splash ();
162
163         void launch_chat ();
164         void launch_manual ();
165         void launch_reference ();
166         void launch_tracker ();
167         void launch_subscribe ();
168         void launch_cheat_sheet ();
169         void launch_website ();
170         void launch_website_dev ();
171         void launch_forums ();
172         void launch_howto_report ();
173         void show_about ();
174         void hide_about ();
175
176         void load_from_application_api (const std::string& path);
177         void finish();
178
179         int load_session (const std::string& path, const std::string& snapshot, std::string mix_template = std::string());
180         bool session_loaded;
181         int build_session (const std::string& path, const std::string& snapshot, ARDOUR::BusProfile&);
182         bool session_is_new() const { return _session_is_new; }
183
184         ARDOUR::Session* the_session() { return _session; }
185
186         bool get_smart_mode () const;
187
188         int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = "");
189         int  build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path);
190         bool ask_about_loading_existing_session (const std::string& session_path);
191
192         /// @return true if session was successfully unloaded.
193         int unload_session (bool hide_stuff = false);
194         void close_session();
195
196         int  save_state_canfail (std::string state_name = "", bool switch_to_it = false);
197         void save_state (const std::string & state_name = "", bool switch_to_it = false);
198
199         static ARDOUR_UI *instance () { return theArdourUI; }
200
201         PublicEditor&     the_editor() { return *editor;}
202         Mixer_UI* the_mixer() { return mixer; }
203
204         void new_midi_tracer_window ();
205         void toggle_editing_space();
206         void toggle_mixer_space();
207         void toggle_mixer_list();
208         void toggle_monitor_section_visibility ();
209         void toggle_keep_tearoffs();
210
211         static PublicEditor* _instance;
212
213         /** Emitted frequently with the audible frame, false, and the edit point as
214          *  parameters respectively.
215          *
216          *  (either RapidScreenUpdate || SuperRapidScreenUpdate - user-config)
217          */
218         static sigc::signal<void, framepos_t, bool, framepos_t> Clock;
219
220         static void close_all_dialogs () { CloseAllDialogs(); }
221         static sigc::signal<void> CloseAllDialogs;
222
223         XMLNode* editor_settings() const;
224         XMLNode* mixer_settings () const;
225         XMLNode* keyboard_settings () const;
226         XMLNode* tearoff_settings (const char*) const;
227
228         void save_ardour_state ();
229         gboolean configure_handler (GdkEventConfigure* conf);
230
231         void halt_on_xrun_message ();
232         void xrun_handler (framepos_t);
233         void create_xrun_marker (framepos_t);
234
235         GUIObjectState* gui_object_state;
236
237         MainClock* primary_clock;
238         MainClock* secondary_clock;
239         void focus_on_clock ();
240         AudioClock*   big_clock;
241
242         TimeInfoBox* time_info_box;
243
244         VideoTimeLine *video_timeline;
245
246         void store_clock_modes ();
247         void restore_clock_modes ();
248         void reset_main_clocks ();
249
250         void synchronize_sync_source_and_video_pullup ();
251
252         void add_route (Gtk::Window* float_window);
253         void add_routes_part_two ();
254         void add_routes_thread ();
255
256         void start_duplicate_routes ();
257
258         void add_video (Gtk::Window* float_window);
259         void remove_video ();
260         void start_video_server_menu (Gtk::Window* float_window);
261         bool start_video_server (Gtk::Window* float_window, bool popup_msg);
262         void stop_video_server (bool ask_confirm=false);
263         void flush_videotimeline_cache (bool localcacheonly=false);
264         void export_video (bool range = false);
265
266         void session_add_audio_track (
267                 int input_channels,
268                 int32_t output_channels,
269                 ARDOUR::TrackMode mode,
270                 ARDOUR::RouteGroup* route_group,
271                 uint32_t how_many,
272                 std::string const & name_template
273                 ) {
274
275                 session_add_audio_route (true, input_channels, output_channels, mode, route_group, how_many, name_template);
276         }
277
278         void session_add_audio_bus (int input_channels, int32_t output_channels, ARDOUR::RouteGroup* route_group,
279                                     uint32_t how_many, std::string const & name_template) {
280                 session_add_audio_route (false, input_channels, output_channels, ARDOUR::Normal, route_group, how_many, name_template);
281         }
282
283         void session_add_midi_track (ARDOUR::RouteGroup* route_group, uint32_t how_many, std::string const & name_template,
284                                      ARDOUR::PluginInfoPtr instrument) {
285                 session_add_midi_route (true, route_group, how_many, name_template, instrument);
286         }
287
288         void session_add_mixed_track (const ARDOUR::ChanCount& input, const ARDOUR::ChanCount& output, ARDOUR::RouteGroup* route_group, uint32_t how_many, std::string const & name_template,
289                                       ARDOUR::PluginInfoPtr instrument);
290
291         /*void session_add_midi_bus () {
292                 session_add_midi_route (false);
293         }*/
294
295         void attach_to_engine ();
296         void post_engine ();
297
298         gint exit_on_main_window_close (GdkEventAny *);
299
300         void maximise_editing_space ();
301         void restore_editing_space ();
302
303         void show_ui_prefs ();
304
305         bool check_audioengine(Gtk::Window&);
306
307         void update_tearoff_visibility ();
308
309         void setup_profile ();
310         void setup_tooltips ();
311
312         void set_shuttle_fract (double);
313
314         void get_process_buffers ();
315         void drop_process_buffers ();
316
317         void reset_peak_display ();
318         void reset_route_peak_display (ARDOUR::Route*);
319         void reset_group_peak_display (ARDOUR::RouteGroup*);
320
321         const std::string& announce_string() const { return _announce_string; }
322
323         void hide_application ();
324
325         Gtk::Notebook& tabs();
326         Gtk::Window& main_window () { return _main_window; }
327
328         void setup_toplevel_window (Gtk::Window&, const std::string& name, void* owner);
329         
330         /* called from a static C function */
331
332         GtkNotebook* tab_window_root_drop (GtkNotebook* src,
333                                            GtkWidget* w,
334                                            gint x,
335                                            gint y,
336                                            gpointer user_data);
337
338         bool tabbed_window_state_event_handler (GdkEventWindowState*, void* object);
339         bool key_event_handler (GdkEventKey*, Gtk::Window* window);
340
341   protected:
342         friend class PublicEditor;
343
344         void toggle_auto_play ();
345         void toggle_auto_input ();
346         void toggle_punch ();
347         void unset_dual_punch ();
348         bool ignore_dual_punch;
349         void toggle_punch_in ();
350         void toggle_punch_out ();
351         void show_loop_punch_ruler_and_disallow_hide ();
352         void reenable_hide_loop_punch_ruler_if_appropriate ();
353         void toggle_auto_return ();
354         void toggle_click ();
355         void toggle_audio_midi_setup ();
356         void toggle_session_auto_loop ();
357         void toggle_rc_options_window ();
358         void toggle_session_options_window ();
359
360   private:
361         Gtk::Window   _main_window;
362         Gtk::VBox      main_vpacker;
363         Gtk::HBox      status_bar_hpacker;
364         Gtk::Notebook _tabs;
365         PublicEditor*  editor;
366         Mixer_UI*      mixer;
367         Gtk::Tooltips _tooltips;
368         NSM_Client*    nsm;
369         bool          _was_dirty;
370         bool          _mixer_on_top;
371         bool          _initial_verbose_plugin_scan;
372         bool           first_time_engine_run;
373
374         Gtkmm2ext::Bindings _global_bindings;
375         
376         void goto_editor_window ();
377         void goto_mixer_window ();
378         void toggle_mixer_window ();
379         void toggle_meterbridge ();
380         void toggle_editor_mixer ();
381
382         int  setup_windows ();
383         void setup_transport ();
384         void setup_clock ();
385
386         static ARDOUR_UI *theArdourUI;
387         SessionDialog *_session_dialog;
388
389         int starting ();
390
391         int  ask_about_saving_session (const std::vector<std::string>& actions);
392
393         void save_session_at_its_request (std::string);
394         /* periodic safety backup, to be precise */
395         gint autosave_session();
396         void update_autosave();
397         sigc::connection _autosave_connection;
398
399         void map_transport_state ();
400         int32_t do_engine_start ();
401
402         void engine_halted (const char* reason, bool free_reason);
403         void engine_stopped ();
404         void engine_running ();
405
406         void use_config ();
407
408         void about_signal_response(int response);
409
410         Gtk::VBox     top_packer;
411
412         sigc::connection clock_signal_connection;
413         void         update_clocks ();
414         void         start_clocking ();
415         void         stop_clocking ();
416
417         void update_transport_clocks (framepos_t pos);
418         void record_state_changed ();
419
420         std::list<MidiTracer*> _midi_tracer_windows;
421
422         void detach_tearoff (Gtk::Box* parent, Gtk::Widget* contents);
423         void reattach_tearoff (Gtk::Box* parent, Gtk::Widget* contents, int32_t order);
424         void reattach_all_tearoffs ();
425
426         /* Transport Control */
427
428         Gtkmm2ext::TearOff*      transport_tearoff;
429         Gtk::Frame               transport_frame;
430         Gtk::HBox                transport_tearoff_hbox;
431         Gtk::HBox                transport_hbox;
432         Gtk::Fixed               transport_base;
433         Gtk::Fixed               transport_button_base;
434         Gtk::Frame               transport_button_frame;
435         Gtk::HBox                transport_button_hbox;
436         Gtk::VBox                transport_button_vbox;
437         Gtk::HBox                transport_option_button_hbox;
438         Gtk::VBox                transport_option_button_vbox;
439         Gtk::HBox                transport_clock_hbox;
440         Gtk::VBox                transport_clock_vbox;
441         Gtk::HBox                primary_clock_hbox;
442         Gtk::HBox                secondary_clock_hbox;
443
444         struct TransportControllable : public PBD::Controllable {
445             enum ToggleType {
446                     Roll = 0,
447                     Stop,
448                     RecordEnable,
449                     GotoStart,
450                     GotoEnd,
451                     AutoLoop,
452                     PlaySelection,
453             };
454
455             TransportControllable (std::string name, ARDOUR_UI&, ToggleType);
456             void set_value (double, PBD::Controllable::GroupControlDisposition group_override);
457             double get_value (void) const;
458
459             ARDOUR_UI& ui;
460             ToggleType type;
461         };
462
463         boost::shared_ptr<TransportControllable> roll_controllable;
464         boost::shared_ptr<TransportControllable> stop_controllable;
465         boost::shared_ptr<TransportControllable> goto_start_controllable;
466         boost::shared_ptr<TransportControllable> goto_end_controllable;
467         boost::shared_ptr<TransportControllable> auto_loop_controllable;
468         boost::shared_ptr<TransportControllable> play_selection_controllable;
469         boost::shared_ptr<TransportControllable> rec_controllable;
470
471         void toggle_follow_edits ();
472
473         void set_transport_controllable_state (const XMLNode&);
474         XMLNode& get_transport_controllable_state ();
475
476         ArdourButton roll_button;
477         ArdourButton stop_button;
478         ArdourButton goto_start_button;
479         ArdourButton goto_end_button;
480         ArdourButton auto_loop_button;
481         ArdourButton play_selection_button;
482         ArdourButton rec_button;
483
484         void toggle_external_sync ();
485         void toggle_time_master ();
486         void toggle_video_sync ();
487
488         ShuttleControl* shuttle_box;
489
490         ArdourButton auto_return_button;
491         ArdourButton follow_edits_button;
492         ArdourButton auto_input_button;
493         ArdourButton click_button;
494         ArdourButton sync_button;
495
496         ArdourButton auditioning_alert_button;
497         ArdourButton solo_alert_button;
498         ArdourButton feedback_alert_button;
499         ArdourButton error_alert_button;
500
501         Gtk::VBox alert_box;
502         Gtk::VBox meter_box;
503         LevelMeterHBox * editor_meter;
504         float            editor_meter_max_peak;
505         ArdourButton     editor_meter_peak_display;
506         bool             editor_meter_peak_button_release (GdkEventButton*);
507
508         void blink_handler (bool);
509         sigc::connection blink_connection;
510
511         void cancel_solo ();
512         void solo_blink (bool);
513         void sync_blink (bool);
514         void audition_blink (bool);
515         void feedback_blink (bool);
516         void error_blink (bool);
517
518         void set_flat_buttons();
519
520         void soloing_changed (bool);
521         void auditioning_changed (bool);
522         void _auditioning_changed (bool);
523
524         bool solo_alert_press (GdkEventButton* ev);
525         bool audition_alert_press (GdkEventButton* ev);
526         bool feedback_alert_press (GdkEventButton *);
527         bool error_alert_press (GdkEventButton *);
528
529         void big_clock_value_changed ();
530         void primary_clock_value_changed ();
531         void secondary_clock_value_changed ();
532
533         /* called by Blink signal */
534
535         void transport_rec_enable_blink (bool onoff);
536
537         Gtk::Menu*        session_popup_menu;
538
539         /* menu bar and associated stuff */
540
541         Gtk::MenuBar* menu_bar;
542         Gtk::EventBox menu_bar_base;
543         Gtk::HBox     menu_hbox;
544
545         void use_menubar_as_top_menubar ();
546         void build_menu_bar ();
547
548         Gtk::Label   wall_clock_label;
549         gint update_wall_clock ();
550
551         Gtk::Label   disk_space_label;
552         void update_disk_space ();
553
554         Gtk::Label   timecode_format_label;
555         void update_timecode_format ();
556
557         Gtk::Label   cpu_load_label;
558         void update_cpu_load ();
559
560         Gtk::Label   xrun_label;
561         void update_xrun_count ();
562
563         Gtk::Label   peak_thread_work_label;
564         void update_peak_thread_work ();
565
566         Gtk::Label   buffer_load_label;
567         void update_buffer_load ();
568
569         Gtk::Label   sample_rate_label;
570         void update_sample_rate (ARDOUR::framecnt_t);
571
572         Gtk::Label    format_label;
573         void update_format ();
574
575         void every_second ();
576         void every_point_one_seconds ();
577         void every_point_zero_something_seconds ();
578
579         sigc::connection second_connection;
580         sigc::connection point_one_second_connection;
581         sigc::connection point_zero_something_second_connection;
582         sigc::connection fps_connection;
583
584         void set_fps_timeout_connection ();
585
586         void open_session ();
587         void open_recent_session ();
588         bool process_save_template_prompter (ArdourPrompter& prompter);
589         void save_template ();
590
591         void edit_metadata ();
592         void import_metadata ();
593
594         void session_add_audio_route (bool, int32_t, int32_t, ARDOUR::TrackMode, ARDOUR::RouteGroup *, uint32_t, std::string const &);
595         void session_add_midi_route (bool, ARDOUR::RouteGroup *, uint32_t, std::string const &, ARDOUR::PluginInfoPtr);
596
597         void set_transport_sensitivity (bool);
598
599         //stuff for ProTools-style numpad
600         void transport_numpad_event (int num);
601         void transport_numpad_decimal ();
602         bool _numpad_locate_happening;
603         int _pending_locate_num;
604         gint transport_numpad_timeout ();
605         sigc::connection _numpad_timeout_connection;
606
607         void transport_goto_nth_marker (int nth);
608         void transport_goto_zero ();
609         void transport_goto_start ();
610         void transport_goto_end ();
611         void transport_goto_wallclock ();
612         void transport_stop ();
613         void transport_record (bool roll);
614         void transport_roll ();
615         void transport_play_selection();
616         void transport_play_preroll();
617         void transport_forward (int option);
618         void transport_rewind (int option);
619         void transport_loop ();
620         void toggle_roll (bool with_abort, bool roll_out_of_bounded_mode);
621         bool trx_record_enable_all_tracks ();
622
623         bool _session_is_new;
624         void set_session (ARDOUR::Session *);
625         void connect_dependents_to_session (ARDOUR::Session *);
626         void we_have_dependents ();
627
628         void setup_session_options ();
629
630         guint32  last_key_press_time;
631
632         bool process_snapshot_session_prompter (ArdourPrompter& prompter, bool switch_to_it);
633         void snapshot_session (bool switch_to_it);
634
635         void quick_snapshot_session (bool switch_to_it);  //does not promtp for name, just makes a timestamped file
636
637         SaveAsDialog* save_as_dialog;
638
639         bool save_as_progress_update (float fraction, int64_t cnt, int64_t total, Gtk::Label* label, Gtk::ProgressBar* bar);
640         void save_session_as ();
641         void rename_session ();
642         void setup_order_hint (AddRouteDialog::InsertAt);
643
644         int         create_mixer ();
645         int         create_editor ();
646
647         Meterbridge  *meterbridge;
648         int         create_meterbridge ();
649
650         /* Dialogs that can be created via new<T> */
651
652         RCOptionEditor* rc_option_editor;
653         Gtk::HBox rc_option_editor_placeholder;
654         
655         WM::Proxy<SpeakerDialog> speaker_config_window;
656         WM::Proxy<KeyEditor> key_editor;
657         WM::Proxy<AddRouteDialog> add_route_dialog;
658         WM::Proxy<About> about;
659         WM::Proxy<LocationUIWindow> location_ui;
660         WM::Proxy<RouteParams_UI> route_params;
661         WM::Proxy<EngineControl> audio_midi_setup;
662         WM::Proxy<ExportVideoDialog> export_video_dialog;
663
664         /* Windows/Dialogs that require a creator method */
665
666         WM::ProxyWithConstructor<SessionOptionEditor> session_option_editor;
667         WM::ProxyWithConstructor<AddVideoDialog> add_video_dialog;
668         WM::ProxyWithConstructor<BundleManager> bundle_manager;
669         WM::ProxyWithConstructor<BigClockWindow> big_clock_window;
670         WM::ProxyWithConstructor<GlobalPortMatrixWindow> audio_port_matrix;
671         WM::ProxyWithConstructor<GlobalPortMatrixWindow> midi_port_matrix;
672
673         /* creator methods */
674
675         SessionOptionEditor*    create_session_option_editor ();
676         BundleManager*          create_bundle_manager ();
677         AddVideoDialog*         create_add_video_dialog ();
678         BigClockWindow*         create_big_clock_window();
679         GlobalPortMatrixWindow* create_global_port_matrix (ARDOUR::DataType);
680
681         ARDOUR::SystemExec *video_server_process;
682
683         void handle_locations_change (ARDOUR::Location*);
684
685         /* Keyboard Handling */
686
687         ArdourKeyboard* keyboard;
688
689         /* Keymap handling */
690
691         void install_actions ();
692
693         void toggle_record_enable (uint32_t);
694
695         uint32_t rec_enabled_streams;
696         void count_recenabled_streams (ARDOUR::Route&);
697
698         Splash* splash;
699
700         void pop_back_splash (Gtk::Window&);
701
702         /* cleanup */
703
704         Gtk::MenuItem *cleanup_item;
705
706         void display_cleanup_results (ARDOUR::CleanupReport& rep, const gchar* list_title, const bool msg_delete);
707         void cleanup ();
708         void cleanup_peakfiles ();
709         void flush_trash ();
710
711         bool have_configure_timeout;
712         ARDOUR::microseconds_t last_configure_time;
713         gint configure_timeout ();
714
715         ARDOUR::microseconds_t last_peak_grab;
716         ARDOUR::microseconds_t last_shuttle_request;
717
718         bool have_disk_speed_dialog_displayed;
719         void disk_speed_dialog_gone (int ignored_response, Gtk::MessageDialog*);
720         void disk_overrun_handler ();
721         void disk_underrun_handler ();
722         void gui_idle_handler ();
723
724         void cancel_plugin_scan ();
725         void cancel_plugin_timeout ();
726         void plugin_scan_dialog (std::string type, std::string plugin, bool);
727         void plugin_scan_timeout (int);
728
729         void session_format_mismatch (std::string, std::string);
730
731         void session_dialog (std::string);
732         int pending_state_dialog ();
733         int sr_mismatch_dialog (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
734
735         Gtk::MenuItem* jack_disconnect_item;
736         Gtk::MenuItem* jack_reconnect_item;
737         Gtk::Menu*     jack_bufsize_menu;
738
739         Glib::RefPtr<Gtk::ActionGroup> common_actions;
740
741         void editor_realized ();
742
743         std::vector<std::string> positional_sync_strings;
744
745         void toggle_send_midi_feedback ();
746         void toggle_use_mmc ();
747         void toggle_send_mmc ();
748         void toggle_send_mtc ();
749         void toggle_send_midi_clock ();
750
751         void toggle_use_osc ();
752
753         void parameter_changed (std::string);
754         void session_parameter_changed (std::string);
755
756         bool first_idle ();
757
758         void check_memory_locking ();
759
760         void audioengine_setup ();
761
762         void display_message (const char *prefix, gint prefix_len,
763                         Glib::RefPtr<Gtk::TextBuffer::Tag> ptag, Glib::RefPtr<Gtk::TextBuffer::Tag> mtag,
764                         const char *msg);
765         Gtk::Label status_bar_label;
766         bool status_bar_button_press (GdkEventButton*);
767
768         void loading_message (const std::string& msg);
769
770         PBD::ScopedConnectionList forever_connections;
771         PBD::ScopedConnection halt_connection;
772
773         void step_edit_status_change (bool);
774
775         void platform_specific ();
776         void platform_setup ();
777
778         /* these are used only in response to a platform-specific "ShouldQuit" signal
779          */
780         bool idle_finish ();
781         void queue_finish ();
782         void fontconfig_dialog ();
783
784         int missing_file (ARDOUR::Session*s, std::string str, ARDOUR::DataType type);
785         int ambiguous_file (std::string file, std::vector<std::string> hits);
786
787         bool click_button_clicked (GdkEventButton *);
788
789         VisibilityGroup _status_bar_visibility;
790
791         /** A ProcessThread so that we have some thread-local buffers for use by
792          *  PluginEqGui::impulse_analysis ().
793          */
794         ARDOUR::ProcessThread* _process_thread;
795
796         void feedback_detected ();
797
798         ArdourButton             midi_panic_button;
799         void                     midi_panic ();
800
801         void successful_graph_sort ();
802         bool _feedback_exists;
803
804         enum ArdourLogLevel {
805                 LogLevelNone = 0,
806                 LogLevelInfo,
807                 LogLevelWarning,
808                 LogLevelError
809         };
810
811         ArdourLogLevel _log_not_acknowledged;
812
813         void resize_text_widgets ();
814
815         bool xrun_button_release (GdkEventButton* ev);
816
817         std::string _announce_string;
818         void check_announcements ();
819
820         int do_audio_midi_setup (uint32_t);
821         void audioengine_became_silent ();
822
823         DuplicateRouteDialog* duplicate_routes_dialog;
824
825         void grab_focus_after_dialog ();
826
827         void tabs_switch (GtkNotebookPage*, guint page_number);
828         bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev, Gtkmm2ext::Bindings*);
829 };
830
831 #endif /* __ardour_gui_h__ */