/[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 490 by capela, Fri Apr 1 00:34:58 2005 UTC revision 758 by capela, Sun Aug 28 00:31:34 2005 UTC
# Line 20  Line 20 
20    
21  *****************************************************************************/  *****************************************************************************/
22    
23    #include "qsamplerAbout.h"
24    #include "qsamplerDeviceForm.h"
25    
26  #include <qvalidator.h>  #include <qvalidator.h>
27  #include <qmessagebox.h>  #include <qmessagebox.h>
28  #include <qfiledialog.h>  #include <qfiledialog.h>
29  #include <qfileinfo.h>  #include <qfileinfo.h>
30  #include <qlistbox.h>  #include <qlistbox.h>
31    
 #include "qsamplerDeviceForm.h"  
   
 #include "config.h"  
   
32    
33  // Kind of constructor.  // Kind of constructor.
34  void qsamplerChannelForm::init (void)  void qsamplerChannelForm::init (void)
# Line 72  void qsamplerChannelForm::setup ( qsampl Line 71  void qsamplerChannelForm::setup ( qsampl
71    
72          // It can be a brand new channel, remember?          // It can be a brand new channel, remember?
73          bool bNew = (m_pChannel->channelID() < 0);          bool bNew = (m_pChannel->channelID() < 0);
74          setCaption(m_pChannel->channelName());          setCaption(QSAMPLER_TITLE ": " + m_pChannel->channelName());
75    
76          // Check if we're up and connected.          // Check if we're up and connected.
77          if (m_pChannel->client() == NULL)          if (m_pChannel->client() == NULL)
# Line 88  void qsamplerChannelForm::setup ( qsampl Line 87  void qsamplerChannelForm::setup ( qsampl
87          // Load combo box history...          // Load combo box history...
88          pOptions->loadComboBoxHistory(InstrumentFileComboBox);          pOptions->loadComboBoxHistory(InstrumentFileComboBox);
89    
90            // Notify.that we've just changed one audio route.
91            QObject::connect(AudioRoutingTable, SIGNAL(valueChanged(int,int)),
92                    this, SLOT(changeAudioRouting(int,int)));
93    
94          // Populate Engines list.          // Populate Engines list.
95          const char **ppszEngines = ::lscp_get_available_engines(m_pChannel->client());          const char **ppszEngines = ::lscp_list_available_engines(m_pChannel->client());
96          if (ppszEngines) {          if (ppszEngines) {
97                  EngineNameComboBox->clear();                  EngineNameComboBox->clear();
98                  for (int iEngine = 0; ppszEngines[iEngine]; iEngine++)                  for (int iEngine = 0; ppszEngines[iEngine]; iEngine++)
99                          EngineNameComboBox->insertItem(ppszEngines[iEngine]);                          EngineNameComboBox->insertItem(ppszEngines[iEngine]);
100          }          }
101          else m_pChannel->appendMessagesClient("lscp_get_available_engines");          else m_pChannel->appendMessagesClient("lscp_list_available_engines");
102    
103          // Populate Audio output type list.          // Populate Audio output type list.
104          AudioDriverComboBox->clear();          AudioDriverComboBox->clear();
# Line 215  void qsamplerChannelForm::accept (void) Line 218  void qsamplerChannelForm::accept (void)
218                                  iErrors++;                                  iErrors++;
219                          else if (!m_pChannel->setAudioDevice(pDevice->deviceID()))                          else if (!m_pChannel->setAudioDevice(pDevice->deviceID()))
220                                  iErrors++;                                  iErrors++;
221                            else if (!m_audioRouting.isEmpty()) {
222                                    // Set the audio route changes...
223                                    qsamplerChannelRoutingMap::ConstIterator iter;
224                                    for (iter = m_audioRouting.begin();
225                                                    iter != m_audioRouting.end(); ++iter) {
226                                            if (!m_pChannel->setAudioChannel(iter.key(), iter.data()))
227                                                    iErrors++;
228                                    }
229                            }
230                  }                  }
231                  // Accept MIDI driver or device selection...                  // Accept MIDI driver or device selection...
232                  if (m_midiDevices.isEmpty()) {                  if (m_midiDevices.isEmpty()) {
# Line 263  void qsamplerChannelForm::reject (void) Line 275  void qsamplerChannelForm::reject (void)
275    
276          // Check if there's any pending changes...          // Check if there's any pending changes...
277          if (m_iDirtyCount > 0 && OkPushButton->isEnabled()) {          if (m_iDirtyCount > 0 && OkPushButton->isEnabled()) {
278                  switch (QMessageBox::warning(this, tr("Warning"),                  switch (QMessageBox::warning(this,
279                            QSAMPLER_TITLE ": " + tr("Warning"),
280                          tr("Some channel settings have been changed.\n\n"                          tr("Some channel settings have been changed.\n\n"
281                          "Do you want to apply the changes?"),                          "Do you want to apply the changes?"),
282                          tr("Apply"), tr("Discard"), tr("Cancel"))) {                          tr("Apply"), tr("Discard"), tr("Cancel"))) {
# Line 292  void qsamplerChannelForm::openInstrument Line 305  void qsamplerChannelForm::openInstrument
305          // FIXME: the instrument file filters should be restricted,          // FIXME: the instrument file filters should be restricted,
306          // depending on the current engine.          // depending on the current engine.
307          QString sInstrumentFile = QFileDialog::getOpenFileName(          QString sInstrumentFile = QFileDialog::getOpenFileName(
308                          pOptions->sInstrumentDir,                   // Start here.                  pOptions->sInstrumentDir,                   // Start here.
309                          tr("Instrument files") + " (*.gig *.dls)",  // Filter (GIG and DLS files)                  tr("Instrument files") + " (*.gig *.dls)",  // Filter (GIG and DLS files)
310                          this, 0,                                    // Parent and name (none)                  this, 0,                                    // Parent and name (none)
311                          tr("Instrument files")                      // Caption.                  QSAMPLER_TITLE ": " + tr("Instrument files")    // Caption.
312          );          );
313    
314          if (sInstrumentFile.isEmpty())          if (sInstrumentFile.isEmpty())
315                  return;                  return;
316    
317          InstrumentFileComboBox->setCurrentText(sInstrumentFile);          InstrumentFileComboBox->setCurrentText(sInstrumentFile);
318            updateInstrumentName();
319  }  }
320    
321    
# Line 392  void qsamplerChannelForm::selectMidiDriv Line 406  void qsamplerChannelForm::selectMidiDriv
406                                          pDevice = m_midiDevices.next()) {                                          pDevice = m_midiDevices.next()) {
407                          if (pDevice->deviceID() == iDeviceID) {                          if (pDevice->deviceID() == iDeviceID) {
408                                  MidiDeviceComboBox->setCurrentItem(iMidiItem);                                  MidiDeviceComboBox->setCurrentItem(iMidiItem);
409                          //      selectMidiDeviceItem(iMidiItem);                                  selectMidiDeviceItem(iMidiItem);
410                                  break;                                  break;
411                          }                          }
412                          iMidiItem++;                          iMidiItem++;
# Line 491  void qsamplerChannelForm::selectAudioDri Line 505  void qsamplerChannelForm::selectAudioDri
505                                          pDevice = m_audioDevices.next()) {                                          pDevice = m_audioDevices.next()) {
506                          if (pDevice->deviceID() == iDeviceID) {                          if (pDevice->deviceID() == iDeviceID) {
507                                  AudioDeviceComboBox->setCurrentItem(iAudioItem);                                  AudioDeviceComboBox->setCurrentItem(iAudioItem);
508                          //      selectAudioDeviceItem(iAudioItem);                                  selectAudioDeviceItem(iAudioItem);
509                                  break;                                  break;
510                          }                          }
511                          iAudioItem++;                          iAudioItem++;
# Line 499  void qsamplerChannelForm::selectAudioDri Line 513  void qsamplerChannelForm::selectAudioDri
513          }          }
514          AudioDeviceTextLabel->setEnabled(bEnabled);          AudioDeviceTextLabel->setEnabled(bEnabled);
515          AudioDeviceComboBox->setEnabled(bEnabled);          AudioDeviceComboBox->setEnabled(bEnabled);
516            AudioRoutingTable->setEnabled(bEnabled);
517            if (!bEnabled)
518                    AudioRoutingTable->setNumRows(0);
519  }  }
520    
521    
# Line 518  void qsamplerChannelForm::selectAudioDev Line 535  void qsamplerChannelForm::selectAudioDev
535  {  {
536          qsamplerDevice *pDevice = m_audioDevices.at(iAudioItem);          qsamplerDevice *pDevice = m_audioDevices.at(iAudioItem);
537          if (pDevice) {          if (pDevice) {
538                  // Is there anything to do here?                  // Refresh the audio routing table.
539                    AudioRoutingTable->refresh(pDevice, m_pChannel->audioRouting());
540                    // Reset routing change map.
541                    m_audioRouting.clear();
542          }          }
543  }  }
544    
# Line 542  void qsamplerChannelForm::setupAudioDevi Line 562  void qsamplerChannelForm::setupAudioDevi
562  }  }
563    
564    
565    // Audio routing change slot.
566    void qsamplerChannelForm::changeAudioRouting ( int iRow, int iCol )
567    {
568            if (m_iDirtySetup > 0)
569                    return;
570            if (iRow < 0 || iCol < 0)
571                    return;
572    
573            // Verify that this is a QComboTableItem (magic rtti == 1)
574            QTableItem *pItem = AudioRoutingTable->item(iRow, iCol);
575            if (pItem == NULL)
576                    return;
577            if (pItem->rtti() == 1) {       // 1 == QComboTableItem
578                    QComboTableItem *pComboItem = (QComboTableItem *) pItem;
579                    // FIXME: Its not garanteed that we must have
580                    // iAudioOut == iRow on all times forth!
581                    m_audioRouting[iRow] = pComboItem->currentItem();
582                    // And let's get dirty...
583                    m_iDirtyCount++;
584            }
585    }
586    
587    
588  // UPdate all device lists slot.  // UPdate all device lists slot.
589  void qsamplerChannelForm::updateDevices (void)  void qsamplerChannelForm::updateDevices (void)
590  {  {

Legend:
Removed from v.490  
changed lines
  Added in v.758

  ViewVC Help
Powered by ViewVC