143 |
} |
} |
144 |
} |
} |
145 |
} |
} |
146 |
|
|
147 |
|
// In case scale tuning has been changed, recalculate pitch for |
148 |
|
// all active voices. |
149 |
|
ProcessScaleTuningChange(); |
150 |
|
|
151 |
// reset internal voice counter (just for statistic of active voices) |
// reset internal voice counter (just for statistic of active voices) |
152 |
ActiveVoiceCountTemp = 0; |
ActiveVoiceCountTemp = 0; |
1456 |
|
|
1457 |
return -1; |
return -1; |
1458 |
} |
} |
1459 |
|
|
1460 |
|
/** |
1461 |
|
* Checks whether scale tuning setting has been changed since last |
1462 |
|
* time this method was called, if yes, it recalculates the pitch |
1463 |
|
* for all active voices. |
1464 |
|
*/ |
1465 |
|
void ProcessScaleTuningChange() { |
1466 |
|
const bool changed = ScaleTuningChanged.readAndReset(); |
1467 |
|
if (!changed) return; |
1468 |
|
|
1469 |
|
for (int i = 0; i < engineChannels.size(); i++) { |
1470 |
|
EngineChannelBase<V, R, I>* channel = |
1471 |
|
static_cast<EngineChannelBase<V, R, I>*>(engineChannels[i]); |
1472 |
|
channel->OnScaleTuningChanged(); |
1473 |
|
} |
1474 |
|
} |
1475 |
|
|
1476 |
private: |
private: |
1477 |
Pool<V>* pVoicePool; ///< Contains all voices that can be activated. |
Pool<V>* pVoicePool; ///< Contains all voices that can be activated. |