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