46 |
|
|
47 |
namespace QSampler { |
namespace QSampler { |
48 |
|
|
49 |
|
//------------------------------------------------------------------------- |
50 |
|
// QSampler::InstrumentForm -- Instrument map item form implementation. |
51 |
|
// |
52 |
|
|
53 |
InstrumentForm::InstrumentForm ( QWidget* pParent ) |
InstrumentForm::InstrumentForm ( QWidget* pParent ) |
54 |
: QDialog(pParent) |
: QDialog(pParent) |
55 |
{ |
{ |
111 |
|
|
112 |
|
|
113 |
// Channel dialog setup formal initializer. |
// Channel dialog setup formal initializer. |
114 |
void InstrumentForm::setup ( qsamplerInstrument *pInstrument ) |
void InstrumentForm::setup ( Instrument *pInstrument ) |
115 |
{ |
{ |
116 |
m_pInstrument = pInstrument; |
m_pInstrument = pInstrument; |
117 |
|
|
129 |
if (pMainForm->client() == NULL) |
if (pMainForm->client() == NULL) |
130 |
return; |
return; |
131 |
|
|
132 |
qsamplerOptions *pOptions = pMainForm->options(); |
Options *pOptions = pMainForm->options(); |
133 |
if (pOptions == NULL) |
if (pOptions == NULL) |
134 |
return; |
return; |
135 |
|
|
148 |
|
|
149 |
// Populate maps list. |
// Populate maps list. |
150 |
m_ui.MapComboBox->clear(); |
m_ui.MapComboBox->clear(); |
151 |
m_ui.MapComboBox->insertItems(0, qsamplerInstrument::getMapNames()); |
m_ui.MapComboBox->insertItems(0, Instrument::getMapNames()); |
152 |
|
|
153 |
// Populate Engines list. |
// Populate Engines list. |
154 |
const char **ppszEngines |
const char **ppszEngines |
167 |
int iMap = (bNew ? pOptions->iMidiMap : m_pInstrument->map()); |
int iMap = (bNew ? pOptions->iMidiMap : m_pInstrument->map()); |
168 |
if (iMap < 0) |
if (iMap < 0) |
169 |
iMap = 0; |
iMap = 0; |
170 |
const QString& sMapName = qsamplerInstrument::getMapName(iMap); |
const QString& sMapName = Instrument::getMapName(iMap); |
171 |
if (!sMapName.isEmpty()) { |
if (!sMapName.isEmpty()) { |
172 |
m_ui.MapComboBox->setCurrentIndex( |
m_ui.MapComboBox->setCurrentIndex( |
173 |
m_ui.MapComboBox->findText(sMapName, |
m_ui.MapComboBox->findText(sMapName, |
197 |
if (sEngineName.isEmpty() || bNew) |
if (sEngineName.isEmpty() || bNew) |
198 |
sEngineName = pOptions->sEngineName; |
sEngineName = pOptions->sEngineName; |
199 |
if (sEngineName.isEmpty()) |
if (sEngineName.isEmpty()) |
200 |
sEngineName = qsamplerChannel::noEngineName(); |
sEngineName = Channel::noEngineName(); |
201 |
if (m_ui.EngineNameComboBox->findText(sEngineName, |
if (m_ui.EngineNameComboBox->findText(sEngineName, |
202 |
Qt::MatchExactly | Qt::MatchCaseSensitive) < 0) { |
Qt::MatchExactly | Qt::MatchCaseSensitive) < 0) { |
203 |
m_ui.EngineNameComboBox->addItem(sEngineName); |
m_ui.EngineNameComboBox->addItem(sEngineName); |
209 |
// Instrument filename and index... |
// Instrument filename and index... |
210 |
QString sInstrumentFile = m_pInstrument->instrumentFile(); |
QString sInstrumentFile = m_pInstrument->instrumentFile(); |
211 |
if (sInstrumentFile.isEmpty()) |
if (sInstrumentFile.isEmpty()) |
212 |
sInstrumentFile = qsamplerChannel::noInstrumentName(); |
sInstrumentFile = Channel::noInstrumentName(); |
213 |
m_ui.InstrumentFileComboBox->setEditText(sInstrumentFile); |
m_ui.InstrumentFileComboBox->setEditText(sInstrumentFile); |
214 |
m_ui.InstrumentNrComboBox->clear(); |
m_ui.InstrumentNrComboBox->clear(); |
215 |
m_ui.InstrumentNrComboBox->insertItems(0, |
m_ui.InstrumentNrComboBox->insertItems(0, |
216 |
qsamplerChannel::getInstrumentList(sInstrumentFile, |
Channel::getInstrumentList(sInstrumentFile, |
217 |
pOptions->bInstrumentNames)); |
pOptions->bInstrumentNames)); |
218 |
m_ui.InstrumentNrComboBox->setCurrentIndex(m_pInstrument->instrumentNr()); |
m_ui.InstrumentNrComboBox->setCurrentIndex(m_pInstrument->instrumentNr()); |
219 |
|
|
255 |
if (pMainForm == NULL) |
if (pMainForm == NULL) |
256 |
return; |
return; |
257 |
|
|
258 |
qsamplerOptions *pOptions = pMainForm->options(); |
Options *pOptions = pMainForm->options(); |
259 |
if (pOptions == NULL) |
if (pOptions == NULL) |
260 |
return; |
return; |
261 |
|
|
282 |
if (pMainForm == NULL) |
if (pMainForm == NULL) |
283 |
return; |
return; |
284 |
|
|
285 |
qsamplerOptions *pOptions = pMainForm->options(); |
Options *pOptions = pMainForm->options(); |
286 |
if (pOptions == NULL) |
if (pOptions == NULL) |
287 |
return; |
return; |
288 |
|
|
290 |
// to retrieve the REAL instrument names. |
// to retrieve the REAL instrument names. |
291 |
m_ui.InstrumentNrComboBox->clear(); |
m_ui.InstrumentNrComboBox->clear(); |
292 |
m_ui.InstrumentNrComboBox->insertItems(0, |
m_ui.InstrumentNrComboBox->insertItems(0, |
293 |
qsamplerChannel::getInstrumentList( |
Channel::getInstrumentList( |
294 |
m_ui.InstrumentFileComboBox->currentText(), |
m_ui.InstrumentFileComboBox->currentText(), |
295 |
pOptions->bInstrumentNames) |
pOptions->bInstrumentNames) |
296 |
); |
); |
326 |
if (pMainForm->client() == NULL) |
if (pMainForm->client() == NULL) |
327 |
return; |
return; |
328 |
|
|
329 |
qsamplerOptions *pOptions = pMainForm->options(); |
Options *pOptions = pMainForm->options(); |
330 |
if (pOptions == NULL) |
if (pOptions == NULL) |
331 |
return; |
return; |
332 |
|
|
404 |
!m_ui.NameLineEdit->text().isEmpty() && |
!m_ui.NameLineEdit->text().isEmpty() && |
405 |
m_ui.EngineNameComboBox->currentIndex() >= 0 && |
m_ui.EngineNameComboBox->currentIndex() >= 0 && |
406 |
m_ui.EngineNameComboBox->currentText() != |
m_ui.EngineNameComboBox->currentText() != |
407 |
qsamplerChannel::noEngineName(); |
Channel::noEngineName(); |
408 |
|
|
409 |
const QString& sPath = m_ui.InstrumentFileComboBox->currentText(); |
const QString& sPath = m_ui.InstrumentFileComboBox->currentText(); |
410 |
bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists(); |
bValid = bValid && !sPath.isEmpty() && QFileInfo(sPath).exists(); |