merge with master and fix 2 conflicts
[ardour.git] / gtk2_ardour / ardour_ui.h
index 5d623a873160bb30036fe569075337d3f5735988..1052ee23a6aac5f3b31ed3da325a510de24debc9 100644 (file)
@@ -70,6 +70,7 @@
 #include "ardour_dialog.h"
 #include "ardour_window.h"
 #include "editing.h"
+#include "meterbridge.h"
 #include "nsm.h"
 #include "ui_config.h"
 #include "enums.h"
@@ -81,13 +82,13 @@ class AddRouteDialog;
 class AddVideoDialog;
 class VideoTimeLine;
 class SystemExec;
-class ArdourStartup;
 class ArdourKeyboard;
 class AudioClock;
 class BigClockWindow;
 class BundleManager;
 class ButtonJoiner;
 class ConnectionEditor;
+class EngineControl;
 class KeyEditor;
 class LocationUIWindow;
 class MainClock;
@@ -95,6 +96,7 @@ class Mixer_UI;
 class PublicEditor;
 class RCOptionEditor;
 class RouteParams_UI;
+class SessionDialog;
 class SessionOptionEditor;
 class ShuttleControl;
 class Splash;
@@ -102,6 +104,7 @@ class SpeakerDialog;
 class ThemeManager;
 class TimeInfoBox;
 class MidiTracer;
+class LevelMeterHBox;
 class GlobalPortMatrixWindow;
 class GUIObjectState;
 
@@ -149,7 +152,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        bool get_smart_mode () const;
        
        int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = "");
-       int  build_session_from_nsd (const std::string& session_name, const std::string& session_path);
+        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);
 
        /// @return true if session was successfully unloaded.
@@ -175,10 +178,17 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
 
        static PublicEditor* _instance;
        static sigc::signal<void,bool> Blink;
+
+       /** point_zero_one_seconds -- 10Hz ^= 100ms */
        static sigc::signal<void>      RapidScreenUpdate;
+
+       /** point_zero_something_seconds -- currently 25Hz ^= 40ms */
        static sigc::signal<void>      SuperRapidScreenUpdate;
+
        /** Emitted frequently with the audible frame, false, and the edit point as
         *  parameters respectively.
+        *
+        *  (either RapidScreenUpdate || SuperRapidScreenUpdate - user-config)
         */
        static sigc::signal<void, framepos_t, bool, framepos_t> Clock;
 
@@ -254,7 +264,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
                session_add_midi_route (false);
        }*/
 
-       int  create_engine ();
+        void attach_to_engine ();
        void post_engine ();
 
        gint exit_on_main_window_close (GdkEventAny *);
@@ -272,8 +282,15 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        void get_process_buffers ();
        void drop_process_buffers ();
 
+       void reset_peak_display ();
+       void reset_route_peak_display (ARDOUR::Route*);
+       void reset_group_peak_display (ARDOUR::RouteGroup*);
+
         const std::string& announce_string() const { return _announce_string; }
 
+        int disconnect_from_engine ();
+        int reconnect_to_engine ();
+
   protected:
        friend class PublicEditor;
 
@@ -288,23 +305,22 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        void reenable_hide_loop_punch_ruler_if_appropriate ();
        void toggle_auto_return ();
        void toggle_click ();
-
+        void toggle_audio_midi_setup ();
        void toggle_session_auto_loop ();
-
        void toggle_rc_options_window ();
        void toggle_session_options_window ();
 
   private:
-       ArdourStartup*      _startup;
-       ARDOUR::AudioEngine *engine;
-       Gtk::Tooltips        _tooltips;
+       Gtk::Tooltips       _tooltips;
        NSM_Client          *nsm;
-       bool                 _was_dirty;
-        bool                 _mixer_on_top;
+       bool                _was_dirty;
+        bool                _mixer_on_top;
+        bool first_time_engine_run;
 
        void goto_editor_window ();
        void goto_mixer_window ();
        void toggle_mixer_window ();
+       void toggle_meterbridge ();
         void toggle_editor_mixer ();
 
        int  setup_windows ();
@@ -313,8 +329,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
 
        static ARDOUR_UI *theArdourUI;
 
-       void startup ();
-       void shutdown ();
+        int starting ();
 
        int  ask_about_saving_session (const std::vector<std::string>& actions);
 
@@ -434,6 +449,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        ArdourButton feedback_alert_button;
 
        Gtk::VBox alert_box;
+       Gtk::VBox meter_box;
+       LevelMeterHBox * editor_meter;
+       float            editor_meter_max_peak;
+       ArdourButton     editor_meter_peak_display;
+       bool             editor_meter_peak_button_release (GdkEventButton*);
 
        void solo_blink (bool);
        void sync_blink (bool);
@@ -518,12 +538,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        
        gint every_second ();
        gint every_point_one_seconds ();
-       gint every_point_zero_one_seconds ();
+       gint every_point_zero_something_seconds ();
 
        sigc::connection second_connection;
        sigc::connection point_one_second_connection;
-       sigc::connection point_oh_five_second_connection;
-       sigc::connection point_zero_one_second_connection;
+       sigc::connection point_zero_something_second_connection;
 
        void open_session ();
        void open_recent_session ();
@@ -569,6 +588,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        PublicEditor     *editor;
        int         create_editor ();
 
+       Meterbridge  *meterbridge;
+       int         create_meterbridge ();
         /* Dialogs that can be created via new<T> */
 
         WM::Proxy<SpeakerDialog> speaker_config_window;
@@ -579,6 +600,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
         WM::Proxy<About> about;
         WM::Proxy<LocationUIWindow> location_ui;
         WM::Proxy<RouteParams_UI> route_params;
+        WM::Proxy<EngineControl> audio_midi_setup;
 
         /* Windows/Dialogs that require a creator method */
 
@@ -646,10 +668,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        int pending_state_dialog ();
        int sr_mismatch_dialog (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
 
-       void disconnect_from_jack ();
-       void reconnect_to_jack ();
-       void set_jack_buffer_size (ARDOUR::pframes_t);
-
        Gtk::MenuItem* jack_disconnect_item;
        Gtk::MenuItem* jack_reconnect_item;
        Gtk::Menu*     jack_bufsize_menu;
@@ -689,6 +707,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        void loading_message (const std::string& msg);
 
        PBD::ScopedConnectionList forever_connections;
+        PBD::ScopedConnection halt_connection; 
 
         void step_edit_status_change (bool);
 
@@ -725,6 +744,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
 
         std::string _announce_string;
         void check_announcements ();
+
+        int do_audio_midi_setup (uint32_t);
 };
 
 #endif /* __ardour_gui_h__ */