/[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 2836 by schoenebeck, Sun Jan 4 17:16:05 2015 UTC revision 2837 by persson, Sun Aug 23 06:14:00 2015 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 - 2013 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2015 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 69  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;
# Line 676  namespace LinuxSampler { namespace gig { Line 676  namespace LinuxSampler { namespace gig {
676              const uint neededSilenceSamples = (maxSamplesPerCycle << CONFIG_MAX_PITCH) + 3;              const uint neededSilenceSamples = (maxSamplesPerCycle << CONFIG_MAX_PITCH) + 3;
677              const uint currentlyCachedSilenceSamples = pSample->GetCache().NullExtensionSize / pSample->FrameSize;              const uint currentlyCachedSilenceSamples = pSample->GetCache().NullExtensionSize / pSample->FrameSize;
678              if (currentlyCachedSilenceSamples < neededSilenceSamples) {              if (currentlyCachedSilenceSamples < neededSilenceSamples) {
679                  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));
680                  ::gig::buffer_t buf = pSample->LoadSampleDataWithNullSamplesExtension(neededSilenceSamples);                  ::gig::buffer_t buf = pSample->LoadSampleDataWithNullSamplesExtension(neededSilenceSamples);
681                  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));
682              }              }
683          }          }
684          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 689  namespace LinuxSampler { namespace gig { Line 689  namespace LinuxSampler { namespace gig {
689      }      }
690    
691      void InstrumentResourceManager::UncacheInitialSamples(::gig::Sample* pSample) {      void InstrumentResourceManager::UncacheInitialSamples(::gig::Sample* pSample) {
692          dmsg(1,("Uncaching sample %x\n",pSample));          dmsg(1,("Uncaching sample %p\n",(void*)pSample));
693          if (pSample->GetCache().Size) pSample->ReleaseSampleData();          if (pSample->GetCache().Size) pSample->ReleaseSampleData();
694      }      }
695    

Legend:
Removed from v.2836  
changed lines
  Added in v.2837

  ViewVC Help
Powered by ViewVC