Mercurial > hg > svgui
comparison layer/TimeRulerLayer.cpp @ 30:ea6fe8cfcdd5
* Add the Note layer for pianoroll-type display of note-type data
* Complete the MIDI file importer (well, nearly -- it would be nice to
be able to import the non-note data as other sorts of models, and that's
not done yet).
* Minor refactoring in RealTime etc
author | Chris Cannam |
---|---|
date | Fri, 10 Feb 2006 17:51:36 +0000 |
parents | 2d5005f2b3d9 |
children | ad214997dddb |
comparison
equal
deleted
inserted
replaced
29:9f55af9676b4 | 30:ea6fe8cfcdd5 |
---|---|
183 | 183 |
184 RealTime rt = RealTime::frame2RealTime(rectStart, sampleRate); | 184 RealTime rt = RealTime::frame2RealTime(rectStart, sampleRate); |
185 long ms = rt.sec * 1000 + rt.msec(); | 185 long ms = rt.sec * 1000 + rt.msec(); |
186 ms = (ms / incms) * incms - incms; | 186 ms = (ms / incms) * incms - incms; |
187 | 187 |
188 RealTime incRt = RealTime(incms / 1000, (incms % 1000) * 1000000); | 188 RealTime incRt = RealTime::fromMilliseconds(incms); |
189 long incFrame = RealTime::realTime2Frame(incRt, sampleRate); | 189 long incFrame = RealTime::realTime2Frame(incRt, sampleRate); |
190 int incX = incFrame / zoomLevel; | 190 int incX = incFrame / zoomLevel; |
191 int ticks = 10; | 191 int ticks = 10; |
192 if (incX < minPixelSpacing * 2) { | 192 if (incX < minPixelSpacing * 2) { |
193 ticks = quarter ? 4 : 5; | 193 ticks = quarter ? 4 : 5; |
205 greyColour = m_colour.light(150); | 205 greyColour = m_colour.light(150); |
206 } | 206 } |
207 | 207 |
208 while (1) { | 208 while (1) { |
209 | 209 |
210 rt = RealTime(ms / 1000, (ms % 1000) * 1000000); | 210 rt = RealTime::fromMilliseconds(ms); |
211 ms += incms; | 211 ms += incms; |
212 | 212 |
213 long frame = RealTime::realTime2Frame(rt, sampleRate); | 213 long frame = RealTime::realTime2Frame(rt, sampleRate); |
214 if (frame >= rectEnd) break; | 214 if (frame >= rectEnd) break; |
215 | 215 |