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-2008 Christian Schoenebeck * |
7 |
* Copyright (C) 2009-2010 Christian Schoenebeck and Grigor Iliev * |
* Copyright (C) 2009-2013 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 * |
51 |
virtual ~AbstractEngine(); |
virtual ~AbstractEngine(); |
52 |
|
|
53 |
// implementation of abstract methods derived from class 'LinuxSampler::Engine' |
// implementation of abstract methods derived from class 'LinuxSampler::Engine' |
54 |
virtual void SendSysex(void* pData, uint Size, MidiInputPort* pSender); |
virtual void SendSysex(void* pData, uint Size, MidiInputPort* pSender) OVERRIDE; |
55 |
virtual void Reset(); |
virtual void Reset() OVERRIDE; |
56 |
virtual void Enable(); |
virtual void Enable() OVERRIDE; |
57 |
virtual void Disable(); |
virtual void Disable() OVERRIDE; |
58 |
virtual uint VoiceCount(); |
virtual uint VoiceCount() OVERRIDE; |
59 |
virtual uint VoiceCountMax(); |
virtual uint VoiceCountMax() OVERRIDE; |
60 |
virtual String EngineName(); |
virtual String EngineName() OVERRIDE; |
61 |
|
|
62 |
virtual Format GetEngineFormat() = 0; |
virtual Format GetEngineFormat() = 0; |
63 |
virtual void Connect(AudioOutputDevice* pAudioOut) = 0; |
virtual void Connect(AudioOutputDevice* pAudioOut) = 0; |
64 |
virtual void DisableAndLock(); |
virtual void DisableAndLock(); |
65 |
|
|
66 |
void SetVoiceCount(uint Count);// Simple array wrapper just to make sure memory is freed |
void SetVoiceCount(uint Count); |
|
// when liblinuxsampler is unloaded |
|
67 |
|
|
68 |
float Random() { |
float Random() { |
69 |
RandomSeed = RandomSeed * 1103515245 + 12345; // classic pseudo random number generator |
RandomSeed = RandomSeed * 1103515245 + 12345; // classic pseudo random number generator |
70 |
return RandomSeed / 4294967296.0f; |
return RandomSeed / 4294967296.0f; |
71 |
} |
} |
72 |
|
|
73 |
|
// Simple array wrapper just to make sure memory is freed |
74 |
|
// when liblinuxsampler is unloaded |
75 |
class FloatTable { |
class FloatTable { |
76 |
private: |
private: |
77 |
const float* array; |
const float* array; |
111 |
int ActiveVoiceCountMax; ///< the maximum voice usage since application start |
int ActiveVoiceCountMax; ///< the maximum voice usage since application start |
112 |
atomic_t ActiveVoiceCount; ///< number of currently active voices |
atomic_t ActiveVoiceCount; ///< number of currently active voices |
113 |
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. |
|
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); |