Oscilloscope 0.5.0
A simple oscilloscope VST
Loading...
Searching...
No Matches
ControlSection.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 ControlSection.h
5 Created: 8 Mar 2023 11:57:32am
6 Author: wadda
7
8 ==============================================================================
9*/
10
11#pragma once
12
13#include <JuceHeader.h>
14#include "ColorPalette.h"
15#include "InitVariables.h"
16#include "BasicControls.h"
17#include "ProControls.h"
18
19//==============================================================================
23class ControlSection : public juce::Component
24{
25public:
31
36 ~ControlSection() override;
37
44 void setAttachment(juce::String attachmentName, juce::AudioProcessorValueTreeState &processorTreeState);
45
52 void setMultipleAttachments(std::vector<juce::String> attachmentNames, juce::AudioProcessorValueTreeState &processorTreeState);
53
61
66 void resetButtonText();
67
68 void paint(juce::Graphics &) override;
69 void resized() override;
70
71private:
75 enum Attachments
76 {
77 BufferLength,
78 DrawGrid,
79 IsProfessional,
80 IsTriggered,
81 TriggerLevel,
82 SlopeButtonTriggered,
83 IsAutoTriggered,
84 DecayTime,
85 MuteOutput,
86 Default
87 };
88
92 const std::map<juce::String, ControlSection::Attachments> attachmentsMap{
93 {"drawGrid", ControlSection::Attachments::DrawGrid},
94 {"bufferLength", ControlSection::Attachments::BufferLength},
95 {"isProfessional", ControlSection::Attachments::IsProfessional},
96 {"isTriggered", ControlSection::Attachments::IsTriggered},
97 {"triggerLevel", ControlSection::Attachments::TriggerLevel},
98 {"slopeButtonTriggered", ControlSection::Attachments::SlopeButtonTriggered},
99 {"autoTriggered", ControlSection::Attachments::IsAutoTriggered},
100 {"decayTime", ControlSection::Attachments::DecayTime},
101 {"muteOutput", ControlSection::Attachments::MuteOutput},
102
103 };
104
111 Attachments resolveAttachment(juce::String attachmentName);
112
117 BasicControls basicControls;
118
123 ProControls proControls;
124
129 juce::Rectangle<int> toggleOscilloscopeArea;
130
131 // GUI expander elements
132 juce::ToggleButton toggleOscilloscope;
133 juce::Label toggleText;
134 std::unique_ptr<juce::AudioProcessorValueTreeState::ButtonAttachment> isProfessionalAttachment;
135
140 int numHorizontalSections;
141 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ControlSection)
142};
void resized() override
~ControlSection() override
void paint(juce::Graphics &) override
void resetNumHorizontalSections()
void setAttachment(juce::String attachmentName, juce::AudioProcessorValueTreeState &processorTreeState)
void setMultipleAttachments(std::vector< juce::String > attachmentNames, juce::AudioProcessorValueTreeState &processorTreeState)