115 |
class SignalUnitRack { |
class SignalUnitRack { |
116 |
protected: |
protected: |
117 |
uint CurrentStep; // The current time step |
uint CurrentStep; // The current time step |
118 |
bool bHasEq; |
bool bHasEq, releaseStageEntered; |
119 |
|
|
120 |
public: |
public: |
121 |
FixedArray<SignalUnit*> Units; // A list of all signal units in this rack |
FixedArray<SignalUnit*> Units; // A list of all signal units in this rack |
123 |
/** |
/** |
124 |
* @param maxUnitCount We are using fixed size array because of the real-time safe requirements. |
* @param maxUnitCount We are using fixed size array because of the real-time safe requirements. |
125 |
*/ |
*/ |
126 |
SignalUnitRack(int maxUnitCount): CurrentStep(0), bHasEq(false), Units(maxUnitCount) { } |
SignalUnitRack(int maxUnitCount): CurrentStep(0), bHasEq(false), |
127 |
|
releaseStageEntered(false), Units(maxUnitCount) { } |
128 |
|
|
129 |
uint GetCurrentStep() { return CurrentStep; } |
uint GetCurrentStep() { return CurrentStep; } |
130 |
|
|
153 |
|
|
154 |
/** Initializes and triggers the rack. */ |
/** Initializes and triggers the rack. */ |
155 |
virtual void Trigger() { |
virtual void Trigger() { |
156 |
|
releaseStageEntered = false; |
157 |
CurrentStep = 0; |
CurrentStep = 0; |
158 |
for (int i = 0; i < Units.size(); i++) { |
for (int i = 0; i < Units.size(); i++) { |
159 |
Units[i]->Trigger(); |
Units[i]->Trigger(); |
165 |
* called when the voice enter the release stage. |
* called when the voice enter the release stage. |
166 |
*/ |
*/ |
167 |
virtual void EnterReleaseStage() { |
virtual void EnterReleaseStage() { |
168 |
|
releaseStageEntered = true; |
169 |
for (int i = 0; i < Units.size(); i++) { |
for (int i = 0; i < Units.size(); i++) { |
170 |
Units[i]->EnterReleaseStage(); |
Units[i]->EnterReleaseStage(); |
171 |
} |
} |
172 |
} |
} |
173 |
|
|
174 |
|
bool isReleaseStageEntered() { return releaseStageEntered; } |
175 |
|
|
176 |
/** |
/** |
177 |
* When the rack belongs to a voice, this method is |
* When the rack belongs to a voice, this method is |
178 |
* called when the voice is of type which ignore note off. |
* called when the voice is of type which ignore note off. |