@@ -180,3 +180,17 @@ void AudioEffectEnvelope::update(void) | |||
release(block); | |||
} | |||
bool AudioEffectEnvelope::isActive() | |||
{ | |||
uint8_t current_state = *(volatile uint8_t *)&state; | |||
if (current_state == STATE_IDLE) return false; | |||
return true; | |||
} | |||
bool AudioEffectEnvelope::isSustain() | |||
{ | |||
uint8_t current_state = *(volatile uint8_t *)&state; | |||
if (current_state == STATE_SUSTAIN) return true; | |||
return false; | |||
} | |||
@@ -74,6 +74,8 @@ public: | |||
release_forced_count = milliseconds2count(milliseconds); | |||
if (release_count == 0) release_count = 1; | |||
} | |||
bool isActive(); | |||
bool isSustain(); | |||
using AudioStream::release; | |||
virtual void update(void); | |||
private: |
@@ -2463,6 +2463,14 @@ double s_freq = .0625;</p> | |||
disable this feature (never extra latency). Longer times help | |||
reduce clicks or pops. The default is 5 millisecond. | |||
</p> | |||
<p class=func><span class=keyword>isActive</span>();</p> | |||
<p class=desc>Returns true when the envelope is currently in any of | |||
its 6 phases. | |||
</p> | |||
<p class=func><span class=keyword>isSustain</span>();</p> | |||
<p class=desc>Returns true when the envelope is currently in the | |||
sustain phase. | |||
</p> | |||
<h3>Examples</h3> | |||
<p class=exam>File > Examples > Audio > Synthesis > PlaySynthMusic | |||
</p> |
@@ -119,6 +119,8 @@ decay KEYWORD2 | |||
sustain KEYWORD2 | |||
release KEYWORD2 | |||
releaseNoteOn KEYWORD2 | |||
isActive KEYWORD2 | |||
isSustain KEYWORD2 | |||
inputLevel KEYWORD2 | |||
inputSelect KEYWORD2 | |||
muteHeadphone KEYWORD2 |