OSC: Added feedback for /strip/hide
[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 <gtkmm/box.h>
41 #include <gtkmm/frame.h>
42 #include <gtkmm/label.h>
43 #include <gtkmm/table.h>
44 #include <gtkmm/fixed.h>
45 #include <gtkmm/drawingarea.h>
46 #include <gtkmm/eventbox.h>
47 #include <gtkmm/menu.h>
48 #include <gtkmm/menuitem.h>
49 #include <gtkmm/messagedialog.h>
50 #include <gtkmm/notebook.h>
51 #include <gtkmm/button.h>
52 #include <gtkmm/togglebutton.h>
53 #include <gtkmm/treeview.h>
54 #include <gtkmm/menubar.h>
55 #include <gtkmm/textbuffer.h>
56 #include <gtkmm/adjustment.h>
57
58 #include "gtkmm2ext/gtk_ui.h"
59 #include "gtkmm2ext/bindings.h"
60 #include "gtkmm2ext/visibility_tracker.h"
61
62 #include "ardour/ardour.h"
63 #include "ardour/types.h"
64 #include "ardour/utils.h"
65 #include "ardour/plugin.h"
66 #include "ardour/session_handle.h"
67 #include "ardour/system_exec.h"
68
69 #include "video_timeline.h"
70
71 #include "widgets/ardour_button.h"
72 #include "widgets/ardour_spacer.h"
73
74 #include "add_route_dialog.h"
75 #include "ardour_dialog.h"
76 #include "ardour_window.h"
77 #include "dsp_load_indicator.h"
78 #include "disk_space_indicator.h"
79 #include "editing.h"
80 #include "enums.h"
81 #include "mini_timeline.h"
82 #include "shuttle_control.h"
83 #include "transport_control.h"
84 #include "transport_control_ui.h"
85 #include "visibility_group.h"
86 #include "window_manager.h"
87
88 #ifdef COMPILER_MSVC
89 #include "about.h"
90 #include "add_video_dialog.h"
91 #include "big_clock_window.h"
92 #include "big_transport_window.h"
93 #include "bundle_manager.h"
94 #include "engine_dialog.h"
95 #include "export_video_dialog.h"
96 #include "global_port_matrix.h"
97 #include "idleometer.h"
98 #include "keyeditor.h"
99 #include "location_ui.h"
100 #include "lua_script_manager.h"
101 #include "rc_option_editor.h"
102 #include "route_dialogs.h"
103 #include "route_params_ui.h"
104 #include "session_option_editor.h"
105 #include "speaker_dialog.h"
106 #else
107 class About;
108 class AddRouteDialog;
109 class AddVideoDialog;
110 class BigClockWindow;
111 class BigTransportWindow;
112 class BundleManager;
113 class EngineControl;
114 class ExportVideoDialog;
115 class KeyEditor;
116 class LocationUIWindow;
117 class LuaScriptManager;
118 class RCOptionEditor;
119 class RouteParams_UI;
120 class SessionOptionEditor;
121 class SpeakerDialog;
122 class GlobalPortMatrixWindow;
123 class IdleOMeter;
124 #endif
125
126 class VideoTimeLine;
127 class ArdourKeyboard;
128 class AudioClock;
129 class ConnectionEditor;
130 class DuplicateRouteDialog;
131 class MainClock;
132 class Mixer_UI;
133 class PublicEditor;
134 class SaveAsDialog;
135 class SaveTemplateDialog;
136 class SessionDialog;
137 class SessionOptionEditorWindow;
138 class Splash;
139 class TimeInfoBox;
140 class Meterbridge;
141 class LuaWindow;
142 class MidiTracer;
143 class NSM_Client;
144 class LevelMeterHBox;
145 class GUIObjectState;
146
147 namespace ARDOUR {
148         class ControlProtocolInfo;
149         class IO;
150         class Port;
151         class Route;
152         class RouteGroup;
153         class Location;
154         class ProcessThread;
155 }
156
157 namespace Gtk {
158         class ProgressBar;
159 }
160
161 namespace ArdourWidgets {
162         class Prompter;
163         class Tabbable;
164 }
165
166 class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr, public TransportControlProvider
167 {
168 public:
169         ARDOUR_UI (int *argcp, char **argvp[], const char* localedir);
170         ~ARDOUR_UI();
171
172         bool run_startup (bool should_be_new, std::string load_template);
173
174         void show_splash ();
175         void hide_splash ();
176
177         void launch_chat ();
178         void launch_manual ();
179         void launch_reference ();
180         void launch_tracker ();
181         void launch_subscribe ();
182         void launch_cheat_sheet ();
183         void launch_website ();
184         void launch_website_dev ();
185         void launch_forums ();
186         void launch_howto_report ();
187         void show_about ();
188         void hide_about ();
189
190         void load_from_application_api (const std::string& path);
191         void finish();
192
193         int load_session (const std::string& path, const std::string& snapshot, std::string mix_template = std::string());
194         bool session_loaded;
195         bool session_load_in_progress;
196         int build_session (const std::string& path, const std::string& snapshot, ARDOUR::BusProfile*);
197         bool session_is_new() const { return _session_is_new; }
198
199         ARDOUR::Session* the_session() { return _session; }
200
201         bool get_smart_mode () const;
202
203         int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = "");
204         int  build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path);
205         bool ask_about_loading_existing_session (const std::string& session_path);
206
207         /// @return true if session was successfully unloaded.
208         int unload_session (bool hide_stuff = false);
209         void close_session();
210
211         int  save_state_canfail (std::string state_name = "", bool switch_to_it = false);
212         void save_state (const std::string & state_name = "", bool switch_to_it = false);
213
214         static ARDOUR_UI *instance () { return theArdourUI; }
215
216         /* signal emitted when escape key is pressed. All UI components that
217            need to respond to Escape in some way (e.g. break drag, clear
218            selection, etc) should connect to and handle this.
219         */
220         PBD::Signal0<void> Escape;
221
222         PublicEditor&     the_editor() { return *editor;}
223         Mixer_UI* the_mixer() { return mixer; }
224
225         void new_midi_tracer_window ();
226         void toggle_editing_space();
227         void toggle_mixer_space();
228         void toggle_mixer_list();
229         void toggle_monitor_section_visibility ();
230         void toggle_keep_tearoffs();
231
232         void reset_focus (Gtk::Widget*);
233
234         static PublicEditor* _instance;
235
236         /** Emitted frequently with the audible sample, false, and the edit point as
237          *  parameters respectively.
238          *
239          *  (either RapidScreenUpdate || SuperRapidScreenUpdate - user-config)
240          */
241         static sigc::signal<void, samplepos_t> Clock;
242
243         static void close_all_dialogs () { CloseAllDialogs(); }
244         static sigc::signal<void> CloseAllDialogs;
245
246         XMLNode* main_window_settings() const;
247         XMLNode* editor_settings() const;
248         XMLNode* preferences_settings() const;
249         XMLNode* mixer_settings () const;
250         XMLNode* keyboard_settings () const;
251         XMLNode* tearoff_settings (const char*) const;
252
253         void save_ardour_state ();
254         gboolean configure_handler (GdkEventConfigure* conf);
255
256         void halt_on_xrun_message ();
257         void xrun_handler (samplepos_t);
258         void create_xrun_marker (samplepos_t);
259
260         GUIObjectState* gui_object_state;
261
262         MainClock* primary_clock;
263         MainClock* secondary_clock;
264         void focus_on_clock ();
265         AudioClock*   big_clock;
266
267         VideoTimeLine *video_timeline;
268
269         void store_clock_modes ();
270         void restore_clock_modes ();
271         void reset_main_clocks ();
272
273         void synchronize_sync_source_and_video_pullup ();
274
275         void add_route ();
276         void add_route_dialog_response (int);
277
278         void add_routes_part_two ();
279         void add_routes_thread ();
280
281         void start_duplicate_routes ();
282
283         void add_video (Gtk::Window* float_window);
284         void remove_video ();
285         void start_video_server_menu (Gtk::Window* float_window);
286         bool start_video_server (Gtk::Window* float_window, bool popup_msg);
287         void stop_video_server (bool ask_confirm=false);
288         void flush_videotimeline_cache (bool localcacheonly=false);
289         void export_video (bool range = false);
290
291         void session_add_audio_route (bool, int32_t, int32_t, ARDOUR::TrackMode, ARDOUR::RouteGroup *, uint32_t, std::string const &, bool, ARDOUR::PresentationInfo::order_t order);
292
293         void session_add_mixed_track (const ARDOUR::ChanCount&, const ARDOUR::ChanCount&, ARDOUR::RouteGroup*,
294                                       uint32_t, std::string const &, bool strict_io,
295                                       ARDOUR::PluginInfoPtr, ARDOUR::Plugin::PresetRecord* pset,
296                                       ARDOUR::PresentationInfo::order_t order);
297
298         void session_add_midi_bus (ARDOUR::RouteGroup*, uint32_t, std::string const &, bool strict_io,
299                                    ARDOUR::PluginInfoPtr, ARDOUR::Plugin::PresetRecord* pset,
300                                    ARDOUR::PresentationInfo::order_t order);
301
302         void session_add_midi_route (bool, ARDOUR::RouteGroup *, uint32_t, std::string const &, bool,
303                                      ARDOUR::PluginInfoPtr, ARDOUR::Plugin::PresetRecord*,
304                                      ARDOUR::PresentationInfo::order_t order);
305
306         void display_insufficient_ports_message ();
307
308         void attach_to_engine ();
309         void post_engine ();
310
311         gint exit_on_main_window_close (GdkEventAny *);
312
313         void maximise_editing_space ();
314         void restore_editing_space ();
315
316         void show_ui_prefs ();
317
318         bool check_audioengine(Gtk::Window&);
319
320         void setup_profile ();
321         void setup_tooltips ();
322
323         void set_shuttle_fract (double);
324
325         void get_process_buffers ();
326         void drop_process_buffers ();
327
328         void reset_peak_display ();
329         void reset_route_peak_display (ARDOUR::Route*);
330         void reset_group_peak_display (ARDOUR::RouteGroup*);
331
332         const std::string& announce_string() const { return _announce_string; }
333
334         void hide_application ();
335
336         Gtk::Notebook& tabs();
337         Gtk::Window& main_window () { return _main_window; }
338
339         void setup_toplevel_window (Gtk::Window&, const std::string& name, void* owner);
340
341         /* called from a static C function */
342
343         GtkNotebook* tab_window_root_drop (GtkNotebook* src,
344                                            GtkWidget* w,
345                                            gint x,
346                                            gint y,
347                                            gpointer user_data);
348
349         bool tabbed_window_state_event_handler (GdkEventWindowState*, void* object);
350         bool key_event_handler (GdkEventKey*, Gtk::Window* window);
351
352         Gtkmm2ext::ActionMap global_actions;
353
354         ARDOUR::PresentationInfo::order_t translate_order (RouteDialogs::InsertAt);
355
356         std::map<std::string, std::string> route_setup_info (const std::string& script_path);
357
358 protected:
359         friend class PublicEditor;
360
361         void toggle_auto_play ();
362         void toggle_auto_input ();
363         void toggle_punch ();
364         void unset_dual_punch ();
365         bool ignore_dual_punch;
366         void toggle_punch_in ();
367         void toggle_punch_out ();
368         void toggle_session_monitoring_in ();
369         void toggle_session_monitoring_disk ();
370         void show_loop_punch_ruler_and_disallow_hide ();
371         void reenable_hide_loop_punch_ruler_if_appropriate ();
372         void toggle_auto_return ();
373         void toggle_click ();
374         void toggle_audio_midi_setup ();
375         void toggle_session_auto_loop ();
376         void toggle_rc_options_window ();
377         void toggle_session_options_window ();
378
379 private:
380
381         Gtk::Window   _main_window;
382         Gtkmm2ext::VisibilityTracker* main_window_visibility;
383         Gtk::VBox      main_vpacker;
384         Gtk::HBox      status_bar_hpacker;
385         Gtk::Notebook _tabs;
386         PublicEditor*  editor;
387         Mixer_UI*      mixer;
388         Gtk::Tooltips _tooltips;
389         NSM_Client*    nsm;
390         bool          _was_dirty;
391         bool          _mixer_on_top;
392         bool          _initial_verbose_plugin_scan;
393         bool           first_time_engine_run;
394
395         void show_tabbable (ArdourWidgets::Tabbable*);
396         void hide_tabbable (ArdourWidgets::Tabbable*);
397         void detach_tabbable (ArdourWidgets::Tabbable*);
398         void attach_tabbable (ArdourWidgets::Tabbable*);
399         void button_change_tabbable_visibility (ArdourWidgets::Tabbable*);
400         void key_change_tabbable_visibility (ArdourWidgets::Tabbable*);
401         void toggle_editor_and_mixer ();
402
403         void tabbable_state_change (ArdourWidgets::Tabbable&);
404
405         void toggle_meterbridge ();
406         void toggle_luawindow ();
407
408         int  setup_windows ();
409         void setup_transport ();
410         void setup_clock ();
411
412         static ARDOUR_UI *theArdourUI;
413         SessionDialog *_session_dialog;
414
415         int starting ();
416
417         int  ask_about_saving_session (const std::vector<std::string>& actions);
418
419         void save_session_at_its_request (std::string);
420         /* periodic safety backup, to be precise */
421         gint autosave_session();
422         void update_autosave();
423         sigc::connection _autosave_connection;
424
425         void session_dirty_changed ();
426         void update_title ();
427
428         void map_transport_state ();
429         int32_t do_engine_start ();
430
431         void engine_halted (const char* reason, bool free_reason);
432         void engine_stopped ();
433         void engine_running ();
434
435         void use_config ();
436
437         void about_signal_response(int response);
438
439         Gtk::VBox    top_packer;
440
441         sigc::connection clock_signal_connection;
442         void         update_clocks ();
443         void         start_clocking ();
444         void         stop_clocking ();
445
446         void update_transport_clocks (samplepos_t pos);
447         void record_state_changed ();
448
449         std::list<MidiTracer*> _midi_tracer_windows;
450
451         /* Transport Control */
452
453         Gtk::Table               transport_table;
454         Gtk::Frame               transport_frame;
455         Gtk::HBox                transport_hbox;
456
457         ArdourWidgets::ArdourVSpacer* secondary_clock_spacer;
458         void repack_transport_hbox ();
459         void update_clock_visibility ();
460         void toggle_follow_edits ();
461
462         void set_transport_controllable_state (const XMLNode&);
463         XMLNode& get_transport_controllable_state ();
464
465         TransportControlUI transport_ctrl;
466
467         ArdourWidgets::ArdourButton punch_in_button;
468         ArdourWidgets::ArdourButton punch_out_button;
469         ArdourWidgets::ArdourButton layered_button;
470
471         ArdourWidgets::ArdourVSpacer recpunch_spacer;
472         ArdourWidgets::ArdourVSpacer monitoring_spacer;
473
474         ArdourWidgets::ArdourButton monitor_in_button;
475         ArdourWidgets::ArdourButton monitor_disk_button;
476         ArdourWidgets::ArdourButton auto_input_button;
477
478         Gtk::Label   punch_label;
479         Gtk::Label   layered_label;
480
481         Gtk::Label   punch_space;
482         Gtk::Label   mon_space;
483
484         void toggle_external_sync ();
485         void toggle_time_master ();
486         void toggle_video_sync ();
487
488         ShuttleControl     shuttle_box;
489         MiniTimeline       mini_timeline;
490         TimeInfoBox*       time_info_box;
491         DspLoadIndicator   dsp_load_indicator;
492         DiskSpaceIndicator disk_space_indicator;
493
494         ArdourWidgets::ArdourButton auto_return_button;
495         ArdourWidgets::ArdourButton follow_edits_button;
496         ArdourWidgets::ArdourButton sync_button;
497
498         ArdourWidgets::ArdourButton auditioning_alert_button;
499         ArdourWidgets::ArdourButton solo_alert_button;
500         ArdourWidgets::ArdourButton feedback_alert_button;
501         ArdourWidgets::ArdourButton error_alert_button;
502
503         ArdourWidgets::ArdourButton action_script_call_btn[10];
504         Gtk::Table action_script_table;
505
506         Gtk::VBox alert_box;
507         Gtk::VBox meter_box;
508         ArdourWidgets::ArdourButton editor_meter_peak_display;
509         LevelMeterHBox *            editor_meter;
510         float                       editor_meter_max_peak;
511         bool                        editor_meter_peak_button_release (GdkEventButton*);
512
513         bool editor_meter_button_press (GdkEventButton* ev);
514         void popup_editor_meter_menu (GdkEventButton* ev);
515         void add_editor_meter_type_item (Gtk::Menu_Helpers::MenuList&, Gtk::RadioMenuItem::Group&, std::string const &, ARDOUR::MeterType);
516         bool _suspend_editor_meter_callbacks;
517
518         void blink_handler (bool);
519         sigc::connection blink_connection;
520
521         void cancel_solo ();
522         void solo_blink (bool);
523         void sync_blink (bool);
524         void audition_blink (bool);
525         void feedback_blink (bool);
526         void error_blink (bool);
527
528         void set_flat_buttons();
529
530         void soloing_changed (bool);
531         void auditioning_changed (bool);
532         void _auditioning_changed (bool);
533
534         bool solo_alert_press (GdkEventButton* ev);
535         void audition_alert_clicked ();
536         bool error_alert_press (GdkEventButton *);
537
538         void layered_button_clicked ();
539
540         void big_clock_value_changed ();
541         void primary_clock_value_changed ();
542         void secondary_clock_value_changed ();
543
544         /* called by Blink signal */
545
546         void transport_rec_enable_blink (bool onoff);
547
548         Gtk::Menu*        session_popup_menu;
549
550         /* menu bar and associated stuff */
551
552         Gtk::MenuBar* menu_bar;
553         Gtk::EventBox menu_bar_base;
554         Gtk::HBox     menu_hbox;
555
556         void use_menubar_as_top_menubar ();
557         void build_menu_bar ();
558
559         Gtk::Label   wall_clock_label;
560         gint update_wall_clock ();
561
562         Gtk::Label   disk_space_label;
563         void update_disk_space ();
564
565         Gtk::Label   timecode_format_label;
566         void update_timecode_format ();
567
568         Gtk::Label   cpu_load_label;
569         void update_cpu_load ();
570
571         Gtk::Label   xrun_label;
572         void update_xrun_count ();
573
574         Gtk::Label   peak_thread_work_label;
575         void update_peak_thread_work ();
576
577         Gtk::Label   buffer_load_label;
578         void update_buffer_load ();
579
580         Gtk::Label   sample_rate_label;
581         void update_sample_rate (ARDOUR::samplecnt_t);
582
583         Gtk::Label    format_label;
584         void update_format ();
585
586         void every_second ();
587         void every_point_one_seconds ();
588         void every_point_zero_something_seconds ();
589
590         sigc::connection second_connection;
591         sigc::connection point_one_second_connection;
592         sigc::connection point_zero_something_second_connection;
593         sigc::connection fps_connection;
594
595         void set_fps_timeout_connection ();
596
597         void open_session ();
598         void open_recent_session ();
599         void save_template_dialog_response (int response, SaveTemplateDialog* d);
600         void save_template ();
601         void manage_templates ();
602
603         void meta_session_setup (const std::string& script_path);
604         void meta_route_setup (const std::string& script_path);
605
606         void edit_metadata ();
607         void import_metadata ();
608
609         void set_transport_sensitivity (bool);
610
611         //stuff for ProTools-style numpad
612         void transport_numpad_event (int num);
613         void transport_numpad_decimal ();
614         bool _numpad_locate_happening;
615         int _pending_locate_num;
616         gint transport_numpad_timeout ();
617         sigc::connection _numpad_timeout_connection;
618
619         void transport_goto_nth_marker (int nth);
620         void transport_goto_zero ();
621         void transport_goto_start ();
622         void transport_goto_end ();
623         void transport_goto_wallclock ();
624         void transport_stop ();
625         void transport_record (bool roll);
626         void transport_roll ();
627         void transport_play_selection();
628         void transport_play_preroll();
629         void transport_rec_preroll();
630         void transport_rec_count_in();
631         void transport_forward (int option);
632         void transport_rewind (int option);
633         void transport_loop ();
634         void toggle_roll (bool with_abort, bool roll_out_of_bounded_mode);
635         bool trx_record_enable_all_tracks ();
636
637         bool _session_is_new;
638         void set_session (ARDOUR::Session *);
639         void connect_dependents_to_session (ARDOUR::Session *);
640         void we_have_dependents ();
641
642         void setup_session_options ();
643
644         guint32  last_key_press_time;
645
646         bool process_snapshot_session_prompter (ArdourWidgets::Prompter& prompter, bool switch_to_it);
647         void snapshot_session (bool switch_to_it);
648
649         void quick_snapshot_session (bool switch_to_it);  //does not promtp for name, just makes a timestamped file
650
651         SaveAsDialog* save_as_dialog;
652
653         bool save_as_progress_update (float fraction, int64_t cnt, int64_t total, Gtk::Label* label, Gtk::ProgressBar* bar);
654         void save_session_as ();
655         void archive_session ();
656         void rename_session ();
657
658         int         create_mixer ();
659         int         create_editor ();
660         int         create_meterbridge ();
661         int         create_luawindow ();
662         int         create_masters ();
663
664         Meterbridge  *meterbridge;
665         LuaWindow    *luawindow;
666
667         /* Dialogs that can be created via new<T> */
668
669         RCOptionEditor* rc_option_editor;
670         Gtk::HBox rc_option_editor_placeholder;
671
672         WM::Proxy<SpeakerDialog> speaker_config_window;
673         WM::Proxy<AddRouteDialog> add_route_dialog;
674         WM::Proxy<About> about;
675         WM::Proxy<LocationUIWindow> location_ui;
676         WM::Proxy<RouteParams_UI> route_params;
677         WM::Proxy<EngineControl> audio_midi_setup;
678         WM::Proxy<ExportVideoDialog> export_video_dialog;
679         WM::Proxy<LuaScriptManager> lua_script_window;
680         WM::Proxy<IdleOMeter> idleometer;
681
682         /* Windows/Dialogs that require a creator method */
683
684         WM::ProxyWithConstructor<SessionOptionEditor> session_option_editor;
685         WM::ProxyWithConstructor<AddVideoDialog> add_video_dialog;
686         WM::ProxyWithConstructor<BundleManager> bundle_manager;
687         WM::ProxyWithConstructor<BigClockWindow> big_clock_window;
688         WM::ProxyWithConstructor<BigTransportWindow> big_transport_window;
689         WM::ProxyWithConstructor<GlobalPortMatrixWindow> audio_port_matrix;
690         WM::ProxyWithConstructor<GlobalPortMatrixWindow> midi_port_matrix;
691         WM::ProxyWithConstructor<KeyEditor> key_editor;
692
693         /* creator methods */
694
695         SessionOptionEditor*    create_session_option_editor ();
696         BundleManager*          create_bundle_manager ();
697         AddVideoDialog*         create_add_video_dialog ();
698         BigClockWindow*         create_big_clock_window();
699         BigTransportWindow*     create_big_transport_window();
700         GlobalPortMatrixWindow* create_global_port_matrix (ARDOUR::DataType);
701         KeyEditor*              create_key_editor ();
702
703         ARDOUR::SystemExec *video_server_process;
704
705         void handle_locations_change (ARDOUR::Location*);
706
707         /* Keyboard Handling */
708
709         ArdourKeyboard* keyboard;
710
711         /* Keymap handling */
712
713         void install_actions ();
714
715         void toggle_record_enable (uint16_t);
716
717         uint32_t rec_enabled_streams;
718         void count_recenabled_streams (ARDOUR::Route&);
719
720         Splash* splash;
721
722         void pop_back_splash (Gtk::Window&);
723
724         /* cleanup */
725
726         Gtk::MenuItem *cleanup_item;
727
728         void display_cleanup_results (ARDOUR::CleanupReport& rep, const gchar* list_title, const bool msg_delete);
729         void cleanup ();
730         void cleanup_peakfiles ();
731         void flush_trash ();
732
733         bool have_configure_timeout;
734         ARDOUR::microseconds_t last_configure_time;
735         gint configure_timeout ();
736
737         ARDOUR::microseconds_t last_peak_grab;
738         ARDOUR::microseconds_t last_shuttle_request;
739
740         bool have_disk_speed_dialog_displayed;
741         void disk_speed_dialog_gone (int ignored_response, Gtk::MessageDialog*);
742         void disk_overrun_handler ();
743         void disk_underrun_handler ();
744         void gui_idle_handler ();
745
746         void cancel_plugin_scan ();
747         void cancel_plugin_timeout ();
748         void plugin_scan_dialog (std::string type, std::string plugin, bool);
749         void plugin_scan_timeout (int);
750
751         void session_format_mismatch (std::string, std::string);
752
753         void session_dialog (std::string);
754         int pending_state_dialog ();
755         int sr_mismatch_dialog (ARDOUR::samplecnt_t, ARDOUR::samplecnt_t);
756         void sr_mismatch_message (ARDOUR::samplecnt_t, ARDOUR::samplecnt_t);
757
758         Gtk::MenuItem* jack_disconnect_item;
759         Gtk::MenuItem* jack_reconnect_item;
760         Gtk::Menu*     jack_bufsize_menu;
761
762         Glib::RefPtr<Gtk::ActionGroup> common_actions;
763
764         void editor_realized ();
765
766         std::vector<std::string> positional_sync_strings;
767
768         void toggle_use_mmc ();
769         void toggle_send_mmc ();
770         void toggle_send_mtc ();
771         void toggle_send_midi_clock ();
772
773         void toggle_use_osc ();
774
775         void parameter_changed (std::string);
776         void session_parameter_changed (std::string);
777
778         bool first_idle ();
779
780         void check_memory_locking ();
781
782         void audioengine_setup ();
783
784         void display_message (const char *prefix, gint prefix_len,
785                         Glib::RefPtr<Gtk::TextBuffer::Tag> ptag, Glib::RefPtr<Gtk::TextBuffer::Tag> mtag,
786                         const char *msg);
787         Gtk::Label status_bar_label;
788         bool status_bar_button_press (GdkEventButton*);
789
790         void loading_message (const std::string& msg);
791
792         PBD::ScopedConnectionList forever_connections;
793         PBD::ScopedConnection halt_connection;
794         PBD::ScopedConnection editor_meter_connection;
795
796         /* these are used only in response to a platform-specific "ShouldQuit" signal */
797         bool idle_finish ();
798         void queue_finish ();
799         void fontconfig_dialog ();
800
801         int missing_file (ARDOUR::Session*s, std::string str, ARDOUR::DataType type);
802         int ambiguous_file (std::string file, std::vector<std::string> hits);
803
804         bool click_button_clicked (GdkEventButton *);
805         bool sync_button_clicked (GdkEventButton *);
806
807         VisibilityGroup _status_bar_visibility;
808
809         /** A ProcessThread so that we have some thread-local buffers for use by
810          *  PluginEqGui::impulse_analysis ().
811          */
812         ARDOUR::ProcessThread* _process_thread;
813
814         void feedback_detected ();
815
816         ArdourWidgets::ArdourButton             midi_panic_button;
817         void                     midi_panic ();
818
819         void successful_graph_sort ();
820         bool _feedback_exists;
821
822         enum ArdourLogLevel {
823                 LogLevelNone = 0,
824                 LogLevelInfo,
825                 LogLevelWarning,
826                 LogLevelError
827         };
828
829         ArdourLogLevel _log_not_acknowledged;
830
831         void resize_text_widgets ();
832
833         bool xrun_button_release (GdkEventButton* ev);
834
835         std::string _announce_string;
836         void check_announcements ();
837
838         int do_audio_midi_setup (uint32_t);
839         void audioengine_became_silent ();
840
841         DuplicateRouteDialog* duplicate_routes_dialog;
842
843         void grab_focus_after_dialog ();
844
845         void tabs_switch (GtkNotebookPage*, guint page_number);
846         void tabs_page_added (Gtk::Widget*, guint);
847         void tabs_page_removed (Gtk::Widget*, guint);
848         ArdourWidgets::ArdourButton editor_visibility_button;
849         ArdourWidgets::ArdourButton mixer_visibility_button;
850         ArdourWidgets::ArdourButton prefs_visibility_button;
851
852         bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev, Gtkmm2ext::Bindings*);
853         bool try_gtk_accel_binding (GtkWindow* win, GdkEventKey* ev, bool translate, GdkModifierType modifier);
854
855         bool main_window_delete_event (GdkEventAny*);
856         bool idle_ask_about_quit ();
857
858         void load_bindings ();
859         bool tabbable_visibility_button_press (GdkEventButton* ev, std::string const& tabbable_name);
860
861         void step_up_through_tabs ();
862         void step_down_through_tabs ();
863
864         void escape ();
865         void close_current_dialog ();
866         void pre_release_dialog ();
867
868         bool bind_lua_action_script (GdkEventButton*, int);
869         void update_action_script_btn (int i, const std::string&);
870 };
871
872 #endif /* __ardour_gui_h__ */