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

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

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

revision 958 by schoenebeck, Wed Nov 29 19:48:38 2006 UTC revision 1038 by persson, Sat Feb 3 15:33:00 2007 UTC
# Line 63  namespace LinuxSampler { namespace gig { Line 63  namespace LinuxSampler { namespace gig {
63       */       */
64      class InstrumentResourceManager : public InstrumentManager, public ResourceManager<InstrumentManager::instrument_id_t, ::gig::Instrument> {      class InstrumentResourceManager : public InstrumentManager, public ResourceManager<InstrumentManager::instrument_id_t, ::gig::Instrument> {
65          public:          public:
66                InstrumentResourceManager() : Gigs(this) {}
67              virtual ~InstrumentResourceManager() {}              virtual ~InstrumentResourceManager() {}
68              static void OnInstrumentLoadingProgress(::gig::progress_t* pProgress);              static void OnInstrumentLoadingProgress(::gig::progress_t* pProgress);
69    
# Line 71  namespace LinuxSampler { namespace gig { Line 72  namespace LinuxSampler { namespace gig {
72              virtual InstrumentManager::mode_t GetMode(const instrument_id_t& ID);              virtual InstrumentManager::mode_t GetMode(const instrument_id_t& ID);
73              virtual void SetMode(const instrument_id_t& ID, InstrumentManager::mode_t Mode);              virtual void SetMode(const instrument_id_t& ID, InstrumentManager::mode_t Mode);
74              virtual String GetInstrumentName(instrument_id_t ID);              virtual String GetInstrumentName(instrument_id_t ID);
75    
76                void HandBackInstrument(::gig::Instrument* pResource, InstrumentConsumer* pConsumer,
77                                        ::gig::DimensionRegion** dimRegionsInUse);
78                void HandBackDimReg(::gig::DimensionRegion* pDimReg);
79    
80          protected:          protected:
81              virtual ::gig::Instrument* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg);              virtual ::gig::Instrument* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg);
82              virtual void               Destroy(::gig::Instrument* pResource, void* pArg);              virtual void               Destroy(::gig::Instrument* pResource, void* pArg);
# Line 84  namespace LinuxSampler { namespace gig { Line 90  namespace LinuxSampler { namespace gig {
90                      virtual void         Destroy(::gig::File* pResource, void* pArg);                      virtual void         Destroy(::gig::File* pResource, void* pArg);
91                      virtual void         OnBorrow(::gig::File* pResource, GigConsumer* pConsumer, void*& pArg) {} // ignore                      virtual void         OnBorrow(::gig::File* pResource, GigConsumer* pConsumer, void*& pArg) {} // ignore
92                  public:                  public:
93                        GigResourceManager(InstrumentResourceManager* parent) : parent(parent) {}
94                      virtual ~GigResourceManager() {}                      virtual ~GigResourceManager() {}
95                    private:
96                        InstrumentResourceManager* parent;
97              } Gigs;              } Gigs;
98    
99              void CacheInitialSamples(::gig::Sample* pSample, gig::EngineChannel* pEngineChannel);              void CacheInitialSamples(::gig::Sample* pSample, gig::EngineChannel* pEngineChannel);
100    
101                struct dimreg_info_t {
102                    int           refCount;
103                    ::gig::File*  file;
104                    ::RIFF::File* riff;
105                };
106                Mutex DimRegInfoMutex; ///< protects the DimRegInfo and SampleRefCount maps from concurrent access by the instrument loader and disk threads
107                std::map< ::gig::DimensionRegion*, dimreg_info_t> DimRegInfo; ///< contains dimension regions that are still in use but belong to released instrument
108                std::map< ::gig::Sample*, int> SampleRefCount; ///< contains samples that are still in use but belong to a released instrument
109      };      };
110    
111      /**      /**

Legend:
Removed from v.958  
changed lines
  Added in v.1038

  ViewVC Help
Powered by ViewVC