diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-23 20:14:07 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-23 20:14:07 +0000 |
commit | f4401c59284258c6aa56707da64e3da32756329f (patch) | |
tree | 73679199ae43516347d607adad212c10612f7eb9 /libs/pbd/undo.cc | |
parent | cac03dbeb6ebdcd406385dd14a746cb8c51dd5f8 (diff) |
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
Diffstat (limited to 'libs/pbd/undo.cc')
-rw-r--r-- | libs/pbd/undo.cc | 28 |
1 files changed, 3 insertions, 25 deletions
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 */ } |