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) |
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()); |
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()); |
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 |
|
|