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

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

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

revision 2012 by iliev, Fri Oct 23 17:53:17 2009 UTC revision 2902 by schoenebeck, Tue May 3 14:00:16 2016 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
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 - 2009 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2016 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   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 30  Line 30 
30  #include "../../common/global_private.h"  #include "../../common/global_private.h"
31  #include "../../plugins/InstrumentEditorFactory.h"  #include "../../plugins/InstrumentEditorFactory.h"
32    
 // We need to know the maximum number of sample points which are going to  
 // be processed for each render cycle of the audio output driver, to know  
 // how much initial sample points we need to cache into RAM. If the given  
 // sampler channel does not have an audio output device assigned yet  
 // though, we simply use this default value.  
 #define GIG_RESOURCE_MANAGER_DEFAULT_MAX_SAMPLES_PER_CYCLE     128  
   
33  namespace LinuxSampler { namespace gig {  namespace LinuxSampler { namespace gig {
34    
     // data stored as long as an instrument resource exists  
     struct instr_entry_t {  
         InstrumentManager::instrument_id_t ID;  
         ::gig::File*                       pGig;  
         uint                               MaxSamplesPerCycle; ///< if some engine requests an already allocated instrument with a higher value, we have to reallocate the instrument  
     };  
   
35      // some data needed for the libgig callback function      // some data needed for the libgig callback function
36      struct progress_callback_arg_t {      struct progress_callback_arg_t {
37          InstrumentResourceManager*          pManager;          InstrumentResourceManager*          pManager;
# Line 83  namespace LinuxSampler { namespace gig { Line 69  namespace LinuxSampler { namespace gig {
69       *                    instrument ID       *                    instrument ID
70       */       */
71      void InstrumentResourceManager::OnInstrumentLoadingProgress(::gig::progress_t* pProgress) {      void InstrumentResourceManager::OnInstrumentLoadingProgress(::gig::progress_t* pProgress) {
72          dmsg(7,("gig::InstrumentResourceManager: progress %f%", pProgress->factor));          dmsg(7,("gig::InstrumentResourceManager: progress %f%%", pProgress->factor));
73          progress_callback_arg_t* pArg = static_cast<progress_callback_arg_t*>(pProgress->custom);          progress_callback_arg_t* pArg = static_cast<progress_callback_arg_t*>(pProgress->custom);
74          // we randomly schedule 90% for the .gig file loading and the remaining 10% later for sample caching          // we randomly schedule 90% for the .gig file loading and the remaining 10% later for sample caching
75          const float localProgress = 0.9f * pProgress->factor;          const float localProgress = 0.9f * pProgress->factor;
76          pArg->pManager->DispatchResourceProgressEvent(*pArg->pInstrumentKey, localProgress);          pArg->pManager->DispatchResourceProgressEvent(*pArg->pInstrumentKey, localProgress);
77      }      }
78    
     std::vector<InstrumentResourceManager::instrument_id_t> InstrumentResourceManager::Instruments() {  
         return Entries();  
     }  
   
79      String InstrumentResourceManager::GetInstrumentName(instrument_id_t ID) {      String InstrumentResourceManager::GetInstrumentName(instrument_id_t ID) {
80          Lock();          Lock();
81          ::gig::Instrument* pInstrument = Resource(ID, false);          ::gig::Instrument* pInstrument = Resource(ID, false);
# Line 147  namespace LinuxSampler { namespace gig { Line 129  namespace LinuxSampler { namespace gig {
129          ::RIFF::File* riff = NULL;          ::RIFF::File* riff = NULL;
130          ::gig::File*  gig  = NULL;          ::gig::File*  gig  = NULL;
131          try {          try {
132              if(!loaded) {              if (!loaded) {
133                  riff = new ::RIFF::File(ID.FileName);                  riff = new ::RIFF::File(ID.FileName);
134                  gig  = new ::gig::File(riff);                  gig  = new ::gig::File(riff);
135                  gig->SetAutoLoad(false); // avoid time consuming samples scanning                  gig->SetAutoLoad(false); // avoid time consuming samples scanning
# Line 226  namespace LinuxSampler { namespace gig { Line 208  namespace LinuxSampler { namespace gig {
208          }          }
209      }      }
210    
211      InstrumentEditor* InstrumentResourceManager::LaunchInstrumentEditor(instrument_id_t ID, void* pUserData) throw (InstrumentManagerException) {      InstrumentEditor* InstrumentResourceManager::LaunchInstrumentEditor(LinuxSampler::EngineChannel* pEngineChannel, instrument_id_t ID, void* pUserData) throw (InstrumentManagerException) {
212          const String sDataType    = GetInstrumentDataStructureName(ID);          const String sDataType    = GetInstrumentDataStructureName(ID);
213          const String sDataVersion = GetInstrumentDataStructureVersion(ID);          const String sDataVersion = GetInstrumentDataStructureVersion(ID);
214          // find instrument editors capable to handle given instrument          // find instrument editors capable to handle given instrument
# Line 253  namespace LinuxSampler { namespace gig { Line 235  namespace LinuxSampler { namespace gig {
235          InstrumentEditorProxies.add(pProxy);          InstrumentEditorProxies.add(pProxy);
236          InstrumentEditorProxiesMutex.Unlock();          InstrumentEditorProxiesMutex.Unlock();
237          // launch the instrument editor for the given instrument          // launch the instrument editor for the given instrument
238          pEditor->Launch(pInstrument, sDataType, sDataVersion, pUserData);          pEditor->Launch(pEngineChannel, pInstrument, sDataType, sDataVersion, pUserData);
239    
240          // register the instrument editor as virtual MIDI device as well ...          // register the instrument editor as virtual MIDI device as well ...
241          VirtualMidiDevice* pVirtualMidiDevice =          VirtualMidiDevice* pVirtualMidiDevice =
# Line 289  namespace LinuxSampler { namespace gig { Line 271  namespace LinuxSampler { namespace gig {
271          int iProxyIndex                = -1;          int iProxyIndex                = -1;
272    
273          // first find the editor proxy entry for this editor          // first find the editor proxy entry for this editor
274          InstrumentEditorProxiesMutex.Lock();          {
275          for (int i = 0; i < InstrumentEditorProxies.size(); i++) {              LockGuard lock(InstrumentEditorProxiesMutex);
276              InstrumentEditorProxy* pCurProxy =              for (int i = 0; i < InstrumentEditorProxies.size(); i++) {
277                  dynamic_cast<InstrumentEditorProxy*>(                  InstrumentEditorProxy* pCurProxy =
278                      InstrumentEditorProxies[i]                      dynamic_cast<InstrumentEditorProxy*>(
279                  );                          InstrumentEditorProxies[i]
280              if (pCurProxy->pEditor == pSender) {                          );
281                  pProxy      = pCurProxy;                  if (pCurProxy->pEditor == pSender) {
282                  iProxyIndex = i;                      pProxy      = pCurProxy;
283                  pInstrument = pCurProxy->pInstrument;                      iProxyIndex = i;
284                        pInstrument = pCurProxy->pInstrument;
285                    }
286              }              }
287          }          }
         InstrumentEditorProxiesMutex.Unlock();  
288    
289          if (!pProxy) {          if (!pProxy) {
290              std::cerr << "Eeeek, could not find instrument editor proxy, "              std::cerr << "Eeeek, could not find instrument editor proxy, "
# Line 329  namespace LinuxSampler { namespace gig { Line 312  namespace LinuxSampler { namespace gig {
312    
313          // finally delete proxy entry and hand back instrument          // finally delete proxy entry and hand back instrument
314          if (pInstrument) {          if (pInstrument) {
315              InstrumentEditorProxiesMutex.Lock();              {
316              InstrumentEditorProxies.remove(iProxyIndex);                  LockGuard lock(InstrumentEditorProxiesMutex);
317              InstrumentEditorProxiesMutex.Unlock();                  InstrumentEditorProxies.remove(iProxyIndex);
318                }
319    
320              HandBack(pInstrument, pProxy);              HandBack(pInstrument, pProxy);
321              delete pProxy;              delete pProxy;
# Line 408  namespace LinuxSampler { namespace gig { Line 392  namespace LinuxSampler { namespace gig {
392      }      }
393    
394      void InstrumentResourceManager::OnDataStructureToBeChanged(void* pStruct, String sStructType, InstrumentEditor* pSender) {      void InstrumentResourceManager::OnDataStructureToBeChanged(void* pStruct, String sStructType, InstrumentEditor* pSender) {
395            dmsg(5,("gig::InstrumentResourceManager::OnDataStructureToBeChanged(%s)\n", sStructType.c_str()));
396          //TODO: remove code duplication          //TODO: remove code duplication
397          if (sStructType == "gig::File") {          if (sStructType == "gig::File") {
398              // completely suspend all engines that use that file              // completely suspend all engines that use that file
# Line 448  namespace LinuxSampler { namespace gig { Line 433  namespace LinuxSampler { namespace gig {
433              std::set<Engine*>::iterator end  = engines.end();              std::set<Engine*>::iterator end  = engines.end();
434              for (; iter != end; ++iter) (*iter)->Suspend(pRegion);              for (; iter != end; ++iter) (*iter)->Suspend(pRegion);
435              Unlock();              Unlock();
436            } else if (sStructType == "gig::Script") {
437                // no need to suspend anything here, since the sampler is
438                // processing a translated VM representation of the original script
439                // source code, not accessing the source code itself during playback
440                ::gig::Script* pScript = (::gig::Script*) pStruct;
441                // remember the original source code of the script, since the script
442                // resource manager uses the source code as key
443                pendingScriptUpdatesMutex.Lock();
444                pendingScriptUpdates[pScript] = pScript->GetScriptAsText();
445                pendingScriptUpdatesMutex.Unlock();
446          } else {          } else {
447              std::cerr << "gig::InstrumentResourceManager: ERROR, unknown data "              std::cerr << "gig::InstrumentResourceManager: ERROR, unknown data "
448                           "structure '" << sStructType << "' requested to be "                           "structure '" << sStructType << "' requested to be "
# Line 458  namespace LinuxSampler { namespace gig { Line 453  namespace LinuxSampler { namespace gig {
453      }      }
454    
455      void InstrumentResourceManager::OnDataStructureChanged(void* pStruct, String sStructType, InstrumentEditor* pSender) {      void InstrumentResourceManager::OnDataStructureChanged(void* pStruct, String sStructType, InstrumentEditor* pSender) {
456            dmsg(5,("gig::InstrumentResourceManager::OnDataStructureChanged(%s)\n", sStructType.c_str()));
457          //TODO: remove code duplication          //TODO: remove code duplication
458          if (sStructType == "gig::File") {          if (sStructType == "gig::File") {
459              // resume all previously suspended engines              // resume all previously suspended engines
# Line 515  namespace LinuxSampler { namespace gig { Line 511  namespace LinuxSampler { namespace gig {
511              std::set<Engine*>::iterator end  = engines.end();              std::set<Engine*>::iterator end  = engines.end();
512              for (; iter != end; ++iter) (*iter)->Resume(pRegion);              for (; iter != end; ++iter) (*iter)->Resume(pRegion);
513              Unlock();              Unlock();
514            } else if (sStructType == "gig::Script") {
515                // inform all engine channels which are using this script, that
516                // they need to reload (parse) the script's source code text
517                ::gig::Script* pScript = (::gig::Script*) pStruct;
518                pendingScriptUpdatesMutex.Lock();
519                if (pendingScriptUpdates.count(pScript)) {
520                    const String& code = pendingScriptUpdates[pScript];
521                    std::set<EngineChannel*> channels = GetEngineChannelsUsingScriptSourceCode(code, true/*lock*/);
522                    pendingScriptUpdates.erase(pScript);
523                    std::set<EngineChannel*>::iterator iter = channels.begin();
524                    std::set<EngineChannel*>::iterator end  = channels.end();
525                    for (; iter != end; ++iter) (*iter)->reloadScript(pScript);
526                }
527                pendingScriptUpdatesMutex.Unlock();
528          } else {          } else {
529              std::cerr << "gig::InstrumentResourceManager: ERROR, unknown data "              std::cerr << "gig::InstrumentResourceManager: ERROR, unknown data "
530                           "structure '" << sStructType << "' requested to be "                           "structure '" << sStructType << "' requested to be "
# Line 559  namespace LinuxSampler { namespace gig { Line 569  namespace LinuxSampler { namespace gig {
569    
570      ::gig::Instrument* InstrumentResourceManager::Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg) {      ::gig::Instrument* InstrumentResourceManager::Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg) {
571          // get gig file from internal gig file manager          // get gig file from internal gig file manager
572          ::gig::File* pGig = Gigs.Borrow(Key.FileName, (GigConsumer*) Key.Index); // conversion kinda hackish :/          ::gig::File* pGig = Gigs.Borrow(Key.FileName, reinterpret_cast<GigConsumer*>(Key.Index)); // conversion kinda hackish :/
573    
574          // we pass this to the progress callback mechanism of libgig          // we pass this to the progress callback mechanism of libgig
575          progress_callback_arg_t callbackArg;          progress_callback_arg_t callbackArg;
# Line 580  namespace LinuxSampler { namespace gig { Line 590  namespace LinuxSampler { namespace gig {
590          pGig->GetFirstSample(); // just to force complete instrument loading          pGig->GetFirstSample(); // just to force complete instrument loading
591          dmsg(1,("OK\n"));          dmsg(1,("OK\n"));
592    
593            uint maxSamplesPerCycle = GetMaxSamplesPerCycle(pConsumer);
594    
595          // cache initial samples points (for actually needed samples)          // cache initial samples points (for actually needed samples)
596          dmsg(1,("Caching initial samples..."));          dmsg(1,("Caching initial samples..."));
597          uint iRegion = 0; // just for progress calculation          uint iRegion = 0; // just for progress calculation
# Line 591  namespace LinuxSampler { namespace gig { Line 603  namespace LinuxSampler { namespace gig {
603    
604              if (pRgn->GetSample() && !pRgn->GetSample()->GetCache().Size) {              if (pRgn->GetSample() && !pRgn->GetSample()->GetCache().Size) {
605                  dmsg(2,("C"));                  dmsg(2,("C"));
606                  CacheInitialSamples(pRgn->GetSample(), (EngineChannel*) pConsumer);                  CacheInitialSamples(pRgn->GetSample(), maxSamplesPerCycle);
607              }              }
608              for (uint i = 0; i < pRgn->DimensionRegions; i++) {              for (uint i = 0; i < pRgn->DimensionRegions; i++) {
609                  CacheInitialSamples(pRgn->pDimensionRegions[i]->pSample, (EngineChannel*) pConsumer);                  CacheInitialSamples(pRgn->pDimensionRegions[i]->pSample, maxSamplesPerCycle);
610              }              }
611    
612              pRgn = pInstrument->GetNextRegion();              pRgn = pInstrument->GetNextRegion();
# Line 607  namespace LinuxSampler { namespace gig { Line 619  namespace LinuxSampler { namespace gig {
619          instr_entry_t* pEntry = new instr_entry_t;          instr_entry_t* pEntry = new instr_entry_t;
620          pEntry->ID.FileName   = Key.FileName;          pEntry->ID.FileName   = Key.FileName;
621          pEntry->ID.Index      = Key.Index;          pEntry->ID.Index      = Key.Index;
622          pEntry->pGig          = pGig;          pEntry->pFile         = pGig;
623    
624          EngineChannel* pEngineChannel = dynamic_cast<EngineChannel*>(pConsumer);          // and we save this to check if we need to reallocate for an engine with higher value of 'MaxSamplesPerSecond'
625          // and we save this to check if we need to reallocate for a engine with higher value of 'MaxSamplesPerSecond'          pEntry->MaxSamplesPerCycle = maxSamplesPerCycle;
626          pEntry->MaxSamplesPerCycle =          
             (!pEngineChannel) ? 0 /* don't care for instrument editors */ :  
                 (pEngineChannel->GetEngine()) ?  
                     dynamic_cast<Engine*>(pEngineChannel->GetEngine())->pAudioOutputDevice->MaxSamplesPerCycle()  
                     : GIG_RESOURCE_MANAGER_DEFAULT_MAX_SAMPLES_PER_CYCLE;  
627          pArg = pEntry;          pArg = pEntry;
628    
629          return pInstrument;          return pInstrument;
630      }      }
631    
632      void InstrumentResourceManager::Destroy( ::gig::Instrument* pResource, void* pArg) {      void InstrumentResourceManager::Destroy(::gig::Instrument* pResource, void* pArg) {
633          instr_entry_t* pEntry = (instr_entry_t*) pArg;          instr_entry_t* pEntry = (instr_entry_t*) pArg;
634          // we don't need the .gig file here anymore          // we don't need the .gig file here anymore
635          Gigs.HandBack(pEntry->pGig, (GigConsumer*) pEntry->ID.Index); // conversion kinda hackish :/          Gigs.HandBack(pEntry->pFile, reinterpret_cast<GigConsumer*>(pEntry->ID.Index)); // conversion kinda hackish :/
636          delete pEntry;          delete pEntry;
637      }      }
638    
     void InstrumentResourceManager::OnBorrow(::gig::Instrument* pResource, InstrumentConsumer* pConsumer, void*& pArg) {  
         instr_entry_t* pEntry = (instr_entry_t*) pArg;  
         EngineChannel* pEngineChannel = dynamic_cast<EngineChannel*>(pConsumer);  
         uint maxSamplesPerCycle =  
             (pEngineChannel && pEngineChannel->GetEngine()) ? dynamic_cast<Engine*>(pEngineChannel->GetEngine())->pAudioOutputDevice->MaxSamplesPerCycle()  
                                           : GIG_RESOURCE_MANAGER_DEFAULT_MAX_SAMPLES_PER_CYCLE;  
         if (pEntry->MaxSamplesPerCycle < maxSamplesPerCycle) {  
             Update(pResource, pConsumer);  
         }  
     }  
   
639      void InstrumentResourceManager::DeleteRegionIfNotUsed(::gig::DimensionRegion* pRegion, region_info_t* pRegInfo) {      void InstrumentResourceManager::DeleteRegionIfNotUsed(::gig::DimensionRegion* pRegion, region_info_t* pRegInfo) {
640          // TODO: we could delete Region and Instrument here if they have become unused          // TODO: we could delete Region and Instrument here if they have become unused
641      }      }
642    
643      void InstrumentResourceManager::DeleteSampleIfNotUsed(::gig::Sample* pSample, region_info_t* pRegInfo) {      void InstrumentResourceManager::DeleteSampleIfNotUsed(::gig::Sample* pSample, region_info_t* pRegInfo) {
644          ::gig::File* gig = pRegInfo->file;          ::gig::File* gig = pRegInfo->file;
645          ::RIFF::File* riff = static_cast< ::RIFF::File*>(pRegInfo->pArg);          ::RIFF::File* riff = static_cast< ::RIFF::File*>(pRegInfo->pArg);
# Line 682  namespace LinuxSampler { namespace gig { Line 680  namespace LinuxSampler { namespace gig {
680       *                   will be cached)       *                   will be cached)
681       */       */
682      void InstrumentResourceManager::CacheInitialSamples(::gig::Sample* pSample, AbstractEngine* pEngine) {      void InstrumentResourceManager::CacheInitialSamples(::gig::Sample* pSample, AbstractEngine* pEngine) {
683            uint maxSamplesPerCycle =
684                (pEngine) ? pEngine->pAudioOutputDevice->MaxSamplesPerCycle() :
685                DefaultMaxSamplesPerCycle();
686            CacheInitialSamples(pSample, maxSamplesPerCycle);
687        }
688    
689        void InstrumentResourceManager::CacheInitialSamples(::gig::Sample* pSample, uint maxSamplesPerCycle) {
690          if (!pSample) {          if (!pSample) {
691              dmsg(4,("gig::InstrumentResourceManager: Skipping sample (pSample == NULL)\n"));              dmsg(4,("gig::InstrumentResourceManager: Skipping sample (pSample == NULL)\n"));
692              return;              return;
# Line 694  namespace LinuxSampler { namespace gig { Line 699  namespace LinuxSampler { namespace gig {
699              // number of '0' samples (silence samples) behind the official buffer              // number of '0' samples (silence samples) behind the official buffer
700              // border, to allow the interpolator do it's work even at the end of              // border, to allow the interpolator do it's work even at the end of
701              // the sample.              // the sample.
             const uint maxSamplesPerCycle =  
                 (pEngine) ? pEngine->pAudioOutputDevice->MaxSamplesPerCycle()  
                           : GIG_RESOURCE_MANAGER_DEFAULT_MAX_SAMPLES_PER_CYCLE;  
702              const uint neededSilenceSamples = (maxSamplesPerCycle << CONFIG_MAX_PITCH) + 3;              const uint neededSilenceSamples = (maxSamplesPerCycle << CONFIG_MAX_PITCH) + 3;
703              const uint currentlyCachedSilenceSamples = pSample->GetCache().NullExtensionSize / pSample->FrameSize;              const uint currentlyCachedSilenceSamples = pSample->GetCache().NullExtensionSize / pSample->FrameSize;
704              if (currentlyCachedSilenceSamples < neededSilenceSamples) {              if (currentlyCachedSilenceSamples < neededSilenceSamples) {
705                  dmsg(3,("Caching whole sample (sample name: \"%s\", sample size: %d)\n", pSample->pInfo->Name.c_str(), pSample->SamplesTotal));                  dmsg(3,("Caching whole sample (sample name: \"%s\", sample size: %lu)\n", pSample->pInfo->Name.c_str(), pSample->SamplesTotal));
706                  ::gig::buffer_t buf = pSample->LoadSampleDataWithNullSamplesExtension(neededSilenceSamples);                  ::gig::buffer_t buf = pSample->LoadSampleDataWithNullSamplesExtension(neededSilenceSamples);
707                  dmsg(4,("Cached %d Bytes, %d silence bytes.\n", buf.Size, buf.NullExtensionSize));                  dmsg(4,("Cached %lu Bytes, %lu silence bytes.\n", buf.Size, buf.NullExtensionSize));
708              }              }
709          }          }
710          else { // we only cache CONFIG_PRELOAD_SAMPLES and stream the other sample points from disk          else { // we only cache CONFIG_PRELOAD_SAMPLES and stream the other sample points from disk
# Line 713  namespace LinuxSampler { namespace gig { Line 715  namespace LinuxSampler { namespace gig {
715      }      }
716    
717      void InstrumentResourceManager::UncacheInitialSamples(::gig::Sample* pSample) {      void InstrumentResourceManager::UncacheInitialSamples(::gig::Sample* pSample) {
718          dmsg(1,("Uncaching sample %x\n",pSample));          dmsg(1,("Uncaching sample %p\n",(void*)pSample));
719          if (pSample->GetCache().Size) pSample->ReleaseSampleData();          if (pSample->GetCache().Size) pSample->ReleaseSampleData();
720      }      }
721    
# Line 740  namespace LinuxSampler { namespace gig { Line 742  namespace LinuxSampler { namespace gig {
742    
743      /**      /**
744       * Returns a list with all gig engine channels that are currently using       * Returns a list with all gig engine channels that are currently using
745         * the given real-time instrument script (provided as source code).
746         *
747         * @param pScript - search criteria
748         * @param bLock - whether we should lock (mutex) the instrument manager
749         *                during this call and unlock at the end of this call
750         */
751        std::set<EngineChannel*> InstrumentResourceManager::GetEngineChannelsUsingScriptSourceCode(const String& code, bool bLock) {
752            if (bLock) Lock();
753            std::set<EngineChannel*> result;
754            std::set<InstrumentScriptConsumer*> consumers = scripts.ConsumersOf(code);
755            std::set<InstrumentScriptConsumer*>::iterator iter = consumers.begin();
756            std::set<InstrumentScriptConsumer*>::iterator end  = consumers.end();
757            for (; iter != end; ++iter) {
758                EngineChannel* pEngineChannel = dynamic_cast<EngineChannel*>(*iter);
759                if (!pEngineChannel) continue;
760                result.insert(pEngineChannel);
761            }
762            if (bLock) Unlock();
763            return result;
764        }
765    
766        /**
767         * Returns a list with all gig engine channels that are currently using
768       * the given instrument.       * the given instrument.
769       *       *
770       * @param pInstrument - search criteria       * @param pInstrument - search criteria
# Line 924  namespace LinuxSampler { namespace gig { Line 949  namespace LinuxSampler { namespace gig {
949      }      }
950    
951      void InstrumentResourceManager::GigResourceManager::Destroy(::gig::File* pResource, void* pArg) {      void InstrumentResourceManager::GigResourceManager::Destroy(::gig::File* pResource, void* pArg) {
952          dmsg(1,("Freeing gig file from memory..."));          dmsg(1,("Freeing gig file '%s' from memory ...", pResource->GetFileName().c_str()));
953    
954          // Delete as much as possible of the gig file. Some of the          // Delete as much as possible of the gig file. Some of the
955          // dimension regions and samples may still be in use - these          // dimension regions and samples may still be in use - these

Legend:
Removed from v.2012  
changed lines
  Added in v.2902

  ViewVC Help
Powered by ViewVC