comparison layer/WaveformLayer.cpp @ 248:28c8e8e3c537

* Fix many compile warnings, remove some debug output
author Chris Cannam
date Mon, 30 Apr 2007 13:36:23 +0000
parents 34bbbcb3c01f
children 11021509c4eb
comparison
equal deleted inserted replaced
247:0e9f59f991aa 248:28c8e8e3c537
367 return completion; 367 return completion;
368 } 368 }
369 369
370 bool 370 bool
371 WaveformLayer::getValueExtents(float &min, float &max, 371 WaveformLayer::getValueExtents(float &min, float &max,
372 bool &log, QString &unit) const 372 bool &, QString &unit) const
373 { 373 {
374 if (m_scale == LinearScale) { 374 if (m_scale == LinearScale) {
375 min = 0.0; 375 min = 0.0;
376 max = 1.0; 376 max = 1.0;
377 unit = "V"; 377 unit = "V";
999 WaveformLayer::getYForValue(View *v, Scale scale, float value, size_t channel, 999 WaveformLayer::getYForValue(View *v, Scale scale, float value, size_t channel,
1000 size_t minChannel, size_t maxChannel) const 1000 size_t minChannel, size_t maxChannel) const
1001 { 1001 {
1002 if (maxChannel < minChannel || channel < minChannel) return 0; 1002 if (maxChannel < minChannel || channel < minChannel) return 0;
1003 1003
1004 int w = v->width();
1005 int h = v->height(); 1004 int h = v->height();
1006 1005
1007 int channels = maxChannel - minChannel + 1; 1006 int channels = maxChannel - minChannel + 1;
1008 int m = (h / channels) / 2; 1007 int m = (h / channels) / 2;
1009 int my = m + (((channel - minChannel) * h) / channels); 1008 int my = m + (((channel - minChannel) * h) / channels);
1033 1032
1034 return my - vy; 1033 return my - vy;
1035 } 1034 }
1036 1035
1037 int 1036 int
1038 WaveformLayer::getVerticalScaleWidth(View *v, QPainter &paint) const 1037 WaveformLayer::getVerticalScaleWidth(View *, QPainter &paint) const
1039 { 1038 {
1040 if (m_scale == LinearScale) { 1039 if (m_scale == LinearScale) {
1041 return paint.fontMetrics().width("0.0") + 13; 1040 return paint.fontMetrics().width("0.0") + 13;
1042 } else { 1041 } else {
1043 return std::max(paint.fontMetrics().width(tr("0dB")), 1042 return std::max(paint.fontMetrics().width(tr("0dB")),