#include "ardour/ardour.h"
#include "ardour/audioregion.h"
-#include "ardour/crossfade_compare.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;
+ }
+
+enum AnchorPoint {
+ StartOfIn,
+ EndOfIn,
+ EndOfOut
+};
-class AudioRegion;
class Playlist;
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,
- framepos_t position,
framecnt_t initial_length,
AnchorPoint);
/* the usual XML constructor */
- Crossfade (const Playlist&, XMLNode&);
+ Crossfade (const Playlist&, XMLNode const &);
virtual ~Crossfade();
- bool operator== (const ARDOUR::Crossfade&);
+ static void make_property_quarks ();
XMLNode& get_state (void);
int set_state (const XMLNode&, int version);
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;
+ uint32_t chan_n) const;
bool refresh ();
framecnt_t overlap_length() const;
PBD::Signal1<void,boost::shared_ptr<Region> > Invalidated;
- PBD::Signal1<void,PBD::PropertyChange> StateChanged;
-
- bool covers (framecnt_t frame) const {
- return _position <= frame && frame < _position + _length;
- }
OverlapType coverage (framepos_t start, framepos_t end) const;
static framecnt_t short_xfade_length() { return _short_xfade_length; }
static void set_short_xfade_length (framecnt_t n);
- static PBD::PropertyChange ActiveChanged;
- static PBD::PropertyChange FollowOverlapChanged;
+ /** emitted when the actual fade curves change, as opposed to one of the Stateful properties */
+ PBD::Signal0<void> FadesChanged;
private:
friend struct CrossfadeComparePtr;
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;
static Sample* crossfade_buffer_in;
void initialize ();
+ void register_properties ();
int compute (boost::shared_ptr<ARDOUR::AudioRegion>, boost::shared_ptr<ARDOUR::AudioRegion>, CrossfadeModel);
bool update ();
+ bool operator== (const ARDOUR::Crossfade&);
+
protected:
framecnt_t read_raw_internal (Sample*, framepos_t, framecnt_t, int) const;
};