32 |
#include "../common/Pool.h" |
#include "../common/Pool.h" |
33 |
#include "../common/RingBuffer.h" |
#include "../common/RingBuffer.h" |
34 |
#include "../common/ChangeFlagRelaxed.h" |
#include "../common/ChangeFlagRelaxed.h" |
35 |
|
#include "../common/ResourceManager.h" |
36 |
#include "../drivers/audio/AudioOutputDevice.h" |
#include "../drivers/audio/AudioOutputDevice.h" |
37 |
#include "common/Event.h" |
#include "common/Event.h" |
38 |
#include "common/SignalUnitRack.h" |
#include "common/SignalUnitRack.h" |
39 |
|
#include "common/InstrumentScriptVM.h" |
40 |
|
|
41 |
namespace LinuxSampler { |
namespace LinuxSampler { |
42 |
|
|
97 |
AudioChannel* pDedicatedVoiceChannelLeft; ///< encapsulates a special audio rendering buffer (left) for rendering and routing audio on a per voice basis (this is a very special case and only used for voices which lie on a note which was set with individual, dedicated FX send level) |
AudioChannel* pDedicatedVoiceChannelLeft; ///< encapsulates a special audio rendering buffer (left) for rendering and routing audio on a per voice basis (this is a very special case and only used for voices which lie on a note which was set with individual, dedicated FX send level) |
98 |
AudioChannel* pDedicatedVoiceChannelRight; ///< encapsulates a special audio rendering buffer (right) for rendering and routing audio on a per voice basis (this is a very special case and only used for voices which lie on a note which was set with individual, dedicated FX send level) |
AudioChannel* pDedicatedVoiceChannelRight; ///< encapsulates a special audio rendering buffer (right) for rendering and routing audio on a per voice basis (this is a very special case and only used for voices which lie on a note which was set with individual, dedicated FX send level) |
99 |
|
|
100 |
|
typedef ResourceConsumer<VMParserContext> ScriptConsumer; |
101 |
|
|
102 |
|
class ScriptResourceManager : public ResourceManager<String, VMParserContext> { |
103 |
|
protected: |
104 |
|
// implementation of derived abstract methods from 'ResourceManager' |
105 |
|
virtual VMParserContext* Create(String Key, ScriptConsumer* pConsumer, void*& pArg); |
106 |
|
virtual void Destroy(VMParserContext* pResource, void* pArg); |
107 |
|
virtual void OnBorrow(VMParserContext* pResource, ScriptConsumer* pConsumer, void*& pArg) {} // ignore |
108 |
|
public: |
109 |
|
ScriptResourceManager(AbstractEngine* parent) : parent(parent) {} |
110 |
|
virtual ~ScriptResourceManager() {} |
111 |
|
private: |
112 |
|
AbstractEngine* parent; |
113 |
|
} scripts; |
114 |
|
|
115 |
friend class AbstractVoice; |
friend class AbstractVoice; |
116 |
friend class AbstractEngineChannel; |
friend class AbstractEngineChannel; |
117 |
template<class V, class R, class I> friend class EngineChannelBase; |
template<class V, class R, class I> friend class EngineChannelBase; |
133 |
int ActiveVoiceCountMax; ///< the maximum voice usage since application start |
int ActiveVoiceCountMax; ///< the maximum voice usage since application start |
134 |
atomic_t ActiveVoiceCount; ///< number of currently active voices |
atomic_t ActiveVoiceCount; ///< number of currently active voices |
135 |
int VoiceSpawnsLeft; ///< We only allow CONFIG_MAX_VOICES voices to be spawned per audio fragment, we use this variable to ensure this limit. |
int VoiceSpawnsLeft; ///< We only allow CONFIG_MAX_VOICES voices to be spawned per audio fragment, we use this variable to ensure this limit. |
136 |
|
InstrumentScriptVM* pScriptVM; ///< Real-time instrument script virtual machine runner for this engine. |
137 |
|
|
138 |
void RouteAudio(EngineChannel* pEngineChannel, uint Samples); |
void RouteAudio(EngineChannel* pEngineChannel, uint Samples); |
139 |
void RouteDedicatedVoiceChannels(EngineChannel* pEngineChannel, optional<float> FxSendLevels[2], uint Samples); |
void RouteDedicatedVoiceChannels(EngineChannel* pEngineChannel, optional<float> FxSendLevels[2], uint Samples); |