comparison widgets/PluginParameterBox.cpp @ 249:e6d0b097d102 sv1-1.0rc1

* more compile warning fixes
author Chris Cannam
date Mon, 30 Apr 2007 14:06:45 +0000
parents 8495187c13ce
children 15b8a4bfe855
comparison
equal deleted inserted replaced
248:28c8e8e3c537 249:e6d0b097d102
67 std::string currentProgram = m_plugin->getCurrentProgram(); 67 std::string currentProgram = m_plugin->getCurrentProgram();
68 68
69 QComboBox *programCombo = new QComboBox; 69 QComboBox *programCombo = new QComboBox;
70 programCombo->setMaxVisibleItems(20); 70 programCombo->setMaxVisibleItems(20);
71 71
72 for (int i = 0; i < programs.size(); ++i) { 72 for (size_t i = 0; i < programs.size(); ++i) {
73 programCombo->addItem(programs[i].c_str()); 73 programCombo->addItem(programs[i].c_str());
74 if (programs[i] == currentProgram) { 74 if (programs[i] == currentProgram) {
75 programCombo->setCurrentIndex(i); 75 programCombo->setCurrentIndex(i);
76 } 76 }
77 } 77 }
131 131
132 QComboBox *combobox = new QComboBox; 132 QComboBox *combobox = new QComboBox;
133 combobox->setObjectName(identifier); 133 combobox->setObjectName(identifier);
134 for (unsigned int j = 0; j < valueNames.size(); ++j) { 134 for (unsigned int j = 0; j < valueNames.size(); ++j) {
135 combobox->addItem(valueNames[j].c_str()); 135 combobox->addItem(valueNames[j].c_str());
136 if (lrintf((value - min) / qtz) == j) { 136 if ((unsigned int)(lrintf(fabsf((value - min) / qtz))) == j) {
137 combobox->setCurrentIndex(j); 137 combobox->setCurrentIndex(j);
138 } 138 }
139 } 139 }
140 connect(combobox, SIGNAL(activated(int)), 140 connect(combobox, SIGNAL(activated(int)),
141 this, SLOT(dialChanged(int))); 141 this, SLOT(dialChanged(int)));
299 if (qtz > 0.0) { 299 if (qtz > 0.0) {
300 int step = int((value - min) / qtz); 300 int step = int((value - min) / qtz);
301 value = min + step * qtz; 301 value = min + step * qtz;
302 } 302 }
303 303
304 int imin = 0, imax = 100; 304 int imax = 100;
305 305
306 if (qtz > 0.0) { 306 if (qtz > 0.0) {
307 imax = int((max - min) / qtz); 307 imax = int((max - min) / qtz);
308 } else { 308 } else {
309 qtz = (max - min) / 100.0; 309 qtz = (max - min) / 100.0;
310 } 310 }
311 311
312 int ival = (value - min) / qtz; 312 int ival = lrintf((value - min) / qtz);
313 313
314 AudioDial *dial = m_params[identifier].dial; 314 AudioDial *dial = m_params[identifier].dial;
315 if (dial) { 315 if (dial) {
316 dial->blockSignals(true); 316 dial->blockSignals(true);
317 dial->setValue(ival); 317 dial->setValue(ival);
357 i->second.dial->blockSignals(false); 357 i->second.dial->blockSignals(false);
358 } 358 }
359 359
360 if (i->second.combo) { 360 if (i->second.combo) {
361 i->second.combo->blockSignals(true); 361 i->second.combo->blockSignals(true);
362 i->second.combo->setCurrentIndex(value); 362 i->second.combo->setCurrentIndex(lrintf(value));
363 i->second.combo->blockSignals(false); 363 i->second.combo->blockSignals(false);
364 } 364 }
365 } 365 }
366 366
367 emit pluginConfigurationChanged(PluginXml(m_plugin).toXmlString()); 367 emit pluginConfigurationChanged(PluginXml(m_plugin).toXmlString());