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 - 2008 Christian Schoenebeck * |
* Copyright (C) 2005 - 2022 Christian Schoenebeck * |
7 |
* Copyright (C) 2009 - 2012 Christian Schoenebeck and Grigor Iliev * |
* Copyright (C) 2009 - 2012 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 * |
80 |
virtual void DeleteSampleIfNotUsed(Sample* pSample, region_info_t* pRegInfo); |
virtual void DeleteSampleIfNotUsed(Sample* pSample, region_info_t* pRegInfo); |
81 |
private: |
private: |
82 |
typedef ResourceConsumer< ::sfz::File> SfzConsumer; |
typedef ResourceConsumer< ::sfz::File> SfzConsumer; |
83 |
|
typedef ResourceConsumer< ::sfz::Instrument> SfzInstrConsumer; |
84 |
|
|
85 |
class SfzResourceManager : public ResourceManager<String, ::sfz::File> { |
class SfzResourceManager : public ResourceManager<String, ::sfz::File>, public SfzConsumer { |
86 |
protected: |
protected: |
87 |
// implementation of derived abstract methods from 'ResourceManager' |
// implementation of derived abstract methods from 'ResourceManager' |
88 |
virtual ::sfz::File* Create(String Key, SfzConsumer* pConsumer, void*& pArg); |
virtual ::sfz::File* Create(String Key, SfzConsumer* pConsumer, void*& pArg); |
89 |
virtual void Destroy(::sfz::File* pResource, void* pArg); |
virtual void Destroy(::sfz::File* pResource, void* pArg); |
90 |
virtual void OnBorrow(::sfz::File* pResource, SfzConsumer* pConsumer, void*& pArg) {} // ignore |
virtual void OnBorrow(::sfz::File* pResource, SfzConsumer* pConsumer, void*& pArg) {} // ignore |
91 |
|
|
92 |
|
// implementation of derived abstract methods from 'ResourceConsumer' |
93 |
|
virtual void ResourceToBeUpdated(::sfz::File* pResource, void*& pUpdateArg) OVERRIDE; |
94 |
|
virtual void ResourceUpdated(::sfz::File* pOldResource, ::sfz::File* pNewResource, void* pUpdateArg) OVERRIDE; |
95 |
|
virtual void OnResourceProgress(float fProgress) OVERRIDE {} // ignore |
96 |
public: |
public: |
97 |
SfzResourceManager(InstrumentResourceManager* parent) : parent(parent) {} |
SfzResourceManager(InstrumentResourceManager* parent) : parent(parent) {} |
98 |
virtual ~SfzResourceManager() {} |
virtual ~SfzResourceManager() {} |