remove method and inline its contents. Nothing gained by wrapping this up
[ardour.git] / gtk2_ardour / ardour_ui.h
index 4bfd1f7cbc2c726d23bad7360382ff2765e9ac74..633cdd06a6756614e1a0077502718e0f448fb233 100644 (file)
@@ -37,7 +37,6 @@
 
 
 #include "pbd/xml++.h"
-#include "pbd/controllable.h"
 #include <gtkmm/box.h>
 #include <gtkmm/frame.h>
 #include <gtkmm/label.h>
@@ -79,6 +78,8 @@
 #include "enums.h"
 #include "mini_timeline.h"
 #include "shuttle_control.h"
+#include "transport_control.h"
+#include "transport_control_ui.h"
 #include "visibility_group.h"
 #include "window_manager.h"
 
@@ -86,6 +87,7 @@
 #include "about.h"
 #include "add_video_dialog.h"
 #include "big_clock_window.h"
+#include "big_transport_window.h"
 #include "bundle_manager.h"
 #include "engine_dialog.h"
 #include "export_video_dialog.h"
 #include "keyeditor.h"
 #include "location_ui.h"
 #include "lua_script_manager.h"
+#include "plugin_dspload_window.h"
 #include "rc_option_editor.h"
 #include "route_dialogs.h"
 #include "route_params_ui.h"
 #include "session_option_editor.h"
 #include "speaker_dialog.h"
+#include "transport_masters_dialog.h"
 #else
 class About;
 class AddRouteDialog;
 class AddVideoDialog;
 class BigClockWindow;
+class BigTransportWindow;
 class BundleManager;
 class EngineControl;
 class ExportVideoDialog;
@@ -116,6 +121,8 @@ class SessionOptionEditor;
 class SpeakerDialog;
 class GlobalPortMatrixWindow;
 class IdleOMeter;
+class PluginDSPLoadWindow;
+class TransportMastersWindow;
 #endif
 
 class VideoTimeLine;
@@ -158,7 +165,9 @@ namespace ArdourWidgets {
        class Tabbable;
 }
 
-class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
+#define MAX_LUA_ACTION_SCRIPTS 12
+
+class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr, public TransportControlProvider
 {
 public:
        ARDOUR_UI (int *argcp, char **argvp[], const char* localedir);
@@ -186,7 +195,6 @@ public:
        void finish();
 
        int load_session (const std::string& path, const std::string& snapshot, std::string mix_template = std::string());
-       bool session_loaded;
        bool session_load_in_progress;
        int build_session (const std::string& path, const std::string& snapshot, ARDOUR::BusProfile*);
        bool session_is_new() const { return _session_is_new; }
@@ -195,6 +203,9 @@ public:
 
        bool get_smart_mode () const;
 
+       RCOptionEditor* get_rc_option_editor() { return rc_option_editor; }
+       void show_tabbable (ArdourWidgets::Tabbable*);
+
        int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = "");
        int  build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path);
        bool ask_about_loading_existing_session (const std::string& session_path);
@@ -220,8 +231,6 @@ public:
        void new_midi_tracer_window ();
        void toggle_editing_space();
        void toggle_mixer_space();
-       void toggle_mixer_list();
-       void toggle_monitor_section_visibility ();
        void toggle_keep_tearoffs();
 
        void reset_focus (Gtk::Widget*);
@@ -233,7 +242,7 @@ public:
         *
         *  (either RapidScreenUpdate || SuperRapidScreenUpdate - user-config)
         */
-       static sigc::signal<void, samplepos_t, bool, samplepos_t> Clock;
+       static sigc::signal<void, samplepos_t> Clock;
 
        static void close_all_dialogs () { CloseAllDialogs(); }
        static sigc::signal<void> CloseAllDialogs;
@@ -283,7 +292,8 @@ public:
        void flush_videotimeline_cache (bool localcacheonly=false);
        void export_video (bool range = false);
 
-       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);
+       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);
 
        void session_add_mixed_track (const ARDOUR::ChanCount&, const ARDOUR::ChanCount&, ARDOUR::RouteGroup*,
                                      uint32_t, std::string const &, bool strict_io,
@@ -298,6 +308,8 @@ public:
                                     ARDOUR::PluginInfoPtr, ARDOUR::Plugin::PresetRecord*,
                                     ARDOUR::PresentationInfo::order_t order);
 
+       void session_add_foldback_bus (uint32_t, std::string const &);
+
        void display_insufficient_ports_message ();
 
        void attach_to_engine ();
@@ -344,8 +356,6 @@ public:
        bool tabbed_window_state_event_handler (GdkEventWindowState*, void* object);
        bool key_event_handler (GdkEventKey*, Gtk::Window* window);
 
-       Gtkmm2ext::ActionMap global_actions;
-
        ARDOUR::PresentationInfo::order_t translate_order (RouteDialogs::InsertAt);
 
        std::map<std::string, std::string> route_setup_info (const std::string& script_path);
@@ -353,6 +363,11 @@ public:
 protected:
        friend class PublicEditor;
 
+       void toggle_use_monitor_section ();
+       void monitor_dim_all ();
+       void monitor_cut_all ();
+       void monitor_mono ();
+
        void toggle_auto_play ();
        void toggle_auto_input ();
        void toggle_punch ();
@@ -372,6 +387,7 @@ protected:
        void toggle_session_options_window ();
 
 private:
+
        Gtk::Window   _main_window;
        Gtkmm2ext::VisibilityTracker* main_window_visibility;
        Gtk::VBox      main_vpacker;
@@ -386,7 +402,6 @@ private:
        bool          _initial_verbose_plugin_scan;
        bool           first_time_engine_run;
 
-       void show_tabbable (ArdourWidgets::Tabbable*);
        void hide_tabbable (ArdourWidgets::Tabbable*);
        void detach_tabbable (ArdourWidgets::Tabbable*);
        void attach_tabbable (ArdourWidgets::Tabbable*);
@@ -451,46 +466,13 @@ private:
        ArdourWidgets::ArdourVSpacer* secondary_clock_spacer;
        void repack_transport_hbox ();
        void update_clock_visibility ();
-
-       struct TransportControllable : public PBD::Controllable {
-               enum ToggleType {
-                       Roll = 0,
-                       Stop,
-                       RecordEnable,
-                       GotoStart,
-                       GotoEnd,
-                       AutoLoop,
-                       PlaySelection,
-               };
-
-               TransportControllable (std::string name, ARDOUR_UI&, ToggleType);
-               void set_value (double, PBD::Controllable::GroupControlDisposition group_override);
-               double get_value (void) const;
-
-               ARDOUR_UI& ui;
-               ToggleType type;
-       };
-
-       boost::shared_ptr<TransportControllable> roll_controllable;
-       boost::shared_ptr<TransportControllable> stop_controllable;
-       boost::shared_ptr<TransportControllable> goto_start_controllable;
-       boost::shared_ptr<TransportControllable> goto_end_controllable;
-       boost::shared_ptr<TransportControllable> auto_loop_controllable;
-       boost::shared_ptr<TransportControllable> play_selection_controllable;
-       boost::shared_ptr<TransportControllable> rec_controllable;
-
        void toggle_follow_edits ();
 
        void set_transport_controllable_state (const XMLNode&);
        XMLNode& get_transport_controllable_state ();
 
-       ArdourWidgets::ArdourButton roll_button;
-       ArdourWidgets::ArdourButton stop_button;
-       ArdourWidgets::ArdourButton goto_start_button;
-       ArdourWidgets::ArdourButton goto_end_button;
-       ArdourWidgets::ArdourButton auto_loop_button;
-       ArdourWidgets::ArdourButton play_selection_button;
-       ArdourWidgets::ArdourButton rec_button;
+       TransportControlUI transport_ctrl;
+
        ArdourWidgets::ArdourButton punch_in_button;
        ArdourWidgets::ArdourButton punch_out_button;
        ArdourWidgets::ArdourButton layered_button;
@@ -512,13 +494,16 @@ private:
        void toggle_time_master ();
        void toggle_video_sync ();
 
-       ShuttleControl shuttle_box;
-       MiniTimeline   mini_timeline;
-       TimeInfoBox   *time_info_box;
+       ShuttleControl     shuttle_box;
+       MiniTimeline       mini_timeline;
+       TimeInfoBox*       time_info_box;
+
+
+       ArdourWidgets::ArdourVSpacer      meterbox_spacer;
+       ArdourWidgets::ArdourVSpacer      meterbox_spacer2;
 
        ArdourWidgets::ArdourButton auto_return_button;
        ArdourWidgets::ArdourButton follow_edits_button;
-       ArdourWidgets::ArdourButton click_button;
        ArdourWidgets::ArdourButton sync_button;
 
        ArdourWidgets::ArdourButton auditioning_alert_button;
@@ -526,11 +511,11 @@ private:
        ArdourWidgets::ArdourButton feedback_alert_button;
        ArdourWidgets::ArdourButton error_alert_button;
 
-       ArdourWidgets::ArdourButton action_script_call_btn[10];
+       ArdourWidgets::ArdourButton action_script_call_btn[MAX_LUA_ACTION_SCRIPTS];
        Gtk::Table action_script_table;
 
        Gtk::VBox alert_box;
-       Gtk::VBox meter_box;
+       Gtk::Table editor_meter_table;
        ArdourWidgets::ArdourButton editor_meter_peak_display;
        LevelMeterHBox *            editor_meter;
        float                       editor_meter_max_peak;
@@ -585,24 +570,19 @@ private:
        Gtk::Label   wall_clock_label;
        gint update_wall_clock ();
 
-       Gtk::Label   disk_space_label;
+       Gtk::Label  disk_space_label;
        void update_disk_space ();
+       void format_disk_space_label (float);
 
        Gtk::Label   timecode_format_label;
        void update_timecode_format ();
 
-       Gtk::Label   cpu_load_label;
+       Gtk::Label  dsp_load_label;
        void update_cpu_load ();
 
-       Gtk::Label   xrun_label;
-       void update_xrun_count ();
-
        Gtk::Label   peak_thread_work_label;
        void update_peak_thread_work ();
 
-       Gtk::Label   buffer_load_label;
-       void update_buffer_load ();
-
        Gtk::Label   sample_rate_label;
        void update_sample_rate (ARDOUR::samplecnt_t);
 
@@ -632,7 +612,6 @@ private:
        void edit_metadata ();
        void import_metadata ();
 
-       void set_loop_sensitivity ();
        void set_transport_sensitivity (bool);
 
        //stuff for ProTools-style numpad
@@ -705,6 +684,8 @@ private:
        WM::Proxy<ExportVideoDialog> export_video_dialog;
        WM::Proxy<LuaScriptManager> lua_script_window;
        WM::Proxy<IdleOMeter> idleometer;
+       WM::Proxy<PluginDSPLoadWindow> plugin_dsp_load_window;
+       WM::Proxy<TransportMastersWindow> transport_masters_window;
 
        /* Windows/Dialogs that require a creator method */
 
@@ -712,6 +693,7 @@ private:
        WM::ProxyWithConstructor<AddVideoDialog> add_video_dialog;
        WM::ProxyWithConstructor<BundleManager> bundle_manager;
        WM::ProxyWithConstructor<BigClockWindow> big_clock_window;
+       WM::ProxyWithConstructor<BigTransportWindow> big_transport_window;
        WM::ProxyWithConstructor<GlobalPortMatrixWindow> audio_port_matrix;
        WM::ProxyWithConstructor<GlobalPortMatrixWindow> midi_port_matrix;
        WM::ProxyWithConstructor<KeyEditor> key_editor;
@@ -722,6 +704,7 @@ private:
        BundleManager*          create_bundle_manager ();
        AddVideoDialog*         create_add_video_dialog ();
        BigClockWindow*         create_big_clock_window();
+       BigTransportWindow*     create_big_transport_window();
        GlobalPortMatrixWindow* create_global_port_matrix (ARDOUR::DataType);
        KeyEditor*              create_key_editor ();
 
@@ -806,9 +789,7 @@ private:
 
        void audioengine_setup ();
 
-       void display_message (const char *prefix, gint prefix_len,
-                       Glib::RefPtr<Gtk::TextBuffer::Tag> ptag, Glib::RefPtr<Gtk::TextBuffer::Tag> mtag,
-                       const char *msg);
+       void display_message (const char* prefix, gint prefix_len, Glib::RefPtr<Gtk::TextBuffer::Tag>, Glib::RefPtr<Gtk::TextBuffer::Tag>, const char* msg);
        Gtk::Label status_bar_label;
        bool status_bar_button_press (GdkEventButton*);
 
@@ -818,8 +799,6 @@ private:
        PBD::ScopedConnection halt_connection;
        PBD::ScopedConnection editor_meter_connection;
 
-       void step_edit_status_change (bool);
-
        /* these are used only in response to a platform-specific "ShouldQuit" signal */
        bool idle_finish ();
        void queue_finish ();
@@ -829,7 +808,6 @@ private:
        int ambiguous_file (std::string file, std::vector<std::string> hits);
 
        bool click_button_clicked (GdkEventButton *);
-       bool click_button_scroll (GdkEventScroll *);
        bool sync_button_clicked (GdkEventButton *);
 
        VisibilityGroup _status_bar_visibility;
@@ -883,7 +861,6 @@ private:
        bool main_window_delete_event (GdkEventAny*);
        bool idle_ask_about_quit ();
 
-       void load_bindings ();
        bool tabbable_visibility_button_press (GdkEventButton* ev, std::string const& tabbable_name);
 
        void step_up_through_tabs ();