Oscilloscope 0.5.0
A simple oscilloscope VST
Loading...
Searching...
No Matches
BasicControls.cpp
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 BasicControls.cpp
5 Created: 16 Mar 2023 11:52:22am
6 Author: covariant
7
8 ==============================================================================
9*/
10
11#include <JuceHeader.h>
12#include "BasicControls.h"
13
14//==============================================================================
16{
17 // add and make visible elements
18 addAndMakeVisible(drawGrid);
19 addAndMakeVisible(bufferLength);
20 addAndMakeVisible(muteOutput);
21
22 // set texts
23 drawGrid.setButtonText("Grid");
24 muteOutput.setButtonText("Mute");
25
26 // set styles
27 bufferLength.setSliderStyle(juce::Slider::SliderStyle::LinearHorizontal);
28 bufferLength.setTextBoxStyle(juce::Slider::NoTextBox, true, 0, 0);
29}
30
32{
33}
34
35void BasicControls::paint(juce::Graphics &g)
36{
37}
38
40{
46 drawGrid.setSize(getWidth() / 5., getHeight() * 3. / 4.);
47 drawGrid.setTopLeftPosition(10, getHeight() / 8.);
48
49 muteOutput.setSize(getWidth() / 5., getHeight() * 3. / 4.);
50 muteOutput.setTopLeftPosition(10 + getWidth() / 5, getHeight() / 8.);
51
52 bufferLength.setSize(getWidth() * 2 / 5, getHeight() * 3. / 4.);
53 bufferLength.setTopLeftPosition(getWidth() * 11. / 20., getHeight() / 8.);
54}
void resized() override
void paint(juce::Graphics &) override
juce::ToggleButton drawGrid
Definition: BasicControls.h:40
~BasicControls() override
juce::ToggleButton muteOutput
Definition: BasicControls.h:46
juce::Slider bufferLength
Definition: BasicControls.h:52