forked from mtytel/helm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
145 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* Copyright 2013-2017 Matt Tytel | ||
* | ||
* helm is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* helm is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with helm. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "distortion_section.h" | ||
|
||
#include "colors.h" | ||
#include "fonts.h" | ||
#include "synth_button.h" | ||
|
||
#define KNOB_WIDTH 40 | ||
|
||
DistortionSection::DistortionSection(String name) : SynthSection(name) { | ||
|
||
addSlider(type_ = new SynthSlider("distortion_type")); | ||
type_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag); | ||
|
||
addSlider(drive_ = new SynthSlider("distortion_drive")); | ||
drive_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag); | ||
|
||
addSlider(mix_ = new SynthSlider("distortion_mix")); | ||
mix_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag); | ||
} | ||
|
||
DistortionSection::~DistortionSection() { | ||
type_ = nullptr; | ||
drive_ = nullptr; | ||
mix_ = nullptr; | ||
} | ||
|
||
void DistortionSection::paintBackground(Graphics& g) { | ||
SynthSection::paintBackground(g); | ||
|
||
g.setColour(Colors::controlLabelText); | ||
g.setFont(Fonts::instance()->proportional_regular().withPointHeight(10.0f)); | ||
|
||
drawTextForComponent(g, TRANS("TYPE"), type_); | ||
drawTextForComponent(g, TRANS("DRIVE"), drive_); | ||
drawTextForComponent(g, TRANS("MIX"), mix_); | ||
} | ||
|
||
void DistortionSection::resized() { | ||
float space = (getWidth() - (3.0f * KNOB_WIDTH)) / 4.0f; | ||
int y = 36; | ||
|
||
type_->setBounds(space, y, KNOB_WIDTH, KNOB_WIDTH); | ||
drive_->setBounds((KNOB_WIDTH + space) + space, y, KNOB_WIDTH, KNOB_WIDTH); | ||
mix_->setBounds(2 * (KNOB_WIDTH + space) + space, y, KNOB_WIDTH, KNOB_WIDTH); | ||
|
||
SynthSection::resized(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* Copyright 2013-2017 Matt Tytel | ||
* | ||
* helm is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* helm is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with helm. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
#ifndef DISTORTION_SECTION_H | ||
#define DISTORTION_SECTION_H | ||
|
||
#include "JuceHeader.h" | ||
#include "synth_section.h" | ||
#include "synth_slider.h" | ||
|
||
class DistortionSection : public SynthSection { | ||
public: | ||
DistortionSection(String name); | ||
~DistortionSection(); | ||
|
||
void paintBackground(Graphics& g) override; | ||
void resized() override; | ||
|
||
private: | ||
ScopedPointer<SynthSlider> type_; | ||
ScopedPointer<SynthSlider> drive_; | ||
ScopedPointer<SynthSlider> mix_; | ||
|
||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistortionSection) | ||
}; | ||
|
||
#endif // DISTORTION_SECTION_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters