cont'd work on plugin-state templates - #6709
[ardour.git] / libs / ardour / ardour / route.h
index cf7ec90fd1dfe37d29d403fe25ba5b9dc1ecbea9..0ef063b29cf0d27339e0524037bc203cea523d98 100644 (file)
@@ -101,7 +101,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        void set_comment (std::string str, void *src);
 
        bool set_name (const std::string& str);
-       static void set_name_in_state (XMLNode &, const std::string &);
+       static void set_name_in_state (XMLNode &, const std::string &, bool rename_playlist = true);
 
         uint32_t order_key () const;
         bool has_order_key () const;
@@ -158,7 +158,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        /* controls use set_solo() to modify this route's solo state
         */
 
-       void set_solo (bool yn, void *src);
+       void set_solo (bool yn, void *src, bool group_override = false);
        bool soloed () const { return self_soloed () || soloed_by_others (); }
        void clear_all_solo_state ();
 
@@ -173,7 +173,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        void set_solo_safe (bool yn, void *src);
        bool solo_safe() const;
 
-       void set_listen (bool yn, void* src);
+       void set_listen (bool yn, void* src, bool group_override = false);
        bool listening_via_monitor () const;
        void enable_monitor_send ();
 
@@ -286,8 +286,8 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        PBD::Signal0<void>       active_changed;
        PBD::Signal0<void>       phase_invert_changed;
        PBD::Signal0<void>       denormal_protection_changed;
-       PBD::Signal1<void,void*> listen_changed;
-       PBD::Signal2<void,bool,void*> solo_changed;
+       PBD::Signal2<void,void*,bool> listen_changed;
+       PBD::Signal3<void,bool,void*,bool> solo_changed;
        PBD::Signal1<void,void*> solo_safe_changed;
        PBD::Signal1<void,void*> solo_isolated_changed;
        PBD::Signal1<void,void*> comment_changed;
@@ -389,6 +389,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        public:
                SoloControllable (std::string name, boost::shared_ptr<Route>);
                void set_value (double);
+               void set_value_unchecked (double);
                double get_value () const;
 
        private:
@@ -399,6 +400,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        public:
                MuteControllable (std::string name, boost::shared_ptr<Route>);
                void set_value (double);
+               void set_value_unchecked (double);
                double get_value () const;
 
                /* Pretend to change value, but do not affect actual route mute. */
@@ -408,6 +410,28 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
                boost::weak_ptr<Route> _route;
        };
 
+       class LIBARDOUR_API PhaseControllable : public AutomationControl {
+       public:
+               PhaseControllable (std::string name, boost::shared_ptr<Route>);
+               void set_value (double);
+               void set_channel (uint32_t);
+               double get_value () const;
+               uint32_t channel() const;
+
+       private:
+               boost::weak_ptr<Route> _route;
+               uint32_t _current_phase;
+       };
+
+       class LIBARDOUR_API GroupGainControllable : public AutomationControl {
+       public:
+               GroupGainControllable (std::string name, boost::shared_ptr<Route>);
+               void set_value (double);
+               double get_value () const;
+       private:
+               boost::weak_ptr<Route> _route;
+       };
+
        boost::shared_ptr<SoloControllable> solo_control() const {
                return _solo_control;
        }
@@ -420,6 +444,14 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
                return _mute_master;
        }
 
+       boost::shared_ptr<PhaseControllable> phase_control() const {
+               return _phase_control;
+       }
+
+       boost::shared_ptr<GroupGainControllable> group_gain_control() const {
+               return _group_gain_control;
+       }
+
        /* Route doesn't own these items, but sub-objects that it does own have them
           and to make UI code a bit simpler, we provide direct access to them
           here.
@@ -429,6 +461,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        boost::shared_ptr<PannerShell> panner_shell() const;
        boost::shared_ptr<AutomationControl> gain_control() const;
        boost::shared_ptr<Pannable> pannable() const;
+       boost::shared_ptr<AutomationControl> trim_control() const;
 
        /**
           Return the first processor that accepts has at least one MIDI input
@@ -440,6 +473,50 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        boost::shared_ptr<Processor> the_instrument() const;
         InstrumentInfo& instrument_info() { return _instrument_info; }
 
+        /* "well-known" controls for panning. Any or all of these may return
+         * null.
+         */
+
+        boost::shared_ptr<AutomationControl> pan_azimuth_control() const;
+        boost::shared_ptr<AutomationControl> pan_elevation_control() const;
+        boost::shared_ptr<AutomationControl> pan_width_control() const;
+        boost::shared_ptr<AutomationControl> pan_frontback_control() const;
+        boost::shared_ptr<AutomationControl> pan_lfe_control() const;
+
+        /* "well-known" controls for an EQ in this route. Any or all may
+         * be null. eq_band_cnt() must return 0 if there is no EQ present.
+         * Passing an @param band value >= eq_band_cnt() will guarantee the
+         * return of a null ptr (or an empty string for eq_band_name()).
+         */
+        uint32_t eq_band_cnt () const;
+        std::string eq_band_name (uint32_t) const;
+        boost::shared_ptr<AutomationControl> eq_gain_controllable (uint32_t band) const;
+        boost::shared_ptr<AutomationControl> eq_freq_controllable (uint32_t band) const;
+        boost::shared_ptr<AutomationControl> eq_q_controllable (uint32_t band) const;
+        boost::shared_ptr<AutomationControl> eq_shape_controllable (uint32_t band) const;
+        boost::shared_ptr<AutomationControl> eq_enable_controllable () const;
+        boost::shared_ptr<AutomationControl> eq_hpf_controllable () const;
+
+        /* "well-known" controls for a compressor in this route. Any or all may
+         * be null.
+         */
+        boost::shared_ptr<AutomationControl> comp_enable_controllable () const;
+        boost::shared_ptr<AutomationControl> comp_threshold_controllable () const;
+        boost::shared_ptr<AutomationControl> comp_speed_controllable () const;
+        boost::shared_ptr<AutomationControl> comp_mode_controllable () const;
+        boost::shared_ptr<AutomationControl> comp_makeup_controllable () const;
+        boost::shared_ptr<AutomationControl> comp_redux_controllable () const;
+
+        /* @param mode must be supplied by the comp_mode_controllable(). All other values
+         * result in undefined behaviour
+         */
+        std::string comp_mode_name (uint32_t mode) const;
+        /* @param mode - as for comp mode name. This returns the name for the
+         * parameter/control accessed via comp_speed_controllable(), which can
+         * be mode dependent.
+         */
+        std::string comp_speed_name (uint32_t mode) const;
+
        void protect_automation ();
 
        enum {
@@ -557,6 +634,8 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        boost::shared_ptr<SoloControllable> _solo_control;
        boost::shared_ptr<MuteControllable> _mute_control;
        boost::shared_ptr<MuteMaster> _mute_master;
+       boost::shared_ptr<PhaseControllable> _phase_control;
+       boost::shared_ptr<GroupGainControllable> _group_gain_control;
 
        virtual void act_on_mute () {}
 
@@ -635,6 +714,8 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        void setup_invisible_processors ();
        void unpan ();
 
+       void set_plugin_state_dir (boost::weak_ptr<Processor>, const std::string&);
+
        boost::shared_ptr<CapturingProcessor> _capturing_processor;
 
        /** A handy class to keep processor state while we attempt a reconfiguration