X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fcrossfade.h;h=5e25bbe00db436a2cdb356909f6b095bf77593ef;hb=9e0d03020ff47773f7d1c0414de1c74e6c9e0dac;hp=b0785a6e594e1d2d29acdf04a27131d43b0e290d;hpb=d8ade6d30595a3a8be343b392e47d422940eac27;p=ardour.git diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h index b0785a6e59..5e25bbe00d 100644 --- a/libs/ardour/ardour/crossfade.h +++ b/libs/ardour/ardour/crossfade.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000 Paul Davis + Copyright (C) 2000 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,15 +24,14 @@ #include #include -#include -#include -#include +#include "pbd/undo.h" +#include "pbd/statefuldestructible.h" -#include -#include -#include -#include +#include "ardour/ardour.h" +#include "ardour/audioregion.h" +#include "ardour/crossfade_compare.h" +#include "evoral/Curve.hpp" namespace ARDOUR { @@ -44,29 +43,29 @@ class Crossfade : public ARDOUR::AudioRegion public: class NoCrossfadeHere: std::exception { - public: + public: virtual const char *what() const throw() { return "no crossfade should be constructed here"; } }; - + /* constructor for "fixed" xfades at each end of an internal overlap */ Crossfade (boost::shared_ptr in, boost::shared_ptr out, - nframes_t position, - nframes_t initial_length, - AnchorPoint); + nframes_t position, + nframes_t initial_length, + AnchorPoint); /* constructor for xfade between two regions that are overlapped in any way except the "internal" case. */ - + Crossfade (boost::shared_ptr in, boost::shared_ptr out, CrossfadeModel, bool active); /* copy constructor to copy a crossfade with new regions. used (for example) - when a playlist copy is made + when a playlist copy is made */ Crossfade (boost::shared_ptr, boost::shared_ptr, boost::shared_ptr); - + /* the usual XML constructor */ Crossfade (const Playlist&, XMLNode&); @@ -75,17 +74,17 @@ class Crossfade : public ARDOUR::AudioRegion bool operator== (const ARDOUR::Crossfade&); XMLNode& get_state (void); - int set_state (const XMLNode&); + int set_state (const XMLNode&, int version); boost::shared_ptr in() const { return _in; } boost::shared_ptr out() const { return _out; } - - nframes_t read_at (Sample *buf, Sample *mixdown_buffer, - float *gain_buffer, nframes_t position, nframes_t cnt, - uint32_t chan_n, - nframes_t read_frames = 0, - nframes_t skip_frames = 0) const; - + + 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; + bool refresh (); uint32_t upper_layer () const { @@ -106,10 +105,8 @@ class Crossfade : public ARDOUR::AudioRegion nframes_t overlap_length() const; - void invalidate(); - - sigc::signal > Invalidated; - sigc::signal StateChanged; + PBD::Signal1 > Invalidated; + PBD::Signal1 StateChanged; bool covers (nframes_t frame) const { return _position <= frame && frame < _position + _length; @@ -126,16 +123,16 @@ class Crossfade : public ARDOUR::AudioRegion bool can_follow_overlap() const; void set_follow_overlap (bool yn); - AutomationList& fade_in() { return _fade_in; } + AutomationList& fade_in() { return _fade_in; } AutomationList& fade_out() { return _fade_out; } - nframes_t set_length (nframes_t); + nframes_t set_xfade_length (nframes_t); bool is_dependent() const { return true; } - bool depends_on (boost::shared_ptr other) const { - return other == _in || other == _out; + bool depends_on (boost::shared_ptr 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); @@ -170,10 +167,10 @@ class Crossfade : public ARDOUR::AudioRegion bool update (); protected: - nframes_t read_raw_internal (Sample*, nframes_t, nframes_t) const; + nframes_t read_raw_internal (Sample*, sframes_t, nframes_t, int) const; }; } // namespace ARDOUR -#endif /* __ardour_overlap_h__ */ +#endif /* __ardour_overlap_h__ */