2 |
// |
// |
3 |
// ui.h extension file, included from the uic-generated form implementation. |
// ui.h extension file, included from the uic-generated form implementation. |
4 |
/**************************************************************************** |
/**************************************************************************** |
5 |
Copyright (C) 2004, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2005, rncbc aka Rui Nuno Capela. All rights reserved. |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
110 |
|
|
111 |
// Engine name... |
// Engine name... |
112 |
QString sEngineName = pChannel->engineName(); |
QString sEngineName = pChannel->engineName(); |
113 |
if (sEngineName.isEmpty() && bNew) |
if (sEngineName.isEmpty() || bNew) |
114 |
sEngineName = pOptions->sEngineName; |
sEngineName = pOptions->sEngineName; |
115 |
if (sEngineName.isEmpty()) |
if (sEngineName.isEmpty()) |
116 |
sEngineName = tr("(No engine)"); |
sEngineName = qsamplerChannel::noEngineName(); |
117 |
if (EngineNameComboBox->listBox()->findItem(sEngineName, Qt::ExactMatch) == NULL) |
if (EngineNameComboBox->listBox()->findItem(sEngineName, Qt::ExactMatch) == NULL) |
118 |
EngineNameComboBox->insertItem(sEngineName); |
EngineNameComboBox->insertItem(sEngineName); |
119 |
EngineNameComboBox->setCurrentText(sEngineName); |
EngineNameComboBox->setCurrentText(sEngineName); |
120 |
// Instrument filename and index... |
// Instrument filename and index... |
121 |
QString sInstrumentFile = pChannel->instrumentFile(); |
QString sInstrumentFile = pChannel->instrumentFile(); |
122 |
if (sInstrumentFile.isEmpty()) |
if (sInstrumentFile.isEmpty()) |
123 |
sInstrumentFile = tr("(No instrument)"); |
sInstrumentFile = qsamplerChannel::noInstrumentName(); |
124 |
InstrumentFileComboBox->setCurrentText(sInstrumentFile); |
InstrumentFileComboBox->setCurrentText(sInstrumentFile); |
125 |
InstrumentNrSpinBox->setValue(pChannel->instrumentNr()); |
InstrumentNrComboBox->clear(); |
126 |
|
InstrumentNrComboBox->insertStringList( |
127 |
|
qsamplerChannel::getInstrumentList(sInstrumentFile, |
128 |
|
pOptions->bInstrumentNames)); |
129 |
|
InstrumentNrComboBox->setCurrentItem(pChannel->instrumentNr()); |
130 |
// MIDI input driver... |
// MIDI input driver... |
131 |
QString sMidiDriver = pChannel->midiDriver(); |
QString sMidiDriver = pChannel->midiDriver(); |
132 |
if (sMidiDriver.isEmpty() || bNew) |
if (sMidiDriver.isEmpty() || bNew) |
153 |
AudioDriverComboBox->insertItem(sAudioDriver); |
AudioDriverComboBox->insertItem(sAudioDriver); |
154 |
AudioDriverComboBox->setCurrentText(sAudioDriver); |
AudioDriverComboBox->setCurrentText(sAudioDriver); |
155 |
} |
} |
156 |
|
// As convenient, make it ready on stabilizeForm() for |
157 |
|
// prompt acceptance, if we got the minimum required... |
158 |
|
if (sEngineName != qsamplerChannel::noEngineName() && |
159 |
|
sInstrumentFile != qsamplerChannel::noInstrumentName()) |
160 |
|
m_iDirtyCount++; |
161 |
// Done. |
// Done. |
162 |
m_iDirtySetup--; |
m_iDirtySetup--; |
163 |
stabilizeForm(); |
stabilizeForm(); |
196 |
if (!m_pChannel->loadEngine(EngineNameComboBox->currentText())) |
if (!m_pChannel->loadEngine(EngineNameComboBox->currentText())) |
197 |
iErrors++; |
iErrors++; |
198 |
// Instrument file and index... |
// Instrument file and index... |
199 |
if (!m_pChannel->loadInstrument(InstrumentFileComboBox->currentText(), InstrumentNrSpinBox->value())) |
if (!m_pChannel->loadInstrument(InstrumentFileComboBox->currentText(), InstrumentNrComboBox->currentItem())) |
200 |
iErrors++; |
iErrors++; |
201 |
// Show error messages? |
// Show error messages? |
202 |
if (iErrors > 0) |
if (iErrors > 0) |
267 |
// Refresh the actual instrument name. |
// Refresh the actual instrument name. |
268 |
void qsamplerChannelForm::updateInstrumentName (void) |
void qsamplerChannelForm::updateInstrumentName (void) |
269 |
{ |
{ |
270 |
// FIXME: A better idea would be to use libgig |
qsamplerOptions *pOptions = m_pChannel->options(); |
271 |
// to retrieve the REAL instrument name. |
if (pOptions == NULL) |
272 |
InstrumentNameTextLabel->setText(QFileInfo(InstrumentFileComboBox->currentText()).fileName() |
return; |
273 |
+ " [" + QString::number(InstrumentNrSpinBox->value()) + "]"); |
|
274 |
|
// Finally this better idea would be to use libgig |
275 |
|
// to retrieve the REAL instrument names. |
276 |
|
InstrumentNrComboBox->clear(); |
277 |
|
InstrumentNrComboBox->insertStringList( |
278 |
|
qsamplerChannel::getInstrumentList( |
279 |
|
InstrumentFileComboBox->currentText(), |
280 |
|
pOptions->bInstrumentNames) |
281 |
|
); |
282 |
|
|
283 |
optionsChanged(); |
optionsChanged(); |
284 |
} |
} |