20 |
|
|
21 |
*****************************************************************************/ |
*****************************************************************************/ |
22 |
|
|
23 |
|
#include "qsamplerAbout.h" |
24 |
|
#include "qsamplerDeviceForm.h" |
25 |
|
|
26 |
#include <qvalidator.h> |
#include <qvalidator.h> |
27 |
#include <qmessagebox.h> |
#include <qmessagebox.h> |
28 |
#include <qfiledialog.h> |
#include <qfiledialog.h> |
29 |
#include <qfileinfo.h> |
#include <qfileinfo.h> |
30 |
#include <qlistbox.h> |
#include <qlistbox.h> |
31 |
|
|
|
#include "qsamplerDeviceForm.h" |
|
|
|
|
|
#include "config.h" |
|
|
|
|
32 |
|
|
33 |
// Kind of constructor. |
// Kind of constructor. |
34 |
void qsamplerChannelForm::init (void) |
void qsamplerChannelForm::init (void) |
71 |
|
|
72 |
// It can be a brand new channel, remember? |
// It can be a brand new channel, remember? |
73 |
bool bNew = (m_pChannel->channelID() < 0); |
bool bNew = (m_pChannel->channelID() < 0); |
74 |
setCaption(m_pChannel->channelName()); |
setCaption(QSAMPLER_TITLE ": " + m_pChannel->channelName()); |
75 |
|
|
76 |
// Check if we're up and connected. |
// Check if we're up and connected. |
77 |
if (m_pChannel->client() == NULL) |
if (m_pChannel->client() == NULL) |
88 |
pOptions->loadComboBoxHistory(InstrumentFileComboBox); |
pOptions->loadComboBoxHistory(InstrumentFileComboBox); |
89 |
|
|
90 |
// Populate Engines list. |
// Populate Engines list. |
91 |
const char **ppszEngines = ::lscp_get_available_engines(m_pChannel->client()); |
const char **ppszEngines = ::lscp_list_available_engines(m_pChannel->client()); |
92 |
if (ppszEngines) { |
if (ppszEngines) { |
93 |
EngineNameComboBox->clear(); |
EngineNameComboBox->clear(); |
94 |
for (int iEngine = 0; ppszEngines[iEngine]; iEngine++) |
for (int iEngine = 0; ppszEngines[iEngine]; iEngine++) |
95 |
EngineNameComboBox->insertItem(ppszEngines[iEngine]); |
EngineNameComboBox->insertItem(ppszEngines[iEngine]); |
96 |
} |
} |
97 |
else m_pChannel->appendMessagesClient("lscp_get_available_engines"); |
else m_pChannel->appendMessagesClient("lscp_list_available_engines"); |
98 |
|
|
99 |
// Populate Audio output type list. |
// Populate Audio output type list. |
100 |
AudioDriverComboBox->clear(); |
AudioDriverComboBox->clear(); |
262 |
|
|
263 |
// Check if there's any pending changes... |
// Check if there's any pending changes... |
264 |
if (m_iDirtyCount > 0 && OkPushButton->isEnabled()) { |
if (m_iDirtyCount > 0 && OkPushButton->isEnabled()) { |
265 |
switch (QMessageBox::warning(this, tr("Warning"), |
switch (QMessageBox::warning(this, |
266 |
|
QSAMPLER_TITLE ": " + tr("Warning"), |
267 |
tr("Some channel settings have been changed.\n\n" |
tr("Some channel settings have been changed.\n\n" |
268 |
"Do you want to apply the changes?"), |
"Do you want to apply the changes?"), |
269 |
tr("Apply"), tr("Discard"), tr("Cancel"))) { |
tr("Apply"), tr("Discard"), tr("Cancel"))) { |
292 |
// FIXME: the instrument file filters should be restricted, |
// FIXME: the instrument file filters should be restricted, |
293 |
// depending on the current engine. |
// depending on the current engine. |
294 |
QString sInstrumentFile = QFileDialog::getOpenFileName( |
QString sInstrumentFile = QFileDialog::getOpenFileName( |
295 |
pOptions->sInstrumentDir, // Start here. |
pOptions->sInstrumentDir, // Start here. |
296 |
tr("Instrument files") + " (*.gig *.dls)", // Filter (GIG and DLS files) |
tr("Instrument files") + " (*.gig *.dls)", // Filter (GIG and DLS files) |
297 |
this, 0, // Parent and name (none) |
this, 0, // Parent and name (none) |
298 |
tr("Instrument files") // Caption. |
QSAMPLER_TITLE ": " + tr("Instrument files") // Caption. |
299 |
); |
); |
300 |
|
|
301 |
if (sInstrumentFile.isEmpty()) |
if (sInstrumentFile.isEmpty()) |
302 |
return; |
return; |
303 |
|
|
304 |
InstrumentFileComboBox->setCurrentText(sInstrumentFile); |
InstrumentFileComboBox->setCurrentText(sInstrumentFile); |
305 |
|
updateInstrumentName(); |
306 |
} |
} |
307 |
|
|
308 |
|
|