329 |
} |
} |
330 |
|
|
331 |
/** |
/** |
332 |
* Let this engine proceed to render the given amount of sample points. The |
* Let this engine proceed to render the given amount of sample points. |
333 |
* calculated audio data of all voices of this engine will be placed into |
* The engine will iterate through all engine channels and render audio |
334 |
* the engine's audio sum buffer which has to be copied and eventually be |
* for each engine channel independently. The calculated audio data of |
335 |
* converted to the appropriate value range by the audio output class (e.g. |
* all voices of each engine channel will be placed into the audio sum |
336 |
* AlsaIO or JackIO) right after. |
* buffers of the respective audio output device, connected to the |
337 |
|
* respective engine channel. |
338 |
* |
* |
339 |
* @param Samples - number of sample points to be rendered |
* @param Samples - number of sample points to be rendered |
340 |
* @returns 0 on success |
* @returns 0 on success |
341 |
*/ |
*/ |
342 |
int Engine::RenderAudio(uint Samples) { |
int Engine::RenderAudio(uint Samples) { |
343 |
dmsg(5,("RenderAudio(Samples=%d)\n", Samples)); |
dmsg(7,("RenderAudio(Samples=%d)\n", Samples)); |
344 |
|
|
345 |
// return if engine disabled |
// return if engine disabled |
346 |
if (EngineDisabled.Pop()) { |
if (EngineDisabled.Pop()) { |
871 |
DimValues[i] = itNoteOnEvent->Param.Note.Velocity; |
DimValues[i] = itNoteOnEvent->Param.Note.Velocity; |
872 |
break; |
break; |
873 |
case ::gig::dimension_channelaftertouch: |
case ::gig::dimension_channelaftertouch: |
874 |
DimValues[i] = 0; //TODO: we currently ignore this dimension |
DimValues[i] = pEngineChannel->ControllerTable[128]; |
875 |
break; |
break; |
876 |
case ::gig::dimension_releasetrigger: |
case ::gig::dimension_releasetrigger: |
877 |
VoiceType = (ReleaseTriggerVoice) ? Voice::type_release_trigger : (!iLayer) ? Voice::type_release_trigger_required : Voice::type_normal; |
VoiceType = (ReleaseTriggerVoice) ? Voice::type_release_trigger : (!iLayer) ? Voice::type_release_trigger_required : Voice::type_normal; |
1243 |
} |
} |
1244 |
case 7: { // volume |
case 7: { // volume |
1245 |
//TODO: not sample accurate yet |
//TODO: not sample accurate yet |
1246 |
pEngineChannel->GlobalVolume = VolumeCurve[itControlChangeEvent->Param.CC.Value] * CONFIG_GLOBAL_ATTENUATION; |
pEngineChannel->MidiVolume = VolumeCurve[itControlChangeEvent->Param.CC.Value]; |
1247 |
pEngineChannel->bStatusChanged = true; // engine channel status has changed, so set notify flag |
pEngineChannel->bStatusChanged = true; // engine channel status has changed, so set notify flag |
1248 |
break; |
break; |
1249 |
} |
} |
1568 |
} |
} |
1569 |
|
|
1570 |
String Engine::Version() { |
String Engine::Version() { |
1571 |
String s = "$Revision: 1.63 $"; |
String s = "$Revision: 1.66 $"; |
1572 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
1573 |
} |
} |
1574 |
|
|
1575 |
|
InstrumentManager* Engine::GetInstrumentManager() { |
1576 |
|
return &instruments; |
1577 |
|
} |
1578 |
|
|
1579 |
// static constant initializers |
// static constant initializers |
1580 |
const float* Engine::VolumeCurve(InitVolumeCurve()); |
const float* Engine::VolumeCurve(InitVolumeCurve()); |
1581 |
const float* Engine::PanCurve(InitPanCurve()); |
const float* Engine::PanCurve(InitPanCurve()); |