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

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

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

revision 968 by capela, Sun Dec 3 18:27:23 2006 UTC revision 969 by capela, Wed Dec 6 19:38:02 2006 UTC
# Line 33  Line 33 
33  #include <qfileinfo.h>  #include <qfileinfo.h>
34  #include <qlistbox.h>  #include <qlistbox.h>
35    
36    // Needed for lroundf()
37    #include <math.h>
38    
39    
40  // Kind of constructor.  // Kind of constructor.
41  void qsamplerInstrumentForm::init (void)  void qsamplerInstrumentForm::init (void)
# Line 104  void qsamplerInstrumentForm::setup ( qsa Line 107  void qsamplerInstrumentForm::setup ( qsa
107          // and populate the instrument form fields.          // and populate the instrument form fields.
108    
109          // Instrument bank/program...          // Instrument bank/program...
110          BankSpinBox->setValue(m_pInstrument->bank());          int iBank = m_pInstrument->bank();
111          ProgramSpinBox->setValue(m_pInstrument->program());          int iProgram = m_pInstrument->program();
112            BankSpinBox->setValue(iBank);
113            ProgramSpinBox->setValue(iProgram);
114            // Spacial hack to avoid changes on the key...
115            if (!bNew) {
116                    BankSpinBox->setRange(iBank, iBank);
117                    ProgramSpinBox->setRange(iProgram, iProgram);
118            }
119    
120          // Instrument name...          // Instrument name...
121          NameLineEdit->setText(m_pInstrument->name());          NameLineEdit->setText(m_pInstrument->name());
# Line 133  void qsamplerInstrumentForm::setup ( qsa Line 143  void qsamplerInstrumentForm::setup ( qsa
143          InstrumentNrComboBox->setCurrentItem(m_pInstrument->instrumentNr());          InstrumentNrComboBox->setCurrentItem(m_pInstrument->instrumentNr());
144    
145          // Instrument volume....          // Instrument volume....
146          VolumeSpinBox->setValue(int(m_pInstrument->volume() * 100.0f));          VolumeSpinBox->setValue(::lroundf(100.0f * m_pInstrument->volume()));
147    
148          // Instrument load mode...          // Instrument load mode...
149          LoadModeComboBox->setCurrentItem(m_pInstrument->loadMode());          LoadModeComboBox->setCurrentItem(m_pInstrument->loadMode());
# Line 249  void qsamplerInstrumentForm::accept (voi Line 259  void qsamplerInstrumentForm::accept (voi
259                  m_pInstrument->setEngineName(EngineNameComboBox->currentText());                  m_pInstrument->setEngineName(EngineNameComboBox->currentText());
260                  m_pInstrument->setInstrumentFile(InstrumentFileComboBox->currentText());                  m_pInstrument->setInstrumentFile(InstrumentFileComboBox->currentText());
261                  m_pInstrument->setInstrumentNr(InstrumentNrComboBox->currentItem());                  m_pInstrument->setInstrumentNr(InstrumentNrComboBox->currentItem());
262                  m_pInstrument->setVolume(float(VolumeSpinBox->value() / 100));                  m_pInstrument->setVolume(0.01f * float(VolumeSpinBox->value()));
263                  m_pInstrument->setLoadMode(LoadModeComboBox->currentItem());                  m_pInstrument->setLoadMode(LoadModeComboBox->currentItem());
264          }          }
265    

Legend:
Removed from v.968  
changed lines
  Added in v.969

  ViewVC Help
Powered by ViewVC