Move ARDOUR_UI::ThemeChanged signal into Gtkmm2ext::UI
[ardour.git] / gtk2_ardour / ardour_ui.h
index dc48856174ebc025b641593591db9e5b85151d2d..f76f5e73df8926e4df68c621f5ad44dd25665e45 100644 (file)
@@ -57,6 +57,7 @@
 #include <gtkmm2ext/bindable_button.h>
 #include <ardour/ardour.h>
 #include <ardour/session.h>
+#include <ardour/configuration.h>
 
 #include "audio_clock.h"
 #include "ardour_dialog.h"
@@ -73,7 +74,7 @@ class About;
 class AddRouteDialog;
 class NewSessionDialog;
 class LocationUI;
-class ColorManager;
+class ThemeManager;
 
 namespace Gtkmm2ext {
        class TearOff;
@@ -96,7 +97,7 @@ namespace ALSA {
 class ARDOUR_UI : public Gtkmm2ext::UI
 {
   public:
-       ARDOUR_UI (int *argcp, char **argvp[], string rcfile);
+       ARDOUR_UI (int *argcp, char **argvp[]);
        ~ARDOUR_UI();
 
        void show ();
@@ -107,7 +108,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        
        int load_session (const string & path, const string & snapshot, string* mix_template = 0);
        bool session_loaded;
-       int build_session (const string & path, const string & snapshot, 
+       /// @return true if building the session was successful
+       bool build_session (const string & path, const string & snapshot, 
                           uint32_t ctl_chns, 
                           uint32_t master_chns,
                           ARDOUR::AutoConnectOption input_connect,
@@ -119,17 +121,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI
 
        ARDOUR::Session* the_session() { return session; }
 
-       bool will_create_new_session_automatically() const {
-               return _will_create_new_session_automatically;
-       }
-
-       void set_will_create_new_session_automatically (bool yn) {
-               _will_create_new_session_automatically = yn;
-       }
-
-        void new_session(std::string path = string());
+       bool new_session(std::string path = string());
        gint cmdline_new_session (string path);
-       int  unload_session ();
+       
+       /// @return true if session was successfully unloaded.
+       bool unload_session ();
        void close_session(); 
 
        int  save_state_canfail (string state_name = "");
@@ -137,7 +133,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        void restore_state (string state_name = "");
 
        static double gain_to_slider_position (ARDOUR::gain_t g);
-        static ARDOUR::gain_t slider_position_to_gain (double pos);
+       static ARDOUR::gain_t slider_position_to_gain (double pos);
 
        static ARDOUR_UI *instance () { return theArdourUI; }
 
@@ -145,7 +141,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        Mixer_UI* the_mixer() { return mixer; }
        
        void toggle_location_window ();
-       void toggle_color_manager ();
+       void toggle_theme_manager ();
        void toggle_big_clock_window ();
        void toggle_connection_editor ();
        void toggle_route_params_window ();
@@ -155,9 +151,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
 
        static sigc::signal<void,bool> Blink;
        static sigc::signal<void>      RapidScreenUpdate;
-       static sigc::signal<void>      MidRapidScreenUpdate;
        static sigc::signal<void>      SuperRapidScreenUpdate;
-       static sigc::signal<void,nframes_t> Clock;
+       static sigc::signal<void,nframes_t, bool, nframes_t> Clock;
 
        /* this is a helper function to centralize the (complex) logic for
           blinking rec-enable buttons.
@@ -197,7 +192,13 @@ class ARDOUR_UI : public Gtkmm2ext::UI
                session_add_audio_route (false, input_channels, output_channels, ARDOUR::Normal, how_many);
        }
 
-       void session_add_midi_track ();
+       void session_add_midi_track (uint32_t how_many) {
+               session_add_midi_route (true, how_many);
+       }
+
+       /*void session_add_midi_bus () {
+               session_add_midi_route (false);
+       }*/
 
        void set_engine (ARDOUR::AudioEngine&);
        gint start_engine ();
@@ -213,6 +214,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        void set_keybindings_path (std::string path);
        void save_keybindings ();
 
+       void setup_profile ();
+       void setup_theme ();
+
   protected:
        friend class PublicEditor;
 
@@ -256,6 +260,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        ARDOUR::AudioEngine                 *engine;
        ARDOUR::Session                     *session;
 
+       bool check_audioengine();
+
        Gtk::Tooltips          _tooltips;
 
        void                     goto_editor_window ();
@@ -290,6 +296,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        int  ask_about_saving_session (const string & why);
        int  save_the_session;
 
+       /* periodic safety backup, to be precise */
+       gint autosave_session();
+       void update_autosave();
+       sigc::connection _autosave_connection;
+
        void queue_transport_change ();
        void map_transport_state ();
        int32_t do_engine_start ();
@@ -440,7 +451,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        Gtk::ToggleButton solo_alert_button;
 
        Gtk::VBox alert_box;
-       
+
        void solo_blink (bool);
        void audition_blink (bool);
 
@@ -517,7 +528,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
 
        gint every_second ();
        gint every_point_one_seconds ();
-       gint every_point_oh_five_seconds ();
        gint every_point_zero_one_seconds ();
 
        sigc::connection second_connection;
@@ -527,8 +537,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
 
        gint session_menu (GdkEventButton *);
 
-       bool _will_create_new_session_automatically;
-
        NewSessionDialog* new_session_dialog;
        
        void open_session ();
@@ -536,6 +544,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        void save_template ();
 
        void session_add_audio_route (bool disk, int32_t input_channels, int32_t output_channels, ARDOUR::TrackMode mode, uint32_t how_many);
+       void session_add_midi_route (bool disk, uint32_t how_many);
 
        void set_transport_sensitivity (bool);
 
@@ -588,7 +597,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        int         create_location_ui ();
        void        handle_locations_change (ARDOUR::Location*);
 
-       ColorManager* color_manager;
+       ThemeManager* theme_manager;
 
        /* Options window */
        
@@ -655,20 +664,23 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        void toggle_send_midi_feedback ();
        void toggle_use_mmc ();
        void toggle_send_mmc ();
-       void toggle_use_midi_control();
        void toggle_send_mtc ();
 
        void toggle_use_osc ();
 
+       void toggle_denormal_protection ();
+
        void set_input_auto_connect (ARDOUR::AutoConnectOption);
        void set_output_auto_connect (ARDOUR::AutoConnectOption);
        void set_solo_model (ARDOUR::SoloModel);
        void set_monitor_model (ARDOUR::MonitorModel);
        void set_remote_model (ARDOUR::RemoteModel);
+       void set_denormal_model (ARDOUR::DenormalModel);
 
        void toggle_StopPluginsWithTransport();
        void toggle_DoNotRunPluginsWhileRecording();
        void toggle_VerifyRemoveLastCapture();
+       void toggle_PeriodicSafetyBackups();
        void toggle_StopRecordingOnXrun();
        void toggle_StopTransportAtEndOfSession();
        void toggle_GainReduceFastTransport();
@@ -676,10 +688,13 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        void toggle_ShowSoloMutes();
        void toggle_LatchedRecordEnable ();
        void toggle_RegionEquivalentsOverlap ();
+       void toggle_PrimaryClockDeltaEditCursor ();
+       void toggle_SecondaryClockDeltaEditCursor ();
 
        void mtc_port_changed ();
        void map_solo_model ();
        void map_monitor_model ();
+       void map_denormal_model ();
        void map_remote_model ();
        void map_file_header_format ();
        void map_file_data_format ();
@@ -700,6 +715,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI
 
        void no_memory_warning ();
        void check_memory_locking ();
+
+       bool ab_direction;
+       void disable_all_plugins ();
+       void ab_all_plugins ();
 };
 
 #endif /* __ardour_gui_h__ */