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