Mercurial > hg > svgui
comparison widgets/PropertyBox.cpp @ 675:3437e0fad7ae imaf_enc
IMAF load code from Jesus Corral Garcia
| author | Chris Cannam |
|---|---|
| date | Mon, 04 Nov 2013 17:09:36 +0000 |
| parents | 4806715f7a19 |
| children | d3cbfb11b70a |
comparison
equal
deleted
inserted
replaced
| 643:77fa3fdbfc7e | 675:3437e0fad7ae |
|---|---|
| 49 | 49 |
| 50 #include <cassert> | 50 #include <cassert> |
| 51 #include <iostream> | 51 #include <iostream> |
| 52 #include <cmath> | 52 #include <cmath> |
| 53 | 53 |
| 54 #include "Fader.h" | |
| 54 //#define DEBUG_PROPERTY_BOX 1 | 55 //#define DEBUG_PROPERTY_BOX 1 |
| 55 | 56 |
| 57 QHBoxLayout *layout1 = new QHBoxLayout; | |
| 58 int tracks=0; | |
| 59 //#include "C:/Users/Paco/Desktop/SV mio/sonic-visualiser/main/imafdecoder.h" | |
| 56 PropertyBox::PropertyBox(PropertyContainer *container) : | 60 PropertyBox::PropertyBox(PropertyContainer *container) : |
| 57 m_container(container), | 61 m_container(container), |
| 58 m_showButton(0), | 62 m_showButton(0), |
| 59 m_playButton(0) | 63 m_playButton(0) |
| 60 { | 64 { |
| 110 { | 114 { |
| 111 #ifdef DEBUG_PROPERTY_BOX | 115 #ifdef DEBUG_PROPERTY_BOX |
| 112 std::cerr << "PropertyBox[" << this << "]::~PropertyBox" << std::endl; | 116 std::cerr << "PropertyBox[" << this << "]::~PropertyBox" << std::endl; |
| 113 #endif | 117 #endif |
| 114 } | 118 } |
| 119 | |
| 115 | 120 |
| 116 void | 121 void |
| 117 PropertyBox::populateViewPlayFrame() | 122 PropertyBox::populateViewPlayFrame() |
| 118 { | 123 { |
| 119 #ifdef DEBUG_PROPERTY_BOX | 124 #ifdef DEBUG_PROPERTY_BOX |
| 196 connect(pluginButton, SIGNAL(clicked()), | 201 connect(pluginButton, SIGNAL(clicked()), |
| 197 this, SLOT(editPlugin())); | 202 this, SLOT(editPlugin())); |
| 198 } | 203 } |
| 199 | 204 |
| 200 AudioDial *gainDial = new AudioDial; | 205 AudioDial *gainDial = new AudioDial; |
| 201 layout->addWidget(gainDial); | 206 layout->addWidget(gainDial); |
| 202 gainDial->setMeterColor(Qt::darkRed); | 207 gainDial->setMeterColor(Qt::darkRed); |
| 203 gainDial->setMinimum(-50); | 208 gainDial->setMinimum(-50); |
| 204 gainDial->setMaximum(50); | 209 gainDial->setMaximum(50); |
| 205 gainDial->setPageStep(1); | 210 gainDial->setPageStep(1); |
| 206 gainDial->setFixedWidth(24); | 211 gainDial->setFixedWidth(24); |
| 207 gainDial->setFixedHeight(24); | 212 gainDial->setFixedHeight(24); |
| 208 gainDial->setNotchesVisible(false); | 213 gainDial->setNotchesVisible(false); |
| 209 gainDial->setDefaultValue(0); | 214 gainDial->setDefaultValue(0); |
| 210 gainDial->setObjectName(tr("Playback Gain")); | 215 gainDial->setObjectName(tr("Playback Gain")); |
| 211 gainDial->setRangeMapper(new LinearRangeMapper | 216 gainDial->setRangeMapper(new LinearRangeMapper |
| 212 (-50, 50, -25, 25, tr("dB"))); | 217 (-50, 50, -25, 25, tr("dB"))); |
| 221 this, SLOT(mouseEnteredWidget())); | 226 this, SLOT(mouseEnteredWidget())); |
| 222 connect(gainDial, SIGNAL(mouseLeft()), | 227 connect(gainDial, SIGNAL(mouseLeft()), |
| 223 this, SLOT(mouseLeftWidget())); | 228 this, SLOT(mouseLeftWidget())); |
| 224 playGainChanged(params->getPlayGain()); | 229 playGainChanged(params->getPlayGain()); |
| 225 layout->setAlignment(gainDial, Qt::AlignVCenter); | 230 layout->setAlignment(gainDial, Qt::AlignVCenter); |
| 231 | |
| 232 //code added by Jesus | |
| 233 | |
| 234 QString property_container_name; // the name could be : Waveform, Time Instants, etc | |
| 235 property_container_name = layer->getPropertyContainerName();// obtain the name | |
| 236 boolean isWaveform; | |
| 237 | |
| 238 isWaveform = property_container_name.contains("Waveform", Qt::CaseInsensitive);//if QString contains "Waveform" | |
| 239 | |
| 240 if (isWaveform == true){ | |
| 241 tracks++; | |
| 242 | |
| 243 AudioDial *gainDial1 = new AudioDial; | |
| 244 gainDial1->setMeterColor(Qt::darkRed); | |
| 245 gainDial1->setMinimum(-63); | |
| 246 gainDial1->setMaximum(10); | |
| 247 gainDial1->setPageStep(1); | |
| 248 gainDial1->setFixedWidth(60); | |
| 249 gainDial1->setFixedHeight(60); | |
| 250 gainDial1->setNotchesVisible(false); | |
| 251 gainDial1->setDefaultValue(0); | |
| 252 gainDial1->setObjectName(tr("Playback Gain")); | |
| 253 gainDial1->setRangeMapper(new LinearRangeMapper | |
| 254 (-50, 50, -25, 25, tr("dB"))); | |
| 255 gainDial1->setShowToolTip(true); | |
| 256 connect(gainDial1, SIGNAL(valueChanged(int)), | |
| 257 this, SLOT(playGainDialChanged(int))); | |
| 258 connect(params, SIGNAL(playGainChanged(float)), | |
| 259 this, SLOT(playGainChanged(float))); | |
| 260 connect(this, SIGNAL(changePlayGainDial(int)), | |
| 261 gainDial1, SLOT(setValue(int))); | |
| 262 connect(gainDial1, SIGNAL(mouseEntered()), | |
| 263 this, SLOT(mouseEnteredWidget())); | |
| 264 connect(gainDial1, SIGNAL(mouseLeft()), | |
| 265 this, SLOT(mouseLeftWidget())); | |
| 266 playGainChanged(params->getPlayGain()); | |
| 267 layout1->setAlignment(gainDial1, Qt::AlignVCenter); | |
| 268 | |
| 269 QWidget *window = new QWidget; | |
| 270 | |
| 271 | |
| 272 // QLabel *showLabel1 = new QLabel(tr("Track")); | |
| 273 // layout1->addWidget(showLabel1); | |
| 274 // layout1->setAlignment(showLabel1, Qt::AlignVCenter); | |
| 275 | |
| 276 layout1->addWidget(gainDial1); | |
| 277 if (tracks==3){ | |
| 278 window->setLayout(layout1); | |
| 279 window ->showNormal(); | |
| 280 } | |
| 281 } // end if | |
| 282 // end code added by Jesus | |
| 226 | 283 |
| 227 AudioDial *panDial = new AudioDial; | 284 AudioDial *panDial = new AudioDial; |
| 228 layout->addWidget(panDial); | 285 layout->addWidget(panDial); |
| 229 panDial->setMeterColor(Qt::darkGreen); | 286 panDial->setMeterColor(Qt::darkGreen); |
| 230 panDial->setMinimum(-50); | 287 panDial->setMinimum(-50); |
