/[svn]/qsampler/trunk/src/qsamplerChannelForm.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerChannelForm.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1461 by schoenebeck, Sun Oct 28 23:30:36 2007 UTC revision 1474 by schoenebeck, Mon Nov 5 20:47:38 2007 UTC
# Line 1  Line 1 
1    // qsamplerChannelForm.cpp
2    //
3    /****************************************************************************
4       Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
5       Copyright (C) 2007, Christian Schoenebeck
6    
7       This program is free software; you can redistribute it and/or
8       modify it under the terms of the GNU General Public License
9       as published by the Free Software Foundation; either version 2
10       of the License, or (at your option) any later version.
11    
12       This program is distributed in the hope that it will be useful,
13       but WITHOUT ANY WARRANTY; without even the implied warranty of
14       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15       GNU General Public License for more details.
16    
17       You should have received a copy of the GNU General Public License along
18       with this program; if not, write to the Free Software Foundation, Inc.,
19       51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20    
21    *****************************************************************************/
22    
23  #include "qsamplerChannelForm.h"  #include "qsamplerChannelForm.h"
24    
25  #include "qsamplerAbout.h"  #include "qsamplerAbout.h"
# Line 29  ChannelForm::ChannelForm(QWidget* parent Line 51  ChannelForm::ChannelForm(QWidget* parent
51    
52          // Try to restore normal window positioning.          // Try to restore normal window positioning.
53          adjustSize();          adjustSize();
54    
55            QObject::connect(ui.EngineNameComboBox,
56                    SIGNAL(activated(int)),
57                    SLOT(optionsChanged()));
58            QObject::connect(ui.InstrumentFileComboBox,
59                    SIGNAL(activated(const QString&)),
60                    SLOT(updateInstrumentName()));
61            QObject::connect(ui.InstrumentFileToolButton,
62                    SIGNAL(clicked()),
63                    SLOT(openInstrumentFile()));
64            QObject::connect(ui.InstrumentNrComboBox,
65                    SIGNAL(activated(int)),
66                    SLOT(optionsChanged()));
67            QObject::connect(ui.MidiDriverComboBox,
68                    SIGNAL(activated(const QString&)),
69                    SLOT(selectMidiDriver(const QString&)));
70            QObject::connect(ui.MidiDeviceComboBox,
71                    SIGNAL(activated(int)),
72                    SLOT(selectMidiDevice(int)));
73            QObject::connect(ui.MidiPortSpinBox,
74                    SIGNAL(valueChanged(int)),
75                    SLOT(optionsChanged()));
76            QObject::connect(ui.MidiChannelComboBox,
77                    SIGNAL(activated(int)),
78                    SLOT(optionsChanged()));
79            QObject::connect(ui.MidiMapComboBox,
80                    SIGNAL(activated(int)),
81                    SLOT(optionsChanged()));
82            QObject::connect(ui.AudioDriverComboBox,
83                    SIGNAL(activated(const QString&)),
84                    SLOT(selectAudioDriver(const QString&)));
85            QObject::connect(ui.AudioDeviceComboBox,
86                    SIGNAL(activated(int)),
87                    SLOT(selectAudioDevice(int)));
88            QObject::connect(ui.OkPushButton,
89                    SIGNAL(clicked()),
90                    SLOT(accept()));
91            QObject::connect(ui.CancelPushButton,
92                    SIGNAL(clicked()),
93                    SLOT(reject()));
94            QObject::connect(ui.MidiDeviceToolButton,
95                    SIGNAL(clicked()),
96                    SLOT(setupMidiDevice()));
97            QObject::connect(ui.AudioDeviceToolButton,
98                    SIGNAL(clicked()),
99                    SLOT(setupAudioDevice()));
100  }  }
101    
102  ChannelForm::~ChannelForm() {  ChannelForm::~ChannelForm() {
# Line 79  void ChannelForm::setup ( qsamplerChanne Line 147  void ChannelForm::setup ( qsamplerChanne
147          if (ppszEngines) {          if (ppszEngines) {
148                  ui.EngineNameComboBox->clear();                  ui.EngineNameComboBox->clear();
149                  for (int iEngine = 0; ppszEngines[iEngine]; iEngine++)                  for (int iEngine = 0; ppszEngines[iEngine]; iEngine++)
150                          ui.EngineNameComboBox->insertItem(ppszEngines[iEngine]);                          ui.EngineNameComboBox->addItem(QString(ppszEngines[iEngine]));
151          }          }
152          else m_pChannel->appendMessagesClient("lscp_list_available_engines");          else m_pChannel->appendMessagesClient("lscp_list_available_engines");
153    
# Line 107  void ChannelForm::setup ( qsamplerChanne Line 175  void ChannelForm::setup ( qsamplerChanne
175          if (sEngineName.isEmpty())          if (sEngineName.isEmpty())
176                  sEngineName = qsamplerChannel::noEngineName();                  sEngineName = qsamplerChannel::noEngineName();
177          if (ui.EngineNameComboBox->findText(sEngineName,          if (ui.EngineNameComboBox->findText(sEngineName,
178                          Qt::MatchExactly | Qt::MatchCaseSensitive) == 0) {                          Qt::MatchExactly | Qt::MatchCaseSensitive) < 0) {
179                  ui.EngineNameComboBox->insertItem(sEngineName);                  ui.EngineNameComboBox->addItem(sEngineName);
180          }          }
181          ui.EngineNameComboBox->setCurrentText(sEngineName);          ui.EngineNameComboBox->setCurrentIndex(
182                    ui.EngineNameComboBox->findText(sEngineName,
183                            Qt::MatchExactly | Qt::MatchCaseSensitive));
184          // Instrument filename and index...          // Instrument filename and index...
185          QString sInstrumentFile = pChannel->instrumentFile();          QString sInstrumentFile = pChannel->instrumentFile();
186          if (sInstrumentFile.isEmpty())          if (sInstrumentFile.isEmpty())
# Line 130  void ChannelForm::setup ( qsamplerChanne Line 200  void ChannelForm::setup ( qsamplerChanne
200                  sMidiDriver = pOptions->sMidiDriver.upper();                  sMidiDriver = pOptions->sMidiDriver.upper();
201          if (!sMidiDriver.isEmpty()) {          if (!sMidiDriver.isEmpty()) {
202                  if (ui.MidiDriverComboBox->findText(sMidiDriver,                  if (ui.MidiDriverComboBox->findText(sMidiDriver,
203                                  Qt::MatchExactly | Qt::MatchCaseSensitive) == 0) {                                  Qt::MatchExactly | Qt::MatchCaseSensitive) < 0) {
204                          ui.MidiDriverComboBox->insertItem(sMidiDriver);                          ui.MidiDriverComboBox->insertItem(sMidiDriver);
205                  }                  }
206                  ui.MidiDriverComboBox->setCurrentText(sMidiDriver);                  ui.MidiDriverComboBox->setCurrentText(sMidiDriver);
# Line 168  void ChannelForm::setup ( qsamplerChanne Line 238  void ChannelForm::setup ( qsamplerChanne
238                  sAudioDriver = pOptions->sAudioDriver.upper();                  sAudioDriver = pOptions->sAudioDriver.upper();
239          if (!sAudioDriver.isEmpty()) {          if (!sAudioDriver.isEmpty()) {
240                  if (ui.AudioDriverComboBox->findText(sAudioDriver,                  if (ui.AudioDriverComboBox->findText(sAudioDriver,
241                                  Qt::MatchExactly | Qt::MatchCaseSensitive) == 0) {                                  Qt::MatchExactly | Qt::MatchCaseSensitive) < 0) {
242                          ui.AudioDriverComboBox->insertItem(sAudioDriver);                          ui.AudioDriverComboBox->insertItem(sAudioDriver);
243                  }                  }
244                  ui.AudioDriverComboBox->setCurrentText(sAudioDriver);                  ui.AudioDriverComboBox->setCurrentText(sAudioDriver);
# Line 664  void ChannelForm::stabilizeForm (void) Line 734  void ChannelForm::stabilizeForm (void)
734    
735    
736  } // namespace QSampler  } // namespace QSampler
737    
738    
739    // end of qsamplerChannelForm.cpp

Legend:
Removed from v.1461  
changed lines
  Added in v.1474

  ViewVC Help
Powered by ViewVC