mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
Add panic button
This commit is contained in:
parent
bf8f8d8ec6
commit
b466218cbd
6 changed files with 15 additions and 11 deletions
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
//==============================================================================
|
||||
WavetableAudioProcessorEditor::WavetableAudioProcessorEditor (WavetableAudioProcessor& p)
|
||||
: ProcessorEditor (p), vaProc (p)
|
||||
: ProcessorEditor (p), wtProc (p)
|
||||
{
|
||||
scope.setName ("scope");
|
||||
scope.setNumChannels (2);
|
||||
|
|
@ -14,6 +14,8 @@ WavetableAudioProcessorEditor::WavetableAudioProcessorEditor (WavetableAudioProc
|
|||
|
||||
addAndMakeVisible (editor);
|
||||
addAndMakeVisible (scope);
|
||||
|
||||
usage.panic.onClick = [this] { wtProc.presetLoaded = true; };
|
||||
addAndMakeVisible (usage);
|
||||
|
||||
usage.setBounds (45, 12, 150, 16);
|
||||
|
|
@ -67,9 +69,9 @@ void WavetableAudioProcessorEditor::resized()
|
|||
void WavetableAudioProcessorEditor::addMenuItems (juce::PopupMenu& m)
|
||||
{
|
||||
m.addSeparator();
|
||||
m.addItem ("MPE", true, vaProc.globalParams.mpe->getUserValueBool(), [this]
|
||||
m.addItem ("MPE", true, wtProc.globalParams.mpe->getUserValueBool(), [this]
|
||||
{
|
||||
vaProc.globalParams.mpe->setUserValue (vaProc.globalParams.mpe->getUserValueBool() ? 0.0f : 1.0f);
|
||||
wtProc.globalParams.mpe->setUserValue (wtProc.globalParams.mpe->getUserValueBool() ? 0.0f : 1.0f);
|
||||
});
|
||||
|
||||
auto setSize = [this] (float scale)
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ public:
|
|||
void showAboutInfo() override;
|
||||
|
||||
private:
|
||||
WavetableAudioProcessor& vaProc;
|
||||
WavetableAudioProcessor& wtProc;
|
||||
|
||||
gin::TriggeredScope scope { vaProc.scopeFifo };
|
||||
gin::SynthesiserUsage usage { vaProc };
|
||||
gin::TriggeredScope scope { wtProc.scopeFifo };
|
||||
gin::SynthesiserUsage usage { wtProc };
|
||||
|
||||
Editor editor { vaProc };
|
||||
Editor editor { wtProc };
|
||||
|
||||
#if JUCE_DEBUG
|
||||
std::unique_ptr<melatonin::Inspector> inspector;
|
||||
|
|
|
|||
|
|
@ -615,6 +615,7 @@ void WavetableAudioProcessor::stateUpdated()
|
|||
userTable2.fromBase64Encoding (state.getProperty ("wt2Data").toString());
|
||||
|
||||
reloadWavetables();
|
||||
presetLoaded = true;
|
||||
}
|
||||
|
||||
void WavetableAudioProcessor::updateState()
|
||||
|
|
@ -728,9 +729,9 @@ void WavetableAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, ju
|
|||
return;
|
||||
}
|
||||
|
||||
if (blockMissed)
|
||||
if (blockMissed || presetLoaded)
|
||||
{
|
||||
blockMissed = false;
|
||||
blockMissed = presetLoaded = false;
|
||||
turnOffAllVoices (false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ public:
|
|||
|
||||
juce::AudioPlayHead* playhead = nullptr;
|
||||
bool blockMissed = false;
|
||||
bool presetLoaded = false;
|
||||
|
||||
struct CurTable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ bool WavetableVoice::isVoiceActive()
|
|||
float WavetableVoice::getFilterCutoffNormalized()
|
||||
{
|
||||
float freq = filter.getFrequency();
|
||||
return proc.filterParams.frequency->getUserRange().convertTo0to1 (gin::getMidiNoteFromHertz (freq));
|
||||
return proc.filterParams.frequency->getUserRange().convertTo0to1 (juce::jlimit (0.0f, 1.0f, gin::getMidiNoteFromHertz (freq)));
|
||||
}
|
||||
|
||||
gin::WTOscillator::Params WavetableVoice::getLiveWTParams (int osc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue