瀏覽代碼

Add isActive() and isSustain() to envelope

dds
PaulStoffregen 6 年之前
父節點
當前提交
4d98116e6f
共有 4 個文件被更改,包括 26 次插入0 次删除
  1. +14
    -0
      effect_envelope.cpp
  2. +2
    -0
      effect_envelope.h
  3. +8
    -0
      gui/index.html
  4. +2
    -0
      keywords.txt

+ 14
- 0
effect_envelope.cpp 查看文件

@@ -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;
}


+ 2
- 0
effect_envelope.h 查看文件

@@ -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:

+ 8
- 0
gui/index.html 查看文件

@@ -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 &gt; Examples &gt; Audio &gt; Synthesis &gt; PlaySynthMusic
</p>

+ 2
- 0
keywords.txt 查看文件

@@ -119,6 +119,8 @@ decay KEYWORD2
sustain KEYWORD2
release KEYWORD2
releaseNoteOn KEYWORD2
isActive KEYWORD2
isSustain KEYWORD2
inputLevel KEYWORD2
inputSelect KEYWORD2
muteHeadphone KEYWORD2

Loading…
取消
儲存