diff layer/TimeInstantLayer.cpp @ 21:3a506d25d95a

* Add command history class, and basic undo/redo menus. No actual commands to undo/redo yet. Selecting the placeholders sometimes seems to cause a crash, so this looks a little uncertain so far. * Add Rename Layer * Remove models from playback when their layers are removed (and ref counts hit zero) * Don't hang around waiting so much when there's work to be done in the audio buffer fill thread * Put more sensible names on layers generated from transforms * Add basic editing to time-value layer like existing editing in time-instants layer, and make both of them snap to the appropriate resolution during drag
author Chris Cannam
date Mon, 30 Jan 2006 17:51:56 +0000
parents 1deb5f87a18c
children 179bf7b5ddea
line wrap: on
line diff
--- a/layer/TimeInstantLayer.cpp	Mon Jan 30 13:19:42 2006 +0000
+++ b/layer/TimeInstantLayer.cpp	Mon Jan 30 17:51:56 2006 +0000
@@ -348,6 +348,7 @@
 
     long frame = getFrameForX(e->x());
     if (frame < 0) frame = 0;
+    frame = frame / m_model->getResolution() * m_model->getResolution();
     m_editingPoint = SparseOneDimensionalModel::Point(frame, tr("New Point"));
     m_model->addPoint(m_editingPoint);
     m_editing = true;
@@ -362,6 +363,7 @@
 
     long frame = getFrameForX(e->x());
     if (frame < 0) frame = 0;
+    frame = frame / m_model->getResolution() * m_model->getResolution();
     m_model->deletePoint(m_editingPoint);
     m_editingPoint.frame = frame;
     m_model->addPoint(m_editingPoint);
@@ -398,6 +400,7 @@
 
     long frame = getFrameForX(e->x());
     if (frame < 0) frame = 0;
+    frame = frame / m_model->getResolution() * m_model->getResolution();
     m_model->deletePoint(m_editingPoint);
     m_editingPoint.frame = frame;
     m_model->addPoint(m_editingPoint);