#include <sigc++/bind.h>
#include <sigc++/class_slot.h>
+#include <glibmm/thread.h>
+
#include <pbd/basename.h>
-#include <pbd/lockmonitor.h>
#include <pbd/xml++.h>
#include <ardour/audioregion.h>
#include <ardour/dB.h>
#include <ardour/playlist.h>
#include <ardour/audiofilter.h>
+#include <ardour/audiosource.h>
#include "i18n.h"
#include <locale.h>
{
}
-AudioRegion::AudioRegion (Source& src, jack_nframes_t start, jack_nframes_t length, bool announce)
+AudioRegion::AudioRegion (AudioSource& src, jack_nframes_t start, jack_nframes_t length, bool announce)
: Region (start, length, PBD::basename_nosuffix(src.name()), 0, Region::Flag(Region::DefaultFlags|Region::External)),
_fade_in (0.0, 2.0, 1.0, false),
_fade_out (0.0, 2.0, 1.0, false),
}
}
-AudioRegion::AudioRegion (Source& src, jack_nframes_t start, jack_nframes_t length, const string& name, layer_t layer, Flag flags, bool announce)
+AudioRegion::AudioRegion (AudioSource& src, jack_nframes_t start, jack_nframes_t length, const string& name, layer_t layer, Flag flags, bool announce)
: Region (start, length, name, layer, flags),
_fade_in (0.0, 2.0, 1.0, false),
_fade_out (0.0, 2.0, 1.0, false),
{
/* create a new AudioRegion, that is part of an existing one */
- set<Source*> unique_srcs;
+ set<AudioSource*> unique_srcs;
for (SourceList::const_iterator i= other.sources.begin(); i != other.sources.end(); ++i) {
sources.push_back (*i);
{
/* Pure copy constructor */
- set<Source*> unique_srcs;
+ set<AudioSource*> unique_srcs;
for (SourceList::const_iterator i = other.sources.begin(); i != other.sources.end(); ++i) {
sources.push_back (*i);
/* NOTE: no CheckNewRegion signal emitted here. This is the copy constructor */
}
-AudioRegion::AudioRegion (Source& src, const XMLNode& node)
+AudioRegion::AudioRegion (AudioSource& src, const XMLNode& node)
: Region (node),
_fade_in (0.0, 2.0, 1.0, false),
_fade_out (0.0, 2.0, 1.0, false),
_fade_out (0.0, 2.0, 1.0, false),
_envelope (0.0, 2.0, 1.0, false)
{
- /* basic AudioRegion constructor */
-
- set<Source*> unique_srcs;
+ set<AudioSource*> unique_srcs;
for (SourceList::iterator i=srcs.begin(); i != srcs.end(); ++i) {
sources.push_back (*i);
for (uint32_t n=0; n < sources.size(); ++n) {
snprintf (buf2, sizeof(buf2), "source-%d", n);
- snprintf (buf, sizeof(buf), "%" PRIu64, sources[n]->id());
+ sources[n]->id().print (buf2);
node.add_property (buf2, buf);
}
AudioRegion::lock_sources ()
{
SourceList::iterator i;
- set<Source*> unique_srcs;
+ set<AudioSource*> unique_srcs;
for (i = sources.begin(); i != sources.end(); ++i) {
unique_srcs.insert (*i);
AudioRegion::unlock_sources ()
{
SourceList::iterator i;
- set<Source*> unique_srcs;
+ set<AudioSource*> unique_srcs;
for (i = sources.begin(); i != sources.end(); ++i) {
unique_srcs.insert (*i);
}
bool
-AudioRegion::region_list_equivalent (const AudioRegion& other)
+AudioRegion::region_list_equivalent (const AudioRegion& other) const
{
return size_equivalent (other) && source_equivalent (other) && _name == other._name;
}
bool
-AudioRegion::source_equivalent (const AudioRegion& other)
+AudioRegion::source_equivalent (const AudioRegion& other) const
{
- SourceList::iterator i;
+ SourceList::const_iterator i;
SourceList::const_iterator io;
for (i = sources.begin(), io = other.sources.begin(); i != sources.end() && io != other.sources.end(); ++i, ++io) {
}
bool
-AudioRegion::equivalent (const AudioRegion& other)
+AudioRegion::overlap_equivalent (const AudioRegion& other) const
+{
+ return coverage (other.first_frame(), other.last_frame()) != OverlapNone;
+}
+
+bool
+AudioRegion::equivalent (const AudioRegion& other) const
{
return _start == other._start &&
_position == other._position &&
}
bool
-AudioRegion::size_equivalent (const AudioRegion& other)
+AudioRegion::size_equivalent (const AudioRegion& other) const
{
return _start == other._start &&
_length == other._length;