/[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 294 by capela, Mon Oct 11 12:27:39 2004 UTC revision 295 by capela, Tue Nov 16 15:26:18 2004 UTC
# Line 50  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 ( qsamplerChannel *pChannel, bool bNew )  void qsamplerChannelForm::setup ( qsamplerChannel *pChannel )
54  {  {
55      m_pChannel = pChannel;      m_pChannel = pChannel;
56    
# Line 60  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(tr("Channel %1").arg(m_pChannel->channelID()));      // It can be a brand new channel, remember?
64        bool bNew = (m_pChannel->channelID() < 0);
65        setCaption(m_pChannel->channelName());
66    
67      // Check if we're up and connected.      // Check if we're up and connected.
68      if (m_pChannel->client() == NULL)      if (m_pChannel->client() == NULL)
# Line 123  void qsamplerChannelForm::setup ( qsampl Line 125  void qsamplerChannelForm::setup ( qsampl
125      InstrumentNrSpinBox->setValue(pChannel->instrumentNr());      InstrumentNrSpinBox->setValue(pChannel->instrumentNr());
126      // MIDI input driver...      // MIDI input driver...
127      QString sMidiDriver = pChannel->midiDriver();      QString sMidiDriver = pChannel->midiDriver();
128      if (sMidiDriver.isEmpty() && bNew)      if (sMidiDriver.isEmpty() || bNew)
129          sMidiDriver = pOptions->sMidiDriver;          sMidiDriver = pOptions->sMidiDriver;
130      if (!sMidiDriver.isEmpty()) {      if (!sMidiDriver.isEmpty()) {
131          if (MidiDriverComboBox->listBox()->findItem(sMidiDriver, Qt::ExactMatch) == NULL)          if (MidiDriverComboBox->listBox()->findItem(sMidiDriver, Qt::ExactMatch) == NULL)
# Line 134  void qsamplerChannelForm::setup ( qsampl Line 136  void qsamplerChannelForm::setup ( qsampl
136      MidiPortSpinBox->setValue(pChannel->midiPort());      MidiPortSpinBox->setValue(pChannel->midiPort());
137      // MIDI input channel...      // MIDI input channel...
138      int iMidiChannel = pChannel->midiChannel();      int iMidiChannel = pChannel->midiChannel();
139      if (bNew)      // When new, try to suggest a sensible MIDI channel...
140          iMidiChannel = (pChannel->channelID() % 16);      if (iMidiChannel < 0)
141            iMidiChannel = (::lscp_get_channels(m_pChannel->client()) % 16);
142      MidiChannelComboBox->setCurrentItem(iMidiChannel);      MidiChannelComboBox->setCurrentItem(iMidiChannel);
143      // Audio output driver...      // Audio output driver...
144      QString sAudioDriver = pChannel->audioDriver();      QString sAudioDriver = pChannel->audioDriver();
145      if (sAudioDriver.isEmpty() && bNew)      if (sAudioDriver.isEmpty() || bNew)
146          sAudioDriver = pOptions->sAudioDriver;          sAudioDriver = pOptions->sAudioDriver;
147      if (!sAudioDriver.isEmpty()) {      if (!sAudioDriver.isEmpty()) {
148          if (AudioDriverComboBox->listBox()->findItem(sAudioDriver, Qt::ExactMatch) == NULL)          if (AudioDriverComboBox->listBox()->findItem(sAudioDriver, Qt::ExactMatch) == NULL)
# Line 165  void qsamplerChannelForm::accept (void) Line 168  void qsamplerChannelForm::accept (void)
168      // We'll go for it!      // We'll go for it!
169      if (m_iDirtyCount > 0) {      if (m_iDirtyCount > 0) {
170          int iErrors = 0;          int iErrors = 0;
171            // Are we a new channel?
172            if (!m_pChannel->addChannel())
173                iErrors++;
174          // Audio output driver type...          // Audio output driver type...
175          if (!m_pChannel->setAudioDriver(AudioDriverComboBox->currentText()))          if (!m_pChannel->setAudioDriver(AudioDriverComboBox->currentText()))
176              iErrors++;              iErrors++;

Legend:
Removed from v.294  
changed lines
  Added in v.295

  ViewVC Help
Powered by ViewVC