3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
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-2009 Christian Schoenebeck * |
* Copyright (C) 2005-2008 Christian Schoenebeck * |
7 |
* Copyright (C) 2009 Grigor Iliev * |
* Copyright (C) 2009-2010 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 * |
121 |
if (DiskVoice) { |
if (DiskVoice) { |
122 |
// check if we reached the allowed limit of the sample RAM cache |
// check if we reached the allowed limit of the sample RAM cache |
123 |
if (finalSynthesisParameters.dPos > MaxRAMPos) { |
if (finalSynthesisParameters.dPos > MaxRAMPos) { |
124 |
dmsg(5,("Voice: switching to disk playback (Pos=%f)\n", finalSynthesisParameters.dPos)); |
dmsg(5,("VoiceBase: switching to disk playback (Pos=%f)\n", finalSynthesisParameters.dPos)); |
125 |
this->PlaybackState = Voice::playback_state_disk; |
this->PlaybackState = Voice::playback_state_disk; |
126 |
} |
} |
127 |
} else if (finalSynthesisParameters.dPos >= pSample->GetCache().Size / SmplInfo.FrameSize) { |
} else if (finalSynthesisParameters.dPos >= pSample->GetCache().Size / SmplInfo.FrameSize) { |
175 |
break; |
break; |
176 |
|
|
177 |
case Voice::playback_state_end: |
case Voice::playback_state_end: |
178 |
std::cerr << "gig::Voice::Render(): entered with playback_state_end, this is a bug!\n" << std::flush; |
std::cerr << "VoiceBase::Render(): entered with playback_state_end, this is a bug!\n" << std::flush; |
179 |
break; |
break; |
180 |
} |
} |
181 |
|
|
185 |
itTriggerEvent = Pool<Event>::Iterator(); |
itTriggerEvent = Pool<Event>::Iterator(); |
186 |
|
|
187 |
// If sample stream or release stage finished, kill the voice |
// If sample stream or release stage finished, kill the voice |
188 |
if ( |
if (PlaybackState == Voice::playback_state_end || |
189 |
PlaybackState == Voice::playback_state_end || |
pEG1->getSegmentType() == EG::segment_end) { |
190 |
EG1.getSegmentType() == gig::EGADSR::segment_end |
KillImmediately(); |
191 |
) KillImmediately(); |
} |
192 |
} |
} |
193 |
|
|
194 |
/** |
/** |
227 |
S* pSample; ///< Pointer to the sample to be played back |
S* pSample; ///< Pointer to the sample to be played back |
228 |
R* pRegion; ///< Pointer to the articulation information of current region of this voice |
R* pRegion; ///< Pointer to the articulation information of current region of this voice |
229 |
|
|
230 |
|
virtual MidiKeyBase* GetMidiKeyInfo(int MIDIKey) { |
231 |
|
EC* pChannel = static_cast<EC*>(pEngineChannel); |
232 |
|
return &pChannel->pMIDIKeyInfo[MIDIKey]; |
233 |
|
} |
234 |
|
|
235 |
virtual unsigned long GetNoteOnTime(int MIDIKey) { |
virtual unsigned long GetNoteOnTime(int MIDIKey) { |
236 |
EC* pChannel = static_cast<EC*>(pEngineChannel); |
EC* pChannel = static_cast<EC*>(pEngineChannel); |
237 |
return pChannel->pMIDIKeyInfo[MIDIKey].NoteOnTime; |
return pChannel->pMIDIKeyInfo[MIDIKey].NoteOnTime; |