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