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

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

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

revision 1840 by capela, Thu Feb 19 11:44:57 2009 UTC revision 2389 by capela, Sun Dec 30 15:34:06 2012 UTC
# Line 1  Line 1 
1  // qsamplerChannelForm.cpp  // qsamplerChannelForm.cpp
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2004-2009, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2012, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007, 2008 Christian Schoenebeck     Copyright (C) 2007, 2008 Christian Schoenebeck
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
# Line 64  ChannelForm::ChannelForm ( QWidget* pPar Line 64  ChannelForm::ChannelForm ( QWidget* pPar
64    
65          m_ui.AudioRoutingTable->setModel(&m_routingModel);          m_ui.AudioRoutingTable->setModel(&m_routingModel);
66          m_ui.AudioRoutingTable->setItemDelegate(&m_routingDelegate);          m_ui.AudioRoutingTable->setItemDelegate(&m_routingDelegate);
67    #if QT_VERSION >= 0x050000
68            m_ui.AudioRoutingTable->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
69    #else
70          m_ui.AudioRoutingTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);          m_ui.AudioRoutingTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
71    #endif
72  //      m_ui.AudioRoutingTable->verticalHeader()->hide();  //      m_ui.AudioRoutingTable->verticalHeader()->hide();
73    
74          // This goes initially hidden, and will be shown          // This goes initially hidden, and will be shown
# Line 107  ChannelForm::ChannelForm ( QWidget* pPar Line 111  ChannelForm::ChannelForm ( QWidget* pPar
111          QObject::connect(m_ui.AudioDeviceComboBox,          QObject::connect(m_ui.AudioDeviceComboBox,
112                  SIGNAL(activated(int)),                  SIGNAL(activated(int)),
113                  SLOT(selectAudioDevice(int)));                  SLOT(selectAudioDevice(int)));
114          QObject::connect(m_ui.OkPushButton,          QObject::connect(m_ui.DialogButtonBox,
115                  SIGNAL(clicked()),                  SIGNAL(accepted()),
116                  SLOT(accept()));                  SLOT(accept()));
117          QObject::connect(m_ui.CancelPushButton,          QObject::connect(m_ui.DialogButtonBox,
118                  SIGNAL(clicked()),                  SIGNAL(rejected()),
119                  SLOT(reject()));                  SLOT(reject()));
120          QObject::connect(m_ui.MidiDeviceToolButton,          QObject::connect(m_ui.MidiDeviceToolButton,
121                  SIGNAL(clicked()),                  SIGNAL(clicked()),
# Line 434  void ChannelForm::reject (void) Line 438  void ChannelForm::reject (void)
438          bool bReject = true;          bool bReject = true;
439    
440          // Check if there's any pending changes...          // Check if there's any pending changes...
441          if (m_iDirtyCount > 0 && m_ui.OkPushButton->isEnabled()) {          if (m_iDirtyCount > 0) {
442                  switch (QMessageBox::warning(this,                  switch (QMessageBox::warning(this,
443                          QSAMPLER_TITLE ": " + tr("Warning"),                          QSAMPLER_TITLE ": " + tr("Warning"),
444                          tr("Some channel settings have been changed.\n\n"                          tr("Some channel settings have been changed.\n\n"
# Line 473  void ChannelForm::openInstrumentFile (vo Line 477  void ChannelForm::openInstrumentFile (vo
477    
478          // FIXME: the instrument file filters should be restricted,          // FIXME: the instrument file filters should be restricted,
479          // depending on the current engine.          // depending on the current engine.
480            QStringList filters;
481            const QString& sEngineName = m_ui.EngineNameComboBox->currentText().toUpper();
482            if (sEngineName.contains("GIG"))
483                    filters << tr("GIG Instrument files") + " (*.gig *.dls)";
484            if (sEngineName.contains("SFZ"))
485                    filters << tr("SFZ Instrument files") + " (*.sfz)";
486            if (sEngineName.contains("SF2"))
487                    filters << tr("SF2 Instrument files") + " (*.sf2)";
488            filters << tr("All files") + " (*.*)";
489            const QString& filter = filters.join(";;");
490    
491          QString sInstrumentFile = QFileDialog::getOpenFileName(this,          QString sInstrumentFile = QFileDialog::getOpenFileName(this,
492                  QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption.                  QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption.
493                  pOptions->sInstrumentDir,                 // Start here.                  pOptions->sInstrumentDir, // Start here.
494                  tr("Instrument files") + " (*.gig *.dls)" // Filter (GIG and DLS files)                  filter                    // File filter.
495          );          );
496    
497          if (sInstrumentFile.isEmpty())          if (sInstrumentFile.isEmpty())
# Line 570  void ChannelForm::selectMidiDriverItem ( Line 585  void ChannelForm::selectMidiDriverItem (
585          m_midiDevices.clear();          m_midiDevices.clear();
586    
587          // Populate with the current ones...          // Populate with the current ones...
588          const QPixmap midiPixmap(":/icons/midi2.png");          const QPixmap midiPixmap(":/images/midi2.png");
589          int *piDeviceIDs = Device::getDevices(pMainForm->client(),          int *piDeviceIDs = Device::getDevices(pMainForm->client(),
590                  Device::Midi);                  Device::Midi);
591          for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) {          for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) {
# Line 685  void ChannelForm::selectAudioDriverItem Line 700  void ChannelForm::selectAudioDriverItem
700          m_audioDevices.clear();          m_audioDevices.clear();
701    
702          // Populate with the current ones...          // Populate with the current ones...
703          const QPixmap audioPixmap(":/icons/audio2.png");          const QPixmap audioPixmap(":/images/audio2.png");
704          int *piDeviceIDs = Device::getDevices(pMainForm->client(),          int *piDeviceIDs = Device::getDevices(pMainForm->client(),
705                  Device::Audio);                  Device::Audio);
706          for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) {          for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) {
# Line 807  void ChannelForm::stabilizeForm (void) Line 822  void ChannelForm::stabilizeForm (void)
822          const QString& sPath = InstrumentFileComboBox->currentText();          const QString& sPath = InstrumentFileComboBox->currentText();
823          bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists();          bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists();
824  #endif  #endif
825          m_ui.OkPushButton->setEnabled(m_iDirtyCount > 0 && bValid);          m_ui.DialogButtonBox->button(
826                    QDialogButtonBox::Ok)->setEnabled(m_iDirtyCount > 0 && bValid);
827  }  }
828    
829    

Legend:
Removed from v.1840  
changed lines
  Added in v.2389

  ViewVC Help
Powered by ViewVC