/* playlist "callbacks" */
void notify_crossfade_added (boost::shared_ptr<Crossfade>);
- void flush_notifications ();
+ void flush_notifications (bool);
void finalize_split_region (boost::shared_ptr<Region> orig, boost::shared_ptr<Region> left, boost::shared_ptr<Region> right);
virtual void playlist_changed (const PBD::PropertyChange&);
virtual void playlist_deleted (boost::weak_ptr<Playlist>);
- virtual void playlist_ranges_moved (std::list< Evoral::RangeMove<framepos_t> > const &);
+ virtual void playlist_ranges_moved (std::list< Evoral::RangeMove<framepos_t> > const &, bool);
virtual void transport_stopped_wallclock (struct tm&, time_t, bool abort) = 0;
virtual void transport_looped (nframes_t transport_frame) = 0;
PBD::Signal0<void> NameChanged;
PBD::Signal0<void> LengthChanged;
PBD::Signal0<void> LayeringChanged;
- PBD::Signal1<void,std::list< Evoral::RangeMove<framepos_t> > const &> RangesMoved;
+ PBD::Signal2<void,std::list< Evoral::RangeMove<framepos_t> > const &, bool> RangesMoved;
static std::string bump_name (std::string old_name, Session&);
void freeze ();
- void thaw ();
+ void thaw (bool from_undo = false);
void raise_region (boost::shared_ptr<Region>);
void lower_region (boost::shared_ptr<Region>);
}
void delay_notifications ();
- void release_notifications ();
- virtual void flush_notifications ();
+ void release_notifications (bool from_undo = false);
+ virtual void flush_notifications (bool from_undo = false);
void clear_pending ();
void _set_sort_id ();
void
-AudioPlaylist::flush_notifications ()
+AudioPlaylist::flush_notifications (bool from_undo)
{
- Playlist::flush_notifications();
+ Playlist::flush_notifications (from_undo);
if (in_flush) {
return;
_playlist->ContentsChanged.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_modified, this));
_playlist->DropReferences.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_deleted, this, boost::weak_ptr<Playlist>(_playlist)));
- _playlist->RangesMoved.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_ranges_moved, this, _1));
+ _playlist->RangesMoved.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_ranges_moved, this, _1, _2));
}
/* don't do this if we've already asked for it *or* if we are setting up
}
void
-Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<framepos_t> > const & movements_frames)
+Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<framepos_t> > const & movements_frames, bool from_undo)
{
+ /* If we're coming from an undo, it will have handled
+ automation undo (it must, since automation-follows-regions
+ can lose automation data). Hence we can do nothing here.
+ */
+
+ if (from_undo) {
+ return;
+ }
+
if (!_track || Config->get_automation_follows_regions () == false) {
return;
}
set<Evoral::Parameter> const a = processor->what_can_be_automated ();
+ cout << "move processor auto for " << processor->name() << "\n";
+
for (set<Evoral::Parameter>::iterator i = a.begin (); i != a.end (); ++i) {
+ cout << "moving " << *i << "\n";
boost::shared_ptr<AutomationList> al = processor->automation_control(*i)->alist();
XMLNode & before = al->get_state ();
al->move_ranges (movements);
void
Playlist::end_undo ()
{
- thaw ();
+ thaw (true);
in_update = false;
}
g_atomic_int_inc (&ignore_state_changes);
}
+/** @param from_undo true if this thaw is triggered by the end of an undo on this playlist */
void
-Playlist::thaw ()
+Playlist::thaw (bool from_undo)
{
g_atomic_int_dec_and_test (&ignore_state_changes);
- release_notifications ();
+ release_notifications (from_undo);
}
freeze_length = _get_extent().second;
}
+/** @param from_undo true if this release is triggered by the end of an undo on this playlist */
void
-Playlist::release_notifications ()
+Playlist::release_notifications (bool from_undo)
{
if (g_atomic_int_dec_and_test (&block_notifications)) {
- flush_notifications ();
+ flush_notifications (from_undo);
}
}
list< Evoral::RangeMove<framepos_t> > m;
m.push_back (move);
- RangesMoved (m);
+ RangesMoved (m, false);
}
}
}
}
+/** @param from_undo true if this flush is triggered by the end of an undo on this playlist */
void
-Playlist::flush_notifications ()
+Playlist::flush_notifications (bool from_undo)
{
set<boost::shared_ptr<Region> > dependent_checks_needed;
set<boost::shared_ptr<Region> >::iterator s;
}
if (!pending_range_moves.empty ()) {
- // cerr << _name << " sends RangesMoved\n";
- RangesMoved (pending_range_moves);
+ RangesMoved (pending_range_moves, from_undo);
}
clear_pending ();