From f4401c59284258c6aa56707da64e3da32756329f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 23 Jun 2010 20:14:07 +0000 Subject: midway snapshot of work done on managing Region & Source lifetimes correctly. may fix missing MIDI file bug ; save empty playlists because they may be referred to by the history file ; undo commands auto-delete when objects they refer to die (currently not commands built from XML deserialization); Sources now know how many regions are using them for something, meaning that we know if we can delete the files holding any data for the source git-svn-id: svn://localhost/ardour2/branches/3.0@7291 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/undo.cc | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'libs/pbd/undo.cc') diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc index a06127926f..120f62c351 100644 --- a/libs/pbd/undo.cc +++ b/libs/pbd/undo.cc @@ -39,7 +39,6 @@ UndoTransaction::UndoTransaction () UndoTransaction::UndoTransaction (const UndoTransaction& rhs) : Command(rhs._name) - , PBD::ScopedConnectionList () , _clearing(false) { clear (); @@ -77,15 +76,15 @@ UndoTransaction::operator= (const UndoTransaction& rhs) } void -UndoTransaction::add_command (Command *const action) +UndoTransaction::add_command (Command *const cmd) { /* catch death of command (e.g. caused by death of object to which it refers. command_death() is a normal static function so there is no need to manage this connection. */ - action->DropReferences.connect_same_thread (*this, boost::bind (&command_death, this, action)); - actions.push_back (action); + cmd->DropReferences.connect_same_thread (*this, boost::bind (&command_death, this, cmd)); + actions.push_back (cmd); } void @@ -250,9 +249,6 @@ UndoHistory::undo (unsigned int n) return; } - struct timeval start, end, diff; - gettimeofday (&start, 0); - { UndoRedoSignaller exception_safe_signaller (*this); @@ -265,16 +261,8 @@ UndoHistory::undo (unsigned int n) ut->undo (); RedoList.push_back (ut); } - gettimeofday (&end, 0); - timersub (&end, &start, &diff); - cerr << "Undo-pre-signals took " << diff.tv_sec << '.' << diff.tv_usec << endl; - } - gettimeofday (&end, 0); - timersub (&end, &start, &diff); - cerr << "Undo took " << diff.tv_sec << '.' << diff.tv_usec << endl; - Changed (); /* EMIT SIGNAL */ } @@ -285,9 +273,6 @@ UndoHistory::redo (unsigned int n) return; } - struct timeval start, end, diff; - gettimeofday (&start, 0); - { UndoRedoSignaller exception_safe_signaller (*this); @@ -300,15 +285,8 @@ UndoHistory::redo (unsigned int n) ut->redo (); UndoList.push_back (ut); } - gettimeofday (&end, 0); - timersub (&end, &start, &diff); - cerr << "Redo-pre-signals took " << diff.tv_sec << '.' << diff.tv_usec << endl; } - gettimeofday (&end, 0); - timersub (&end, &start, &diff); - cerr << "Redo took " << diff.tv_sec << '.' << diff.tv_usec << endl; - Changed (); /* EMIT SIGNAL */ } -- cgit v1.2.3