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