/[svn]/linuxsampler/trunk/src/engines/EngineBase.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/EngineBase.h

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

revision 2410 by schoenebeck, Sat Feb 2 18:52:15 2013 UTC revision 2427 by persson, Sat Mar 2 07:03:04 2013 UTC
# Line 4  Line 4 
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck    *   *   Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck    *
6   *   Copyright (C) 2005-2008 Christian Schoenebeck                         *   *   Copyright (C) 2005-2008 Christian Schoenebeck                         *
7   *   Copyright (C) 2009-2012 Christian Schoenebeck and Grigor Iliev        *   *   Copyright (C) 2009-2013 Christian Schoenebeck and Grigor Iliev        *
8   *                                                                         *   *                                                                         *
9   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
10   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 429  namespace LinuxSampler { Line 429  namespace LinuxSampler {
429               */               */
430              virtual void Suspend(RR* pRegion) {              virtual void Suspend(RR* pRegion) {
431                  dmsg(2,("EngineBase: Suspending Region %x ...\n",pRegion));                  dmsg(2,("EngineBase: Suspending Region %x ...\n",pRegion));
432                  SuspendedRegionsMutex.Lock();                  {
433                  SuspensionChangeOngoing.Set(true);                      LockGuard lock(SuspendedRegionsMutex);
434                  pPendingRegionSuspension = pRegion;                      SuspensionChangeOngoing.Set(true);
435                  SuspensionChangeOngoing.WaitAndUnlockIf(true);                      pPendingRegionSuspension = pRegion;
436                  SuspendedRegionsMutex.Unlock();                      SuspensionChangeOngoing.WaitAndUnlockIf(true);
437                    }
438                  dmsg(2,("EngineBase: Region %x suspended.",pRegion));                  dmsg(2,("EngineBase: Region %x suspended.",pRegion));
439              }              }
440    
# Line 445  namespace LinuxSampler { Line 446  namespace LinuxSampler {
446               */               */
447              virtual void Resume(RR* pRegion) {              virtual void Resume(RR* pRegion) {
448                  dmsg(2,("EngineBase: Resuming Region %x ...\n",pRegion));                  dmsg(2,("EngineBase: Resuming Region %x ...\n",pRegion));
449                  SuspendedRegionsMutex.Lock();                  {
450                  SuspensionChangeOngoing.Set(true);                      LockGuard lock(SuspendedRegionsMutex);
451                  pPendingRegionResumption = pRegion;                      SuspensionChangeOngoing.Set(true);
452                  SuspensionChangeOngoing.WaitAndUnlockIf(true);                      pPendingRegionResumption = pRegion;
453                  SuspendedRegionsMutex.Unlock();                      SuspensionChangeOngoing.WaitAndUnlockIf(true);
454                    }
455                  dmsg(2,("EngineBase: Region %x resumed.\n",pRegion));                  dmsg(2,("EngineBase: Region %x resumed.\n",pRegion));
456              }              }
457    
# Line 1325  namespace LinuxSampler { Line 1327  namespace LinuxSampler {
1327               *  control and status variables. This method is protected by a mutex.               *  control and status variables. This method is protected by a mutex.
1328               */               */
1329              virtual void ResetInternal() {              virtual void ResetInternal() {
1330                  ResetInternalMutex.Lock();                  LockGuard lock(ResetInternalMutex);
1331    
1332                  // make sure that the engine does not get any sysex messages                  // make sure that the engine does not get any sysex messages
1333                  // while it's reseting                  // while it's reseting
# Line 1354  namespace LinuxSampler { Line 1356  namespace LinuxSampler {
1356                  pEventQueue->init();                  pEventQueue->init();
1357                  pSysexBuffer->init();                  pSysexBuffer->init();
1358                  if (sysexDisabled) MidiInputPort::AddSysexListener(this);                  if (sysexDisabled) MidiInputPort::AddSysexListener(this);
                 ResetInternalMutex.Unlock();  
1359              }              }
1360    
1361              /**              /**

Legend:
Removed from v.2410  
changed lines
  Added in v.2427

  ViewVC Help
Powered by ViewVC