merged with trunk revs 2605-2627
git-svn-id: svn://localhost/ardour2/trunk@2628 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -62,26 +62,34 @@ class Location : public PBD::StatefulDestructible
|
||||
: _name (name),
|
||||
_start (sample_start),
|
||||
_end (sample_end),
|
||||
_flags (bits) { }
|
||||
_flags (bits),
|
||||
_locked (false) { }
|
||||
|
||||
Location () {
|
||||
_start = 0;
|
||||
_end = 0;
|
||||
_flags = Flags (0);
|
||||
_locked = false;
|
||||
}
|
||||
|
||||
Location (const Location& other);
|
||||
Location (const XMLNode&);
|
||||
Location* operator= (const Location& other);
|
||||
|
||||
nframes_t start() { return _start; }
|
||||
nframes_t end() { return _end; }
|
||||
nframes_t length() { return _end - _start; }
|
||||
bool locked() const { return _locked; }
|
||||
void lock() { _locked = true; changed (this); }
|
||||
void unlock() { _locked = false; changed (this); }
|
||||
|
||||
nframes_t start() const { return _start; }
|
||||
nframes_t end() const { return _end; }
|
||||
nframes_t length() const { return _end - _start; }
|
||||
|
||||
int set_start (nframes_t s);
|
||||
int set_end (nframes_t e);
|
||||
int set (nframes_t start, nframes_t end);
|
||||
|
||||
int move_to (nframes_t pos);
|
||||
|
||||
const string& name() { return _name; }
|
||||
void set_name (const string &str) { _name = str; name_changed(this); }
|
||||
|
||||
@@ -124,6 +132,7 @@ class Location : public PBD::StatefulDestructible
|
||||
nframes_t _start;
|
||||
nframes_t _end;
|
||||
Flags _flags;
|
||||
bool _locked;
|
||||
|
||||
void set_mark (bool yn);
|
||||
bool set_flag_internal (bool yn, Flags flag);
|
||||
@@ -136,7 +145,7 @@ class Locations : public PBD::StatefulDestructible
|
||||
|
||||
Locations ();
|
||||
~Locations ();
|
||||
|
||||
|
||||
void add (Location *, bool make_current = false);
|
||||
void remove (Location *);
|
||||
void clear ();
|
||||
@@ -182,8 +191,8 @@ class Locations : public PBD::StatefulDestructible
|
||||
|
||||
private:
|
||||
|
||||
LocationList locations;
|
||||
Location *current_location;
|
||||
LocationList locations;
|
||||
Location *current_location;
|
||||
mutable Glib::Mutex lock;
|
||||
|
||||
int set_current_unlocked (Location *);
|
||||
|
||||
@@ -566,6 +566,8 @@ AudioEngine::register_output_port (DataType type, const string& portname, bool p
|
||||
int
|
||||
AudioEngine::unregister_port (Port& port)
|
||||
{
|
||||
/* caller must hold process lock */
|
||||
|
||||
if (!_running) {
|
||||
/* probably happening when the engine has been halted by JACK,
|
||||
in which case, there is nothing we can do here.
|
||||
|
||||
@@ -812,6 +812,10 @@ AudioRegion::set_fade_out (FadeShape shape, nframes_t len)
|
||||
void
|
||||
AudioRegion::set_fade_in_length (nframes_t len)
|
||||
{
|
||||
if (len > _length) {
|
||||
len = _length - 1;
|
||||
}
|
||||
|
||||
bool changed = _fade_in->extend_to (len);
|
||||
|
||||
if (changed) {
|
||||
@@ -823,13 +827,16 @@ AudioRegion::set_fade_in_length (nframes_t len)
|
||||
void
|
||||
AudioRegion::set_fade_out_length (nframes_t len)
|
||||
{
|
||||
if (len > _length) {
|
||||
len = _length - 1;
|
||||
}
|
||||
|
||||
bool changed = _fade_out->extend_to (len);
|
||||
|
||||
if (changed) {
|
||||
_flags = Flag (_flags & ~DefaultFadeOut);
|
||||
send_change (FadeOutChanged);
|
||||
}
|
||||
|
||||
send_change (FadeOutChanged);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -199,12 +199,11 @@ IO::IO (Session& s, const XMLNode& node, DataType dt)
|
||||
|
||||
IO::~IO ()
|
||||
{
|
||||
cerr << "Deleting IO called " << _name << endl;
|
||||
|
||||
Glib::Mutex::Lock guard (m_meter_signal_lock);
|
||||
|
||||
Glib::Mutex::Lock lm (io_lock);
|
||||
|
||||
BLOCK_PROCESS_CALLBACK ();
|
||||
|
||||
for (PortSet::iterator i = _inputs.begin(); i != _inputs.end(); ++i) {
|
||||
_session.engine().unregister_port (*i);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,10 @@ Location::Location (const Location& other)
|
||||
|
||||
_flags = Flags (_flags & ~IsStart);
|
||||
_flags = Flags (_flags & ~IsEnd);
|
||||
|
||||
/* copy is not locked even if original was */
|
||||
|
||||
_locked = false;
|
||||
}
|
||||
|
||||
Location::Location (const XMLNode& node)
|
||||
@@ -73,6 +77,10 @@ Location::operator= (const Location& other)
|
||||
_end = other._end;
|
||||
_flags = other._flags;
|
||||
|
||||
/* copy is not locked even if original was */
|
||||
|
||||
_locked = false;
|
||||
|
||||
/* "changed" not emitted on purpose */
|
||||
|
||||
return this;
|
||||
@@ -81,6 +89,10 @@ Location::operator= (const Location& other)
|
||||
int
|
||||
Location::set_start (nframes_t s)
|
||||
{
|
||||
if (_locked) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (is_mark()) {
|
||||
if (_start != s) {
|
||||
|
||||
@@ -117,6 +129,10 @@ Location::set_start (nframes_t s)
|
||||
int
|
||||
Location::set_end (nframes_t e)
|
||||
{
|
||||
if (_locked) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (is_mark()) {
|
||||
if (_start != e) {
|
||||
_start = e;
|
||||
@@ -140,6 +156,10 @@ Location::set_end (nframes_t e)
|
||||
int
|
||||
Location::set (nframes_t start, nframes_t end)
|
||||
{
|
||||
if (_locked) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (is_mark() && start != end) {
|
||||
return -1;
|
||||
} else if (((is_auto_punch() || is_auto_loop()) && start >= end) || (start > end)) {
|
||||
@@ -158,6 +178,23 @@ Location::set (nframes_t start, nframes_t end)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
Location::move_to (nframes_t pos)
|
||||
{
|
||||
if (_locked) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (_start != pos) {
|
||||
_start = pos;
|
||||
_end = _start + length();
|
||||
|
||||
changed (this); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
Location::set_hidden (bool yn, void *src)
|
||||
{
|
||||
@@ -284,6 +321,7 @@ Location::get_state (void)
|
||||
snprintf (buf, sizeof (buf), "%u", end());
|
||||
node->add_property ("end", buf);
|
||||
node->add_property ("flags", enum_2_string (_flags));
|
||||
node->add_property ("locked", (_locked ? "yes" : "no"));
|
||||
|
||||
return *node;
|
||||
}
|
||||
@@ -343,6 +381,12 @@ Location::set_state (const XMLNode& node)
|
||||
|
||||
_flags = Flags (string_2_enum (prop->value(), _flags));
|
||||
|
||||
if ((prop = node.property ("locked")) != 0) {
|
||||
_locked = (prop->value() == "yes");
|
||||
} else {
|
||||
_locked = false;
|
||||
}
|
||||
|
||||
for (cd_iter = cd_list.begin(); cd_iter != cd_list.end(); ++cd_iter) {
|
||||
|
||||
cd_node = *cd_iter;
|
||||
|
||||
@@ -2113,13 +2113,8 @@ Session::remove_route (shared_ptr<Route> route)
|
||||
|
||||
/* try to cause everyone to drop their references */
|
||||
|
||||
cerr << "pre drop, Route now has " << route.use_count() << " refs\n";
|
||||
cerr << "sig has " << route->GoingAway.size() << endl;
|
||||
|
||||
route->drop_references ();
|
||||
|
||||
cerr << "route dangling refs = " << route.use_count() << endl;
|
||||
|
||||
/* save the new state of the world */
|
||||
|
||||
if (save_state (_current_snapshot_name)) {
|
||||
|
||||
Reference in New Issue
Block a user