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