Fix multi-channel delaylines #7409 part 2/2
[ardour.git] / libs / ardour / ardour / stripable.h
index 2484c263457c45afb0838da5324480996c01efee..3bc2cc33571721874d3834973dc52ae94584b5eb 100644 (file)
 #include <string>
 #include <boost/utility.hpp>
 #include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
 
 #include "pbd/signals.h"
 
+#include "ardour/automatable.h"
 #include "ardour/presentation_info.h"
 #include "ardour/session_object.h"
 #include "ardour/libardour_visibility.h"
@@ -56,10 +58,13 @@ class RecordSafeControl;
  * and behaviour of the object.
  */
 
-class LIBARDOUR_API Stripable : public SessionObject {
-   public:
+class LIBARDOUR_API Stripable : public SessionObject,
+                                public Automatable,
+                                public boost::enable_shared_from_this<Stripable>
+{
+  public:
        Stripable (Session& session, std::string const & name, PresentationInfo const &);
-       virtual ~Stripable () {}
+       virtual ~Stripable ();
 
        /* XXX
           midi on/off
@@ -72,7 +77,7 @@ class LIBARDOUR_API Stripable : public SessionObject {
        int set_state (XMLNode const&, int);
 
        bool is_hidden() const { return _presentation_info.flags() & PresentationInfo::Hidden; }
-       bool is_selected() const { return _presentation_info.flags() & PresentationInfo::Selected; }
+       bool is_selected() const;
 
        PresentationInfo const & presentation_info () const { return _presentation_info; }
        PresentationInfo& presentation_info () { return _presentation_info; }
@@ -82,10 +87,11 @@ class LIBARDOUR_API Stripable : public SessionObject {
 
        void  set_presentation_order (PresentationInfo::order_t);
 
-       struct PresentationOrderSorter {
-               bool operator() (boost::shared_ptr<Stripable> a, boost::shared_ptr<Stripable> b) {
-                       return a->presentation_info().order() < b->presentation_info().order();
-               }
+       struct LIBARDOUR_API Sorter
+       {
+               bool _mixer_order; // master is last
+               Sorter (bool mixer_order = false) : _mixer_order (mixer_order) {}
+               bool operator() (boost::shared_ptr<ARDOUR::Stripable> a, boost::shared_ptr<ARDOUR::Stripable> b);
        };
 
        /* gui's call this for their own purposes. */
@@ -129,13 +135,16 @@ class LIBARDOUR_API Stripable : public SessionObject {
         * return of a null ptr (or an empty string for eq_band_name()).
         */
        virtual uint32_t eq_band_cnt () const = 0;
+       virtual boost::shared_ptr<AutomationControl> eq_enable_controllable () const = 0;
        virtual std::string eq_band_name (uint32_t) const = 0;
        virtual boost::shared_ptr<AutomationControl> eq_gain_controllable (uint32_t band) const = 0;
        virtual boost::shared_ptr<AutomationControl> eq_freq_controllable (uint32_t band) const = 0;
        virtual boost::shared_ptr<AutomationControl> eq_q_controllable (uint32_t band) const = 0;
        virtual boost::shared_ptr<AutomationControl> eq_shape_controllable (uint32_t band) const = 0;
-       virtual boost::shared_ptr<AutomationControl> eq_enable_controllable () const = 0;
-       virtual boost::shared_ptr<AutomationControl> eq_hpf_controllable () const = 0;
+
+       virtual boost::shared_ptr<AutomationControl> filter_freq_controllable (bool hp /* false for LPF*/) const = 0;
+       virtual boost::shared_ptr<AutomationControl> filter_slope_controllable (bool hp) const = 0;
+       virtual boost::shared_ptr<AutomationControl> filter_enable_controllable (bool hp) const = 0;
 
        /* "well-known" controls for a compressor in this route. Any or all may
         * be null.