MCPcopy Create free account
hub / github.com/StrangeLoopsAudio/gRainbow / GRainbowAudioProcessorEditor

Method GRainbowAudioProcessorEditor

Source/PluginEditor.cpp:30–172  ·  view source on GitHub ↗

==============================================================================

Source from the content-addressed store, hash-verified

28
29//==============================================================================
30GRainbowAudioProcessorEditor::GRainbowAudioProcessorEditor(GranularSynth& synth)
31: AudioProcessorEditor(&synth),
32mSynth(synth),
33mParameters(synth.getParams()),
34mArcSpec(synth.getParams()),
35mTrimSelection(synth.getFormatManager(), synth.getParamUI()),
36mProgressBar(PROGRESS_VALUE),
37mTabsGrains(juce::TabbedButtonBar::Orientation::TabsAtTop),
38mTabsLFOs(juce::TabbedButtonBar::Orientation::TabsAtTop),
39mTabsEnvs(juce::TabbedButtonBar::Orientation::TabsAtTop),
40mEnvAdsr(synth.getParams()),
41mEnvGrain(synth.getParams()),
42mAdjustPanel(synth.getParams()),
43mModEnv1(0, synth.getParams()),
44mModEnv2(1, synth.getParams()),
45mModLFO1(0, synth.getParams()),
46mModLFO2(1, synth.getParams()),
47mModLFO3(2, synth.getParams()),
48mMasterPanel(synth.getParams(), synth.getMeterSource()),
49mPianoPanel(synth.getKeyboardState(), synth.getParams()) {
50 setLookAndFeel(&mRainbowLookAndFeel);
51 mRainbowLookAndFeel.setColour(juce::ComboBox::ColourIds::backgroundColourId, Utils::Colour::GLOBAL);
52 mRainbowLookAndFeel.setColour(juce::PopupMenu::ColourIds::backgroundColourId, Utils::Colour::GLOBAL);
53 juce::LookAndFeel::getDefaultLookAndFeel().setDefaultSansSerifTypeface(RainbowLookAndFeel::getCustomTypeface());
54
55 mErrorMessage.clear();
56
57 // Title and preset panel
58 mTitlePresetPanel.btnOpenFile.onClick = [this] { openNewFile(); };
59 mTitlePresetPanel.btnSavePreset.onClick = [this] { savePreset(); };
60 addAndMakeVisible(mTitlePresetPanel);
61
62 if (!mParameters.ui.fileName.isEmpty()) {
63 mTitlePresetPanel.labelFileName.setText(mParameters.ui.fileName, juce::dontSendNotification);
64 }
65
66 // Envelope/adjust tabs
67 juce::Image tabImage = juce::PNGImageFormat::loadFrom(BinaryData::grainEnv_png, BinaryData::grainEnv_pngSize);
68 auto* tabImageComp = new juce::ImageComponent();
69 tabImageComp->setInterceptsMouseClicks(false, false);
70 tabImageComp->setImage(tabImage, juce::RectanglePlacement::onlyReduceInSize);
71 mTabsGrains.addTab("grain env", Utils::Colour::BACKGROUND, &mEnvGrain, false);
72 mTabsGrains.getTabbedButtonBar().getTabButton(0)->setExtraComponent(tabImageComp, juce::TabBarButton::ExtraComponentPlacement::beforeText);
73
74 tabImage = juce::PNGImageFormat::loadFrom(BinaryData::adjust_png, BinaryData::adjust_pngSize);
75 tabImageComp = new juce::ImageComponent();
76 tabImageComp->setInterceptsMouseClicks(false, false);
77 tabImageComp->setImage(tabImage, juce::RectanglePlacement::onlyReduceInSize);
78 mTabsGrains.addTab("adjust", Utils::Colour::BACKGROUND, &mAdjustPanel, false);
79 mTabsGrains.getTabbedButtonBar().getTabButton(1)->setExtraComponent(tabImageComp, juce::TabBarButton::ExtraComponentPlacement::beforeText);
80 mTabsGrains.getTabbedButtonBar().setColour(juce::TabbedButtonBar::ColourIds::tabTextColourId, Utils::Colour::GLOBAL);
81 mTabsGrains.getTabbedButtonBar().setColour(juce::TabbedButtonBar::ColourIds::frontTextColourId, Utils::Colour::GLOBAL);
82 mTabsGrains.setTabBarDepth(Utils::TAB_HEIGHT);
83 mTabsGrains.setOutline(0);
84 addAndMakeVisible(mTabsGrains);
85
86 // Mod LFO tabs
87 mTabsLFOs.setTabBarDepth(Utils::TAB_HEIGHT);

Callers

nothing calls this directly

Calls 9

trimAndExtractPitchesMethod · 0.80
loadWaveformBufferMethod · 0.80
startReferenceToneMethod · 0.80
getSelectedPitchClassMethod · 0.80
stopReferenceToneMethod · 0.80
getHeightMethod · 0.80
loadMethod · 0.80
clearMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected