25 #include "ardour/debug.h"
67 :
Playlist (other, start, cnt, name, hidden)
88 switch (region->
coverage (start, end)) {
168 name(), start, cnt, chan_n,
regions.
size(), mixdown_buffer, gain_buffer));
183 memset (buf, 0,
sizeof (
Sample) * cnt);
207 for (RegionList::iterator i = all->begin(); i != all->end(); ++i) {
218 region_range.
from = max (region_range.
from, start);
219 region_range.
to = min (region_range.
to, start + cnt - 1);
233 to_do.push_back (
Segment (ar, d));
240 d.
to = min (d.
to, body.
to);
248 for (list<Segment>::reverse_iterator i = to_do.rbegin(); i != to_do.rend(); ++i) {
250 name(), i->region->name(), i->range.from,
251 i->range.to - i->range.from + 1, (int) chan_n,
252 buf, i->range.from - start));
253 i->region->read_at (buf + i->range.from - start, mixdown_buffer, gain_buffer, i->range.from, i->range.to - i->range.from + 1, chan_n);
264 cerr <<
"Playlist \"" <<
_name <<
"\" " << endl
270 cerr <<
" " << r->
name() <<
" @ " << r <<
" ["
296 RegionList::iterator tmp = i;
299 if ((*i) == region) {
309 set<boost::shared_ptr<Region> >::iterator xtmp = x;
312 if ((*x) == region) {
348 bool parent_wants_notify;
352 if (parent_wants_notify || (what_changed.
contains (our_interests))) {
365 sort (copies.begin(), copies.end(), cmp);
391 if ((cr = boost::dynamic_pointer_cast<AudioRegion> (compound_region)) == 0) {
395 sort (originals.begin(), originals.end(), cmp);
424 sort (originals.begin(), originals.end(), cmp);
432 if ((ar = boost::dynamic_pointer_cast<AudioRegion> (*i)) == 0) {
442 if (i == originals.begin()) {
456 }
else if (*i == originals.back()) {
488 if ((*i)->name() ==
X_(
"Crossfade")) {
497 if ((p = (*i)->property (
X_(
"in"))) == 0) {
504 warning <<
string_compose (
_(
"Legacy crossfade involved an incoming region not present in playlist \"%1\" - crossfade discarded"),
513 if ((p = (*i)->property (
X_(
"out"))) == 0) {
520 warning <<
string_compose (
_(
"Legacy crossfade involved an outgoing region not present in playlist \"%1\" - crossfade discarded"),
542 if ((*j)->name() ==
X_(
"FadeOut")) {
544 }
else if ((*j)->name() ==
X_(
"FadeIn")) {
560 if ((*j)->name() ==
X_(
"FadeIn")) {
562 }
else if ((*j)->name() ==
X_(
"FadeOut")) {
framecnt_t read(Sample *dst, Sample *mixdown, float *gain_buffer, framepos_t start, framecnt_t cnt, uint32_t chan_n=0)
virtual void set_playlist(boost::weak_ptr< ARDOUR::Playlist >)
ARDOUR::Session & _session
RangeList< T > subtract(Range< T > range, RangeList< T > sub)
LIBARDOUR_API PBD::PropertyDescriptor< bool > fade_out_active
boost::shared_ptr< Region > region_by_id(const PBD::ID &) const
Evoral::Range< framepos_t > body_range() const
void set_fade_out(FadeShape, framecnt_t)
virtual bool region_changed(const PBD::PropertyChange &, boost::shared_ptr< Region >)
const std::string & value() const
void pre_combine(std::vector< boost::shared_ptr< Region > > &)
bool destroy_region(boost::shared_ptr< Region >)
void set_fade_out_length(framecnt_t)
LIBARDOUR_API PBD::PropertyDescriptor< bool > hidden
bool region_changed(const PBD::PropertyChange &, boost::shared_ptr< Region >)
Container::iterator begin()
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
boost::shared_ptr< AutomationList > fade_in()
int set_state(const XMLNode &, int version)
void add_command(Command *const cmd)
boost::shared_ptr< AutomationList > fade_out()
friend class RegionReadLock
T to
end of the range (inclusive: to lies inside the range)
LIBPBD_API Transmitter warning
const XMLNodeList & children(const std::string &str=std::string()) const
std::ostream & endmsg(std::ostream &ostr)
LIBARDOUR_API uint64_t AudioPlayback
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
std::list< XMLNode * > XMLNodeList
void post_combine(std::vector< boost::shared_ptr< Region > > &, boost::shared_ptr< Region >)
XMLProperty * property(const char *)
void add(Range< T > const &range)
void pre_uncombine(std::vector< boost::shared_ptr< Region > > &, boost::shared_ptr< Region >)
std::set< boost::shared_ptr< Region > > all_regions
Container::iterator end()
bool string_is_affirmative(const std::string &str)
Container::iterator erase(typename Container::iterator i)
void notify_region_removed(boost::shared_ptr< Region >)
AudioPlaylist(Session &, const XMLNode &, bool hidden=false)
void set_fade_in_length(framecnt_t)
gain_t scale_amplitude() const
std::list< Range< T > > List
void set_fade_in(FadeShape, framecnt_t)
LIBARDOUR_API PBD::PropertyDescriptor< boost::shared_ptr< AutomationList > > fade_out
Evoral::OverlapType coverage(framepos_t start, framepos_t end) const
LIBARDOUR_API PBD::PropertyDescriptor< boost::shared_ptr< AutomationList > > fade_in
#define DEBUG_TRACE(bits, str)
void set_fade_out_active(bool yn)
RegionListProperty regions
static int loading_state_version
PBD::Property< std::string > _name
void set_fade_in_active(bool yn)
framepos_t position() const
void load_legacy_crossfades(const XMLNode &, int version)
virtual int set_state(const XMLNode &, int version)
Container::size_type size() const
void notify_contents_changed()
boost::shared_ptr< AutomationList > inverse_fade_in()
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > position
Segment(boost::shared_ptr< AudioRegion > r, Evoral::Range< framepos_t > a)
void set_scale_amplitude(gain_t)
int set_state(const XMLNode &, int version)
boost::shared_ptr< RegionList > regions_touched_locked(framepos_t start, framepos_t end)
boost::shared_ptr< AudioRegion > region
the region
bool contains(PropertyDescriptor< T > p) const
framecnt_t length() const
Evoral::Range< framepos_t > range() const
boost::shared_ptr< AutomationList > inverse_fade_out()
Evoral::Range< framepos_t > range
range of the region to read, in session frames
XMLNodeList::const_iterator XMLNodeConstIterator
LIBARDOUR_API PBD::PropertyDescriptor< float > scale_amplitude
LIBARDOUR_API PBD::PropertyDescriptor< bool > envelope_active
LIBARDOUR_API PBD::PropertyDescriptor< bool > fade_in_active
std::string string_compose(const std::string &fmt, const T1 &o1)
LIBARDOUR_API PBD::PropertyDescriptor< boost::shared_ptr< AutomationList > > envelope
framepos_t last_frame() const