start work on auto return target dropdown rather than button
[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 #include <gtkmm2ext/gtk_ui.h>
57 #include <gtkmm2ext/click_box.h>
58 #include <gtkmm2ext/stateful_button.h>
59 #include <gtkmm2ext/bindable_button.h>
60
61 #include "ardour/ardour.h"
62 #include "ardour/types.h"
63 #include "ardour/utils.h"
64 #include "ardour/plugin.h"
65 #include "ardour/session_handle.h"
66 #include "ardour/system_exec.h"
67
68 #include "video_timeline.h"
69
70 #include "about.h"
71 #include "ardour_button.h"
72 #include "ardour_dialog.h"
73 #include "ardour_dropdown.h"
74 #include "ardour_window.h"
75 #include "editing.h"
76 #include "engine_dialog.h"
77 #include "export_video_dialog.h"
78 #include "meterbridge.h"
79 #include "ui_config.h"
80 #include "enums.h"
81 #include "visibility_group.h"
82 #include "window_manager.h"
83
84 #include "add_route_dialog.h"
85 #include "add_video_dialog.h"
86 #include "big_clock_window.h"
87 #include "bundle_manager.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
96 class VideoTimeLine;
97 class ArdourKeyboard;
98 class AudioClock;
99 class ButtonJoiner;
100 class ConnectionEditor;
101 class MainClock;
102 class Mixer_UI;
103 class PublicEditor;
104 class RCOptionEditor;
105 class RouteParams_UI;
106 class SaveAsDialog;
107 class SessionDialog;
108 class SessionOptionEditor;
109 class ShuttleControl;
110 class Splash;
111 class TimeInfoBox;
112 class MidiTracer;
113 class NSM_Client;
114 class LevelMeterHBox;
115 class GUIObjectState;
116
117 namespace ARDOUR {
118         class ControlProtocolInfo;
119         class IO;
120         class Port;
121         class Route;
122         class RouteGroup;
123         class Location;
124         class ProcessThread;
125 }
126
127 namespace Gtkmm2ext {
128         class TearOff;
129 }
130
131 namespace Gtk {
132         class ProgressBar;
133 }
134
135 class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
136 {
137     private:
138         /* This must be the first data element because constructor ordering
139            relies on it.
140         */
141         UIConfiguration*     ui_config;
142
143     public:
144         ARDOUR_UI (int *argcp, char **argvp[], const char* localedir, UIConfiguration*);
145         ~ARDOUR_UI();
146
147         bool run_startup (bool should_be_new, std::string load_template);
148
149         void show_splash ();
150         void hide_splash ();
151
152         void launch_chat ();
153         void launch_manual ();
154         void launch_reference ();
155         void launch_tracker ();
156         void launch_subscribe ();
157         void launch_cheat_sheet ();
158         void launch_website ();
159         void launch_website_dev ();
160         void launch_forums ();
161         void launch_howto_report ();
162         void show_about ();
163         void hide_about ();
164
165         void load_from_application_api (const std::string& path);
166         void finish();
167
168         int load_session (const std::string& path, const std::string& snapshot, std::string mix_template = std::string());
169         bool session_loaded;
170         int build_session (const std::string& path, const std::string& snapshot, ARDOUR::BusProfile&);
171         bool session_is_new() const { return _session_is_new; }
172
173         ARDOUR::Session* the_session() { return _session; }
174
175         bool get_smart_mode () const;
176         
177         int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = "");
178         int  build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path);
179         bool ask_about_loading_existing_session (const std::string& session_path);
180
181         /// @return true if session was successfully unloaded.
182         int unload_session (bool hide_stuff = false);
183         void close_session();
184
185         int  save_state_canfail (std::string state_name = "", bool switch_to_it = false);
186         void save_state (const std::string & state_name = "", bool switch_to_it = false);
187
188         static ARDOUR_UI *instance () { return theArdourUI; }
189         static UIConfiguration *config () { return theArdourUI->ui_config; }
190         static float ui_scale;
191         
192         PublicEditor&     the_editor() { return *editor;}
193         Mixer_UI* the_mixer() { return mixer; }
194
195         void new_midi_tracer_window ();
196         void toggle_editing_space();
197         void toggle_mixer_space();
198         void toggle_keep_tearoffs();
199
200         Gtk::Tooltips& tooltips() { return _tooltips; }
201
202         static PublicEditor* _instance;
203
204         /** Emitted frequently with the audible frame, false, and the edit point as
205          *  parameters respectively.
206          *
207          *  (either RapidScreenUpdate || SuperRapidScreenUpdate - user-config)
208          */
209         static sigc::signal<void, framepos_t, bool, framepos_t> Clock;
210
211         static void close_all_dialogs () { CloseAllDialogs(); }
212         static sigc::signal<void> CloseAllDialogs;
213
214         XMLNode* editor_settings() const;
215         XMLNode* mixer_settings () const;
216         XMLNode* keyboard_settings () const;
217         XMLNode* tearoff_settings (const char*) const;
218
219         void save_ardour_state ();
220         gboolean configure_handler (GdkEventConfigure* conf);
221
222         void halt_on_xrun_message ();
223         void xrun_handler (framepos_t);
224         void create_xrun_marker (framepos_t);
225
226         GUIObjectState* gui_object_state;
227         
228         MainClock* primary_clock;
229         MainClock* secondary_clock;
230         void focus_on_clock ();
231         AudioClock*   big_clock;
232
233         TimeInfoBox* time_info_box;
234
235         VideoTimeLine *video_timeline;
236
237         void store_clock_modes ();
238         void restore_clock_modes ();
239         void reset_main_clocks ();
240
241         void synchronize_sync_source_and_video_pullup ();
242
243         void add_route (Gtk::Window* float_window);
244         void add_routes_part_two ();
245         void add_routes_thread ();
246
247         void add_video (Gtk::Window* float_window);
248         void remove_video ();
249         void start_video_server_menu (Gtk::Window* float_window);
250         bool start_video_server (Gtk::Window* float_window, bool popup_msg);
251         void stop_video_server (bool ask_confirm=false);
252         void flush_videotimeline_cache (bool localcacheonly=false);
253         void export_video (bool range = false);
254
255         void session_add_audio_track (
256                 int input_channels,
257                 int32_t output_channels,
258                 ARDOUR::TrackMode mode,
259                 ARDOUR::RouteGroup* route_group,
260                 uint32_t how_many,
261                 std::string const & name_template
262                 ) {
263
264                 session_add_audio_route (true, input_channels, output_channels, mode, route_group, how_many, name_template);
265         }
266
267         void session_add_audio_bus (int input_channels, int32_t output_channels, ARDOUR::RouteGroup* route_group,
268                                     uint32_t how_many, std::string const & name_template) {
269                 session_add_audio_route (false, input_channels, output_channels, ARDOUR::Normal, route_group, how_many, name_template);
270         }
271
272         void session_add_midi_track (ARDOUR::RouteGroup* route_group, uint32_t how_many, std::string const & name_template,
273                                      ARDOUR::PluginInfoPtr instrument) {
274                 session_add_midi_route (true, route_group, how_many, name_template, instrument);
275         }
276
277         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,
278                                       ARDOUR::PluginInfoPtr instrument);
279
280         /*void session_add_midi_bus () {
281                 session_add_midi_route (false);
282         }*/
283
284         void attach_to_engine ();
285         void post_engine ();
286
287         gint exit_on_main_window_close (GdkEventAny *);
288
289         void maximise_editing_space ();
290         void restore_editing_space ();
291
292         void show_ui_prefs ();
293
294         void update_tearoff_visibility ();
295
296         void setup_profile ();
297         void setup_tooltips ();
298
299         void set_shuttle_fract (double);
300
301         void get_process_buffers ();
302         void drop_process_buffers ();
303
304         void reset_peak_display ();
305         void reset_route_peak_display (ARDOUR::Route*);
306         void reset_group_peak_display (ARDOUR::RouteGroup*);
307
308         const std::string& announce_string() const { return _announce_string; }
309
310         int disconnect_from_engine ();
311         int reconnect_to_engine ();
312         void hide_application ();
313
314   protected:
315         friend class PublicEditor;
316
317         void toggle_auto_play ();
318         void toggle_auto_input ();
319         void toggle_punch ();
320         void unset_dual_punch ();
321         bool ignore_dual_punch;
322         void toggle_punch_in ();
323         void toggle_punch_out ();
324         void show_loop_punch_ruler_and_disallow_hide ();
325         void reenable_hide_loop_punch_ruler_if_appropriate ();
326         void toggle_click ();
327         void toggle_audio_midi_setup ();
328         void toggle_session_auto_loop ();
329         void toggle_rc_options_window ();
330         void toggle_session_options_window ();
331
332   private:
333         PublicEditor*        editor;
334         Mixer_UI*            mixer;
335         Gtk::Tooltips       _tooltips;
336         NSM_Client*          nsm;
337         bool                _was_dirty;
338         bool                _mixer_on_top;
339         bool first_time_engine_run;
340
341         void goto_editor_window ();
342         void goto_mixer_window ();
343         void toggle_mixer_window ();
344         void toggle_meterbridge ();
345         void toggle_editor_mixer ();
346
347         int  setup_windows ();
348         void setup_transport ();
349         void setup_clock ();
350
351         static ARDOUR_UI *theArdourUI;
352
353         int starting ();
354
355         int  ask_about_saving_session (const std::vector<std::string>& actions);
356
357         void save_session_at_its_request (std::string);
358         /* periodic safety backup, to be precise */
359         gint autosave_session();
360         void update_autosave();
361         sigc::connection _autosave_connection;
362
363         void map_transport_state ();
364         int32_t do_engine_start ();
365
366         void engine_halted (const char* reason, bool free_reason);
367         void engine_stopped ();
368         void engine_running ();
369
370         void use_config ();
371
372         void about_signal_response(int response);
373
374         Gtk::VBox     top_packer;
375
376         sigc::connection clock_signal_connection;
377         void         update_clocks ();
378         void         start_clocking ();
379         void         stop_clocking ();
380
381         bool main_window_state_event_handler (GdkEventWindowState*, bool window_was_editor);
382
383         void update_transport_clocks (framepos_t pos);
384         void record_state_changed ();
385
386         std::list<MidiTracer*> _midi_tracer_windows;
387
388         void detach_tearoff (Gtk::Box* parent, Gtk::Widget* contents);
389         void reattach_tearoff (Gtk::Box* parent, Gtk::Widget* contents, int32_t order);
390         void reattach_all_tearoffs ();
391
392         /* Transport Control */
393
394         Gtkmm2ext::TearOff*      transport_tearoff;
395         Gtk::Frame               transport_frame;
396         Gtk::HBox                transport_tearoff_hbox;
397         Gtk::HBox                transport_hbox;
398         Gtk::Fixed               transport_base;
399         Gtk::Fixed               transport_button_base;
400         Gtk::Frame               transport_button_frame;
401         Gtk::HBox                transport_button_hbox;
402         Gtk::VBox                transport_button_vbox;
403         Gtk::HBox                transport_option_button_hbox;
404         Gtk::VBox                transport_option_button_vbox;
405         Gtk::HBox                transport_clock_hbox;
406         Gtk::VBox                transport_clock_vbox;
407         Gtk::HBox                primary_clock_hbox;
408         Gtk::HBox                secondary_clock_hbox;
409
410         struct TransportControllable : public PBD::Controllable {
411             enum ToggleType {
412                     Roll = 0,
413                     Stop,
414                     RecordEnable,
415                     GotoStart,
416                     GotoEnd,
417                     AutoLoop,
418                     PlaySelection,
419             };
420
421             TransportControllable (std::string name, ARDOUR_UI&, ToggleType);
422             void set_value (double);
423             double get_value (void) const;
424
425             ARDOUR_UI& ui;
426             ToggleType type;
427         };
428
429         boost::shared_ptr<TransportControllable> roll_controllable;
430         boost::shared_ptr<TransportControllable> stop_controllable;
431         boost::shared_ptr<TransportControllable> goto_start_controllable;
432         boost::shared_ptr<TransportControllable> goto_end_controllable;
433         boost::shared_ptr<TransportControllable> auto_loop_controllable;
434         boost::shared_ptr<TransportControllable> play_selection_controllable;
435         boost::shared_ptr<TransportControllable> rec_controllable;
436
437         void toggle_follow_edits ();
438
439         void set_transport_controllable_state (const XMLNode&);
440         XMLNode& get_transport_controllable_state ();
441
442         ArdourButton roll_button;
443         ArdourButton stop_button;
444         ArdourButton goto_start_button;
445         ArdourButton goto_end_button;
446         ArdourButton auto_loop_button;
447         ArdourButton play_selection_button;
448         ArdourButton rec_button;
449
450         void toggle_external_sync ();
451         void toggle_time_master ();
452         void toggle_video_sync ();
453
454         ShuttleControl* shuttle_box;
455
456         ArdourDropdown auto_return_dropdown;
457         Gtk::CheckMenuItem *auto_return_last_locate;
458         Gtk::CheckMenuItem *auto_return_range_selection;
459         Gtk::CheckMenuItem *auto_return_region_selection;
460         Gtk::CheckMenuItem *auto_return_loop;
461         Gtk::MenuItem *auto_return_toggle;
462
463         void toggle_auto_return_state (ARDOUR::AutoReturnTarget);
464         void toggle_all_auto_return ();
465         
466         ArdourButton follow_edits_button;
467         ArdourButton auto_input_button;
468         ArdourButton click_button;
469         ArdourButton sync_button;
470
471         ArdourButton auditioning_alert_button;
472         ArdourButton solo_alert_button;
473         ArdourButton feedback_alert_button;
474         ArdourButton error_alert_button;
475
476         Gtk::VBox alert_box;
477         Gtk::VBox meter_box;
478         LevelMeterHBox * editor_meter;
479         float            editor_meter_max_peak;
480         ArdourButton     editor_meter_peak_display;
481         bool             editor_meter_peak_button_release (GdkEventButton*);
482
483         void blink_handler (bool);
484         sigc::connection blink_connection;
485
486         void solo_blink (bool);
487         void sync_blink (bool);
488         void audition_blink (bool);
489         void feedback_blink (bool);
490         void error_blink (bool);
491         
492         void set_flat_buttons();
493
494         void soloing_changed (bool);
495         void auditioning_changed (bool);
496         void _auditioning_changed (bool);
497         
498         bool solo_alert_press (GdkEventButton* ev);
499         bool audition_alert_press (GdkEventButton* ev);
500         bool feedback_alert_press (GdkEventButton *);
501         bool error_alert_press (GdkEventButton *);
502
503         void big_clock_value_changed ();
504         void primary_clock_value_changed ();
505         void secondary_clock_value_changed ();
506
507         /* called by Blink signal */
508
509         void transport_rec_enable_blink (bool onoff);
510
511         Gtk::Menu*        session_popup_menu;
512
513         struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
514             RecentSessionModelColumns() {
515                     add (visible_name);
516                     add (tip);
517                     add (fullpath);
518             }
519             Gtk::TreeModelColumn<std::string> visible_name;
520             Gtk::TreeModelColumn<std::string> tip;
521             Gtk::TreeModelColumn<std::string> fullpath;
522         };
523
524         RecentSessionModelColumns    recent_session_columns;
525         Gtk::TreeView                recent_session_display;
526         Glib::RefPtr<Gtk::TreeStore> recent_session_model;
527
528         ArdourDialog*     session_selector_window;
529         Gtk::FileChooserDialog* open_session_selector;
530
531         void build_session_selector();
532         void redisplay_recent_sessions();
533         void recent_session_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
534
535         struct RecentSessionsSorter {
536                 bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
537                     return ARDOUR::cmp_nocase(a.first, b.first) == -1;
538             }
539         };
540
541         /* menu bar and associated stuff */
542
543         Gtk::MenuBar* menu_bar;
544         Gtk::EventBox menu_bar_base;
545         Gtk::HBox     menu_hbox;
546
547         void use_menubar_as_top_menubar ();
548         void build_menu_bar ();
549
550         Gtk::Label   wall_clock_label;
551         gint update_wall_clock ();
552
553         Gtk::Label   disk_space_label;
554         void update_disk_space ();
555
556         Gtk::Label   timecode_format_label;
557         void update_timecode_format ();
558
559         Gtk::Label   cpu_load_label;
560         void update_cpu_load ();
561
562         Gtk::Label   xrun_label;
563         void update_xrun_count ();
564
565         Gtk::Label   buffer_load_label;
566         void update_buffer_load ();
567
568         Gtk::Label   sample_rate_label;
569         void update_sample_rate (ARDOUR::framecnt_t);
570
571         Gtk::Label    format_label;
572         void update_format ();
573         
574         void every_second ();
575         void every_point_one_seconds ();
576         void every_point_zero_something_seconds ();
577
578         sigc::connection second_connection;
579         sigc::connection point_one_second_connection;
580         sigc::connection point_zero_something_second_connection;
581         sigc::connection fps_connection;
582
583         void set_fps_timeout_connection ();
584
585         void open_session ();
586         void open_recent_session ();
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         void snapshot_session (bool switch_to_it);
631
632         SaveAsDialog* save_as_dialog;
633
634         bool save_as_progress_update (float fraction, int64_t cnt, int64_t total, Gtk::Label* label, Gtk::ProgressBar* bar);
635         void save_session_as ();
636         void rename_session ();
637         void setup_order_hint (AddRouteDialog::InsertAt);
638
639         int         create_mixer ();
640         int         create_editor ();
641
642         Meterbridge  *meterbridge;
643         int         create_meterbridge ();
644         /* Dialogs that can be created via new<T> */
645
646         WM::Proxy<SpeakerDialog> speaker_config_window;
647         WM::Proxy<KeyEditor> key_editor;
648         WM::Proxy<RCOptionEditor> rc_option_editor;
649         WM::Proxy<AddRouteDialog> add_route_dialog;
650         WM::Proxy<About> about;
651         WM::Proxy<LocationUIWindow> location_ui;
652         WM::Proxy<RouteParams_UI> route_params;
653         WM::Proxy<EngineControl> audio_midi_setup;
654         WM::Proxy<ExportVideoDialog> export_video_dialog;
655
656         /* Windows/Dialogs that require a creator method */
657
658         WM::ProxyWithConstructor<SessionOptionEditor> session_option_editor;
659         WM::ProxyWithConstructor<AddVideoDialog> add_video_dialog;
660         WM::ProxyWithConstructor<BundleManager> bundle_manager;
661         WM::ProxyWithConstructor<BigClockWindow> big_clock_window;
662         WM::ProxyWithConstructor<GlobalPortMatrixWindow> audio_port_matrix;
663         WM::ProxyWithConstructor<GlobalPortMatrixWindow> midi_port_matrix;
664
665         /* creator methods */
666
667         SessionOptionEditor*    create_session_option_editor ();
668         BundleManager*          create_bundle_manager ();
669         AddVideoDialog*         create_add_video_dialog ();
670         BigClockWindow*         create_big_clock_window(); 
671         GlobalPortMatrixWindow* create_global_port_matrix (ARDOUR::DataType);
672
673         ARDOUR::SystemExec *video_server_process;
674
675         void handle_locations_change (ARDOUR::Location*);
676
677         /* Keyboard Handling */
678
679         ArdourKeyboard* keyboard;
680
681         /* Keymap handling */
682
683         void install_actions ();
684
685         void toggle_record_enable (uint32_t);
686
687         uint32_t rec_enabled_streams;
688         void count_recenabled_streams (ARDOUR::Route&);
689
690         Splash* splash;
691
692         void pop_back_splash (Gtk::Window&);
693
694         /* cleanup */
695
696         Gtk::MenuItem *cleanup_item;
697
698         void display_cleanup_results (ARDOUR::CleanupReport& rep, const gchar* list_title, const bool msg_delete);
699         void cleanup ();
700         void flush_trash ();
701
702         bool have_configure_timeout;
703         ARDOUR::microseconds_t last_configure_time;
704         gint configure_timeout ();
705
706         ARDOUR::microseconds_t last_peak_grab;
707         ARDOUR::microseconds_t last_shuttle_request;
708
709         bool have_disk_speed_dialog_displayed;
710         void disk_speed_dialog_gone (int ignored_response, Gtk::MessageDialog*);
711         void disk_overrun_handler ();
712         void disk_underrun_handler ();
713         void gui_idle_handler ();
714
715         void cancel_plugin_scan ();
716         void cancel_plugin_timeout ();
717         void plugin_scan_dialog (std::string type, std::string plugin, bool);
718         void plugin_scan_timeout (int);
719
720         void session_format_mismatch (std::string, std::string);
721
722         void session_dialog (std::string);
723         int pending_state_dialog ();
724         int sr_mismatch_dialog (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
725
726         Gtk::MenuItem* jack_disconnect_item;
727         Gtk::MenuItem* jack_reconnect_item;
728         Gtk::Menu*     jack_bufsize_menu;
729
730         Glib::RefPtr<Gtk::ActionGroup> common_actions;
731
732         void editor_realized ();
733
734         std::vector<std::string> positional_sync_strings;
735
736         void toggle_send_midi_feedback ();
737         void toggle_use_mmc ();
738         void toggle_send_mmc ();
739         void toggle_send_mtc ();
740         void toggle_send_midi_clock ();
741
742         void toggle_use_osc ();
743
744         void parameter_changed (std::string);
745         void session_parameter_changed (std::string);
746
747         bool first_idle ();
748
749         void check_memory_locking ();
750
751         bool check_audioengine();
752         void audioengine_setup ();
753
754         void display_message (const char *prefix, gint prefix_len,
755                         Glib::RefPtr<Gtk::TextBuffer::Tag> ptag, Glib::RefPtr<Gtk::TextBuffer::Tag> mtag,
756                         const char *msg);
757         Gtk::Label status_bar_label;
758         bool status_bar_button_press (GdkEventButton*);
759
760         void loading_message (const std::string& msg);
761
762         PBD::ScopedConnectionList forever_connections;
763         PBD::ScopedConnection halt_connection; 
764
765         void step_edit_status_change (bool);
766
767         void platform_specific ();
768         void platform_setup ();
769
770         /* these are used only in response to a platform-specific "ShouldQuit" signal
771          */
772         bool idle_finish ();
773         void queue_finish ();
774         void fontconfig_dialog ();
775
776         int missing_file (ARDOUR::Session*s, std::string str, ARDOUR::DataType type);
777         int ambiguous_file (std::string file, std::vector<std::string> hits);
778
779         bool click_button_clicked (GdkEventButton *);
780
781         VisibilityGroup _status_bar_visibility;
782
783         /** A ProcessThread so that we have some thread-local buffers for use by
784          *  PluginEqGui::impulse_analysis ().
785          */
786         ARDOUR::ProcessThread* _process_thread;
787
788         void feedback_detected ();
789
790         ArdourButton             midi_panic_button;
791         void                     midi_panic ();
792
793         void successful_graph_sort ();
794         bool _feedback_exists;
795
796         enum ArdourLogLevel {
797                 LogLevelNone = 0,
798                 LogLevelInfo,
799                 LogLevelWarning,
800                 LogLevelError
801         };
802
803         ArdourLogLevel _log_not_acknowledged;
804
805         void resize_text_widgets ();
806
807         bool xrun_button_release (GdkEventButton* ev);
808
809         std::string _announce_string;
810         void check_announcements ();
811
812         int do_audio_midi_setup (uint32_t);
813         void audioengine_became_silent ();
814 };
815
816 #endif /* __ardour_gui_h__ */
817