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-2011 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 * |
190 |
// been deleted by the disk thread |
// been deleted by the disk thread |
191 |
if (iPendingStreamDeletions) ProcessPendingStreamDeletions(); |
if (iPendingStreamDeletions) ProcessPendingStreamDeletions(); |
192 |
|
|
193 |
|
// Release the instrument change command. (This has to |
194 |
|
// be done after all voices have been rendered and not |
195 |
|
// in HandleInstrumentChanges, as the RegionsInUse |
196 |
|
// list has been built up by the voice renderers.) |
197 |
|
for (int i = 0; i < engineChannels.size(); i++) { |
198 |
|
EngineChannelBase<V, R, I>* channel = |
199 |
|
static_cast<EngineChannelBase<V, R, I>*>(engineChannels[i]); |
200 |
|
channel->InstrumentChangeCommandReader.Unlock(); |
201 |
|
} |
202 |
FrameTime += Samples; |
FrameTime += Samples; |
203 |
|
|
204 |
EngineDisabled.RttDone(); |
EngineDisabled.RttDone(); |
243 |
} |
} |
244 |
pVoicePool->clear(); |
pVoicePool->clear(); |
245 |
|
|
246 |
|
PostSetMaxVoices(iVoices); |
247 |
ResumeAll(); |
ResumeAll(); |
248 |
} |
} |
249 |
|
|
250 |
|
/** Called after the new max number of voices is set and before resuming the engine. */ |
251 |
|
virtual void PostSetMaxVoices(int iVoices) { } |
252 |
|
|
253 |
virtual uint DiskStreamCount() { return (pDiskThread) ? pDiskThread->GetActiveStreamCount() : 0; } |
virtual uint DiskStreamCount() { return (pDiskThread) ? pDiskThread->GetActiveStreamCount() : 0; } |
254 |
virtual uint DiskStreamCountMax() { return (pDiskThread) ? pDiskThread->ActiveStreamCountMax : 0; } |
virtual uint DiskStreamCountMax() { return (pDiskThread) ? pDiskThread->ActiveStreamCountMax : 0; } |
550 |
|
|
551 |
//friend class EngineChannelBase<V, R, I>; |
//friend class EngineChannelBase<V, R, I>; |
552 |
|
|
553 |
|
static IM instruments; |
554 |
|
|
555 |
protected: |
protected: |
556 |
class SuspensionVoiceHandler : public MidiKeyboardManager<V>::VoiceHandler { |
class SuspensionVoiceHandler : public MidiKeyboardManager<V>::VoiceHandler { |
557 |
public: |
public: |
580 |
} |
} |
581 |
}; |
}; |
582 |
|
|
|
static IM instruments; |
|
|
|
|
583 |
Pool<R*>* pRegionPool[2]; ///< Double buffered pool, used by the engine channels to keep track of regions in use. |
Pool<R*>* pRegionPool[2]; ///< Double buffered pool, used by the engine channels to keep track of regions in use. |
584 |
int MinFadeOutSamples; ///< The number of samples needed to make an instant fade out (e.g. for voice stealing) without leading to clicks. |
int MinFadeOutSamples; ///< The number of samples needed to make an instant fade out (e.g. for voice stealing) without leading to clicks. |
585 |
D* pDiskThread; |
D* pDiskThread; |
785 |
//TODO: this is a lazy solution ATM and not safe in case somebody is currently editing the instrument we're currently switching to (we should store all suspended regions on instrument manager side and when switching to another instrument copy that list to the engine's local list of suspensions |
//TODO: this is a lazy solution ATM and not safe in case somebody is currently editing the instrument we're currently switching to (we should store all suspended regions on instrument manager side and when switching to another instrument copy that list to the engine's local list of suspensions |
786 |
ResetSuspendedRegions(); |
ResetSuspendedRegions(); |
787 |
} |
} |
|
|
|
|
for (int i = 0; i < engineChannels.size(); i++) { |
|
|
EngineChannelBase<V, R, I>* channel = |
|
|
static_cast<EngineChannelBase<V, R, I>*>(engineChannels[i]); |
|
|
channel->InstrumentChangeCommandReader.Unlock(); |
|
|
} |
|
788 |
} |
} |
789 |
|
|
790 |
/** |
/** |