/[svn]/linuxsampler/trunk/src/engines/gig/Engine.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/Engine.cpp

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

revision 1321 by schoenebeck, Tue Sep 4 01:12:49 2007 UTC revision 1555 by schoenebeck, Thu Dec 6 01:39:24 2007 UTC
# Line 29  Line 29 
29    
30  #include "Engine.h"  #include "Engine.h"
31    
32    #include "../../common/global_private.h"
33    
34  namespace LinuxSampler { namespace gig {  namespace LinuxSampler { namespace gig {
35    
36      InstrumentResourceManager Engine::instruments;      InstrumentResourceManager Engine::instruments;
# Line 189  namespace LinuxSampler { namespace gig { Line 191  namespace LinuxSampler { namespace gig {
191       * engine afterwards by calling @c ResumeAll() later on!       * engine afterwards by calling @c ResumeAll() later on!
192       */       */
193      void Engine::SuspendAll() {      void Engine::SuspendAll() {
194          dmsg(1,("gig::Engine: Suspending all ...\n"));          dmsg(2,("gig::Engine: Suspending all ...\n"));
195          // stop the engine, so we can safely modify the engine's          // stop the engine, so we can safely modify the engine's
196          // data structures from this foreign thread          // data structures from this foreign thread
197          DisableAndLock();          DisableAndLock();
# Line 223  namespace LinuxSampler { namespace gig { Line 225  namespace LinuxSampler { namespace gig {
225              if (!iPendingStreamDeletions) break;              if (!iPendingStreamDeletions) break;
226              usleep(10000); // sleep for 10ms              usleep(10000); // sleep for 10ms
227          }          }
228          dmsg(1,("gig::Engine: Everything suspended.\n"));          dmsg(2,("gig::Engine: Everything suspended.\n"));
229      }      }
230    
231      /**      /**
# Line 245  namespace LinuxSampler { namespace gig { Line 247  namespace LinuxSampler { namespace gig {
247       * @param pRegion - region the engine shall stop using       * @param pRegion - region the engine shall stop using
248       */       */
249      void Engine::Suspend(::gig::Region* pRegion) {      void Engine::Suspend(::gig::Region* pRegion) {
250          dmsg(1,("gig::Engine: Suspending Region %x ...\n",pRegion));          dmsg(2,("gig::Engine: Suspending Region %x ...\n",pRegion));
251          SuspendedRegionsMutex.Lock();          SuspendedRegionsMutex.Lock();
252          SuspensionChangeOngoing.Set(true);          SuspensionChangeOngoing.Set(true);
253          pPendingRegionSuspension = pRegion;          pPendingRegionSuspension = pRegion;
254          SuspensionChangeOngoing.WaitAndUnlockIf(true);          SuspensionChangeOngoing.WaitAndUnlockIf(true);
255          SuspendedRegionsMutex.Unlock();          SuspendedRegionsMutex.Unlock();
256          dmsg(1,("gig::Engine: Region %x suspended.",pRegion));          dmsg(2,("gig::Engine: Region %x suspended.",pRegion));
257      }      }
258    
259      /**      /**
# Line 261  namespace LinuxSampler { namespace gig { Line 263  namespace LinuxSampler { namespace gig {
263       * @param pRegion - region the engine shall be allowed to use again       * @param pRegion - region the engine shall be allowed to use again
264       */       */
265      void Engine::Resume(::gig::Region* pRegion) {      void Engine::Resume(::gig::Region* pRegion) {
266          dmsg(1,("gig::Engine: Resuming Region %x ...\n",pRegion));          dmsg(2,("gig::Engine: Resuming Region %x ...\n",pRegion));
267          SuspendedRegionsMutex.Lock();          SuspendedRegionsMutex.Lock();
268          SuspensionChangeOngoing.Set(true);          SuspensionChangeOngoing.Set(true);
269          pPendingRegionResumption = pRegion;          pPendingRegionResumption = pRegion;
270          SuspensionChangeOngoing.WaitAndUnlockIf(true);          SuspensionChangeOngoing.WaitAndUnlockIf(true);
271          SuspendedRegionsMutex.Unlock();          SuspendedRegionsMutex.Unlock();
272          dmsg(1,("gig::Engine: Region %x resumed.\n",pRegion));          dmsg(2,("gig::Engine: Region %x resumed.\n",pRegion));
273      }      }
274    
275      /**      /**
# Line 569  namespace LinuxSampler { namespace gig { Line 571  namespace LinuxSampler { namespace gig {
571       *  @returns       0 on success       *  @returns       0 on success
572       */       */
573      int Engine::RenderAudio(uint Samples) {      int Engine::RenderAudio(uint Samples) {
574          dmsg(7,("RenderAudio(Samples=%d)\n", Samples));          dmsg(8,("RenderAudio(Samples=%d)\n", Samples));
575    
576          // return if engine disabled          // return if engine disabled
577          if (EngineDisabled.Pop()) {          if (EngineDisabled.Pop()) {
# Line 778  namespace LinuxSampler { namespace gig { Line 780  namespace LinuxSampler { namespace gig {
780                  }                  }
781              }              }
782          }          }
783            
784          pEngineChannel->SetVoiceCount(voiceCount);          pEngineChannel->SetVoiceCount(voiceCount);
785          pEngineChannel->SetDiskStreamCount(streamCount);          pEngineChannel->SetDiskStreamCount(streamCount);
786      }      }
# Line 1686  namespace LinuxSampler { namespace gig { Line 1688  namespace LinuxSampler { namespace gig {
1688                  break;                  break;
1689              }              }
1690              case 65: { // portamento on / off              case 65: { // portamento on / off
1691                  KillAllVoices(pEngineChannel, itControlChangeEvent);                  const bool bPortamento = itControlChangeEvent->Param.CC.Value >= 64;
1692                  pEngineChannel->PortamentoMode = itControlChangeEvent->Param.CC.Value >= 64;                  if (bPortamento != pEngineChannel->PortamentoMode)
1693                        KillAllVoices(pEngineChannel, itControlChangeEvent);
1694                    pEngineChannel->PortamentoMode = bPortamento;
1695                  break;                  break;
1696              }              }
1697              case 66: { // sostenuto              case 66: { // sostenuto
# Line 1757  namespace LinuxSampler { namespace gig { Line 1761  namespace LinuxSampler { namespace gig {
1761                  break;                  break;
1762              }              }
1763              case 126: { // mono mode on              case 126: { // mono mode on
1764                  KillAllVoices(pEngineChannel, itControlChangeEvent);                  if (!pEngineChannel->SoloMode)
1765                        KillAllVoices(pEngineChannel, itControlChangeEvent);
1766                  pEngineChannel->SoloMode = true;                  pEngineChannel->SoloMode = true;
1767                  break;                  break;
1768              }              }
1769              case 127: { // poly mode on              case 127: { // poly mode on
1770                  KillAllVoices(pEngineChannel, itControlChangeEvent);                  if (pEngineChannel->SoloMode)
1771                        KillAllVoices(pEngineChannel, itControlChangeEvent);
1772                  pEngineChannel->SoloMode = false;                  pEngineChannel->SoloMode = false;
1773                  break;                  break;
1774              }              }
# Line 1967  namespace LinuxSampler { namespace gig { Line 1973  namespace LinuxSampler { namespace gig {
1973      }      }
1974    
1975      String Engine::Description() {      String Engine::Description() {
1976          return "Gigasampler Engine";          return "Gigasampler Format Engine";
1977      }      }
1978    
1979      String Engine::Version() {      String Engine::Version() {
1980          String s = "$Revision: 1.80 $";          String s = "$Revision: 1.85 $";
1981          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword
1982      }      }
1983    

Legend:
Removed from v.1321  
changed lines
  Added in v.1555

  ViewVC Help
Powered by ViewVC