87 |
EngineNameComboBox->insertItem(ppszEngines[iEngine]); |
EngineNameComboBox->insertItem(ppszEngines[iEngine]); |
88 |
} |
} |
89 |
else m_pChannel->appendMessagesClient("lscp_get_available_engines"); |
else m_pChannel->appendMessagesClient("lscp_get_available_engines"); |
90 |
/* |
|
91 |
// Populate Audio output type list. |
// Populate Audio output type list. |
92 |
const char **ppszAudioDrivers = ::lscp_get_available_audio_drivers(m_pChannel->client()); |
const char **ppszAudioDrivers = ::lscp_get_available_audio_drivers(m_pChannel->client()); |
93 |
if (ppszAudioDrivers) { |
if (ppszAudioDrivers) { |
105 |
MidiDriverComboBox->insertItem(ppszMidiDrivers[iMidiDriver]); |
MidiDriverComboBox->insertItem(ppszMidiDrivers[iMidiDriver]); |
106 |
} |
} |
107 |
else m_pChannel->appendMessagesClient("lscp_get_available_midi_drivers"); |
else m_pChannel->appendMessagesClient("lscp_get_available_midi_drivers"); |
108 |
*/ |
|
109 |
// Read proper channel information, |
// Read proper channel information, |
110 |
// and populate the channel form fields. |
// and populate the channel form fields. |
111 |
|
|
112 |
// Engine name... |
// Engine name... |
113 |
const QString& sEngineName = pChannel->engineName(); |
QString sEngineName = pChannel->engineName(); |
114 |
if (!sEngineName.isEmpty()) { |
if (sEngineName.isEmpty()) |
115 |
if (EngineNameComboBox->listBox()->findItem(sEngineName, Qt::ExactMatch) == NULL) |
sEngineName = tr("(No engine)"); |
116 |
EngineNameComboBox->insertItem(sEngineName); |
if (EngineNameComboBox->listBox()->findItem(sEngineName, Qt::ExactMatch) == NULL) |
117 |
EngineNameComboBox->setCurrentText(sEngineName); |
EngineNameComboBox->insertItem(sEngineName); |
118 |
} |
EngineNameComboBox->setCurrentText(sEngineName); |
119 |
// Instrument filename and index... |
// Instrument filename and index... |
120 |
InstrumentFileComboBox->setCurrentText(pChannel->instrumentFile()); |
QString sInstrumentFile = pChannel->instrumentFile(); |
121 |
|
if (sInstrumentFile.isEmpty()) |
122 |
|
sInstrumentFile = tr("(No instrument)"); |
123 |
|
InstrumentFileComboBox->setCurrentText(sInstrumentFile); |
124 |
InstrumentNrSpinBox->setValue(pChannel->instrumentNr()); |
InstrumentNrSpinBox->setValue(pChannel->instrumentNr()); |
125 |
// MIDI input... |
// MIDI input... |
126 |
const QString& sMidiDriver = pChannel->midiDriver(); |
const QString& sMidiDriver = pChannel->midiDriver(); |
138 |
AudioDriverComboBox->insertItem(sAudioDriver); |
AudioDriverComboBox->insertItem(sAudioDriver); |
139 |
AudioDriverComboBox->setCurrentText(sAudioDriver); |
AudioDriverComboBox->setCurrentText(sAudioDriver); |
140 |
} |
} |
|
// FIXME: Disable this while we don't know what to do. |
|
|
MidiPortTextLabel->setEnabled(false); |
|
|
MidiPortSpinBox->setEnabled(false); |
|
141 |
// Done. |
// Done. |
142 |
m_iDirtySetup--; |
m_iDirtySetup--; |
143 |
stabilizeForm(); |
stabilizeForm(); |
157 |
// We'll go for it! |
// We'll go for it! |
158 |
if (m_iDirtyCount > 0) { |
if (m_iDirtyCount > 0) { |
159 |
int iErrors = 0; |
int iErrors = 0; |
160 |
// Engine name... |
// Audio output driver type... |
161 |
if (!m_pChannel->loadEngine(EngineNameComboBox->currentText())) |
if (!m_pChannel->setAudioDriver(AudioDriverComboBox->currentText())) |
162 |
iErrors++; |
iErrors++; |
163 |
// MIDI input driver type... |
// MIDI input driver type... |
164 |
if (!m_pChannel->setMidiDriver(MidiDriverComboBox->currentText())) |
if (!m_pChannel->setMidiDriver(MidiDriverComboBox->currentText())) |
169 |
// MIDI input channel... |
// MIDI input channel... |
170 |
if (!m_pChannel->setMidiChannel(MidiChannelSpinBox->value())) |
if (!m_pChannel->setMidiChannel(MidiChannelSpinBox->value())) |
171 |
iErrors++; |
iErrors++; |
172 |
// Audio output driver type... |
// Engine name... |
173 |
if (!m_pChannel->setAudioDriver(AudioDriverComboBox->currentText())) |
if (!m_pChannel->loadEngine(EngineNameComboBox->currentText())) |
174 |
iErrors++; |
iErrors++; |
175 |
// Instrument file and index... |
// Instrument file and index... |
176 |
if (!m_pChannel->loadInstrument(InstrumentFileComboBox->currentText(), InstrumentNrSpinBox->value())) |
if (!m_pChannel->loadInstrument(InstrumentFileComboBox->currentText(), InstrumentNrSpinBox->value())) |
265 |
// Stabilize current form state. |
// Stabilize current form state. |
266 |
void qsamplerChannelForm::stabilizeForm (void) |
void qsamplerChannelForm::stabilizeForm (void) |
267 |
{ |
{ |
268 |
const QString sFilename = InstrumentFileComboBox->currentText(); |
const QString& sFilename = InstrumentFileComboBox->currentText(); |
269 |
OkPushButton->setEnabled(m_iDirtyCount > 0 && !sFilename.isEmpty() && QFileInfo(sFilename).exists()); |
OkPushButton->setEnabled(m_iDirtyCount > 0 && !sFilename.isEmpty() && QFileInfo(sFilename).exists()); |
270 |
} |
} |
271 |
|
|