--- qsampler/trunk/src/qsamplerChannelForm.cpp 2007/10/28 23:30:36 1461 +++ qsampler/trunk/src/qsamplerChannelForm.cpp 2007/11/05 20:47:38 1474 @@ -1,3 +1,25 @@ +// qsamplerChannelForm.cpp +// +/**************************************************************************** + Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2007, Christian Schoenebeck + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +*****************************************************************************/ + #include "qsamplerChannelForm.h" #include "qsamplerAbout.h" @@ -29,6 +51,52 @@ // Try to restore normal window positioning. adjustSize(); + + QObject::connect(ui.EngineNameComboBox, + SIGNAL(activated(int)), + SLOT(optionsChanged())); + QObject::connect(ui.InstrumentFileComboBox, + SIGNAL(activated(const QString&)), + SLOT(updateInstrumentName())); + QObject::connect(ui.InstrumentFileToolButton, + SIGNAL(clicked()), + SLOT(openInstrumentFile())); + QObject::connect(ui.InstrumentNrComboBox, + SIGNAL(activated(int)), + SLOT(optionsChanged())); + QObject::connect(ui.MidiDriverComboBox, + SIGNAL(activated(const QString&)), + SLOT(selectMidiDriver(const QString&))); + QObject::connect(ui.MidiDeviceComboBox, + SIGNAL(activated(int)), + SLOT(selectMidiDevice(int))); + QObject::connect(ui.MidiPortSpinBox, + SIGNAL(valueChanged(int)), + SLOT(optionsChanged())); + QObject::connect(ui.MidiChannelComboBox, + SIGNAL(activated(int)), + SLOT(optionsChanged())); + QObject::connect(ui.MidiMapComboBox, + SIGNAL(activated(int)), + SLOT(optionsChanged())); + QObject::connect(ui.AudioDriverComboBox, + SIGNAL(activated(const QString&)), + SLOT(selectAudioDriver(const QString&))); + QObject::connect(ui.AudioDeviceComboBox, + SIGNAL(activated(int)), + SLOT(selectAudioDevice(int))); + QObject::connect(ui.OkPushButton, + SIGNAL(clicked()), + SLOT(accept())); + QObject::connect(ui.CancelPushButton, + SIGNAL(clicked()), + SLOT(reject())); + QObject::connect(ui.MidiDeviceToolButton, + SIGNAL(clicked()), + SLOT(setupMidiDevice())); + QObject::connect(ui.AudioDeviceToolButton, + SIGNAL(clicked()), + SLOT(setupAudioDevice())); } ChannelForm::~ChannelForm() { @@ -79,7 +147,7 @@ if (ppszEngines) { ui.EngineNameComboBox->clear(); for (int iEngine = 0; ppszEngines[iEngine]; iEngine++) - ui.EngineNameComboBox->insertItem(ppszEngines[iEngine]); + ui.EngineNameComboBox->addItem(QString(ppszEngines[iEngine])); } else m_pChannel->appendMessagesClient("lscp_list_available_engines"); @@ -107,10 +175,12 @@ if (sEngineName.isEmpty()) sEngineName = qsamplerChannel::noEngineName(); if (ui.EngineNameComboBox->findText(sEngineName, - Qt::MatchExactly | Qt::MatchCaseSensitive) == 0) { - ui.EngineNameComboBox->insertItem(sEngineName); + Qt::MatchExactly | Qt::MatchCaseSensitive) < 0) { + ui.EngineNameComboBox->addItem(sEngineName); } - ui.EngineNameComboBox->setCurrentText(sEngineName); + ui.EngineNameComboBox->setCurrentIndex( + ui.EngineNameComboBox->findText(sEngineName, + Qt::MatchExactly | Qt::MatchCaseSensitive)); // Instrument filename and index... QString sInstrumentFile = pChannel->instrumentFile(); if (sInstrumentFile.isEmpty()) @@ -130,7 +200,7 @@ sMidiDriver = pOptions->sMidiDriver.upper(); if (!sMidiDriver.isEmpty()) { if (ui.MidiDriverComboBox->findText(sMidiDriver, - Qt::MatchExactly | Qt::MatchCaseSensitive) == 0) { + Qt::MatchExactly | Qt::MatchCaseSensitive) < 0) { ui.MidiDriverComboBox->insertItem(sMidiDriver); } ui.MidiDriverComboBox->setCurrentText(sMidiDriver); @@ -168,7 +238,7 @@ sAudioDriver = pOptions->sAudioDriver.upper(); if (!sAudioDriver.isEmpty()) { if (ui.AudioDriverComboBox->findText(sAudioDriver, - Qt::MatchExactly | Qt::MatchCaseSensitive) == 0) { + Qt::MatchExactly | Qt::MatchCaseSensitive) < 0) { ui.AudioDriverComboBox->insertItem(sAudioDriver); } ui.AudioDriverComboBox->setCurrentText(sAudioDriver); @@ -664,3 +734,6 @@ } // namespace QSampler + + +// end of qsamplerChannelForm.cpp