Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/dlgprefcontrols.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           dlgprefcontrols.cpp  -  description
00003                              -------------------
00004     begin                : Sat Jul 5 2003
00005     copyright            : (C) 2003 by Tue & Ken Haste Andersen
00006     email                : haste@diku.dk
00007 ***************************************************************************/
00008 
00009 /***************************************************************************
00010 *                                                                         *
00011 *   This program is free software; you can redistribute it and/or modify  *
00012 *   it under the terms of the GNU General Public License as published by  *
00013 *   the Free Software Foundation; either version 2 of the License, or     *
00014 *   (at your option) any later version.                                   *
00015 *                                                                         *
00016 ***************************************************************************/
00017 
00018 #include <QList>
00019 #include <QDir>
00020 #include <QToolTip>
00021 #include <QDoubleSpinBox>
00022 #include <QWidget>
00023 
00024 #include "dlgprefcontrols.h"
00025 #include "qcombobox.h"
00026 #include "configobject.h"
00027 #include "controlobject.h"
00028 #include "controlobjectthreadmain.h"
00029 #include "widget/wnumberpos.h"
00030 #include "engine/enginebuffer.h"
00031 #include "engine/ratecontrol.h"
00032 #include "skin/skinloader.h"
00033 #include "skin/legacyskinparser.h"
00034 #include "playermanager.h"
00035 
00036 DlgPrefControls::DlgPrefControls(QWidget * parent, MixxxApp * mixxx,
00037                                  SkinLoader* pSkinLoader,
00038                                  PlayerManager* pPlayerManager,
00039                                  ConfigObject<ConfigValue> * pConfig)
00040         :  QWidget(parent), Ui::DlgPrefControlsDlg() {
00041     m_pConfig = pConfig;
00042     m_mixxx = mixxx;
00043     m_pSkinLoader = pSkinLoader;
00044     m_pPlayerManager = pPlayerManager;
00045 
00046     setupUi(this);
00047 
00048     for (unsigned int i = 0; i < m_pPlayerManager->numDecks(); ++i) {
00049         QString group = QString("[Channel%1]").arg(i+1);
00050         m_rateControls.push_back(new ControlObjectThreadMain(
00051             ControlObject::getControl(ConfigKey(group, "rate"))));
00052         m_rateRangeControls.push_back(new ControlObjectThreadMain(
00053             ControlObject::getControl(ConfigKey(group, "rateRange"))));
00054         m_rateDirControls.push_back(new ControlObjectThreadMain(
00055             ControlObject::getControl(ConfigKey(group, "rate_dir"))));
00056         m_cueControls.push_back(new ControlObjectThreadMain(
00057             ControlObject::getControl(ConfigKey(group, "cue_mode"))));
00058     }
00059 
00060     for (unsigned int i = 0; i < m_pPlayerManager->numSamplers(); ++i) {
00061         QString group = QString("[Sampler%1]").arg(i+1);
00062         m_rateControls.push_back(new ControlObjectThreadMain(
00063             ControlObject::getControl(ConfigKey(group, "rate"))));
00064         m_rateRangeControls.push_back(new ControlObjectThreadMain(
00065             ControlObject::getControl(ConfigKey(group, "rateRange"))));
00066         m_rateDirControls.push_back(new ControlObjectThreadMain(
00067             ControlObject::getControl(ConfigKey(group, "rate_dir"))));
00068         m_cueControls.push_back(new ControlObjectThreadMain(
00069             ControlObject::getControl(ConfigKey(group, "cue_mode"))));
00070 
00071     }
00072 
00073     // Position display configuration
00074     m_pControlPositionDisplay = new ControlObject(ConfigKey("[Controls]", "ShowDurationRemaining"));
00075     connect(m_pControlPositionDisplay, SIGNAL(valueChanged(double)),
00076             this, SLOT(slotSetPositionDisplay(double)));
00077     ComboBoxPosition->addItem(tr("Position"));
00078     ComboBoxPosition->addItem(tr("Remaining"));
00079     if (m_pConfig->getValueString(ConfigKey("[Controls]","PositionDisplay")).length() == 0)
00080         m_pConfig->set(ConfigKey("[Controls]","PositionDisplay"),ConfigValue(0));
00081     if (m_pConfig->getValueString(ConfigKey("[Controls]","PositionDisplay")).toInt() == 1)
00082     {
00083         ComboBoxPosition->setCurrentIndex(1);
00084         m_pControlPositionDisplay->set(1.0f);
00085     }
00086     else
00087     {
00088         ComboBoxPosition->setCurrentIndex(0);
00089         m_pControlPositionDisplay->set(0.0f);
00090     }
00091     connect(ComboBoxPosition,   SIGNAL(activated(int)), this, SLOT(slotSetPositionDisplay(int)));
00092 
00093     // Set default direction as stored in config file
00094     if (m_pConfig->getValueString(ConfigKey("[Controls]","RateDir")).length() == 0)
00095         m_pConfig->set(ConfigKey("[Controls]","RateDir"),ConfigValue(0));
00096 
00097     slotSetRateDir(m_pConfig->getValueString(ConfigKey("[Controls]","RateDir")).toInt());
00098     connect(ComboBoxRateDir,   SIGNAL(activated(int)), this, SLOT(slotSetRateDir(int)));
00099 
00100     // Set default range as stored in config file
00101     if (m_pConfig->getValueString(ConfigKey("[Controls]","RateRange")).length() == 0)
00102         m_pConfig->set(ConfigKey("[Controls]","RateRange"),ConfigValue(1));
00103 
00104     slotSetRateRange(m_pConfig->getValueString(ConfigKey("[Controls]","RateRange")).toInt());
00105     connect(ComboBoxRateRange, SIGNAL(activated(int)), this, SLOT(slotSetRateRange(int)));
00106 
00107     //
00108     // Rate buttons configuration
00109     //
00110     //NOTE: THESE DEFAULTS ARE A LIE! You'll need to hack the same values into the static variables
00111     //      at the top of enginebuffer.cpp
00112     if (m_pConfig->getValueString(ConfigKey("[Controls]","RateTempLeft")).length() == 0)
00113         m_pConfig->set(ConfigKey("[Controls]","RateTempLeft"),ConfigValue(QString("4.0")));
00114     if (m_pConfig->getValueString(ConfigKey("[Controls]","RateTempRight")).length() == 0)
00115         m_pConfig->set(ConfigKey("[Controls]","RateTempRight"),ConfigValue(QString("2.0")));
00116     if (m_pConfig->getValueString(ConfigKey("[Controls]","RatePermLeft")).length() == 0)
00117         m_pConfig->set(ConfigKey("[Controls]","RatePermLeft"),ConfigValue(QString("0.50")));
00118     if (m_pConfig->getValueString(ConfigKey("[Controls]","RatePermRight")).length() == 0)
00119         m_pConfig->set(ConfigKey("[Controls]","RatePermRight"),ConfigValue(QString("0.05")));
00120 
00121     connect(spinBoxTempRateLeft, SIGNAL(valueChanged(double)), this, SLOT(slotSetRateTempLeft(double)));
00122     connect(spinBoxTempRateRight, SIGNAL(valueChanged(double)), this, SLOT(slotSetRateTempRight(double)));
00123     connect(spinBoxPermRateLeft, SIGNAL(valueChanged(double)), this, SLOT(slotSetRatePermLeft(double)));
00124     connect(spinBoxPermRateRight, SIGNAL(valueChanged(double)), this, SLOT(slotSetRatePermRight(double)));
00125 
00126     spinBoxTempRateLeft->setValue(m_pConfig->getValueString(ConfigKey("[Controls]","RateTempLeft")).toDouble());
00127     spinBoxTempRateRight->setValue(m_pConfig->getValueString(ConfigKey("[Controls]","RateTempRight")).toDouble());
00128     spinBoxPermRateLeft->setValue(m_pConfig->getValueString(ConfigKey("[Controls]","RatePermLeft")).toDouble());
00129     spinBoxPermRateRight->setValue(m_pConfig->getValueString(ConfigKey("[Controls]","RatePermRight")).toDouble());
00130 
00131     SliderRateRampSensitivity->setEnabled(true);
00132     SpinBoxRateRampSensitivity->setEnabled(true);
00133 
00134     //
00135     // Visuals
00136     //
00137 
00138     // Set default value in config file, if not present
00139     if (m_pConfig->getValueString(ConfigKey("[Controls]","Visuals")).length() == 0)
00140         m_pConfig->set(ConfigKey("[Controls]","Visuals"), ConfigValue(0));
00141 
00142     // Update combo box
00143     ComboBoxVisuals->addItem(tr("On"));
00144     ComboBoxVisuals->addItem(tr("Off"));
00145     ComboBoxVisuals->setCurrentIndex(m_pConfig->getValueString(ConfigKey("[Controls]","Visuals")).toInt());
00146 
00147     connect(ComboBoxVisuals,   SIGNAL(activated(int)), this, SLOT(slotSetVisuals(int)));
00148 
00149     //
00150     // Skin configurations
00151     //
00152     ComboBoxSkinconf->clear();
00153 
00154     QString qSkinPath(pConfig->getValueString(ConfigKey("[Config]","Path")));
00155     QDir dir(qSkinPath.append("skins/"));
00156     dir.setFilter(QDir::Dirs);
00157 
00158     //
00159     // Override Playing Track on Track Load
00160     //
00161     ComboBoxAllowTrackLoadToPlayingDeck->addItem(tr("Don't load tracks into a playing deck"));
00162     ComboBoxAllowTrackLoadToPlayingDeck->addItem(tr("Load tracks into playing decks"));
00163     ComboBoxAllowTrackLoadToPlayingDeck->setCurrentIndex(m_pConfig->getValueString(ConfigKey("[Controls]", "AllowTrackLoadToPlayingDeck")).toInt());
00164     connect(ComboBoxAllowTrackLoadToPlayingDeck, SIGNAL(activated(int)), this, SLOT(slotSetAllowTrackLoadToPlayingDeck(int)));
00165 
00166     //
00167     // Default Cue Behavior
00168     //
00169 
00170     // Set default value in config file and control objects, if not present
00171     QString cueDefault = m_pConfig->getValueString(ConfigKey("[Controls]","CueDefault"));
00172     if(cueDefault.length() == 0) {
00173         m_pConfig->set(ConfigKey("[Controls]","CueDefault"), ConfigValue(0));
00174         cueDefault = "0";
00175     }
00176     int cueDefaultValue = cueDefault.toInt();
00177 
00178     // Update combo box
00179     ComboBoxCueDefault->addItem(tr("CDJ Mode"));
00180     ComboBoxCueDefault->addItem(tr("Simple"));
00181     ComboBoxCueDefault->setCurrentIndex(cueDefaultValue);
00182 
00183     slotSetCueDefault(cueDefaultValue);
00184     connect(ComboBoxCueDefault,   SIGNAL(activated(int)), this, SLOT(slotSetCueDefault(int)));
00185 
00186     //Cue recall
00187     ComboBoxCueRecall->addItem(tr("On"));
00188     ComboBoxCueRecall->addItem(tr("Off"));
00189     ComboBoxCueRecall->setCurrentIndex(m_pConfig->getValueString(ConfigKey("[Controls]", "CueRecall")).toInt());
00190     //NOTE: for CueRecall, 0 means ON....
00191     connect(ComboBoxCueRecall, SIGNAL(activated(int)), this, SLOT(slotSetCueRecall(int)));
00192 
00193     QList<QFileInfo> list = dir.entryInfoList();
00194     int j=0;
00195     for (int i=0; i<list.size(); ++i)
00196     {
00197         if (list.at(i).fileName()!="." && list.at(i).fileName()!="..")
00198         {
00199             ComboBoxSkinconf->addItem(list.at(i).fileName());
00200             if (list.at(i).fileName() == pConfig->getValueString(ConfigKey("[Config]","Skin")))
00201                 ComboBoxSkinconf->setCurrentIndex(j);
00202             ++j;
00203         }
00204     }
00205 // #endif
00206 
00207    // Detect small display and prompt user to use small skin.
00208    if (QApplication::desktop()->width() >= 800 && QApplication::desktop()->height() == 480 && pConfig->getValueString(ConfigKey("[Config]","Skin"))!= "Outline800x480-WVGA") {
00209       int ret = QMessageBox::warning(this, tr("Mixxx Detected a WVGA Screen"), tr("Mixxx has detected that your screen has a resolution of ") +
00210                    QString::number(QApplication::desktop()->width()) + " x " + QString::number(QApplication::desktop()->height()) + ".  " +
00211                    tr("The only skin compatiable with this size display is Outline800x480-WVGA.  Would you like to use that skin?"),
00212                    QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
00213       if (ret == QMessageBox::Yes) {
00214          pConfig->set(ConfigKey("[Config]","Skin"), ConfigValue("Outline800x480-WVGA"));
00215          pConfig->Save();
00216          ComboBoxSkinconf->setCurrentIndex(ComboBoxSkinconf->findText(pConfig->getValueString(ConfigKey("[Config]","Skin"))));
00217          qDebug() << "Retrieved skin:" << pConfig->getValueString(ConfigKey("[Config]","Skin")) << "ComboBoxSkinconf:" << ComboBoxSkinconf->currentText();
00218          slotSetSkin(1);
00219       }
00220     }
00221 
00222     connect(ComboBoxSkinconf, SIGNAL(activated(int)), this, SLOT(slotSetSkin(int)));
00223 
00224     slotUpdateSchemes();
00225 
00226     connect(ComboBoxSchemeconf, SIGNAL(activated(int)), this, SLOT(slotSetScheme(int)));
00227 
00228     //
00229     // Tooltip configuration
00230     //
00231     // Set default value in config file, if not present
00232     if (m_pConfig->getValueString(ConfigKey("[Controls]","Tooltips")).length() == 0)
00233         m_pConfig->set(ConfigKey("[Controls]","Tooltips"), ConfigValue(1));
00234 
00235     // Update combo box
00236     ComboBoxTooltips->setCurrentIndex((m_pConfig->getValueString(ConfigKey("[Controls]","Tooltips")).toInt()+1)%2);
00237 
00238     //
00239     // Ramping Temporary Rate Change configuration
00240     //
00241 
00242     // Set Ramp Rate On or Off
00243     connect(groupBoxRateRamp, SIGNAL(toggled(bool)), this, SLOT(slotSetRateRamp(bool)));
00244     groupBoxRateRamp->setChecked((bool)
00245             m_pConfig->getValueString(ConfigKey("[Controls]","RateRamp")).toInt()
00246     );
00247 
00248     // Update Ramp Rate Sensitivity
00249     connect(SliderRateRampSensitivity, SIGNAL(valueChanged(int)), this, SLOT(slotSetRateRampSensitivity(int)));
00250     SliderRateRampSensitivity->setValue(
00251         m_pConfig->getValueString(ConfigKey("[Controls]","RateRampSensitivity")).toInt()
00252     );
00253 
00254     connect(ComboBoxTooltips,   SIGNAL(activated(int)), this, SLOT(slotSetTooltips(int)));
00255 
00256     slotUpdateSchemes();
00257     slotUpdate();
00258 }
00259 
00260 DlgPrefControls::~DlgPrefControls()
00261 {
00262     foreach (ControlObjectThreadMain* pControl, m_rateControls) {
00263         delete pControl;
00264     }
00265     foreach (ControlObjectThreadMain* pControl, m_rateDirControls) {
00266         delete pControl;
00267     }
00268     foreach (ControlObjectThreadMain* pControl, m_cueControls) {
00269         delete pControl;
00270     }
00271     foreach (ControlObjectThreadMain* pControl, m_rateRangeControls) {
00272         delete pControl;
00273     }
00274 }
00275 
00276 void DlgPrefControls::slotUpdateSchemes()
00277 {
00278     // Since this involves opening a file we won't do this as part of regular slotUpdate
00279     QList<QString> schlist = LegacySkinParser::getSchemeList(
00280         m_pSkinLoader->getConfiguredSkinPath());
00281 
00282     ComboBoxSchemeconf->clear();
00283 
00284     if (schlist.size() == 0) {
00285         ComboBoxSchemeconf->setEnabled(false);
00286         ComboBoxSchemeconf->addItem(tr("This skin does not support schemes", 0));
00287         ComboBoxSchemeconf->setCurrentIndex(0);
00288     } else {
00289         ComboBoxSchemeconf->setEnabled(true);
00290         for (int i = 0; i < schlist.size(); i++) {
00291             ComboBoxSchemeconf->addItem(schlist[i]);
00292 
00293             if (schlist[i] == m_pConfig->getValueString(ConfigKey("[Config]","Scheme"))) {
00294                 ComboBoxSchemeconf->setCurrentIndex(i);
00295             }
00296         }
00297     }
00298 }
00299 
00300 void DlgPrefControls::slotUpdate()
00301 {
00302     ComboBoxRateRange->clear();
00303     ComboBoxRateRange->addItem(tr("8% (Technics SL1210)"));
00304     ComboBoxRateRange->addItem(tr("10%"));
00305     ComboBoxRateRange->addItem(tr("20%"));
00306     ComboBoxRateRange->addItem(tr("30%"));
00307     ComboBoxRateRange->addItem(tr("40%"));
00308     ComboBoxRateRange->addItem(tr("50%"));
00309     ComboBoxRateRange->addItem(tr("60%"));
00310     ComboBoxRateRange->addItem(tr("70%"));
00311     ComboBoxRateRange->addItem(tr("80%"));
00312     ComboBoxRateRange->addItem(tr("90%"));
00313 
00314     double deck1RateRange = m_rateRangeControls[0]->get();
00315     double deck1RateDir = m_rateDirControls[0]->get();
00316 
00317     float idx = 10. * deck1RateRange;
00318     if (deck1RateRange == 0.08)
00319         idx = 0.;
00320 
00321     ComboBoxRateRange->setCurrentIndex((int)idx);
00322 
00323     ComboBoxRateDir->clear();
00324     ComboBoxRateDir->addItem(tr("Up increases speed"));
00325     ComboBoxRateDir->addItem(tr("Down increases speed (Technics SL1210)"));
00326 
00327     if (deck1RateDir == 1)
00328         ComboBoxRateDir->setCurrentIndex(0);
00329     else
00330         ComboBoxRateDir->setCurrentIndex(1);
00331 }
00332 
00333 void DlgPrefControls::slotSetRateRange(int pos)
00334 {
00335     float range = (float)(pos)/10.;
00336     if (pos==0)
00337         range = 0.08f;
00338 
00339     // Set rate range for every group
00340     foreach (ControlObjectThreadMain* pControl, m_rateRangeControls) {
00341         pControl->slotSet(range);
00342     }
00343 
00344     // Reset rate for every group
00345     foreach (ControlObjectThreadMain* pControl, m_rateControls) {
00346         pControl->slotSet(0);
00347     }
00348 }
00349 
00350 void DlgPrefControls::slotSetRateDir(int index)
00351 {
00352     float dir = 1.;
00353     if (index == 1)
00354         dir = -1.;
00355 
00356     // Set rate direction for every group
00357     foreach (ControlObjectThreadMain* pControl, m_rateDirControls) {
00358         pControl->slotSet(dir);
00359     }
00360 }
00361 
00362 void DlgPrefControls::slotSetVisuals(int)
00363 {
00364     m_pConfig->set(ConfigKey("[Controls]","Visuals"), ConfigValue(ComboBoxVisuals->currentIndex()));
00365     m_mixxx->rebootMixxxView();
00366 }
00367 
00368 void DlgPrefControls::slotSetAllowTrackLoadToPlayingDeck(int)
00369 {
00370     m_pConfig->set(ConfigKey("[Controls]","AllowTrackLoadToPlayingDeck"), ConfigValue(ComboBoxAllowTrackLoadToPlayingDeck->currentIndex()));
00371 }
00372 
00373 void DlgPrefControls::slotSetCueDefault(int)
00374 {
00375     int cueIndex = ComboBoxCueDefault->currentIndex();
00376     m_pConfig->set(ConfigKey("[Controls]","CueDefault"), ConfigValue(cueIndex));
00377 
00378     // Set cue behavior for every group
00379     foreach (ControlObjectThreadMain* pControl, m_cueControls) {
00380         pControl->slotSet(cueIndex);
00381     }
00382 }
00383 
00384 void DlgPrefControls::slotSetCueRecall(int)
00385 {
00386     m_pConfig->set(ConfigKey("[Controls]","CueRecall"), ConfigValue(ComboBoxCueRecall->currentIndex()));
00387 }
00388 
00389 void DlgPrefControls::slotSetTooltips(int)
00390 {
00391     m_pConfig->set(ConfigKey("[Controls]","Tooltips"), ConfigValue((ComboBoxTooltips->currentIndex()+1)%2));
00392 
00393     //This is somewhat confusing, but to disable tooltips in QT4, you need to install an eventFilter
00394     //on the QApplication object. That object is located in MixxxApp (mixxx.cpp/h), so that's where
00395     //the eventFilter is. The value of the ConfigObject is cached at startup because it's too slow
00396     //to refresh it during each Tooltip event (I think), which is why we require a restart.
00397 
00398 
00399     QMessageBox::information(this, tr("Information"), //make the fact that you have to restart mixxx more obvious
00400     //textLabel->setText(
00401       tr("Mixxx must be restarted before the changes will take effect."));
00402 }
00403 
00404 void DlgPrefControls::slotSetScheme(int)
00405 {
00406     m_pConfig->set(ConfigKey("[Config]", "Scheme"), ComboBoxSchemeconf->currentText());
00407     m_mixxx->rebootMixxxView();
00408 }
00409 
00410 void DlgPrefControls::slotSetSkin(int)
00411 {
00412     m_pConfig->set(ConfigKey("[Config]","Skin"), ComboBoxSkinconf->currentText());
00413     m_mixxx->rebootMixxxView();
00414     slotUpdateSchemes();
00415 }
00416 
00417 void DlgPrefControls::slotSetPositionDisplay(int)
00418 {
00419     int positionDisplay = ComboBoxPosition->currentIndex();
00420     m_pConfig->set(ConfigKey("[Controls]","PositionDisplay"), ConfigValue(positionDisplay));
00421     m_pControlPositionDisplay->set(positionDisplay);
00422 }
00423 
00424 void DlgPrefControls::slotSetPositionDisplay(double v) {
00425     if (v > 0) {
00426         // remaining
00427         ComboBoxPosition->setCurrentIndex(1);
00428         m_pConfig->set(ConfigKey("[Controls]","PositionDisplay"), ConfigValue(1));
00429     } else {
00430         // position
00431         ComboBoxPosition->setCurrentIndex(0);
00432         m_pConfig->set(ConfigKey("[Controls]","PositionDisplay"), ConfigValue(0));
00433     }
00434 }
00435 
00436 void DlgPrefControls::slotSetRateTempLeft(double v)
00437 {
00438     QString str;
00439     str = str.setNum(v, 'f');
00440     m_pConfig->set(ConfigKey("[Controls]","RateTempLeft"),ConfigValue(str));
00441     RateControl::setTemp(v);
00442 }
00443 
00444 void DlgPrefControls::slotSetRateTempRight(double v)
00445 {
00446     QString str;
00447     str = str.setNum(v, 'f');
00448     m_pConfig->set(ConfigKey("[Controls]","RateTempRight"),ConfigValue(str));
00449     RateControl::setTempSmall(v);
00450 }
00451 
00452 void DlgPrefControls::slotSetRatePermLeft(double v)
00453 {
00454     QString str;
00455     str = str.setNum(v, 'f');
00456     m_pConfig->set(ConfigKey("[Controls]","RatePermLeft"),ConfigValue(str));
00457     RateControl::setPerm(v);
00458 }
00459 
00460 void DlgPrefControls::slotSetRatePermRight(double v)
00461 {
00462     QString str;
00463     str = str.setNum(v, 'f');
00464     m_pConfig->set(ConfigKey("[Controls]","RatePermRight"),ConfigValue(str));
00465     RateControl::setPermSmall(v);
00466 }
00467 
00468 void DlgPrefControls::slotSetRateRampSensitivity(int sense)
00469 {
00470     m_pConfig->set(ConfigKey("[Controls]","RateRampSensitivity"),
00471                         ConfigValue(SliderRateRampSensitivity->value()));
00472     RateControl::setRateRampSensitivity(sense);
00473 }
00474 
00475 void DlgPrefControls::slotSetRateRamp(bool mode)
00476 {
00477     m_pConfig->set(ConfigKey("[Controls]", "RateRamp"),
00478                         ConfigValue(groupBoxRateRamp->isChecked()));
00479     RateControl::setRateRamp(mode);
00480 
00481     /*
00482     if ( mode )
00483     {
00484         SliderRateRampSensitivity->setEnabled(TRUE);
00485         SpinBoxRateRampSensitivity->setEnabled(TRUE);
00486     }
00487     else
00488     {
00489         SliderRateRampSensitivity->setEnabled(FALSE);
00490         SpinBoxRateRampSensitivity->setEnabled(FALSE);
00491     }*/
00492 }
00493 
00494 void DlgPrefControls::slotApply()
00495 {
00496     double deck1RateRange = m_rateRangeControls[0]->get();
00497     double deck1RateDir = m_rateDirControls[0]->get();
00498     // Write rate range to config file
00499     float idx = 10. * deck1RateRange;
00500     if (idx==0.8)
00501         idx = 0.;
00502 
00503     m_pConfig->set(ConfigKey("[Controls]","RateRange"), ConfigValue((int)idx));
00504 
00505     // Write rate direction to config file
00506     if (deck1RateDir == 1)
00507         m_pConfig->set(ConfigKey("[Controls]","RateDir"), ConfigValue(0));
00508     else
00509         m_pConfig->set(ConfigKey("[Controls]","RateDir"), ConfigValue(1));
00510 
00511 }
00512 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines