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

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

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

revision 1013 by capela, Mon Jan 8 16:52:48 2007 UTC revision 1015 by capela, Mon Jan 8 19:10:42 2007 UTC
# Line 28  Line 28 
28  #include "qsamplerOptions.h"  #include "qsamplerOptions.h"
29  #include "qsamplerMainForm.h"  #include "qsamplerMainForm.h"
30    
31    #include <qapplication.h>
32  #include <qmessagebox.h>  #include <qmessagebox.h>
33    #include <qeventloop.h>
34  #include <qaction.h>  #include <qaction.h>
35    #include <qcursor.h>
36  #include <qfileinfo.h>  #include <qfileinfo.h>
37  #include <qpopupmenu.h>  #include <qpopupmenu.h>
38    
# Line 336  qsamplerInstrumentItem *qsamplerInstrume Line 339  qsamplerInstrumentItem *qsamplerInstrume
339          // with the very same key (bank, program);          // with the very same key (bank, program);
340          // if yes, just remove it without prejudice...          // if yes, just remove it without prejudice...
341          qsamplerInstrumentItem *pItem = findItem(pInstrument);          qsamplerInstrumentItem *pItem = findItem(pInstrument);
342          if (pItem)          if (pItem) {
343                    // If exactly the same, just update view and bail out...
344                    if (pItem->instrument() == pInstrument) {
345                            pItem->update();
346                            return pItem;
347                    }
348                    // Remove it, as instrument keys must be unique.
349                  delete pItem;                  delete pItem;
350            }
351    
352          // Add the new item under proper group one, if any...          // Add the new item under proper group one, if any...
353          if (pParentGroup) {          if (pParentGroup) {
# Line 683  void qsamplerInstrumentList::refresh (vo Line 693  void qsamplerInstrumentList::refresh (vo
693          if (pMainForm->client() == NULL)          if (pMainForm->client() == NULL)
694                  return;                  return;
695    
696            QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
697    
698            // Load the whole bunch of instrument items...
699          qsamplerInstrumentItem *pItem = NULL;          qsamplerInstrumentItem *pItem = NULL;
700          lscp_midi_instrument_t *pInstrs          lscp_midi_instrument_t *pInstrs
701                  = ::lscp_list_midi_instruments(pMainForm->client(), m_iMidiMap);                  = ::lscp_list_midi_instruments(pMainForm->client(), m_iMidiMap);
# Line 694  void qsamplerInstrumentList::refresh (vo Line 707  void qsamplerInstrumentList::refresh (vo
707                          = new qsamplerInstrument(iMap, iBank, iProg);                          = new qsamplerInstrument(iMap, iBank, iProg);
708                  if (pInstrument->getInstrument())                  if (pInstrument->getInstrument())
709                          pItem = new qsamplerInstrumentItem(this, pInstrument, pItem);                          pItem = new qsamplerInstrumentItem(this, pInstrument, pItem);
710                    // Try to keep it snappy :)
711                    QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
712          }          }
713    
714            QApplication::restoreOverrideCursor();
715    
716          if (pInstrs == NULL && ::lscp_client_get_errno(pMainForm->client())) {          if (pInstrs == NULL && ::lscp_client_get_errno(pMainForm->client())) {
717                  pMainForm->appendMessagesClient("lscp_list_midi_instruments");                  pMainForm->appendMessagesClient("lscp_list_midi_instruments");
718                  pMainForm->appendMessagesError(tr("Could not get current list of MIDI instrument mappings.\n\nSorry."));                  pMainForm->appendMessagesError(tr("Could not get current list of MIDI instrument mappings.\n\nSorry."));

Legend:
Removed from v.1013  
changed lines
  Added in v.1015

  ViewVC Help
Powered by ViewVC