diff options
author | Robert Jonsson <spamatica@gmail.com> | 2011-04-19 19:33:42 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2011-04-19 19:33:42 +0000 |
commit | 0b8e29363db66ddbd0dac925bb57b75310a93eba (patch) | |
tree | 9cc4eeee00a868bb338de5ce67299e36bb4a69a2 /muse2/muse/undo.cpp | |
parent | aab05a914e357938f0ccb3d592186320e0646366 (diff) |
undo for keymap
Diffstat (limited to 'muse2/muse/undo.cpp')
-rw-r--r-- | muse2/muse/undo.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/muse2/muse/undo.cpp b/muse2/muse/undo.cpp index 8d218b0f..44d37591 100644 --- a/muse2/muse/undo.cpp +++ b/muse2/muse/undo.cpp @@ -8,6 +8,7 @@ ///#include "sig.h" #include "al/sig.h" // Tim. +#include "keyevent.h" #include "undo.h" #include "song.h" @@ -72,6 +73,8 @@ void UndoOp::dump() case DeleteSig: case ModifyClip: case ModifyMarker: + case AddKey: + case DeleteKey: break; } } @@ -432,6 +435,16 @@ void Song::doUndo2() AL::sigmap.add(i->a, AL::TimeSignature(i->b, i->c)); updateFlags |= SC_SIG; break; + case UndoOp::AddKey: + ///sigmap.del(i->a); + keymap.delKey(i->a); + updateFlags |= SC_KEY; + break; + case UndoOp::DeleteKey: + ///sigmap.add(i->a, i->b, i->c); + keymap.addKey(i->a, (key_enum)i->b); + updateFlags |= SC_KEY; + break; case UndoOp::ModifyClip: case UndoOp::ModifyMarker: break; @@ -660,6 +673,14 @@ void Song::doRedo2() AL::sigmap.del(i->a); updateFlags |= SC_SIG; break; + case UndoOp::AddKey: + keymap.addKey(i->a, (key_enum)i->b); + updateFlags |= SC_KEY; + break; + case UndoOp::DeleteKey: + keymap.delKey(i->a); + updateFlags |= SC_KEY; + break; case UndoOp::ModifyClip: case UndoOp::ModifyMarker: break; |