comparison layer/WaveformLayer.cpp @ 267:4ed1446ad604

* more on measurement tool -- pull out some logic from pane to layer &c still more to do
author Chris Cannam
date Thu, 21 Jun 2007 16:12:00 +0000
parents dae479593572
children b9380f679f70
comparison
equal deleted inserted replaced
266:aee39d8c0b83 267:4ed1446ad604
993 993
994 return text; 994 return text;
995 } 995 }
996 996
997 int 997 int
998 WaveformLayer::getYForValue(View *v, Scale scale, float value, size_t channel, 998 WaveformLayer::getYForValue(const View *v, Scale scale, float value, size_t channel,
999 size_t minChannel, size_t maxChannel) const 999 size_t minChannel, size_t maxChannel) const
1000 { 1000 {
1001 if (maxChannel < minChannel || channel < minChannel) return 0; 1001 if (maxChannel < minChannel || channel < minChannel) return 0;
1002 1002
1003 int h = v->height(); 1003 int h = v->height();
1031 1031
1032 return my - vy; 1032 return my - vy;
1033 } 1033 }
1034 1034
1035 float 1035 float
1036 WaveformLayer::getValueForY(View *v, Scale scale, int y, 1036 WaveformLayer::getValueForY(const View *v, Scale scale, int y,
1037 size_t minChannel, size_t maxChannel) const 1037 size_t minChannel, size_t maxChannel) const
1038 { 1038 {
1039 if (maxChannel < minChannel) return 0; 1039 if (maxChannel < minChannel) return 0;
1040 1040
1041 int h = v->height(); 1041 int h = v->height();
1083 1083
1084 return value; 1084 return value;
1085 } 1085 }
1086 1086
1087 bool 1087 bool
1088 WaveformLayer::getYScaleValue(View *v, int y, 1088 WaveformLayer::getYScaleValue(const View *v, int y,
1089 float &value, QString &unit) const 1089 float &value, QString &unit) const
1090 { 1090 {
1091 size_t channels = 0, minChannel = 0, maxChannel = 0; 1091 size_t channels = 0, minChannel = 0, maxChannel = 0;
1092 bool mergingChannels = false, mixingChannels = false; 1092 bool mergingChannels = false, mixingChannels = false;
1093 1093