1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
class MayAppAudioProcessorEditor : public juce::AudioProcessorEditor,
public juce::Slider::Listener, public juce::Button::Listener, public juce::ComboBox::Listener, private juce::Timer
{
public:
MyAppAudioProcessorEditor (MyAppAudioProcessor&);
~MyAppAudioProcessorEditor() override;
void paint (juce::Graphics&) override;
void resized() override;
void sliderValueChanged(juce::Slider *slider) override;
void buttonClicked(juce::Button *button) override;
void comboBoxChanged(juce::ComboBox *comboBox) override;
private:
MyAppAudioProcessor& audioProcessor;
ModernDial kitDial, trackDial, velocityDial, minvelocityDial, afterTouchDial, voiceDial, voiceStartDial, midiChannelSelectDial;
juce::Label kitLabel, trackLabel, noteOnButtonLabel, velocityLabel, minvelocityLabel, afterTouchLabel, voiceDialLabel, voiceStartDialLabel, midiChannelSelectDialLabel;
juce::ToggleButton noteOnButton;
juce::ComboBox modeMenu, chordMenu, scaleMenu, rootNoteMenu, scaleModeMenu;
struct Rect_Sequencer : public juce::Component
{
Rect_Sequencer() {setPaintingIsUnclipped(true);}
std::vector<std::unique_ptr<juce::ToggleButton>> channelActiveToggles;
void paint (juce::Graphics& g) override
{
g.setColour(juce::Colours::black);
g.fillRect(getLocalBounds());
}
};
Rect_Sequencer rect_Sequencer;
juce::TooltipWindow tooltipWindow;
CustomLookAndFeel customLookAndFeel;
void timerCallback() override
{
if (! isUnlocked && marketplaceStatus.isUnlocked())
{
isUnlocked = true;
unlockApp();
}
}
void showForm()
{
unlockForm.setVisible (true);
}
void unlockApp()
{
secretButton.setEnabled (true);
unlockButton.setEnabled (false);
unlockLabel.setText ("Status: Unlocked", juce::dontSendNotification);
unlockLabel.setColour (juce::Label::textColourId, juce::Colours::green);
}
void checkFeature()
{
if (marketplaceStatus.isUnlocked())
DBG ("App unlocked!");
else
DBG ("Beware of hackers!");
}
juce::Label unlockLabel { {}, "Status: Locked" };
juce::TextButton unlockButton { "Unlock" },
secretButton { "Super Secret Feature" };
TutorialMarketplaceStatus marketplaceStatus;
TutorialUnlockForm unlockForm;
bool isUnlocked = false;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MyAppAudioProcessorEditor)
};
|