1 |
schoenebeck |
2611 |
/* |
2 |
|
|
* Copyright (c) 2014 Christian Schoenebeck |
3 |
|
|
* |
4 |
|
|
* http://www.linuxsampler.org |
5 |
|
|
* |
6 |
|
|
* This file is part of LinuxSampler and released under the same terms. |
7 |
|
|
* See README file for details. |
8 |
|
|
*/ |
9 |
|
|
|
10 |
|
|
#ifndef LS_ABSTRACTINSTRUMENTMANAGER_H |
11 |
|
|
#define LS_ABSTRACTINSTRUMENTMANAGER_H |
12 |
|
|
|
13 |
|
|
#include "../InstrumentManager.h" |
14 |
|
|
#include "../../common/ResourceManager.h" |
15 |
|
|
#include "../../common/global_private.h" |
16 |
|
|
#include "InstrumentScriptVM.h" |
17 |
|
|
|
18 |
|
|
namespace LinuxSampler { |
19 |
|
|
|
20 |
|
|
typedef ResourceConsumer<VMParserContext> InstrumentScriptConsumer; |
21 |
|
|
|
22 |
|
|
class AbstractInstrumentManager : public InstrumentManager { |
23 |
|
|
public: |
24 |
|
|
AbstractInstrumentManager() { } |
25 |
|
|
virtual ~AbstractInstrumentManager() { } |
26 |
|
|
|
27 |
|
|
class ScriptResourceManager : public ResourceManager<String, VMParserContext> { |
28 |
|
|
public: |
29 |
|
|
ScriptResourceManager() {} |
30 |
|
|
virtual ~ScriptResourceManager() {} |
31 |
|
|
protected: |
32 |
|
|
// implementation of derived abstract methods from 'ResourceManager' |
33 |
|
|
virtual VMParserContext* Create(String Key, InstrumentScriptConsumer* pConsumer, void*& pArg); |
34 |
|
|
virtual void Destroy(VMParserContext* pResource, void* pArg); |
35 |
|
|
virtual void OnBorrow(VMParserContext* pResource, InstrumentScriptConsumer* pConsumer, void*& pArg) {} // ignore |
36 |
|
|
} scripts; |
37 |
|
|
}; |
38 |
|
|
|
39 |
|
|
} // namespace LinuxSampler |
40 |
|
|
|
41 |
|
|
#endif // LS_ABSTRACTINSTRUMENTMANAGER_H |