104 |
* @param Samples - number of sample points to be rendered |
* @param Samples - number of sample points to be rendered |
105 |
* @returns 0 on success |
* @returns 0 on success |
106 |
*/ |
*/ |
107 |
virtual int RenderAudio(uint Samples) { |
virtual int RenderAudio(uint Samples) OVERRIDE { |
108 |
dmsg(8,("RenderAudio(Samples=%d)\n", Samples)); |
dmsg(8,("RenderAudio(Samples=%d)\n", Samples)); |
109 |
|
|
110 |
// return if engine disabled |
// return if engine disabled |
205 |
return 0; |
return 0; |
206 |
} |
} |
207 |
|
|
208 |
virtual int MaxVoices() { return pVoicePool->poolSize(); } |
virtual int MaxVoices() OVERRIDE { return pVoicePool->poolSize(); } |
209 |
|
|
210 |
virtual void SetMaxVoices(int iVoices) throw (Exception) { |
virtual void SetMaxVoices(int iVoices) throw (Exception) OVERRIDE { |
211 |
if (iVoices < 1) |
if (iVoices < 1) |
212 |
throw Exception("Maximum voices for an engine cannot be set lower than 1"); |
throw Exception("Maximum voices for an engine cannot be set lower than 1"); |
213 |
|
|
250 |
/** Called after the new max number of voices is set and before resuming the engine. */ |
/** Called after the new max number of voices is set and before resuming the engine. */ |
251 |
virtual void PostSetMaxVoices(int iVoices) { } |
virtual void PostSetMaxVoices(int iVoices) { } |
252 |
|
|
253 |
virtual uint DiskStreamCount() { return (pDiskThread) ? pDiskThread->GetActiveStreamCount() : 0; } |
virtual uint DiskStreamCount() OVERRIDE { return (pDiskThread) ? pDiskThread->GetActiveStreamCount() : 0; } |
254 |
virtual uint DiskStreamCountMax() { return (pDiskThread) ? pDiskThread->ActiveStreamCountMax : 0; } |
virtual uint DiskStreamCountMax() OVERRIDE { return (pDiskThread) ? pDiskThread->ActiveStreamCountMax : 0; } |
255 |
virtual int MaxDiskStreams() { return iMaxDiskStreams; } |
virtual int MaxDiskStreams() OVERRIDE { return iMaxDiskStreams; } |
256 |
|
|
257 |
virtual void SetMaxDiskStreams(int iStreams) throw (Exception) { |
virtual void SetMaxDiskStreams(int iStreams) throw (Exception) OVERRIDE { |
258 |
if (iStreams < 0) |
if (iStreams < 0) |
259 |
throw Exception("Maximum disk streams for an engine cannot be set lower than 0"); |
throw Exception("Maximum disk streams for an engine cannot be set lower than 0"); |
260 |
|
|
269 |
ResumeAll(); |
ResumeAll(); |
270 |
} |
} |
271 |
|
|
272 |
virtual String DiskStreamBufferFillBytes() { return (pDiskThread) ? pDiskThread->GetBufferFillBytes() : ""; } |
virtual String DiskStreamBufferFillBytes() OVERRIDE { return (pDiskThread) ? pDiskThread->GetBufferFillBytes() : ""; } |
273 |
virtual String DiskStreamBufferFillPercentage() { return (pDiskThread) ? pDiskThread->GetBufferFillPercentage() : ""; } |
virtual String DiskStreamBufferFillPercentage() OVERRIDE { return (pDiskThread) ? pDiskThread->GetBufferFillPercentage() : ""; } |
274 |
virtual InstrumentManager* GetInstrumentManager() { return &instruments; } |
virtual InstrumentManager* GetInstrumentManager() OVERRIDE { return &instruments; } |
275 |
|
|
276 |
/** |
/** |
277 |
* Connect this engine instance with the given audio output device. |
* Connect this engine instance with the given audio output device. |
282 |
* |
* |
283 |
* @param pAudioOut - audio output device to connect to |
* @param pAudioOut - audio output device to connect to |
284 |
*/ |
*/ |
285 |
virtual void Connect(AudioOutputDevice* pAudioOut) { |
virtual void Connect(AudioOutputDevice* pAudioOut) OVERRIDE { |
286 |
// caution: don't ignore if connecting to the same device here, |
// caution: don't ignore if connecting to the same device here, |
287 |
// because otherwise SetMaxDiskStreams() implementation won't work anymore! |
// because otherwise SetMaxDiskStreams() implementation won't work anymore! |
288 |
|
|
370 |
} |
} |
371 |
|
|
372 |
// Implementattion for abstract method derived from Engine. |
// Implementattion for abstract method derived from Engine. |
373 |
virtual void ReconnectAudioOutputDevice() { |
virtual void ReconnectAudioOutputDevice() OVERRIDE { |
374 |
SuspendAll(); |
SuspendAll(); |
375 |
if (pAudioOutputDevice) Connect(pAudioOutputDevice); |
if (pAudioOutputDevice) Connect(pAudioOutputDevice); |
376 |
ResumeAll(); |
ResumeAll(); |
574 |
public: |
public: |
575 |
int PendingStreamDeletions; |
int PendingStreamDeletions; |
576 |
RR* pPendingRegionSuspension; |
RR* pPendingRegionSuspension; |
577 |
|
|
578 |
SuspensionVoiceHandler(RR* pPendingRegionSuspension) { |
SuspensionVoiceHandler(RR* pPendingRegionSuspension) { |
579 |
PendingStreamDeletions = 0; |
PendingStreamDeletions = 0; |
580 |
this->pPendingRegionSuspension = pPendingRegionSuspension; |
this->pPendingRegionSuspension = pPendingRegionSuspension; |
581 |
} |
} |
582 |
|
|
583 |
virtual bool Process(MidiKey* pMidiKey) { |
virtual bool Process(MidiKey* pMidiKey) OVERRIDE { |
584 |
VoiceIterator itVoice = pMidiKey->pActiveVoices->first(); |
VoiceIterator itVoice = pMidiKey->pActiveVoices->first(); |
585 |
// if current key is not associated with this region, skip this key |
// if current key is not associated with this region, skip this key |
586 |
if (itVoice->GetRegion()->GetParent() != pPendingRegionSuspension) return false; |
if (itVoice->GetRegion()->GetParent() != pPendingRegionSuspension) return false; |
588 |
return true; |
return true; |
589 |
} |
} |
590 |
|
|
591 |
virtual void Process(VoiceIterator& itVoice) { |
virtual void Process(VoiceIterator& itVoice) OVERRIDE { |
592 |
// request a notification from disk thread side for stream deletion |
// request a notification from disk thread side for stream deletion |
593 |
const Stream::Handle hStream = itVoice->KillImmediately(true); |
const Stream::Handle hStream = itVoice->KillImmediately(true); |
594 |
if (hStream != Stream::INVALID_HANDLE) { // voice actually used a stream |
if (hStream != Stream::INVALID_HANDLE) { // voice actually used a stream |