/[svn]/qsampler/trunk/src/qsamplerMainForm.ui.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerMainForm.ui.h

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

revision 303 by capela, Fri Nov 19 10:18:59 2004 UTC revision 409 by capela, Thu Feb 24 12:10:54 2005 UTC
# Line 2  Line 2 
2  //  //
3  // ui.h extension file, included from the uic-generated form implementation.  // ui.h extension file, included from the uic-generated form implementation.
4  /****************************************************************************  /****************************************************************************
5     Copyright (C) 2004, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2005, rncbc aka Rui Nuno Capela. All rights reserved.
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License     modify it under the terms of the GNU General Public License
# Line 26  Line 26 
26  #include <qprocess.h>  #include <qprocess.h>
27  #include <qmessagebox.h>  #include <qmessagebox.h>
28  #include <qdragobject.h>  #include <qdragobject.h>
29    #include <qregexp.h>
30  #include <qfiledialog.h>  #include <qfiledialog.h>
31  #include <qfileinfo.h>  #include <qfileinfo.h>
32  #include <qfile.h>  #include <qfile.h>
# Line 44  Line 45 
45    
46  #include "config.h"  #include "config.h"
47    
48    #ifdef HAVE_SIGNAL_H
49    #include <signal.h>
50    #endif
51    
52  // Timer constant stuff.  // Timer constant stuff.
53  #define QSAMPLER_TIMER_MSECS    200  #define QSAMPLER_TIMER_MSECS    200
# Line 104  void qsamplerMainForm::init (void) Line 108  void qsamplerMainForm::init (void)
108      m_pMessages = NULL;      m_pMessages = NULL;
109    
110      // We'll start clean.      // We'll start clean.
111      m_iUntitled    = 0;      m_iUntitled   = 0;
112      m_iDirtyCount  = 0;      m_iDirtyCount = 0;
     m_iChangeCount = 0;  
113    
114      m_pServer = NULL;      m_pServer = NULL;
115      m_pClient = NULL;      m_pClient = NULL;
# Line 116  void qsamplerMainForm::init (void) Line 119  void qsamplerMainForm::init (void)
119    
120      m_iTimerSlot = 0;      m_iTimerSlot = 0;
121    
122    #ifdef HAVE_SIGNAL_H
123            // Set to ignore any fatal "Broken pipe" signals.
124            ::signal(SIGPIPE, SIG_IGN);
125    #endif
126    
127      // Make it an MDI workspace.      // Make it an MDI workspace.
128      m_pWorkspace = new QWorkspace(this);      m_pWorkspace = new QWorkspace(this);
129      m_pWorkspace->setScrollBarsEnabled(true);      m_pWorkspace->setScrollBarsEnabled(true);
# Line 286  void qsamplerMainForm::closeEvent ( QClo Line 294  void qsamplerMainForm::closeEvent ( QClo
294  }  }
295    
296    
297  // Window drag-n-drop event handlers.  // Drag'n'drop file handler.
298  void qsamplerMainForm::dragEnterEvent ( QDragEnterEvent* pDragEnterEvent )  bool qsamplerMainForm::decodeDragFiles ( const QMimeSource *pEvent, QStringList& files )
299  {  {
300      bool bAccept = false;      bool bDecode = false;
301    
302      if (QTextDrag::canDecode(pDragEnterEvent)) {      if (QTextDrag::canDecode(pEvent)) {
303          QString sUrl;          QString sText;
304          if (QTextDrag::decode(pDragEnterEvent, sUrl) && m_pClient)          bDecode = QTextDrag::decode(pEvent, sText);
305              bAccept = QFileInfo(QUrl(sUrl).path()).exists();          if (bDecode) {
306                files = QStringList::split('\n', sText);
307                for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++)
308                    *iter = QUrl((*iter).stripWhiteSpace().replace(QRegExp("^file:"), QString::null)).path();
309            }
310      }      }
311    
312      pDragEnterEvent->accept(bAccept);      return bDecode;
313    }
314    
315    
316    // Window drag-n-drop event handlers.
317    void qsamplerMainForm::dragEnterEvent ( QDragEnterEvent* pDragEnterEvent )
318    {
319            QStringList files;
320            pDragEnterEvent->accept(decodeDragFiles(pDragEnterEvent, files));
321  }  }
322    
323    
324  void qsamplerMainForm::dropEvent ( QDropEvent* pDropEvent )  void qsamplerMainForm::dropEvent ( QDropEvent* pDropEvent )
325  {  {
326      if (QTextDrag::canDecode(pDropEvent)) {      QStringList files;
327          QString sUrl;  
328          if (QTextDrag::decode(pDropEvent, sUrl) && closeSession(true))      if (!decodeDragFiles(pDropEvent, files))
329              loadSessionFile(QUrl(sUrl).path());          return;
330      }  
331        for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) {
332                    const QString& sPath = *iter;
333                    if (qsamplerChannel::isInstrumentFile(sPath)) {
334                            // Try to create a new channel from instrument file...
335                        qsamplerChannel *pChannel = new qsamplerChannel(this);
336                        if (pChannel == NULL)
337                            return;
338                            // Start setting the instrument filename...
339                            pChannel->setInstrument(sPath, 0);
340                        // Before we show it up, may be we'll
341                        // better ask for some initial values?
342                        if (!pChannel->channelSetup(this)) {
343                            delete pChannel;
344                            return;
345                        }
346                        // Finally, give it to a new channel strip...
347                            if (!createChannelStrip(pChannel)) {
348                            delete pChannel;
349                            return;
350                            }
351                        // Make that an overall update.
352                        m_iDirtyCount++;
353                        stabilizeForm();
354                    }   // Otherwise, load an usual session file (LSCP script)...
355                    else if (closeSession(true))
356                            loadSessionFile(sPath);
357                    // Make it look responsive...:)
358                    QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
359            }
360  }  }
361    
362    
# Line 372  bool qsamplerMainForm::newSession (void) Line 421  bool qsamplerMainForm::newSession (void)
421      if (!closeSession(true))      if (!closeSession(true))
422          return false;          return false;
423    
424            // Give us what the server has, right now...
425            updateSession();
426    
427      // Ok increment untitled count.      // Ok increment untitled count.
428      m_iUntitled++;      m_iUntitled++;
429    
# Line 530  bool qsamplerMainForm::loadSessionFile ( Line 582  bool qsamplerMainForm::loadSessionFile (
582              if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) {              if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) {
583                  appendMessagesClient("lscp_client_query");                  appendMessagesClient("lscp_client_query");
584                  iErrors++;                  iErrors++;
585                    break;
586              }              }
587          }          }
588          // Try to make it snappy :)          // Try to make it snappy :)
# Line 541  bool qsamplerMainForm::loadSessionFile ( Line 594  bool qsamplerMainForm::loadSessionFile (
594    
595      // Have we any errors?      // Have we any errors?
596      if (iErrors > 0)      if (iErrors > 0)
597          appendMessagesError(tr("Some setttings could not be loaded\nfrom \"%1\" session file.\n\nSorry.").arg(sFilename));          appendMessagesError(tr("Session could not be loaded\nfrom \"%1\".\n\nSorry.").arg(sFilename));
598    
599      // Now we'll try to create the whole GUI session.          // Now we'll try to create (update) the whole GUI session.
600      int *piChannelIDs = ::lscp_list_channels(m_pClient);          updateSession();
     if (piChannelIDs == NULL) {  
         appendMessagesClient("lscp_list_channels");  
         appendMessagesError(tr("Could not get current list of channels.\n\nSorry."));  
     }  
       
     // Try to (re)create each channel.  
     m_pWorkspace->setUpdatesEnabled(false);  
     for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) {  
         createChannelStrip(new qsamplerChannel(this, piChannelIDs[iChannel]));  
         QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);  
     }  
     m_pWorkspace->setUpdatesEnabled(true);  
601    
602      // Save as default session directory.      // Save as default session directory.
603      if (m_pOptions)      if (m_pOptions)
# Line 569  bool qsamplerMainForm::loadSessionFile ( Line 610  bool qsamplerMainForm::loadSessionFile (
610      appendMessages(tr("Open session: \"%1\".").arg(sessionName(m_sFilename)));      appendMessages(tr("Open session: \"%1\".").arg(sessionName(m_sFilename)));
611            
612      // Make that an overall update.      // Make that an overall update.
     m_iChangeCount++;  
613      stabilizeForm();      stabilizeForm();
614      return true;      return true;
615  }  }
# Line 607  bool qsamplerMainForm::saveSessionFile ( Line 647  bool qsamplerMainForm::saveSessionFile (
647          if (pChannelStrip) {          if (pChannelStrip) {
648              qsamplerChannel *pChannel = pChannelStrip->channel();              qsamplerChannel *pChannel = pChannelStrip->channel();
649              if (pChannel) {              if (pChannel) {
650                  int iChannelID = pChannel->channelID();                  ts << "# Channel " << iChannel << endl;
                 ts << "# " << pChannelStrip->caption() << endl;  
651                  ts << "ADD CHANNEL" << endl;                  ts << "ADD CHANNEL" << endl;
652                  ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannelID << " " << pChannel->audioDriver() << endl;                  ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannel << " " << pChannel->audioDriver() << endl;
653                  ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl;                  ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannel << " " << pChannel->midiDriver() << endl;
654                  ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl;              //  ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannel << " " << pChannel->midiPort() << endl;
655                  ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " ";                  ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannel << " ";
656                  if (pChannel->midiChannel() > 0)                  if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL)
                     ts << pChannel->midiChannel();  
                  else  
657                      ts << "ALL";                      ts << "ALL";
658                    else
659                        ts << pChannel->midiChannel();
660                  ts << endl;                  ts << endl;
661                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl;                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl;
662                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannelID << endl;                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannel << endl;
663                  ts << "SET CHANNEL VOLUME " << iChannelID << " " << pChannel->volume() << endl;                  ts << "SET CHANNEL VOLUME " << iChannel << " " << pChannel->volume() << endl;
664                  ts << endl;                  ts << endl;
665              }              }
666          }          }
# Line 721  void qsamplerMainForm::fileReset (void) Line 760  void qsamplerMainForm::fileReset (void)
760    
761      // Log this.      // Log this.
762      appendMessages(tr("Sampler reset."));      appendMessages(tr("Sampler reset."));
763    
764            // Make it a new session...
765            newSession();
766  }  }
767    
768    
# Line 791  void qsamplerMainForm::editAddChannel (v Line 833  void qsamplerMainForm::editAddChannel (v
833    
834      // Make that an overall update.      // Make that an overall update.
835      m_iDirtyCount++;      m_iDirtyCount++;
     m_iChangeCount++;  
836      stabilizeForm();      stabilizeForm();
837  }  }
838    
# Line 863  void qsamplerMainForm::editResetChannel Line 904  void qsamplerMainForm::editResetChannel
904      if (pChannelStrip == NULL)      if (pChannelStrip == NULL)
905          return;          return;
906    
907      qsamplerChannel *pChannel = pChannelStrip->channel();      // Just invoque the channel strip procedure.
908      if (pChannel == NULL)      pChannelStrip->channelReset();
909          return;  }
910    
     // Reset the existing sampler channel.  
     pChannel->resetChannel();  
911    
912      // And force a deferred update.  // Reset all sampler channels.
913      m_iChangeCount++;  void qsamplerMainForm::editResetAllChannels (void)
914    {
915        if (m_pClient == NULL)
916            return;
917    
918        // Invoque the channel strip procedure,
919            // for all channels out there...
920        m_pWorkspace->setUpdatesEnabled(false);
921        QWidgetList wlist = m_pWorkspace->windowList();
922        for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {
923            qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);
924            if (pChannelStrip)
925                    pChannelStrip->channelReset();
926        }
927        m_pWorkspace->setUpdatesEnabled(true);
928  }  }
929    
930    
# Line 951  void qsamplerMainForm::viewOptions (void Line 1004  void qsamplerMainForm::viewOptions (void
1004          int     bOldMessagesLimit   = m_pOptions->bMessagesLimit;          int     bOldMessagesLimit   = m_pOptions->bMessagesLimit;
1005          int     iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines;          int     iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines;
1006          bool    bOldCompletePath    = m_pOptions->bCompletePath;          bool    bOldCompletePath    = m_pOptions->bCompletePath;
1007            bool    bOldInstrumentNames = m_pOptions->bInstrumentNames;
1008          int     iOldMaxRecentFiles  = m_pOptions->iMaxRecentFiles;          int     iOldMaxRecentFiles  = m_pOptions->iMaxRecentFiles;
1009          // Load the current setup settings.          // Load the current setup settings.
1010          pOptionsForm->setup(m_pOptions);          pOptionsForm->setup(m_pOptions);
# Line 969  void qsamplerMainForm::viewOptions (void Line 1023  void qsamplerMainForm::viewOptions (void
1023                  (!bOldCompletePath &&  m_pOptions->bCompletePath) ||                  (!bOldCompletePath &&  m_pOptions->bCompletePath) ||
1024                  (iOldMaxRecentFiles != m_pOptions->iMaxRecentFiles))                  (iOldMaxRecentFiles != m_pOptions->iMaxRecentFiles))
1025                  updateRecentFilesMenu();                  updateRecentFilesMenu();
1026                if (( bOldInstrumentNames && !m_pOptions->bInstrumentNames) ||
1027                    (!bOldInstrumentNames &&  m_pOptions->bInstrumentNames))
1028                    updateInstrumentNames();
1029              if (( bOldDisplayEffect && !m_pOptions->bDisplayEffect) ||              if (( bOldDisplayEffect && !m_pOptions->bDisplayEffect) ||
1030                  (!bOldDisplayEffect &&  m_pOptions->bDisplayEffect))                  (!bOldDisplayEffect &&  m_pOptions->bDisplayEffect))
1031                  updateDisplayEffect();                  updateDisplayEffect();
# Line 1079  void qsamplerMainForm::helpAbout (void) Line 1136  void qsamplerMainForm::helpAbout (void)
1136      sText += tr("GIG (libgig) file support disabled.");      sText += tr("GIG (libgig) file support disabled.");
1137      sText += "</font></small><br />";      sText += "</font></small><br />";
1138  #endif  #endif
1139    #ifndef CONFIG_INSTRUMENT_NAME
1140        sText += "<small><font color=\"red\">";
1141        sText += tr("LSCP (liblscp) instrument_name support disabled.");
1142        sText += "</font></small><br />";
1143    #endif
1144      sText += "<br />\n";      sText += "<br />\n";
1145      sText += tr("Using") + ": ";      sText += tr("Using") + ": ";
1146      sText += ::lscp_client_package();      sText += ::lscp_client_package();
# Line 1125  void qsamplerMainForm::stabilizeForm (vo Line 1187  void qsamplerMainForm::stabilizeForm (vo
1187      editRemoveChannelAction->setEnabled(bHasChannel);      editRemoveChannelAction->setEnabled(bHasChannel);
1188      editSetupChannelAction->setEnabled(bHasChannel);      editSetupChannelAction->setEnabled(bHasChannel);
1189      editResetChannelAction->setEnabled(bHasChannel);      editResetChannelAction->setEnabled(bHasChannel);
1190        editResetAllChannelsAction->setEnabled(bHasChannel);
1191      channelsArrangeAction->setEnabled(bHasChannel);      channelsArrangeAction->setEnabled(bHasChannel);
1192      viewMessagesAction->setOn(m_pMessages && m_pMessages->isVisible());      viewMessagesAction->setOn(m_pMessages && m_pMessages->isVisible());
1193    
# Line 1157  void qsamplerMainForm::stabilizeForm (vo Line 1220  void qsamplerMainForm::stabilizeForm (vo
1220    
1221    
1222  // Channel change receiver slot.  // Channel change receiver slot.
1223  void qsamplerMainForm::channelStripChanged( qsamplerChannelStrip * )  void qsamplerMainForm::channelStripChanged( qsamplerChannelStrip *pChannelStrip )
1224  {  {
1225      // Flag that we're update those channel strips.          // Add this strip to the changed list...
1226      m_iChangeCount++;          if (m_changedStrips.containsRef(pChannelStrip) == 0)
1227                    m_changedStrips.append(pChannelStrip);
1228    
1229      // Just mark the dirty form.      // Just mark the dirty form.
1230      m_iDirtyCount++;      m_iDirtyCount++;
1231      // and update the form status...      // and update the form status...
# Line 1168  void qsamplerMainForm::channelStripChang Line 1233  void qsamplerMainForm::channelStripChang
1233  }  }
1234    
1235    
1236    // Grab and restore current sampler channels session.
1237    void qsamplerMainForm::updateSession (void)
1238    {
1239            // Retrieve the current channel list.
1240            int *piChannelIDs = ::lscp_list_channels(m_pClient);
1241            if (piChannelIDs == NULL) {
1242                    if (::lscp_client_get_errno(m_pClient)) {
1243                            appendMessagesClient("lscp_list_channels");
1244                            appendMessagesError(tr("Could not get current list of channels.\n\nSorry."));
1245                    }
1246                    return;
1247            }
1248    
1249            // Try to (re)create each channel.
1250            m_pWorkspace->setUpdatesEnabled(false);
1251            for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) {
1252                    // Check if theres already a channel strip for this one...
1253                    if (!channelStrip(piChannelIDs[iChannel]))
1254                            createChannelStrip(new qsamplerChannel(this, piChannelIDs[iChannel]));
1255                    // Make it visibly responsive...
1256                    QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
1257            }
1258            m_pWorkspace->setUpdatesEnabled(true);
1259    }
1260    
1261    
1262  // Update the recent files list and menu.  // Update the recent files list and menu.
1263  void qsamplerMainForm::updateRecentFiles ( const QString& sFilename )  void qsamplerMainForm::updateRecentFiles ( const QString& sFilename )
1264  {  {
# Line 1212  void qsamplerMainForm::updateRecentFiles Line 1303  void qsamplerMainForm::updateRecentFiles
1303  }  }
1304    
1305    
1306    // Force update of the channels instrument names mode.
1307    void qsamplerMainForm::updateInstrumentNames (void)
1308    {
1309        // Full channel list update...
1310        QWidgetList wlist = m_pWorkspace->windowList();
1311        if (wlist.isEmpty())
1312            return;
1313    
1314        m_pWorkspace->setUpdatesEnabled(false);
1315        for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {
1316            qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);
1317            if (pChannelStrip)
1318                pChannelStrip->updateInstrumentName(true);
1319        }
1320        m_pWorkspace->setUpdatesEnabled(true);
1321    }
1322    
1323    
1324  // Force update of the channels display font.  // Force update of the channels display font.
1325  void qsamplerMainForm::updateDisplayFont (void)  void qsamplerMainForm::updateDisplayFont (void)
1326  {  {
# Line 1389  qsamplerChannelStrip *qsamplerMainForm:: Line 1498  qsamplerChannelStrip *qsamplerMainForm::
1498          QWidgetList wlist = m_pWorkspace->windowList();          QWidgetList wlist = m_pWorkspace->windowList();
1499          for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {          for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {
1500              pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);              pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);
1501          //  y += pChannelStrip->height() + pChannelStrip->parentWidget()->baseSize().height();                          if (pChannelStrip) {
1502              y += pChannelStrip->parentWidget()->frameGeometry().height();                          //  y += pChannelStrip->height() + pChannelStrip->parentWidget()->baseSize().height();
1503                                    y += pChannelStrip->parentWidget()->frameGeometry().height();
1504                            }
1505          }          }
1506      }      }
1507    
# Line 1424  qsamplerChannelStrip *qsamplerMainForm:: Line 1535  qsamplerChannelStrip *qsamplerMainForm::
1535          int iHeight = pChannelStrip->parentWidget()->frameGeometry().height();          int iHeight = pChannelStrip->parentWidget()->frameGeometry().height();
1536          pChannelStrip->parentWidget()->setGeometry(0, y, iWidth, iHeight);          pChannelStrip->parentWidget()->setGeometry(0, y, iWidth, iHeight);
1537      }      }
1538        
1539            // This is pretty new, so we'll watch for it closely.
1540            channelStripChanged(pChannelStrip);
1541    
1542      // Return our successful reference...      // Return our successful reference...
1543      return pChannelStrip;      return pChannelStrip;
1544  }  }
# Line 1442  qsamplerChannelStrip *qsamplerMainForm:: Line 1556  qsamplerChannelStrip *qsamplerMainForm::
1556  {  {
1557      QWidgetList wlist = m_pWorkspace->windowList();      QWidgetList wlist = m_pWorkspace->windowList();
1558      if (wlist.isEmpty())      if (wlist.isEmpty())
1559          return 0;          return NULL;
1560    
1561      return (qsamplerChannelStrip *) wlist.at(iChannel);      return (qsamplerChannelStrip *) wlist.at(iChannel);
1562  }  }
1563    
1564    
1565    // Retrieve a channel strip by sampler channel id.
1566    qsamplerChannelStrip *qsamplerMainForm::channelStrip ( int iChannelID )
1567    {
1568            QWidgetList wlist = m_pWorkspace->windowList();
1569            if (wlist.isEmpty())
1570                    return NULL;
1571            
1572            for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {
1573                    qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);
1574                    if (pChannelStrip) {
1575                            qsamplerChannel *pChannel = pChannelStrip->channel();
1576                            if (pChannel && pChannel->channelID() == iChannelID)
1577                                    return pChannelStrip;
1578                    }
1579            }
1580    
1581            // Not found.
1582            return NULL;
1583    }
1584    
1585    
1586  // Construct the windows menu.  // Construct the windows menu.
1587  void qsamplerMainForm::channelsMenuAboutToShow (void)  void qsamplerMainForm::channelsMenuAboutToShow (void)
1588  {  {
# Line 1516  void qsamplerMainForm::timerSlot (void) Line 1651  void qsamplerMainForm::timerSlot (void)
1651      }      }
1652            
1653          // Refresh each channel usage, on each period...          // Refresh each channel usage, on each period...
1654      if (m_pClient && (m_iChangeCount > 0 || m_pOptions->bAutoRefresh)) {      if (m_pClient && (m_changedStrips.count() > 0 || m_pOptions->bAutoRefresh)) {
1655          m_iTimerSlot += QSAMPLER_TIMER_MSECS;          m_iTimerSlot += QSAMPLER_TIMER_MSECS;
1656          if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime && m_pWorkspace->isUpdatesEnabled())  {          if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime && m_pWorkspace->isUpdatesEnabled())  {
1657              m_iTimerSlot = 0;              m_iTimerSlot = 0;
1658              m_iChangeCount = 0;              // Update the channel information for each pending strip...
1659                for (qsamplerChannelStrip *pChannelStrip = m_changedStrips.first();
1660                        pChannelStrip;
1661                                                    pChannelStrip = m_changedStrips.next()) {
1662                                    // If successfull, remove from pending list...
1663                                    if (pChannelStrip->updateChannelInfo())
1664                        m_changedStrips.remove(pChannelStrip);
1665                            }
1666                // Update the channel stream usage for each strip...
1667              QWidgetList wlist = m_pWorkspace->windowList();              QWidgetList wlist = m_pWorkspace->windowList();
1668              for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {              for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {
1669                  qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);                  qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);
1670                  if (pChannelStrip && pChannelStrip->isVisible()) {                  if (pChannelStrip && pChannelStrip->isVisible())
1671                      // If we can't make it clean, try next time.                      pChannelStrip->updateChannelUsage();
                     if (!pChannelStrip->updateChannelUsage())  
                         m_iChangeCount++;  
                 }  
1672              }              }
1673          }          }
1674      }      }

Legend:
Removed from v.303  
changed lines
  Added in v.409

  ViewVC Help
Powered by ViewVC