diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-02-19 21:49:56 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-02-19 21:49:56 +0000 |
commit | d9d1a4a5cf5825945e68ee7e66018d3ae6f00b26 (patch) | |
tree | beeab484491f7ddc6239664033517170dadfd236 /libs/ardour | |
parent | fa701b8c065251d242342b86a54d91826d2290a0 (diff) |
add begin/end undo/redo signals so that playlist can freeze/thaw itself around potentially NxM region property changes; clean up debug output; don't connect streamview to Playlist::ContentsChanged because there appears to be no need for it - we catch add/remove region, and region property changes are handled by RegionView
git-svn-id: svn://localhost/ardour2/branches/3.0@6702 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/playlist.h | 2 | ||||
-rw-r--r-- | libs/ardour/audioregion.cc | 4 | ||||
-rw-r--r-- | libs/ardour/playlist.cc | 39 | ||||
-rw-r--r-- | libs/ardour/region.cc | 2 |
4 files changed, 24 insertions, 23 deletions
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 7213c99397..38469f4723 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -296,6 +296,8 @@ class Playlist : public SessionObject int move_region_to_layer (layer_t, boost::shared_ptr<Region> r, int dir); void relayer (); + void begin_undo (); + void end_undo (); void unset_freeze_parent (Playlist*); void unset_freeze_child (Playlist*); diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 21fda237cb..97ac214fdc 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -625,8 +625,6 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ _envelope->set_max_xval (_length); _envelope->truncate_end (_length); - cerr << _name << " envelope changd\n"; - } else if (child->name() == "FadeIn") { @@ -648,7 +646,6 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ set_fade_in_active (false); } } - cerr << _name << " fadein changd\n"; } else if (child->name() == "FadeOut") { @@ -670,7 +667,6 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ set_fade_out_active (false); } } - cerr << _name << " fadeout changd\n"; } } diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index f3a9c99497..815970a276 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -278,6 +278,9 @@ Playlist::init (bool hide) freeze_length = 0; _explicit_relayering = false; + _session.history().BeginUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::begin_undo, this)); + _session.history().EndUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::end_undo, this)); + ContentsChanged.connect_same_thread (*this, boost::bind (&Playlist::mark_session_dirty, this)); } @@ -321,6 +324,18 @@ Playlist::set_name (const string& str) ***********************************************************************/ void +Playlist::begin_undo () +{ + freeze (); +} + +void +Playlist::end_undo () +{ + thaw (); +} + +void Playlist::freeze () { delay_notifications (); @@ -357,9 +372,7 @@ Playlist::notify_contents_changed () pending_contents_change = true; } else { pending_contents_change = false; - cerr << _name << "send contents change @ " << get_microseconds() << endl; ContentsChanged(); /* EMIT SIGNAL */ - cerr << _name << "done with cc @ " << get_microseconds() << endl; } } @@ -370,9 +383,7 @@ Playlist::notify_layering_changed () pending_layering = true; } else { pending_layering = false; - cerr << _name << "send layering @ " << get_microseconds() << endl; LayeringChanged(); /* EMIT SIGNAL */ - cerr << _name << "done with layering @ " << get_microseconds() << endl; } } @@ -429,9 +440,7 @@ Playlist::notify_region_added (boost::shared_ptr<Region> r) LengthChanged (); /* EMIT SIGNAL */ pending_contents_change = false; RegionAdded (boost::weak_ptr<Region> (r)); /* EMIT SIGNAL */ - cerr << _name << "send3 contents changed @ " << get_microseconds() << endl; ContentsChanged (); /* EMIT SIGNAL */ - cerr << _name << "done contents changed @ " << get_microseconds() << endl; } } @@ -444,9 +453,7 @@ Playlist::notify_length_changed () pending_length = false; LengthChanged(); /* EMIT SIGNAL */ pending_contents_change = false; - cerr << _name << "send4 contents change @ " << get_microseconds() << endl; ContentsChanged (); /* EMIT SIGNAL */ - cerr << _name << "done contents change @ " << get_microseconds() << endl; } } @@ -491,12 +498,12 @@ Playlist::flush_notifications () for (s = pending_removes.begin(); s != pending_removes.end(); ++s) { remove_dependents (*s); - cerr << _name << " sends RegionRemoved\n"; + // cerr << _name << " sends RegionRemoved\n"; RegionRemoved (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */ } for (s = pending_adds.begin(); s != pending_adds.end(); ++s) { - cerr << _name << " sends RegionAdded\n"; + // cerr << _name << " sends RegionAdded\n"; RegionAdded (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */ dependent_checks_needed.insert (*s); } @@ -504,13 +511,13 @@ Playlist::flush_notifications () if (check_length) { if (old_length != _get_maximum_extent()) { pending_length = true; - cerr << _name << " length has changed\n"; + // cerr << _name << " length has changed\n"; } } if (pending_length || (freeze_length != _get_maximum_extent())) { pending_length = false; - cerr << _name << " sends LengthChanged\n"; + // cerr << _name << " sends LengthChanged\n"; LengthChanged(); /* EMIT SIGNAL */ } @@ -519,9 +526,9 @@ Playlist::flush_notifications () relayer (); } pending_contents_change = false; - cerr << _name << " sends 5 contents change @ " << get_microseconds() << endl; + // cerr << _name << " sends 5 contents change @ " << get_microseconds() << endl; ContentsChanged (); /* EMIT SIGNAL */ - cerr << _name << "done contents change @ " << get_microseconds() << endl; + // cerr << _name << "done contents change @ " << get_microseconds() << endl; } for (s = dependent_checks_needed.begin(); s != dependent_checks_needed.end(); ++s) { @@ -529,7 +536,7 @@ Playlist::flush_notifications () } if (!pending_range_moves.empty ()) { - cerr << _name << " sends RangesMoved\n"; + // cerr << _name << " sends RangesMoved\n"; RangesMoved (pending_range_moves); } @@ -1530,9 +1537,7 @@ Playlist::clear (bool with_signals) pending_length = false; LengthChanged (); pending_contents_change = false; - cerr << _name << "send2 contents change @ " << get_microseconds() << endl; ContentsChanged (); - cerr << _name << "done with contents changed @ " << get_microseconds() << endl; } } diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 9cd8d49411..d7b1eec2f7 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1144,8 +1144,6 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang { const XMLProperty* prop; - cerr << "about to call ::set_properties for an XMLNode\n"; - what_changed = set_properties (node); if ((prop = node.property (X_("id")))) { |