83 |
public: |
public: |
84 |
type_t Type; ///< Voice Type (bit field, a voice may have several types) |
type_t Type; ///< Voice Type (bit field, a voice may have several types) |
85 |
int MIDIKey; ///< MIDI key number of the key that triggered the voice |
int MIDIKey; ///< MIDI key number of the key that triggered the voice |
86 |
|
uint8_t MIDIVelocity; ///< MIDI velocity of the key that triggered the voice |
87 |
|
uint8_t MIDIPan; ///< the current MIDI pan value |
88 |
|
|
89 |
|
SignalUnitRack* const pSignalUnitRack; |
90 |
|
|
91 |
AbstractVoice(); |
AbstractVoice(SignalUnitRack* pRack); |
92 |
virtual ~AbstractVoice(); |
virtual ~AbstractVoice(); |
93 |
|
|
94 |
inline bool IsActive() { return PlaybackState; } |
inline bool IsActive() { return PlaybackState; } |
107 |
virtual void Synthesize(uint Samples, sample_t* pSrc, uint Skip); |
virtual void Synthesize(uint Samples, sample_t* pSrc, uint Skip); |
108 |
|
|
109 |
uint GetSampleRate() { return GetEngine()->SampleRate; } |
uint GetSampleRate() { return GetEngine()->SampleRate; } |
|
|
|
|
virtual SignalUnitRack* GetSignalUnitRack() { return NULL; } |
|
110 |
|
|
111 |
void processCCEvents(RTList<Event>::Iterator& itEvent, uint End); |
void processCCEvents(RTList<Event>::Iterator& itEvent, uint End); |
112 |
void processPitchEvent(RTList<Event>::Iterator& itEvent); |
void processPitchEvent(RTList<Event>::Iterator& itEvent); |
183 |
* Gets the sample cache size in bytes. |
* Gets the sample cache size in bytes. |
184 |
*/ |
*/ |
185 |
virtual unsigned long GetSampleCacheSize() = 0; |
virtual unsigned long GetSampleCacheSize() = 0; |
186 |
|
|
187 |
|
/** |
188 |
|
* Because in most cases we cache part of the sample in RAM, if the |
189 |
|
* offset is too big (will extend beyond the RAM cache if the cache contains |
190 |
|
* the beginning of the sample) we should cache in the RAM buffer not the |
191 |
|
* beginning of the sample but a part that starts from the sample offset point. |
192 |
|
* In that case the current sample position should start from zero (Pos). |
193 |
|
* When the offset fits into RAM buffer or the whole sample is cached |
194 |
|
* in RAM, Pos should contain the actual offset. |
195 |
|
* We don't trim the sample because it might have a defined |
196 |
|
* loop start point before the start point of the playback. |
197 |
|
*/ |
198 |
|
virtual void SetSampleStartOffset(); |
199 |
|
|
200 |
/** |
/** |
201 |
* Returns the correct amplitude factor for the given \a MIDIKeyVelocity. |
* Returns the correct amplitude factor for the given \a MIDIKeyVelocity. |