/[svn]/qsampler/trunk/src/qsamplerOptionsForm.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerOptionsForm.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1788 by capela, Sun Oct 26 15:44:42 2008 UTC revision 1803 by schoenebeck, Sun Dec 7 13:58:16 2008 UTC
# Line 127  OptionsForm::OptionsForm ( QWidget* pPar Line 127  OptionsForm::OptionsForm ( QWidget* pPar
127          QObject::connect(m_ui.BaseFontSizeComboBox,          QObject::connect(m_ui.BaseFontSizeComboBox,
128                  SIGNAL(editTextChanged(const QString&)),                  SIGNAL(editTextChanged(const QString&)),
129                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
130            QObject::connect(m_ui.MaxVoicesSpinBox,
131                    SIGNAL(valueChanged(int)),
132                    SLOT(maxVoicesChanged(int)));
133            QObject::connect(m_ui.MaxStreamsSpinBox,
134                    SIGNAL(valueChanged(int)),
135                    SLOT(maxStreamsChanged(int)));
136          QObject::connect(m_ui.OkPushButton,          QObject::connect(m_ui.OkPushButton,
137                  SIGNAL(clicked()),                  SIGNAL(clicked()),
138                  SLOT(accept()));                  SLOT(accept()));
# Line 220  void OptionsForm::setup ( Options *pOpti Line 226  void OptionsForm::setup ( Options *pOpti
226          m_ui.InstrumentNamesCheckBox->setEnabled(false);          m_ui.InstrumentNamesCheckBox->setEnabled(false);
227  #endif  #endif
228    
229            bMaxVoicesModified = bMaxStreamsModified = false;
230    #ifdef CONFIG_MAX_VOICES
231            const bool bMaxVoicesSupported =
232                    m_pOptions->getEffectiveMaxVoices() >= 0;
233            const bool bMaxStreamsSupported =
234                    m_pOptions->getEffectiveMaxStreams() >= 0;
235    
236            m_ui.MaxVoicesSpinBox->setEnabled(bMaxVoicesSupported);
237            m_ui.MaxVoicesSpinBox->setValue(m_pOptions->getMaxVoices());
238            if (!bMaxVoicesSupported)
239                    m_ui.MaxVoicesSpinBox->setToolTip(
240                            tr("This parameter is not supported by the current sampler "
241                               "version in use.")
242                    );
243            else
244                    m_ui.MaxVoicesSpinBox->setToolTip(
245                            tr("The max. amount of voices the sampler shall process "
246                               "simultaniously.")
247                    );
248    
249            m_ui.MaxStreamsSpinBox->setEnabled(bMaxStreamsSupported);
250            m_ui.MaxStreamsSpinBox->setValue(m_pOptions->getMaxStreams());
251            if (!bMaxStreamsSupported)
252                    m_ui.MaxStreamsSpinBox->setToolTip(
253                            tr("This parameter is not supported by the current sampler "
254                               "version in use.")
255                    );
256            else
257                    m_ui.MaxStreamsSpinBox->setToolTip(
258                            tr("The max. amount of disk streams the sampler shall process "
259                               "simultaniously.")
260                    );
261    #else
262            m_ui.MaxVoicesSpinBox->setEnabled(false);
263            m_ui.MaxStreamsSpinBox->setEnabled(false);
264            m_ui.MaxVoicesSpinBox->setToolTip(
265                    tr("QSampler was built without support for this parameter.")
266            );
267            m_ui.MaxStreamsSpinBox->setToolTip(
268                    tr("QSampler was built without support for this parameter.")
269            );
270    #endif // CONFIG_MAX_VOICES
271    
272          // Done.          // Done.
273          m_iDirtySetup--;          m_iDirtySetup--;
274          stabilizeForm();          stabilizeForm();
# Line 263  void OptionsForm::accept (void) Line 312  void OptionsForm::accept (void)
312                  m_iDirtyCount = 0;                  m_iDirtyCount = 0;
313          }          }
314    
315            // if the user modified the limits, apply them to the sampler
316            // (and store it later in qsampler's configuration)
317            if (bMaxVoicesModified && m_ui.MaxVoicesSpinBox->isEnabled())
318                    m_pOptions->setMaxVoices(m_ui.MaxVoicesSpinBox->value());
319            if (bMaxStreamsModified && m_ui.MaxStreamsSpinBox->isEnabled())
320                    m_pOptions->setMaxStreams(m_ui.MaxStreamsSpinBox->value());
321    
322          // Save combobox history...          // Save combobox history...
323          m_pOptions->saveComboBoxHistory(m_ui.ServerHostComboBox);          m_pOptions->saveComboBoxHistory(m_ui.ServerHostComboBox);
324          m_pOptions->saveComboBoxHistory(m_ui.ServerPortComboBox);          m_pOptions->saveComboBoxHistory(m_ui.ServerPortComboBox);
# Line 404  void OptionsForm::toggleDisplayEffect ( Line 460  void OptionsForm::toggleDisplayEffect (
460          optionsChanged();          optionsChanged();
461  }  }
462    
463  } // namespace QSampler  void OptionsForm::maxVoicesChanged(int /*iMaxVoices*/)
464    {
465            bMaxVoicesModified = true;
466            optionsChanged();
467    }
468    
469    void OptionsForm::maxStreamsChanged(int /*iMaxStreams*/)
470    {
471            bMaxStreamsModified = true;
472            optionsChanged();
473    }
474    
475    } // namespace QSampler
476    
477  // end of qsamplerOptionsForm.cpp  // end of qsamplerOptionsForm.cpp

Legend:
Removed from v.1788  
changed lines
  Added in v.1803

  ViewVC Help
Powered by ViewVC