mirror of
https://codeberg.org/armin/monoslicer.git
synced 2026-09-01 04:10:45 +02:00
Initial commit
This commit is contained in:
commit
638cd05ea8
14 changed files with 2783 additions and 0 deletions
96
Source/PluginEditor.h
Normal file
96
Source/PluginEditor.h
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
#pragma once
|
||||
#include <juce_audio_processors/juce_audio_processors.h>
|
||||
#include "PluginProcessor.h"
|
||||
#include "WaveformDisplay.h"
|
||||
|
||||
class MonoSlicerEditor : public juce::AudioProcessorEditor,
|
||||
private juce::FileDragAndDropTarget,
|
||||
private juce::Button::Listener,
|
||||
private juce::ComboBox::Listener,
|
||||
private juce::Timer
|
||||
{
|
||||
public:
|
||||
MonoSlicerEditor(MonoSlicerProcessor&);
|
||||
~MonoSlicerEditor() override;
|
||||
|
||||
void paint(juce::Graphics&) override;
|
||||
void resized() override;
|
||||
|
||||
bool isInterestedInFileDrag(const juce::StringArray& files) override;
|
||||
void filesDropped(const juce::StringArray& files, int x, int y) override;
|
||||
void buttonClicked(juce::Button* button) override;
|
||||
void comboBoxChanged(juce::ComboBox* comboBoxThatHasChanged) override;
|
||||
void timerCallback() override;
|
||||
|
||||
private:
|
||||
MonoSlicerProcessor& processorRef;
|
||||
|
||||
WaveformDisplay waveformDisplay;
|
||||
|
||||
// Bottom panel buttons
|
||||
juce::TextButton autoSliceButton { "Auto Slice" };
|
||||
juce::TextButton clearSlicesButton { "Clear Slices" };
|
||||
|
||||
// Title bar buttons
|
||||
juce::TextButton loadSampleButton { "Load" };
|
||||
juce::TextButton prevSampleButton { "<" };
|
||||
juce::TextButton nextSampleButton { ">" };
|
||||
juce::TextButton undoButton { "Undo" };
|
||||
juce::TextButton redoButton { "Redo" };
|
||||
juce::TextButton zoomInButton { "+" };
|
||||
juce::TextButton zoomOutButton { "-" };
|
||||
juce::TextButton zoomResetButton { "1:1" };
|
||||
juce::ComboBox scaleComboBox;
|
||||
|
||||
static constexpr int baseWidth = 1100;
|
||||
static constexpr int baseHeight = 550;
|
||||
|
||||
// Slice knobs
|
||||
juce::Slider bassSlider, trebleSlider, sensitivitySlider;
|
||||
juce::Label bassLabel, trebleLabel, sensitivityLabel;
|
||||
|
||||
// Amp ADSR knobs
|
||||
juce::Slider ampAttackSlider, ampDecaySlider, ampSustainSlider, ampReleaseSlider;
|
||||
juce::Label ampAttackLabel, ampDecayLabel, ampSustainLabel, ampReleaseLabel;
|
||||
|
||||
// Filter type selector
|
||||
juce::ComboBox filterTypeComboBox;
|
||||
|
||||
// Filter knobs
|
||||
juce::Slider filterCutoffSlider, filterResoSlider, filterEnvDepthSlider;
|
||||
juce::Label filterCutoffLabel, filterResoLabel, filterEnvDepthLabel;
|
||||
|
||||
using SliderAttachment = juce::AudioProcessorValueTreeState::SliderAttachment;
|
||||
using ComboBoxAttachment = juce::AudioProcessorValueTreeState::ComboBoxAttachment;
|
||||
|
||||
// Filter ADSR knobs
|
||||
juce::Slider filterAttackSlider, filterDecaySlider, filterSustainSlider, filterReleaseSlider;
|
||||
juce::Label filterAttackLabel, filterDecayLabel, filterSustainLabel, filterReleaseLabel;
|
||||
|
||||
// Time-stretch controls
|
||||
juce::Slider bpmSlider;
|
||||
juce::ComboBox stretchBeatsComboBox;
|
||||
juce::TextButton stretchButton { "Stretch" };
|
||||
juce::ComboBox keyShiftComboBox;
|
||||
juce::Label keyShiftLabel;
|
||||
std::unique_ptr<SliderAttachment> stretchBpmAttachment;
|
||||
std::unique_ptr<ComboBoxAttachment> stretchBeatsAttachment;
|
||||
std::unique_ptr<ComboBoxAttachment> keyShiftAttachment;
|
||||
std::unique_ptr<ComboBoxAttachment> scaleAttachment;
|
||||
|
||||
std::unique_ptr<SliderAttachment> bassAttachment, trebleAttachment, sensitivityAttachment;
|
||||
std::unique_ptr<SliderAttachment> ampAttackAttachment, ampDecayAttachment, ampSustainAttachment, ampReleaseAttachment;
|
||||
std::unique_ptr<SliderAttachment> filterCutoffAttachment, filterResoAttachment, filterEnvDepthAttachment;
|
||||
std::unique_ptr<SliderAttachment> filterAttackAttachment, filterDecayAttachment, filterSustainAttachment, filterReleaseAttachment;
|
||||
std::unique_ptr<ComboBoxAttachment> filterTypeAttachment;
|
||||
|
||||
juce::FileChooser fileChooser { "Load Audio File", juce::File{}, "*.wav;*.aiff;*.flac;*.ogg" };
|
||||
|
||||
void setupSlider(juce::Slider& slider, juce::Label& label, const juce::String& name);
|
||||
void attachSlider(juce::Slider& slider, juce::Label& label, const juce::String& name,
|
||||
const juce::String& paramId, std::unique_ptr<SliderAttachment>& attachment);
|
||||
|
||||
int keyClickNote = -1;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MonoSlicerEditor)
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue