comparison 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
comparison
equal deleted inserted replaced
20:1deb5f87a18c 21:3a506d25d95a
346 346
347 if (!m_model) return; 347 if (!m_model) return;
348 348
349 long frame = getFrameForX(e->x()); 349 long frame = getFrameForX(e->x());
350 if (frame < 0) frame = 0; 350 if (frame < 0) frame = 0;
351 frame = frame / m_model->getResolution() * m_model->getResolution();
351 m_editingPoint = SparseOneDimensionalModel::Point(frame, tr("New Point")); 352 m_editingPoint = SparseOneDimensionalModel::Point(frame, tr("New Point"));
352 m_model->addPoint(m_editingPoint); 353 m_model->addPoint(m_editingPoint);
353 m_editing = true; 354 m_editing = true;
354 } 355 }
355 356
360 361
361 if (!m_model || !m_editing) return; 362 if (!m_model || !m_editing) return;
362 363
363 long frame = getFrameForX(e->x()); 364 long frame = getFrameForX(e->x());
364 if (frame < 0) frame = 0; 365 if (frame < 0) frame = 0;
366 frame = frame / m_model->getResolution() * m_model->getResolution();
365 m_model->deletePoint(m_editingPoint); 367 m_model->deletePoint(m_editingPoint);
366 m_editingPoint.frame = frame; 368 m_editingPoint.frame = frame;
367 m_model->addPoint(m_editingPoint); 369 m_model->addPoint(m_editingPoint);
368 } 370 }
369 371
396 398
397 if (!m_model || !m_editing) return; 399 if (!m_model || !m_editing) return;
398 400
399 long frame = getFrameForX(e->x()); 401 long frame = getFrameForX(e->x());
400 if (frame < 0) frame = 0; 402 if (frame < 0) frame = 0;
403 frame = frame / m_model->getResolution() * m_model->getResolution();
401 m_model->deletePoint(m_editingPoint); 404 m_model->deletePoint(m_editingPoint);
402 m_editingPoint.frame = frame; 405 m_editingPoint.frame = frame;
403 m_model->addPoint(m_editingPoint); 406 m_model->addPoint(m_editingPoint);
404 } 407 }
405 408