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

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

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

revision 1499 by capela, Tue Nov 20 16:48:04 2007 UTC revision 1506 by schoenebeck, Wed Nov 21 19:57:18 2007 UTC
# Line 44  static inline long lroundf ( float x ) Line 44  static inline long lroundf ( float x )
44  }  }
45  #endif  #endif
46    
47  InstrumentForm::InstrumentForm(QWidget* parent) : QDialog(parent) {  InstrumentForm::InstrumentForm ( QWidget* pParent )
48            : QDialog(pParent)
49    {
50      ui.setupUi(this);      ui.setupUi(this);
51    
52          // Initialize locals.          // Initialize locals.
# Line 96  InstrumentForm::InstrumentForm(QWidget* Line 98  InstrumentForm::InstrumentForm(QWidget*
98                  SLOT(reject()));                  SLOT(reject()));
99  }  }
100    
101  InstrumentForm::~InstrumentForm() {  
102    InstrumentForm::~InstrumentForm (void)
103    {
104  }  }
105    
106    
107  // Channel dialog setup formal initializer.  // Channel dialog setup formal initializer.
108  void InstrumentForm::setup ( qsamplerInstrument *pInstrument )  void InstrumentForm::setup ( qsamplerInstrument *pInstrument )
109  {  {
# Line 189  void InstrumentForm::setup ( qsamplerIns Line 194  void InstrumentForm::setup ( qsamplerIns
194                          Qt::MatchExactly | Qt::MatchCaseSensitive) < 0) {                          Qt::MatchExactly | Qt::MatchCaseSensitive) < 0) {
195                  ui.EngineNameComboBox->addItem(sEngineName);                  ui.EngineNameComboBox->addItem(sEngineName);
196          }          }
197          ui.EngineNameComboBox->setItemText(          ui.EngineNameComboBox->setCurrentIndex(
198                  ui.EngineNameComboBox->currentIndex(),                  ui.EngineNameComboBox->findText(sEngineName,
199                  sEngineName);                          Qt::MatchExactly | Qt::MatchCaseSensitive));
200    
201          // Instrument filename and index...          // Instrument filename and index...
202          QString sInstrumentFile = m_pInstrument->instrumentFile();          QString sInstrumentFile = m_pInstrument->instrumentFile();
203          if (sInstrumentFile.isEmpty())          if (sInstrumentFile.isEmpty())
204                  sInstrumentFile = qsamplerChannel::noInstrumentName();                  sInstrumentFile = qsamplerChannel::noInstrumentName();
205          ui.InstrumentFileComboBox->setItemText(          ui.InstrumentFileComboBox->setEditText(sInstrumentFile);
                 ui.InstrumentFileComboBox->currentIndex(),  
                 sInstrumentFile);  
206          ui.InstrumentNrComboBox->clear();          ui.InstrumentNrComboBox->clear();
207          ui.InstrumentNrComboBox->insertItems(0,          ui.InstrumentNrComboBox->insertItems(0,
208                  qsamplerChannel::getInstrumentList(sInstrumentFile,                  qsamplerChannel::getInstrumentList(sInstrumentFile,
# Line 258  void InstrumentForm::openInstrumentFile Line 262  void InstrumentForm::openInstrumentFile
262          if (sInstrumentFile.isEmpty())          if (sInstrumentFile.isEmpty())
263                  return;                  return;
264    
265          ui.InstrumentFileComboBox->setItemText(          ui.InstrumentFileComboBox->setEditText(sInstrumentFile);
                 ui.InstrumentFileComboBox->currentIndex(),  
                 sInstrumentFile);  
   
266          updateInstrumentName();          updateInstrumentName();
267  }  }
268    
# Line 391  void InstrumentForm::changed (void) Line 392  void InstrumentForm::changed (void)
392  // Stabilize current form state.  // Stabilize current form state.
393  void InstrumentForm::stabilizeForm (void)  void InstrumentForm::stabilizeForm (void)
394  {  {
395          bool bValid = !ui.NameLineEdit->text().isEmpty();          bool bValid =
396                    !ui.NameLineEdit->text().isEmpty() &&
397                    ui.EngineNameComboBox->currentIndex() >= 0 &&
398                    ui.EngineNameComboBox->currentText() !=
399                    qsamplerChannel::noEngineName();
400    
401          const QString& sPath = ui.InstrumentFileComboBox->currentText();          const QString& sPath = ui.InstrumentFileComboBox->currentText();
402          bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists();          bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists();

Legend:
Removed from v.1499  
changed lines
  Added in v.1506

  ViewVC Help
Powered by ViewVC