diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-02 18:05:26 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-02 18:05:26 +0000 |
commit | 17088ee3ea5af1e6174b098bb5bcfdaec6ebf9b0 (patch) | |
tree | cbf9fe8fb94212f9a50c6b760ebaac3b4a1bcec6 /libs/ardour | |
parent | a5ab2e99e19d5f5d4c1f91f38cd774fefdf257dc (diff) |
(1) remove most uses of MementoCommand for Playlist and Region (2) move frozen state from Region into Stateful, renamed "suspend property changes" (3) successive changes to a Property (scalar) after clear_history() do not keep resetting the old value (fixes region trim)
git-svn-id: svn://localhost/ardour2/branches/3.0@6720 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/audio_track.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/automation_list.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_track.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/region.h | 11 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 2 | ||||
-rw-r--r-- | libs/ardour/audio_diskstream.cc | 7 | ||||
-rw-r--r-- | libs/ardour/audio_track.cc | 2 | ||||
-rw-r--r-- | libs/ardour/audioregion.cc | 34 | ||||
-rw-r--r-- | libs/ardour/automation_list.cc | 18 | ||||
-rw-r--r-- | libs/ardour/midi_diskstream.cc | 6 | ||||
-rw-r--r-- | libs/ardour/midi_track.cc | 2 | ||||
-rw-r--r-- | libs/ardour/playlist.cc | 18 | ||||
-rw-r--r-- | libs/ardour/region.cc | 77 | ||||
-rw-r--r-- | libs/ardour/region_factory.cc | 12 | ||||
-rw-r--r-- | libs/ardour/session.cc | 4 |
16 files changed, 71 insertions, 129 deletions
diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index fc5b4255b3..be8d988a41 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -49,7 +49,7 @@ class AudioTrack : public Track int export_stuff (BufferSet& bufs, sframes_t start_frame, nframes_t nframes, bool enable_processing = true); - void freeze (InterThreadInfo&); + void freeze_me (InterThreadInfo&); void unfreeze (); boost::shared_ptr<Region> bounce (InterThreadInfo&); diff --git a/libs/ardour/ardour/automation_list.h b/libs/ardour/ardour/automation_list.h index 1778771c5f..79acedebf3 100644 --- a/libs/ardour/ardour/automation_list.h +++ b/libs/ardour/ardour/automation_list.h @@ -50,7 +50,6 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL AutomationList& operator= (const AutomationList&); bool operator== (const AutomationList&); - void freeze(); void thaw (); void mark_dirty () const; diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h index bc636eea83..6f8fda78da 100644 --- a/libs/ardour/ardour/midi_track.h +++ b/libs/ardour/ardour/midi_track.h @@ -53,7 +53,7 @@ public: int export_stuff (BufferSet& bufs, nframes_t nframes, sframes_t end_frame); - void freeze (InterThreadInfo&); + void freeze_me (InterThreadInfo&); void unfreeze (); boost::shared_ptr<Region> bounce (InterThreadInfo&); diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 1da185c6f2..09dd8f203c 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -93,9 +93,6 @@ class Region PBD::PropertyList* property_factory (const XMLNode&) const; - void unlock_property_changes () { _no_property_changes = false; } - void block_property_changes () { _no_property_changes = true; } - virtual ~Region(); /** Note: changing the name of a Region does not constitute an edit */ @@ -156,8 +153,7 @@ class Region void set_position_lock_style (PositionLockStyle ps); void recompute_position_from_lock_style (); - void freeze (); - void thaw (); + void suspend_property_changes (); bool covers (framepos_t frame) const { return first_frame() <= frame && frame <= last_frame(); @@ -288,6 +284,7 @@ class Region protected: void send_change (const PBD::PropertyChange&); + void mid_thaw (const PBD::PropertyChange&); void trim_to_internal (framepos_t position, framecnt_t length, void *src); virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute); @@ -304,7 +301,6 @@ class Region virtual void recompute_at_end () = 0; DataType _type; - bool _no_property_changes; PBD::Property<bool> _muted; PBD::Property<bool> _opaque; @@ -332,14 +328,11 @@ class Region framepos_t _last_position; PositionLockStyle _positional_lock_style; mutable RegionEditState _first_edit; - int _frozen; BBT_Time _bbt_time; AnalysisFeatureList _transients; bool _valid_transients; mutable uint64_t _read_data_count; ///< modified in read() - PBD::PropertyChange _pending_changed; uint64_t _last_layer_op; ///< timestamp - Glib::Mutex _lock; SourceList _sources; /** Used when timefx are applied, so we can always use the original source */ SourceList _master_sources; diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index d26c84a795..cf88f2e6bd 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -603,7 +603,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi boost::shared_ptr<Region> write_one_track (AudioTrack&, nframes_t start, nframes_t end, bool overwrite, std::vector<boost::shared_ptr<Source> >&, InterThreadInfo& wot, bool enable_processing = true); - int freeze (InterThreadInfo&); + int freeze_all (InterThreadInfo&); /* session-wide solo/mute/rec-enable */ diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index 0ed4b8c70b..eee9f03fe5 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -74,7 +74,7 @@ class Track : public Route FreezeState freeze_state() const; - virtual void freeze (InterThreadInfo&) = 0; + virtual void freeze_me (InterThreadInfo&) = 0; virtual void unfreeze () = 0; virtual boost::shared_ptr<Region> bounce (InterThreadInfo&) = 0; diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index f7a1240bdd..1f77964d0d 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -35,7 +35,7 @@ #include "pbd/xml++.h" #include "pbd/memento_command.h" #include "pbd/enumwriter.h" -#include "pbd/stacktrace.h" +#include "pbd/stateful_diff_command.h" #include "ardour/analyser.h" #include "ardour/ardour.h" @@ -1497,7 +1497,7 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca // cerr << _name << ": there are " << capture_info.size() << " capture_info records\n"; - XMLNode &before = _playlist->get_state(); + _playlist->clear_history (); _playlist->freeze (); for (buffer_position = c->front()->write_source->last_capture_start_frame(), ci = capture_info.begin(); ci != capture_info.end(); ++ci) { @@ -1537,8 +1537,7 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca } _playlist->thaw (); - XMLNode &after = _playlist->get_state(); - _session.add_command (new MementoCommand<Playlist>(*_playlist, &before, &after)); + _session.add_command (new StatefulDiffCommand (_playlist)); } mark_write_completed = true; diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index ebc7a9be66..245b122c18 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -692,7 +692,7 @@ AudioTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt, } void -AudioTrack::freeze (InterThreadInfo& itt) +AudioTrack::freeze_me (InterThreadInfo& itt) { vector<boost::shared_ptr<Source> > srcs; string new_playlist_name; diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index e30a3a5994..abddffc12e 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -589,7 +589,7 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ LocaleGuard lg (X_("POSIX")); boost::shared_ptr<Playlist> the_playlist (_playlist.lock()); - freeze (); + suspend_property_changes (); if (the_playlist) { the_playlist->freeze (); @@ -612,7 +612,7 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ /* Now find envelope description and other related child items */ - _envelope->freeze (); + _envelope->freeze (); for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) { XMLNode *child; @@ -677,9 +677,9 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ } } - _envelope->thaw (); - thaw (); - + _envelope->thaw (); + resume_property_changes (); + if (send) { send_change (what_changed); } @@ -761,9 +761,9 @@ AudioRegion::set_fade_out_shape (FadeShape shape) void AudioRegion::set_fade_in (boost::shared_ptr<AutomationList> f) { - _fade_in->freeze (); + _fade_in->freeze (); *_fade_in = *f; - _fade_in->thaw (); + _fade_in->thaw (); send_change (PropertyChange (Properties::fade_in)); } @@ -771,7 +771,7 @@ AudioRegion::set_fade_in (boost::shared_ptr<AutomationList> f) void AudioRegion::set_fade_in (FadeShape shape, framecnt_t len) { - _fade_in->freeze (); + _fade_in->freeze (); _fade_in->clear (); switch (shape) { @@ -822,15 +822,15 @@ AudioRegion::set_fade_in (FadeShape shape, framecnt_t len) break; } - _fade_in->thaw (); + _fade_in->thaw (); } void AudioRegion::set_fade_out (boost::shared_ptr<AutomationList> f) { - _fade_out->freeze (); + _fade_out->freeze (); *_fade_out = *f; - _fade_out->thaw (); + _fade_out->thaw (); send_change (PropertyChange (Properties::fade_in)); } @@ -838,7 +838,7 @@ AudioRegion::set_fade_out (boost::shared_ptr<AutomationList> f) void AudioRegion::set_fade_out (FadeShape shape, framecnt_t len) { - _fade_out->freeze (); + _fade_out->freeze (); _fade_out->clear (); switch (shape) { @@ -887,7 +887,7 @@ AudioRegion::set_fade_out (FadeShape shape, framecnt_t len) break; } - _fade_out->thaw (); + _fade_out->thaw (); } void @@ -977,11 +977,11 @@ AudioRegion::set_default_fades () void AudioRegion::set_default_envelope () { - _envelope->freeze (); + _envelope->freeze (); _envelope->clear (); _envelope->fast_simple_add (0, 1.0f); _envelope->fast_simple_add (_length, 1.0f); - _envelope->thaw (); + _envelope->thaw (); } void @@ -991,10 +991,10 @@ AudioRegion::recompute_at_end () based on the the existing curve. */ - _envelope->freeze (); + _envelope->freeze (); _envelope->truncate_end (_length); _envelope->set_max_xval (_length); - _envelope->thaw (); + _envelope->thaw (); if (_fade_in->back()->when > _length) { _fade_in->extend_to (_length); diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc index 479674aee6..92a3d167da 100644 --- a/libs/ardour/automation_list.cc +++ b/libs/ardour/automation_list.cc @@ -170,7 +170,7 @@ AutomationList::maybe_signal_changed () { ControlList::maybe_signal_changed (); - if (!_frozen) { + if (!ControlList::frozen()) { StateChanged (); /* EMIT SIGNAL */ } } @@ -208,12 +208,6 @@ AutomationList::stop_touch () } void -AutomationList::freeze () -{ - _frozen++; -} - -void AutomationList::thaw () { ControlList::thaw(); @@ -313,7 +307,7 @@ AutomationList::deserialize_events (const XMLNode& node) return -1; } - freeze (); + ControlList::freeze (); clear (); stringstream str (content_node->content()); @@ -344,8 +338,8 @@ AutomationList::deserialize_events (const XMLNode& node) maybe_signal_changed (); } - thaw (); - + ControlList::thaw (); + return 0; } @@ -377,7 +371,7 @@ AutomationList::set_state (const XMLNode& node, int version) nframes_t x; double y; - freeze (); + ControlList::freeze (); clear (); for (i = elist.begin(); i != elist.end(); ++i) { @@ -397,7 +391,7 @@ AutomationList::set_state (const XMLNode& node, int version) fast_simple_add (x, y); } - thaw (); + ControlList::thaw (); return 0; } diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index ccfaeaa5cd..836fb05c8b 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -35,6 +35,7 @@ #include "pbd/xml++.h" #include "pbd/memento_command.h" #include "pbd/enumwriter.h" +#include "pbd/stateful_diff_command.h" #include "ardour/ardour.h" #include "ardour/audioengine.h" @@ -1011,7 +1012,7 @@ MidiDiskstream::transport_stopped (struct tm& /*when*/, time_t /*twhen*/, bool a // cerr << _name << ": there are " << capture_info.size() << " capture_info records\n"; - XMLNode &before = _playlist->get_state(); + _playlist->clear_history (); _playlist->freeze (); uint32_t buffer_position = 0; @@ -1053,8 +1054,7 @@ MidiDiskstream::transport_stopped (struct tm& /*when*/, time_t /*twhen*/, bool a } _playlist->thaw (); - XMLNode &after = _playlist->get_state(); - _session.add_command (new MementoCommand<Playlist>(*_playlist, &before, &after)); + _session.add_command (new StatefulDiffCommand(_playlist)); } diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index af66f2f40c..9409e9f143 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -556,7 +556,7 @@ MidiTrack::bounce_range (nframes_t /*start*/, nframes_t /*end*/, InterThreadInfo } void -MidiTrack::freeze (InterThreadInfo& /*itt*/) +MidiTrack::freeze_me (InterThreadInfo& /*itt*/) { } diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 6169df8f03..eb21cdcde6 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -855,7 +855,7 @@ Playlist::partition (framepos_t start, framepos_t end, bool cut) partition_internal (start, end, cut, thawlist); for (RegionList::iterator i = thawlist.begin(); i != thawlist.end(); ++i) { - (*i)->thaw (); + (*i)->resume_property_changes (); } } @@ -972,7 +972,7 @@ Playlist::partition_internal (framepos_t start, framepos_t end, bool cutting, Re /* "front" ***** */ - current->freeze (); + current->suspend_property_changes (); thawlist.push_back (current); current->trim_end (pos2, this); @@ -1011,7 +1011,7 @@ Playlist::partition_internal (framepos_t start, framepos_t end, bool cutting, Re /* front ****** */ - current->freeze (); + current->suspend_property_changes (); thawlist.push_back (current); current->trim_end (pos2, this); @@ -1054,7 +1054,7 @@ Playlist::partition_internal (framepos_t start, framepos_t end, bool cutting, Re /* end */ - current->freeze (); + current->suspend_property_changes (); thawlist.push_back (current); current->trim_front (pos3, this); } else if (overlap == OverlapExternal) { @@ -1157,7 +1157,7 @@ Playlist::cut (framepos_t start, framecnt_t cnt, bool result_is_hidden) partition_internal (start, start+cnt-1, true, thawlist); for (RegionList::iterator i = thawlist.begin(); i != thawlist.end(); ++i) { - (*i)->thaw (); + (*i)->resume_property_changes(); } return the_copy; @@ -2123,15 +2123,15 @@ Playlist::set_state (const XMLNode& node, int version) if ((region = region_by_id (id))) { - region->freeze (); + region->suspend_property_changes (); if (region->set_state (*child, version)) { - region->thaw (); + region->resume_property_changes (); continue; } } else if ((region = RegionFactory::create (_session, *child, true)) != 0) { - region->freeze (); + region->suspend_property_changes (); } else { error << _("Playlist: cannot create region from XML") << endmsg; continue; @@ -2141,7 +2141,7 @@ Playlist::set_state (const XMLNode& node, int version) // So that layer_op ordering doesn't get screwed up region->set_last_layer_op( region->layer()); - region->thaw (); + region->resume_property_changes (); } } diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index f59d076c59..b89ad2854b 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -199,13 +199,11 @@ Region::register_properties () Region::Region (Session& s, framepos_t start, framecnt_t length, const string& name, DataType type) : SessionObject(s, name) , _type(type) - , _no_property_changes (true) , REGION_DEFAULT_STATE(start,length) , _last_length (length) , _last_position (0) , _positional_lock_style(AudioTime) , _first_edit (EditChangesNothing) - , _frozen(0) , _read_data_count(0) , _last_layer_op(0) , _pending_explicit_relayer (false) @@ -219,13 +217,11 @@ Region::Region (Session& s, framepos_t start, framecnt_t length, const string& n Region::Region (const SourceList& srcs) : SessionObject(srcs.front()->session(), "toBeRenamed") , _type (srcs.front()->type()) - , _no_property_changes (true) , REGION_DEFAULT_STATE(0,0) , _last_length (0) , _last_position (0) , _positional_lock_style (_type == DataType::AUDIO ? AudioTime : MusicTime) , _first_edit (EditChangesNothing) - , _frozen (0) , _valid_transients(false) , _read_data_count(0) , _last_layer_op (0) @@ -251,13 +247,11 @@ Region::Region (const SourceList& srcs) Region::Region (boost::shared_ptr<const Region> other, frameoffset_t offset, bool offset_relative) : SessionObject(other->session(), other->name()) , _type (other->data_type()) - , _no_property_changes (true) , REGION_COPY_STATE (other) , _last_length (other->_last_length) , _last_position(other->_last_position) \ , _positional_lock_style(other->_positional_lock_style) \ , _first_edit (EditChangesNothing) - , _frozen (0) , _valid_transients(false) , _read_data_count(0) , _last_layer_op (0) @@ -360,13 +354,11 @@ Region::Region (boost::shared_ptr<const Region> other, frameoffset_t offset, boo Region::Region (boost::shared_ptr<const Region> other, const SourceList& srcs) : SessionObject (other->session(), other->name()) , _type (srcs.front()->type()) - , _no_property_changes (true) , REGION_COPY_STATE (other) , _last_length (other->_last_length) , _last_position (other->_last_position) , _positional_lock_style (other->_positional_lock_style) , _first_edit (EditChangesID) - , _frozen (0) , _valid_transients (false) , _read_data_count (0) , _last_layer_op (other->_last_layer_op) @@ -393,13 +385,11 @@ Region::Region (boost::shared_ptr<const Region> other, const SourceList& srcs) Region::Region (boost::shared_ptr<const Region> other) : SessionObject(other->session(), other->name()) , _type(other->data_type()) - , _no_property_changes (true) , REGION_COPY_STATE (other) , _last_length (other->_last_length) , _last_position (other->_last_position) , _positional_lock_style (other->_positional_lock_style) , _first_edit (EditChangesID) - , _frozen(0) , _valid_transients(false) , _read_data_count(0) , _last_layer_op(other->_last_layer_op) @@ -475,7 +465,7 @@ Region::set_length (framecnt_t len, void */*src*/) maybe_uncopy (); invalidate_transients (); - if (!_frozen) { + if (!property_changes_suspended()) { recompute_at_end (); } @@ -803,7 +793,7 @@ Region::trim_front (framepos_t new_position, void *src) } trim_to_internal (new_position, newlen, src); - if (!_frozen) { + if (!property_changes_suspended()) { recompute_at_start (); } } @@ -822,7 +812,7 @@ Region::trim_end (framepos_t new_endpoint, void */*src*/) if (new_endpoint > _position) { trim_to_internal (_position, new_endpoint - _position + 1, this); - if (!_frozen) { + if (!property_changes_suspended()) { recompute_at_end (); } } @@ -837,7 +827,7 @@ Region::trim_to (framepos_t position, framecnt_t length, void *src) trim_to_internal (position, length, src); - if (!_frozen) { + if (!property_changes_suspended()) { recompute_at_start (); recompute_at_end (); } @@ -890,14 +880,14 @@ Region::trim_to_internal (framepos_t position, framecnt_t length, void */*src*/) what_changed.add (Properties::start); } if (_length != length) { - if (!_frozen) { + if (!property_changes_suspended()) { _last_length = _length; } _length = length; what_changed.add (Properties::length); } if (_position != position) { - if (!_frozen) { + if (!property_changes_suspended()) { _last_position = _position; } _position = position; @@ -987,7 +977,7 @@ Region::set_sync_position (framepos_t absolute_pos) if (file_pos != _sync_position) { _sync_marked = true; _sync_position = file_pos; - if (!_frozen) { + if (!property_changes_suspended()) { maybe_uncopy (); } send_change (Properties::sync_position); @@ -999,7 +989,7 @@ Region::clear_sync_position () { if (sync_marked()) { _sync_marked = false; - if (!_frozen) { + if (!property_changes_suspended()) { maybe_uncopy (); } send_change (Properties::sync_position); @@ -1229,43 +1219,22 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang } void -Region::freeze () +Region::suspend_property_changes () { - _frozen++; + Stateful::suspend_property_changes (); _last_length = _length; _last_position = _position; } void -Region::thaw () +Region::mid_thaw (const PropertyChange& what_changed) { - PropertyChange what_changed; - - { - Glib::Mutex::Lock lm (_lock); - - if (_frozen && --_frozen > 0) { - return; - } - - if (!_pending_changed.empty()) { - what_changed = _pending_changed; - _pending_changed.clear (); - } - } - - if (what_changed.empty()) { - return; - } - if (what_changed.contains (Properties::length)) { if (what_changed.contains (Properties::position)) { recompute_at_start (); } recompute_at_end (); } - - send_change (what_changed); } void @@ -1275,15 +1244,7 @@ Region::send_change (const PropertyChange& what_changed) return; } - { - Glib::Mutex::Lock lm (_lock); - if (_frozen) { - _pending_changed.add (what_changed); - return; - } - } - - PropertyChanged (what_changed); + Stateful::send_change (what_changed); if (!_no_property_changes) { @@ -1294,12 +1255,10 @@ Region::send_change (const PropertyChange& what_changed) try { boost::shared_ptr<Region> rptr = shared_from_this(); RegionPropertyChanged (rptr, what_changed); - } catch (...) { /* no shared_ptr available, relax; */ } } - } void @@ -1584,16 +1543,26 @@ Region::set_property (const PropertyBase& prop) } else if (prop == Properties::position_locked.property_id) { _position_locked = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); } else if (prop == Properties::start.property_id) { - _start = dynamic_cast<const PropertyTemplate<framepos_t>*>(&prop)->val(); + framepos_t val = dynamic_cast<const PropertyTemplate<framepos_t>*>(&prop)->val(); + if (val != _start) { + DEBUG_TRACE (DEBUG::Properties, string_compose ("region %1 start changed from %2 to %3", + _name.val(), _start, val)); + _start = val; + return true; + } } else if (prop == Properties::length.property_id) { framecnt_t val = dynamic_cast<const PropertyTemplate<framecnt_t>* > (&prop)->val(); if (val != _length) { + DEBUG_TRACE (DEBUG::Properties, string_compose ("region %1 length changed from %2 to %3", + _name.val(), _length, val)); _length = val; return true; } } else if (prop == Properties::position.property_id) { framepos_t val = dynamic_cast<const PropertyTemplate<framepos_t>*>(&prop)->val(); if (val != _position) { + DEBUG_TRACE (DEBUG::Properties, string_compose ("region %1 position changed from %2 to %3", + _name.val(), _position, val)); _position = val; return true; } diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index d2c5fa1b22..3f4af2462c 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -67,7 +67,6 @@ RegionFactory::create (boost::shared_ptr<const Region> region) } if (ret) { - ret->unlock_property_changes (); map_add (ret); /* pure copy constructor - no property list */ @@ -106,10 +105,7 @@ RegionFactory::create (boost::shared_ptr<Region> region, frameoffset_t offset, c } if (ret) { - ret->set_properties (plist); - ret->unlock_property_changes (); - map_add (ret); if (announce) { @@ -149,10 +145,7 @@ RegionFactory::create (boost::shared_ptr<Region> region, const PropertyList& pli } if (ret) { - ret->set_properties (plist); - ret->unlock_property_changes (); - map_add (ret); if (announce) { @@ -195,8 +188,6 @@ RegionFactory::create (boost::shared_ptr<Region> region, const SourceList& srcs, if (ret) { ret->set_properties (plist); - ret->unlock_property_changes (); - map_add (ret); if (announce) { @@ -242,8 +233,6 @@ RegionFactory::create (const SourceList& srcs, const PropertyList& plist, bool a if (ret) { ret->set_properties (plist); - ret->unlock_property_changes (); - map_add (ret); if (announce) { @@ -290,7 +279,6 @@ RegionFactory::create (SourceList& srcs, const XMLNode& node) if (ret->set_state (node, Stateful::loading_state_version)) { ret.reset (); } else { - ret->unlock_property_changes (); map_add (ret); CheckNewRegion (ret); } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 0c2f12d91d..53c8ea2350 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3847,7 +3847,7 @@ Session::allocate_pan_automation_buffers (nframes_t nframes, uint32_t howmany, b } int -Session::freeze (InterThreadInfo& itt) +Session::freeze_all (InterThreadInfo& itt) { shared_ptr<RouteList> r = routes.reader (); @@ -3859,7 +3859,7 @@ Session::freeze (InterThreadInfo& itt) /* XXX this is wrong because itt.progress will keep returning to zero at the start of every track. */ - t->freeze (itt); + t->freeze_me (itt); } } |