/[svn]/qsampler/trunk/src/qsamplerChannelForm.ui.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerChannelForm.ui.h

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

revision 161 by capela, Tue Jun 29 21:55:30 2004 UTC revision 280 by capela, Mon Oct 11 12:27:39 2004 UTC
# Line 26  Line 26 
26  #include <qfileinfo.h>  #include <qfileinfo.h>
27  #include <qlistbox.h>  #include <qlistbox.h>
28    
 #include "qsamplerOptions.h"  
 #include "qsamplerChannelStrip.h"  
   
29  #include "config.h"  #include "config.h"
30    
31    
# Line 53  void qsamplerChannelForm::destroy (void) Line 50  void qsamplerChannelForm::destroy (void)
50    
51    
52  // Channel dialog setup formal initializer.  // Channel dialog setup formal initializer.
53  void qsamplerChannelForm::setup ( qsamplerChannelStrip *pChannel )  void qsamplerChannelForm::setup ( qsamplerChannel *pChannel, bool bNew )
54  {  {
55      m_pChannel = pChannel;      m_pChannel = pChannel;
56    
# Line 63  void qsamplerChannelForm::setup ( qsampl Line 60  void qsamplerChannelForm::setup ( qsampl
60      if (m_pChannel == NULL)      if (m_pChannel == NULL)
61          return;          return;
62    
63      setCaption(m_pChannel->caption());      setCaption(tr("Channel %1").arg(m_pChannel->channelID()));
64    
65      // Check if we're up and connected.      // Check if we're up and connected.
66      if (m_pChannel->client() == NULL)      if (m_pChannel->client() == NULL)
# Line 111  void qsamplerChannelForm::setup ( qsampl Line 108  void qsamplerChannelForm::setup ( qsampl
108    
109      // Engine name...      // Engine name...
110      QString sEngineName = pChannel->engineName();      QString sEngineName = pChannel->engineName();
111        if (sEngineName.isEmpty() && bNew)
112            sEngineName = pOptions->sEngineName;
113      if (sEngineName.isEmpty())      if (sEngineName.isEmpty())
114          sEngineName = tr("(No engine)");          sEngineName = tr("(No engine)");
115      if (EngineNameComboBox->listBox()->findItem(sEngineName, Qt::ExactMatch) == NULL)      if (EngineNameComboBox->listBox()->findItem(sEngineName, Qt::ExactMatch) == NULL)
# Line 122  void qsamplerChannelForm::setup ( qsampl Line 121  void qsamplerChannelForm::setup ( qsampl
121          sInstrumentFile = tr("(No instrument)");          sInstrumentFile = tr("(No instrument)");
122      InstrumentFileComboBox->setCurrentText(sInstrumentFile);      InstrumentFileComboBox->setCurrentText(sInstrumentFile);
123      InstrumentNrSpinBox->setValue(pChannel->instrumentNr());      InstrumentNrSpinBox->setValue(pChannel->instrumentNr());
124      // MIDI input...      // MIDI input driver...
125      const QString& sMidiDriver = pChannel->midiDriver();      QString sMidiDriver = pChannel->midiDriver();
126        if (sMidiDriver.isEmpty() && bNew)
127            sMidiDriver = pOptions->sMidiDriver;
128      if (!sMidiDriver.isEmpty()) {      if (!sMidiDriver.isEmpty()) {
129          if (MidiDriverComboBox->listBox()->findItem(sMidiDriver, Qt::ExactMatch) == NULL)          if (MidiDriverComboBox->listBox()->findItem(sMidiDriver, Qt::ExactMatch) == NULL)
130              MidiDriverComboBox->insertItem(sMidiDriver);              MidiDriverComboBox->insertItem(sMidiDriver);
131          MidiDriverComboBox->setCurrentText(sMidiDriver);          MidiDriverComboBox->setCurrentText(sMidiDriver);
132      }      }
133        // MIDI input port...
134      MidiPortSpinBox->setValue(pChannel->midiPort());      MidiPortSpinBox->setValue(pChannel->midiPort());
135      MidiChannelSpinBox->setValue(pChannel->midiChannel());      // MIDI input channel...
136      // Audio output...      int iMidiChannel = pChannel->midiChannel();
137      const QString& sAudioDriver = pChannel->audioDriver();      if (bNew)
138            iMidiChannel = (pChannel->channelID() % 16);
139        MidiChannelComboBox->setCurrentItem(iMidiChannel);
140        // Audio output driver...
141        QString sAudioDriver = pChannel->audioDriver();
142        if (sAudioDriver.isEmpty() && bNew)
143            sAudioDriver = pOptions->sAudioDriver;
144      if (!sAudioDriver.isEmpty()) {      if (!sAudioDriver.isEmpty()) {
145          if (AudioDriverComboBox->listBox()->findItem(sAudioDriver, Qt::ExactMatch) == NULL)          if (AudioDriverComboBox->listBox()->findItem(sAudioDriver, Qt::ExactMatch) == NULL)
146              AudioDriverComboBox->insertItem(sAudioDriver);              AudioDriverComboBox->insertItem(sAudioDriver);
# Line 167  void qsamplerChannelForm::accept (void) Line 175  void qsamplerChannelForm::accept (void)
175          if (!m_pChannel->setMidiPort(MidiPortSpinBox->value()))          if (!m_pChannel->setMidiPort(MidiPortSpinBox->value()))
176              iErrors++;              iErrors++;
177          // MIDI input channel...          // MIDI input channel...
178          if (!m_pChannel->setMidiChannel(MidiChannelSpinBox->value()))          if (!m_pChannel->setMidiChannel(MidiChannelComboBox->currentItem()))
179              iErrors++;              iErrors++;
180          // Engine name...          // Engine name...
181          if (!m_pChannel->loadEngine(EngineNameComboBox->currentText()))          if (!m_pChannel->loadEngine(EngineNameComboBox->currentText()))
# Line 180  void qsamplerChannelForm::accept (void) Line 188  void qsamplerChannelForm::accept (void)
188              m_pChannel->appendMessagesError(tr("Some channel settings could not be set.\n\nSorry."));              m_pChannel->appendMessagesError(tr("Some channel settings could not be set.\n\nSorry."));
189      }      }
190    
191      // Save default instrument directory and history...      // Save default engine name, instrument directory and history...
192      pOptions->sInstrumentDir = QFileInfo(InstrumentFileComboBox->currentText()).dirPath(true);      pOptions->sInstrumentDir = QFileInfo(InstrumentFileComboBox->currentText()).dirPath(true);
193        pOptions->sEngineName  = EngineNameComboBox->currentText();
194        pOptions->sAudioDriver = AudioDriverComboBox->currentText();
195        pOptions->sMidiDriver  = MidiDriverComboBox->currentText();
196      pOptions->saveComboBoxHistory(InstrumentFileComboBox);      pOptions->saveComboBoxHistory(InstrumentFileComboBox);
197    
198      // Just go with dialog acceptance.      // Just go with dialog acceptance.
# Line 195  void qsamplerChannelForm::reject (void) Line 206  void qsamplerChannelForm::reject (void)
206      bool bReject = true;      bool bReject = true;
207    
208      // Check if there's any pending changes...      // Check if there's any pending changes...
209      if (m_iDirtyCount > 0) {      if (m_iDirtyCount > 0 && OkPushButton->isEnabled()) {
210          switch (QMessageBox::warning(this, tr("Warning"),          switch (QMessageBox::warning(this, tr("Warning"),
211              tr("Some channel settings have been changed.\n\n"              tr("Some channel settings have been changed.\n\n"
212                 "Do you want to apply the changes?"),                 "Do you want to apply the changes?"),

Legend:
Removed from v.161  
changed lines
  Added in v.280

  ViewVC Help
Powered by ViewVC