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 - 2008 Christian Schoenebeck * |
7 |
* Copyright (C) 2009 Grigor Iliev * |
* Copyright (C) 2009 - 2012 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 * |
59 |
* instrument / file is not needed anymore, then it will be freed from |
* instrument / file is not needed anymore, then it will be freed from |
60 |
* memory. |
* memory. |
61 |
*/ |
*/ |
62 |
class InstrumentResourceManager : public InstrumentManagerDefaultImpl< ::sf2::File, ::sf2::Preset, ::sf2::Region, ::sf2::Sample> { |
class InstrumentResourceManager : public InstrumentManagerBase< ::sf2::File, ::sf2::Preset, ::sf2::Region, ::sf2::Sample> { |
63 |
public: |
public: |
64 |
InstrumentResourceManager() : Sf2s(this) {} |
InstrumentResourceManager() : Sf2s(this) {} |
65 |
virtual ~InstrumentResourceManager() {} |
virtual ~InstrumentResourceManager() {} |
66 |
|
|
67 |
// implementation of derived abstract methods from 'InstrumentManager' |
// implementation of derived abstract methods from 'InstrumentManager' |
|
virtual std::vector<instrument_id_t> Instruments(); |
|
68 |
virtual String GetInstrumentName(instrument_id_t ID); |
virtual String GetInstrumentName(instrument_id_t ID); |
69 |
virtual std::vector<instrument_id_t> GetInstrumentFileContent(String File) throw (InstrumentManagerException); |
virtual std::vector<instrument_id_t> GetInstrumentFileContent(String File) throw (InstrumentManagerException); |
70 |
virtual instrument_info_t GetInstrumentInfo(instrument_id_t ID) throw (InstrumentManagerException); |
virtual instrument_info_t GetInstrumentInfo(instrument_id_t ID) throw (InstrumentManagerException); |
73 |
// implementation of derived abstract methods from 'ResourceManager' |
// implementation of derived abstract methods from 'ResourceManager' |
74 |
virtual ::sf2::Preset* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg); |
virtual ::sf2::Preset* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg); |
75 |
virtual void Destroy(::sf2::Preset* pResource, void* pArg); |
virtual void Destroy(::sf2::Preset* pResource, void* pArg); |
|
virtual void OnBorrow(::sf2::Preset* pResource, InstrumentConsumer* pConsumer, void*& pArg); |
|
76 |
virtual void DeleteRegionIfNotUsed(::sf2::Region* pRegion, region_info_t* pRegInfo); |
virtual void DeleteRegionIfNotUsed(::sf2::Region* pRegion, region_info_t* pRegInfo); |
77 |
virtual void DeleteSampleIfNotUsed(::sf2::Sample* pSample, region_info_t* pRegInfo); |
virtual void DeleteSampleIfNotUsed(::sf2::Sample* pSample, region_info_t* pRegInfo); |
78 |
private: |
private: |