comparison layer/WaveformLayer.cpp @ 4:ce747045a023

* Invalidate cache when model replaced
author Chris Cannam
date Thu, 12 Jan 2006 13:43:15 +0000
parents 77dad696d740
children 02aaea1ffaf7
comparison
equal deleted inserted replaced
3:7af44e8578c8 4:ce747045a023
1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */ 1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */
2 2
3 /* 3 /*
4 A waveform viewer and audio annotation editor. 4 A waveform viewer and audio annotation editor.
5 Chris Cannam, Queen Mary University of London, 2005 5 Chris Cannam, Queen Mary University of London, 2005-2006
6 6
7 This is experimental software. Not for distribution. 7 This is experimental software. Not for distribution.
8 */ 8 */
9 9
10 #include "WaveformLayer.h" 10 #include "WaveformLayer.h"
16 #include <QPainter> 16 #include <QPainter>
17 #include <QPixmap> 17 #include <QPixmap>
18 18
19 #include <iostream> 19 #include <iostream>
20 #include <cmath> 20 #include <cmath>
21
22 //#define DEBUG_WAVEFORM_PAINT 1
21 23
22 using std::cerr; 24 using std::cerr;
23 using std::endl; 25 using std::endl;
24 26
25 WaveformLayer::WaveformLayer(View *w) : 27 WaveformLayer::WaveformLayer(View *w) :
392 y1 = rect.bottom(); 394 y1 = rect.bottom();
393 395
394 long frame0 = startFrame + x0 * zoomLevel; 396 long frame0 = startFrame + x0 * zoomLevel;
395 long frame1 = startFrame + (x1 + 1) * zoomLevel; 397 long frame1 = startFrame + (x1 + 1) * zoomLevel;
396 398
397 // std::cerr << "Painting waveform from " << frame0 << " to " << frame1 << " (" << (x1-x0+1) << " pixels at zoom " << zoomLevel << ")" << std::endl; 399 #ifdef DEBUG_WAVEFORM_PAINT
400 std::cerr << "Painting waveform from " << frame0 << " to " << frame1 << " (" << (x1-x0+1) << " pixels at zoom " << zoomLevel << ")" << std::endl;
401 #endif
398 402
399 RangeSummarisableTimeValueModel::RangeBlock ranges; 403 RangeSummarisableTimeValueModel::RangeBlock ranges;
400 RangeSummarisableTimeValueModel::RangeBlock otherChannelRanges; 404 RangeSummarisableTimeValueModel::RangeBlock otherChannelRanges;
401 RangeSummarisableTimeValueModel::Range range; 405 RangeSummarisableTimeValueModel::Range range;
402 406