comparison widgets/PropertyBox.cpp @ 1051:c02c51ae5238 3.0-plus-imaf

Merge branches 3.0-integration and imaf_enc to 3.0-plus-imaf
author Chris Cannam
date Wed, 20 Apr 2016 12:06:28 +0100
parents 3f7cdfc56dce 282f4be8f058
children
comparison
equal deleted inserted replaced
1050:3691af49291c 1051:c02c51ae5238
46 46
47 #include <cassert> 47 #include <cassert>
48 #include <iostream> 48 #include <iostream>
49 #include <cmath> 49 #include <cmath>
50 50
51 #include "Fader.h"
51 //#define DEBUG_PROPERTY_BOX 1 52 //#define DEBUG_PROPERTY_BOX 1
52 53
54 QHBoxLayout *layout1 = new QHBoxLayout;
55 int tracks=0;
56 extern bool isIMAF;
57 //#include "C:/Users/Paco/Desktop/SV mio/sonic-visualiser/main/imafdecoder.h"
53 PropertyBox::PropertyBox(PropertyContainer *container) : 58 PropertyBox::PropertyBox(PropertyContainer *container) :
54 m_container(container), 59 m_container(container),
55 m_showButton(0), 60 m_showButton(0),
56 m_playButton(0) 61 m_playButton(0)
57 { 62 {
115 { 120 {
116 #ifdef DEBUG_PROPERTY_BOX 121 #ifdef DEBUG_PROPERTY_BOX
117 cerr << "PropertyBox[" << this << "]::~PropertyBox" << endl; 122 cerr << "PropertyBox[" << this << "]::~PropertyBox" << endl;
118 #endif 123 #endif
119 } 124 }
125
120 126
121 void 127 void
122 PropertyBox::populateViewPlayFrame() 128 PropertyBox::populateViewPlayFrame()
123 { 129 {
124 #ifdef DEBUG_PROPERTY_BOX 130 #ifdef DEBUG_PROPERTY_BOX
202 connect(playParamButton, SIGNAL(clicked()), 208 connect(playParamButton, SIGNAL(clicked()),
203 this, SLOT(editPlayParameters())); 209 this, SLOT(editPlayParameters()));
204 } 210 }
205 211
206 AudioDial *gainDial = new AudioDial; 212 AudioDial *gainDial = new AudioDial;
207 layout->addWidget(gainDial); 213 layout->addWidget(gainDial);
208 gainDial->setMeterColor(Qt::darkRed); 214 gainDial->setMeterColor(Qt::darkRed);
209 gainDial->setMinimum(-50); 215 gainDial->setMinimum(-50);
210 gainDial->setMaximum(50); 216 gainDial->setMaximum(50);
211 gainDial->setPageStep(1); 217 gainDial->setPageStep(1);
212 gainDial->setFixedWidth(24); 218 gainDial->setFixedWidth(24);
213 gainDial->setFixedHeight(24); 219 gainDial->setFixedHeight(24);
214 gainDial->setNotchesVisible(false); 220 gainDial->setNotchesVisible(false);
215 gainDial->setDefaultValue(0); 221 gainDial->setDefaultValue(0);
216 gainDial->setObjectName(tr("Playback Gain")); 222 gainDial->setObjectName(tr("Playback Gain"));
217 gainDial->setRangeMapper(new LinearRangeMapper 223 gainDial->setRangeMapper(new LinearRangeMapper
218 (-50, 50, -25, 25, tr("dB"))); 224 (-50, 50, -25, 25, tr("dB")));
227 this, SLOT(mouseEnteredWidget())); 233 this, SLOT(mouseEnteredWidget()));
228 connect(gainDial, SIGNAL(mouseLeft()), 234 connect(gainDial, SIGNAL(mouseLeft()),
229 this, SLOT(mouseLeftWidget())); 235 this, SLOT(mouseLeftWidget()));
230 playGainChanged(params->getPlayGain()); 236 playGainChanged(params->getPlayGain());
231 layout->setAlignment(gainDial, Qt::AlignVCenter); 237 layout->setAlignment(gainDial, Qt::AlignVCenter);
238
239
240 /*
241 //code added by Jesus
242
243 if (isIMAF){
244 QString property_container_name; // the name could be : Waveform, Time Instants, etc
245 property_container_name = layer->getPropertyContainerName();// obtain the name
246 bool isWaveform;
247
248 isWaveform = property_container_name.contains("Waveform", Qt::CaseInsensitive);//if QString contains "Waveform"
249
250 if (isWaveform == true){
251 tracks++;
252
253 AudioDial *gainDial1 = new AudioDial;
254 gainDial1->setMeterColor(Qt::darkRed);
255 gainDial1->setMinimum(-63);
256 gainDial1->setMaximum(10);
257 gainDial1->setPageStep(1);
258 gainDial1->setFixedWidth(60);
259 gainDial1->setFixedHeight(60);
260 gainDial1->setNotchesVisible(false);
261 gainDial1->setDefaultValue(0);
262 gainDial1->setObjectName(tr("Playback Gain"));
263 gainDial1->setRangeMapper(new LinearRangeMapper
264 (-50, 50, -25, 25, tr("dB")));
265 gainDial1->setShowToolTip(true);
266 connect(gainDial1, SIGNAL(valueChanged(int)),
267 this, SLOT(playGainDialChanged(int)));
268 connect(params, SIGNAL(playGainChanged(float)),
269 this, SLOT(playGainChanged(float)));
270 connect(this, SIGNAL(changePlayGainDial(int)),
271 gainDial1, SLOT(setValue(int)));
272 connect(gainDial1, SIGNAL(mouseEntered()),
273 this, SLOT(mouseEnteredWidget()));
274 connect(gainDial1, SIGNAL(mouseLeft()),
275 this, SLOT(mouseLeftWidget()));
276 playGainChanged(params->getPlayGain());
277 layout1->setAlignment(gainDial1, Qt::AlignVCenter);
278
279 QWidget *window = new QWidget;
280
281
282 // QLabel *showLabel1 = new QLabel(tr("Track"));
283 // layout1->addWidget(showLabel1);
284 // layout1->setAlignment(showLabel1, Qt::AlignVCenter);
285
286 layout1->addWidget(gainDial1);
287 if (tracks==3){
288 window->setLayout(layout1);
289 window ->showNormal();
290 }
291 } // end if isWaveform
292 } // end if isIMAF
293 // end code added by Jesus
294 */
232 295
233 AudioDial *panDial = new AudioDial; 296 AudioDial *panDial = new AudioDial;
234 layout->addWidget(panDial); 297 layout->addWidget(panDial);
235 panDial->setMeterColor(Qt::darkGreen); 298 panDial->setMeterColor(Qt::darkGreen);
236 panDial->setMinimum(-50); 299 panDial->setMinimum(-50);