comparison base/View.cpp @ 117:c30728d5625c sv1-v0.9rc1

* Make vertical scale alignment modes work in note layer as well as time-value layer, and several significant fixes to it * Make it possible to draw notes properly on the note layer * Show units (and frequencies etc in note layer's case) in the time-value and note layer description boxes * Minor fix to item edit dialog layout * Some minor menu rearrangement * Comment out a lot of debug output * Add SV website and reference URLs to Help menu, and add code to (attempt to) open them in the user's preferred browser
author Chris Cannam
date Fri, 12 May 2006 14:40:43 +0000
parents 1be256ac7681
children e388730429b5
comparison
equal deleted inserted replaced
116:a08718723b20 117:c30728d5625c
57 // QWidget::setAttribute(Qt::WA_PaintOnScreen); 57 // QWidget::setAttribute(Qt::WA_PaintOnScreen);
58 } 58 }
59 59
60 View::~View() 60 View::~View()
61 { 61 {
62 std::cerr << "View::~View(" << this << ")" << std::endl; 62 // std::cerr << "View::~View(" << this << ")" << std::endl;
63 63
64 m_deleting = true; 64 m_deleting = true;
65 delete m_propertyContainer; 65 delete m_propertyContainer;
66 } 66 }
67 67
160 if (i == 0) return m_propertyContainer; 160 if (i == 0) return m_propertyContainer;
161 return m_layers[i-1]; 161 return m_layers[i-1];
162 } 162 }
163 163
164 bool 164 bool
165 View::getValueExtents(QString unit, float &min, float &max) const 165 View::getValueExtents(QString unit, float &min, float &max, bool &log) const
166 { 166 {
167 bool have = false; 167 bool have = false;
168 168
169 for (LayerList::const_iterator i = m_layers.begin(); 169 for (LayerList::const_iterator i = m_layers.begin();
170 i != m_layers.end(); ++i) { 170 i != m_layers.end(); ++i) {
171 171
172 QString layerUnit; 172 QString layerUnit;
173 float layerMin, layerMax; 173 float layerMin = 0.0, layerMax = 0.0;
174 174 float displayMin = 0.0, displayMax = 0.0;
175 if ((*i)->getValueExtents(layerMin, layerMax, layerUnit) && 175 bool layerLog = false;
176
177 if ((*i)->getValueExtents(layerMin, layerMax, layerLog, layerUnit) &&
176 layerUnit.toLower() == unit.toLower()) { 178 layerUnit.toLower() == unit.toLower()) {
177 179
178 if (!have || layerMin < min) min = layerMin; 180 if ((*i)->getDisplayExtents(displayMin, displayMax)) {
179 if (!have || layerMax > max) max = layerMax; 181
180 have = true; 182 min = displayMin;
183 max = displayMax;
184 log = layerLog;
185 have = true;
186 break;
187
188 } else {
189
190 if (!have || layerMin < min) min = layerMin;
191 if (!have || layerMax > max) max = layerMax;
192 if (layerLog) log = true;
193 have = true;
194 }
181 } 195 }
182 } 196 }
183 197
184 return have; 198 return have;
185 } 199 }
243 } 257 }
244 258
245 void 259 void
246 View::toolModeChanged() 260 View::toolModeChanged()
247 { 261 {
248 std::cerr << "View::toolModeChanged(" << m_manager->getToolMode() << ")" << std::endl; 262 // std::cerr << "View::toolModeChanged(" << m_manager->getToolMode() << ")" << std::endl;
249 } 263 }
250 264
251 long 265 long
252 View::getStartFrame() const 266 View::getStartFrame() const
253 { 267 {