/[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 395 by capela, Sun Feb 20 19:13:33 2005 UTC revision 400 by capela, Mon Feb 21 15:02:58 2005 UTC
# Line 108  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 351  void qsamplerMainForm::dropEvent ( QDrop Line 350  void qsamplerMainForm::dropEvent ( QDrop
350                          }                          }
351                      // Make that an overall update.                      // Make that an overall update.
352                      m_iDirtyCount++;                      m_iDirtyCount++;
                     m_iChangeCount++;  
353                      stabilizeForm();                      stabilizeForm();
354                  }   // Otherwise, load an usual session file (LSCP script)...                  }   // Otherwise, load an usual session file (LSCP script)...
355                  else if (closeSession(true))                  else if (closeSession(true))
# Line 612  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 837  void qsamplerMainForm::editAddChannel (v Line 834  void qsamplerMainForm::editAddChannel (v
834    
835      // Make that an overall update.      // Make that an overall update.
836      m_iDirtyCount++;      m_iDirtyCount++;
     m_iChangeCount++;  
837      stabilizeForm();      stabilizeForm();
838  }  }
839    
# Line 909  void qsamplerMainForm::editResetChannel Line 905  void qsamplerMainForm::editResetChannel
905      if (pChannelStrip == NULL)      if (pChannelStrip == NULL)
906          return;          return;
907    
908      qsamplerChannel *pChannel = pChannelStrip->channel();      // Just invoque the channel strip procedure.
909      if (pChannel == NULL)      pChannelStrip->channelReset();
         return;  
   
     // Reset the existing sampler channel.  
     pChannel->resetChannel();  
   
     // And force a deferred update.  
     m_iChangeCount++;  
910  }  }
911    
912    
# Line 1212  void qsamplerMainForm::stabilizeForm (vo Line 1201  void qsamplerMainForm::stabilizeForm (vo
1201    
1202    
1203  // Channel change receiver slot.  // Channel change receiver slot.
1204  void qsamplerMainForm::channelStripChanged( qsamplerChannelStrip * )  void qsamplerMainForm::channelStripChanged( qsamplerChannelStrip *pChannelStrip )
1205  {  {
1206      // Flag that we're update those channel strips.          // Add this strip to the changed list...
1207      m_iChangeCount++;          if (m_changedStrips.containsRef(pChannelStrip) == 0)
1208                    m_changedStrips.append(pChannelStrip);
1209    
1210      // Just mark the dirty form.      // Just mark the dirty form.
1211      m_iDirtyCount++;      m_iDirtyCount++;
1212      // and update the form status...      // and update the form status...
# Line 1525  qsamplerChannelStrip *qsamplerMainForm:: Line 1516  qsamplerChannelStrip *qsamplerMainForm::
1516          int iHeight = pChannelStrip->parentWidget()->frameGeometry().height();          int iHeight = pChannelStrip->parentWidget()->frameGeometry().height();
1517          pChannelStrip->parentWidget()->setGeometry(0, y, iWidth, iHeight);          pChannelStrip->parentWidget()->setGeometry(0, y, iWidth, iHeight);
1518      }      }
1519        
1520            // This is pretty new, so we'll watch for it closely.
1521            channelStripChanged(pChannelStrip);
1522    
1523      // Return our successful reference...      // Return our successful reference...
1524      return pChannelStrip;      return pChannelStrip;
1525  }  }
# Line 1638  void qsamplerMainForm::timerSlot (void) Line 1632  void qsamplerMainForm::timerSlot (void)
1632      }      }
1633            
1634          // Refresh each channel usage, on each period...          // Refresh each channel usage, on each period...
1635      if (m_pClient && (m_iChangeCount > 0 || m_pOptions->bAutoRefresh)) {      if (m_pClient && (m_changedStrips.count() > 0 || m_pOptions->bAutoRefresh)) {
1636          m_iTimerSlot += QSAMPLER_TIMER_MSECS;          m_iTimerSlot += QSAMPLER_TIMER_MSECS;
1637          if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime && m_pWorkspace->isUpdatesEnabled())  {          if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime && m_pWorkspace->isUpdatesEnabled())  {
1638              m_iTimerSlot = 0;              m_iTimerSlot = 0;
1639              m_iChangeCount = 0;              // Update the channel information for each pending strip...
1640                for (qsamplerChannelStrip *pChannelStrip = m_changedStrips.first();
1641                        pChannelStrip;
1642                                                    pChannelStrip = m_changedStrips.next()) {
1643                                    // If successfull, remove from pending list...
1644                                    if (pChannelStrip->updateChannelInfo())
1645                        m_changedStrips.remove(pChannelStrip);
1646                            }
1647                // Update the channel stream usage for each strip...
1648              QWidgetList wlist = m_pWorkspace->windowList();              QWidgetList wlist = m_pWorkspace->windowList();
1649              for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {              for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {
1650                  qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);                  qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);
1651                  if (pChannelStrip && pChannelStrip->isVisible()) {                  if (pChannelStrip && pChannelStrip->isVisible())
1652                      // If we can't make it clean, try next time.                      pChannelStrip->updateChannelUsage();
                     if (!pChannelStrip->updateChannelUsage())  
                         m_iChangeCount++;  
                 }  
1653              }              }
1654          }          }
1655      }      }

Legend:
Removed from v.395  
changed lines
  Added in v.400

  ViewVC Help
Powered by ViewVC