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

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

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

revision 1528 by capela, Mon Nov 26 18:24:38 2007 UTC revision 1558 by capela, Thu Dec 6 09:35:33 2007 UTC
# Line 35  Line 35 
35    
36  namespace QSampler {  namespace QSampler {
37    
38    //-------------------------------------------------------------------------
39    // QSampler::InstrumentListForm -- Instrument map list form implementation.
40    //
41    
42  InstrumentListForm::InstrumentListForm (  InstrumentListForm::InstrumentListForm (
43          QWidget* pParent, Qt::WindowFlags wflags )          QWidget* pParent, Qt::WindowFlags wflags )
44          : QMainWindow(pParent, wflags)          : QMainWindow(pParent, wflags)
# Line 168  void InstrumentListForm::refreshInstrume Line 172  void InstrumentListForm::refreshInstrume
172          if (pMainForm == NULL)          if (pMainForm == NULL)
173                  return;                  return;
174    
175          qsamplerOptions *pOptions = pMainForm->options();          Options *pOptions = pMainForm->options();
176          if (pOptions == NULL)          if (pOptions == NULL)
177                  return;                  return;
178    
# Line 180  void InstrumentListForm::refreshInstrume Line 184  void InstrumentListForm::refreshInstrume
184          // Populate maps list.          // Populate maps list.
185          m_pMapComboBox->clear();          m_pMapComboBox->clear();
186          m_pMapComboBox->addItem(tr("(All)"));          m_pMapComboBox->addItem(tr("(All)"));
187          m_pMapComboBox->insertItems(1, qsamplerInstrument::getMapNames());          m_pMapComboBox->insertItems(1, Instrument::getMapNames());
188    
189          // Adjust to saved selection...          // Adjust to saved selection...
190          if (iMap < 0 || iMap >= m_pMapComboBox->count())          if (iMap < 0 || iMap >= m_pMapComboBox->count())
# Line 199  void InstrumentListForm::activateMap ( i Line 203  void InstrumentListForm::activateMap ( i
203          if (pMainForm == NULL)          if (pMainForm == NULL)
204                  return;                  return;
205    
206          qsamplerOptions *pOptions = pMainForm->options();          Options *pOptions = pMainForm->options();
207          if (pOptions == NULL)          if (pOptions == NULL)
208                  return;                  return;
209    
# Line 225  void InstrumentListForm::editInstrument Line 229  void InstrumentListForm::editInstrument
229          if (!index.isValid() || !index.data(Qt::UserRole).isValid())          if (!index.isValid() || !index.data(Qt::UserRole).isValid())
230                  return;                  return;
231    
232          qsamplerInstrument* pInstrument          Instrument* pInstrument
233                  = static_cast<qsamplerInstrument *> (                  = static_cast<Instrument *> (
234                          index.data(Qt::UserRole).value<void *> ());                          index.data(Qt::UserRole).value<void *> ());
235    
236          if (pInstrument == NULL)          if (pInstrument == NULL)
237                  return;                  return;
238    
239          // Save current key values...          // Save current key values...
240          qsamplerInstrument oldInstrument(*pInstrument);          Instrument oldInstrument(*pInstrument);
241          // Do the edit dance...          // Do the edit dance...
242          InstrumentForm form(this);          InstrumentForm form(this);
243          form.setup(pInstrument);          form.setup(pInstrument);
# Line 260  void InstrumentListForm::editInstrument Line 264  void InstrumentListForm::editInstrument
264    
265  void InstrumentListForm::newInstrument (void)  void InstrumentListForm::newInstrument (void)
266  {  {
267          qsamplerInstrument instrument;          Instrument instrument;
268    
269          InstrumentForm form(this);          InstrumentForm form(this);
270          form.setup(&instrument);          form.setup(&instrument);
# Line 284  void InstrumentListForm::deleteInstrumen Line 288  void InstrumentListForm::deleteInstrumen
288          if (!index.isValid() || !index.data(Qt::UserRole).isValid())          if (!index.isValid() || !index.data(Qt::UserRole).isValid())
289                  return;                  return;
290    
291          qsamplerInstrument *pInstrument =          Instrument *pInstrument =
292                  static_cast<qsamplerInstrument*> (                  static_cast<Instrument*> (
293                          index.data(Qt::UserRole).value<void *> ());                          index.data(Qt::UserRole).value<void *> ());
294    
295          if (pInstrument == NULL)          if (pInstrument == NULL)
# Line 296  void InstrumentListForm::deleteInstrumen Line 300  void InstrumentListForm::deleteInstrumen
300                  return;                  return;
301    
302          // Prompt user if this is for real...          // Prompt user if this is for real...
303          qsamplerOptions *pOptions = pMainForm->options();          Options *pOptions = pMainForm->options();
304          if (pOptions && pOptions->bConfirmRemove) {          if (pOptions && pOptions->bConfirmRemove) {
305                  if (QMessageBox::warning(this,                  if (QMessageBox::warning(this,
306                          QSAMPLER_TITLE ": " + tr("Warning"),                          QSAMPLER_TITLE ": " + tr("Warning"),

Legend:
Removed from v.1528  
changed lines
  Added in v.1558

  ViewVC Help
Powered by ViewVC