diff layer/SpectrogramLayer.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 6b794a2af3d9
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp	Mon Jan 30 13:19:42 2006 +0000
+++ b/layer/SpectrogramLayer.cpp	Mon Jan 30 17:51:56 2006 +0000
@@ -1103,31 +1103,19 @@
 bool
 SpectrogramLayer::getXBinRange(int x, float &s0, float &s1) const
 {
-//    long   startFrame;
-//    int    zoomLevel;
-    size_t modelStart;
-    size_t modelEnd;
-
-//    startFrame = m_view->getStartFrame();
-//    zoomLevel  = m_view->getZoomLevel();
-    modelStart = m_model->getStartFrame();
-    modelEnd   = m_model->getEndFrame();
+    size_t modelStart = m_model->getStartFrame();
+    size_t modelEnd = m_model->getEndFrame();
 
     // Each pixel column covers an exact range of sample frames:
     int f0 = getFrameForX(x) - modelStart;
     int f1 = getFrameForX(x + 1) - modelStart - 1;
 
-/*
-    int f0 = startFrame + x * zoomLevel - modelStart;
-    int f1 = f0 + zoomLevel - 1;
-*/
     if (f1 < int(modelStart) || f0 > int(modelEnd)) return false;
       
     // And that range may be drawn from a possibly non-integral
     // range of spectrogram windows:
 
     size_t windowIncrement = getWindowIncrement();
-
     s0 = float(f0) / windowIncrement;
     s1 = float(f1) / windowIncrement;