Tweak colouring in the processor list.
[ardour.git] / libs / ardour / ardour / crossfade.h
index 5d8e0235fb96ed604f6a9e7d9873a344437587b1..d527b6abfab89b9fdc90741adb6d02dd5e4681e1 100644 (file)
@@ -24,7 +24,6 @@
 #include <algorithm>
 #include <boost/shared_ptr.hpp>
 
-#include <sigc++/signal.h>
 
 #include "pbd/undo.h"
 #include "pbd/statefuldestructible.h"
 #include "evoral/Curve.hpp"
 
 namespace ARDOUR {
+       namespace Properties {
+               /* "active" is defined elsewhere but we use it with crossfade also */
+               extern PBD::PropertyDescriptor<bool> active;
+               extern PBD::PropertyDescriptor<bool> follow_overlap;
+       }
 
-class AudioRegion;
 class Playlist;
 
 class Crossfade : public ARDOUR::AudioRegion
@@ -51,9 +54,9 @@ class Crossfade : public ARDOUR::AudioRegion
        /* constructor for "fixed" xfades at each end of an internal overlap */
 
        Crossfade (boost::shared_ptr<ARDOUR::AudioRegion> in, boost::shared_ptr<ARDOUR::AudioRegion> out,
-                       nframes_t position,
-                       nframes_t initial_length,
-                       AnchorPoint);
+                  framepos_t position,
+                  framecnt_t initial_length,
+                  AnchorPoint);
 
        /* constructor for xfade between two regions that are overlapped in any way
           except the "internal" case.
@@ -69,9 +72,11 @@ class Crossfade : public ARDOUR::AudioRegion
 
        /* the usual XML constructor */
 
-       Crossfade (const Playlist&, XMLNode&);
+       Crossfade (const Playlist&, XMLNode const &);
        virtual ~Crossfade();
 
+       static void make_property_quarks ();
+
        bool operator== (const ARDOUR::Crossfade&);
 
        XMLNode& get_state (void);
@@ -80,11 +85,11 @@ class Crossfade : public ARDOUR::AudioRegion
        boost::shared_ptr<ARDOUR::AudioRegion> in() const { return _in; }
        boost::shared_ptr<ARDOUR::AudioRegion> out() const { return _out; }
 
-       nframes_t read_at (Sample *buf, Sample *mixdown_buffer,
-                       float *gain_buffer, sframes_t position, nframes_t cnt,
-                       uint32_t chan_n,
-                       nframes_t read_frames = 0,
-                       nframes_t skip_frames = 0) const;
+       framecnt_t read_at (Sample *buf, Sample *mixdown_buffer,
+                           float *gain_buffer, framepos_t position, framecnt_t cnt,
+                           uint32_t chan_n,
+                           framecnt_t read_frames = 0,
+                           framecnt_t skip_frames = 0) const;
 
        bool refresh ();
 
@@ -104,18 +109,17 @@ class Crossfade : public ARDOUR::AudioRegion
                return (_in == a && _out == b) || (_in == b && _out == a);
        }
 
-       nframes_t overlap_length() const;
+       framecnt_t overlap_length() const;
 
-       sigc::signal<void,boost::shared_ptr<Region> > Invalidated;
-       sigc::signal<void,Change>     StateChanged;
+       PBD::Signal1<void,boost::shared_ptr<Region> > Invalidated;
 
-       bool covers (nframes_t frame) const {
+       bool covers (framepos_t frame) const {
                return _position <= frame && frame < _position + _length;
        }
 
-       OverlapType coverage (nframes_t start, nframes_t end) const;
+       OverlapType coverage (framepos_t start, framepos_t end) const;
 
-       static void set_buffer_size (nframes_t);
+       static void set_buffer_size (framecnt_t);
 
        bool active () const { return _active; }
        void set_active (bool yn);
@@ -127,32 +131,32 @@ class Crossfade : public ARDOUR::AudioRegion
        AutomationList& fade_in() { return _fade_in; }
        AutomationList& fade_out() { return _fade_out; }
 
-       nframes_t set_xfade_length (nframes_t);
+       framecnt_t set_xfade_length (framecnt_t);
 
        bool is_dependent() const { return true; }
        bool depends_on (boost::shared_ptr<Region> other) const {
                return other == _in || other == _out;
        }
 
-       static nframes_t short_xfade_length() { return _short_xfade_length; }
-       static void set_short_xfade_length (nframes_t n);
+       static framecnt_t short_xfade_length() { return _short_xfade_length; }
+       static void set_short_xfade_length (framecnt_t n);
 
-       static Change ActiveChanged;
-       static Change FollowOverlapChanged;
+       /** emitted when the actual fade curves change, as opposed to one of the Stateful properties */
+       PBD::Signal0<void> FadesChanged;
 
   private:
        friend struct CrossfadeComparePtr;
        friend class AudioPlaylist;
 
-       static nframes_t _short_xfade_length;
+       static framecnt_t _short_xfade_length;
 
        boost::shared_ptr<ARDOUR::AudioRegion> _in;
        boost::shared_ptr<ARDOUR::AudioRegion> _out;
-       bool                 _active;
+       PBD::Property<bool>  _active;
+       PBD::Property<bool>  _follow_overlap;
        bool                 _in_update;
        OverlapType           overlap_type;
        AnchorPoint          _anchor_point;
-       bool                 _follow_overlap;
        bool                 _fixed;
        int32_t               layer_relation;
 
@@ -168,7 +172,7 @@ class Crossfade : public ARDOUR::AudioRegion
        bool update ();
 
   protected:
-       nframes_t read_raw_internal (Sample*, sframes_t, nframes_t, int) const;
+       framecnt_t read_raw_internal (Sample*, framepos_t, framecnt_t, int) const;
 };