33 |
#include "../common/RingBuffer.h" |
#include "../common/RingBuffer.h" |
34 |
#include "../drivers/audio/AudioOutputDevice.h" |
#include "../drivers/audio/AudioOutputDevice.h" |
35 |
#include "common/Event.h" |
#include "common/Event.h" |
36 |
|
#include "common/SignalUnitRack.h" |
37 |
|
|
38 |
namespace LinuxSampler { |
namespace LinuxSampler { |
39 |
|
|
65 |
|
|
66 |
void SetVoiceCount(uint Count);// Simple array wrapper just to make sure memory is freed |
void SetVoiceCount(uint Count);// Simple array wrapper just to make sure memory is freed |
67 |
// when liblinuxsampler is unloaded |
// when liblinuxsampler is unloaded |
68 |
|
|
69 |
|
float Random() { |
70 |
|
RandomSeed = RandomSeed * 1103515245 + 12345; // classic pseudo random number generator |
71 |
|
return RandomSeed / 4294967296.0f; |
72 |
|
} |
73 |
|
|
74 |
class FloatTable { |
class FloatTable { |
75 |
private: |
private: |
76 |
const float* array; |
const float* array; |
110 |
int ActiveVoiceCountMax; ///< the maximum voice usage since application start |
int ActiveVoiceCountMax; ///< the maximum voice usage since application start |
111 |
atomic_t ActiveVoiceCount; ///< number of currently active voices |
atomic_t ActiveVoiceCount; ///< number of currently active voices |
112 |
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. |
113 |
|
EqSupport* pEq; ///< Used for per voice equalization |
114 |
|
|
115 |
void RouteAudio(EngineChannel* pEngineChannel, uint Samples); |
void RouteAudio(EngineChannel* pEngineChannel, uint Samples); |
116 |
void RouteDedicatedVoiceChannels(EngineChannel* pEngineChannel, optional<float> FxSendLevels[2], uint Samples); |
void RouteDedicatedVoiceChannels(EngineChannel* pEngineChannel, optional<float> FxSendLevels[2], uint Samples); |
127 |
|
|
128 |
uint8_t GSCheckSum(const RingBuffer<uint8_t,false>::NonVolatileReader AddrReader, uint DataSize); |
uint8_t GSCheckSum(const RingBuffer<uint8_t,false>::NonVolatileReader AddrReader, uint DataSize); |
129 |
|
|
|
float Random() { |
|
|
RandomSeed = RandomSeed * 1103515245 + 12345; // classic pseudo random number generator |
|
|
return RandomSeed / 4294967296.0f; |
|
|
} |
|
|
|
|
130 |
virtual void ResetInternal() = 0; |
virtual void ResetInternal() = 0; |
131 |
virtual void KillAllVoices(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itKillEvent) = 0; |
virtual void KillAllVoices(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itKillEvent) = 0; |
132 |
virtual void ProcessNoteOn(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent) = 0; |
virtual void ProcessNoteOn(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent) = 0; |