mirror of
https://codeberg.org/armin/monoslicer.git
synced 2026-09-01 04:10:45 +02:00
rename MonoSlicer to Monoslicer (lower-case s)
This commit is contained in:
parent
ac6f17d9ae
commit
9b7c973622
8 changed files with 78 additions and 58 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#include "PluginEditor.h"
|
||||
|
||||
MonoSlicerEditor::MonoSlicerEditor(MonoSlicerProcessor& p)
|
||||
MonoslicerEditor::MonoslicerEditor(MonoslicerProcessor& p)
|
||||
: AudioProcessorEditor(p),
|
||||
processorRef(p),
|
||||
waveformDisplay(p.getSliceManager())
|
||||
|
|
@ -16,6 +16,7 @@ MonoSlicerEditor::MonoSlicerEditor(MonoSlicerProcessor& p)
|
|||
};
|
||||
|
||||
setupTitleBtn(loadSampleButton, "Load audio file");
|
||||
setupTitleBtn(clearSampleButton, "Clear loaded sample");
|
||||
setupTitleBtn(prevSampleButton, "Previous sample in folder");
|
||||
setupTitleBtn(nextSampleButton, "Next sample in folder");
|
||||
setupTitleBtn(undoButton, "Undo");
|
||||
|
|
@ -182,12 +183,13 @@ MonoSlicerEditor::MonoSlicerEditor(MonoSlicerProcessor& p)
|
|||
startTimerHz(30);
|
||||
}
|
||||
|
||||
MonoSlicerEditor::~MonoSlicerEditor()
|
||||
MonoslicerEditor::~MonoslicerEditor()
|
||||
{
|
||||
autoSliceButton.removeListener(this);
|
||||
clearSlicesButton.removeListener(this);
|
||||
scaleComboBox.removeListener(this);
|
||||
loadSampleButton.removeListener(this);
|
||||
clearSampleButton.removeListener(this);
|
||||
prevSampleButton.removeListener(this);
|
||||
nextSampleButton.removeListener(this);
|
||||
undoButton.removeListener(this);
|
||||
|
|
@ -198,7 +200,7 @@ MonoSlicerEditor::~MonoSlicerEditor()
|
|||
stretchButton.removeListener(this);
|
||||
}
|
||||
|
||||
void MonoSlicerEditor::setupSlider(juce::Slider& slider, juce::Label& label, const juce::String& name)
|
||||
void MonoslicerEditor::setupSlider(juce::Slider& slider, juce::Label& label, const juce::String& name)
|
||||
{
|
||||
addAndMakeVisible(slider);
|
||||
addAndMakeVisible(label);
|
||||
|
|
@ -208,14 +210,14 @@ void MonoSlicerEditor::setupSlider(juce::Slider& slider, juce::Label& label, con
|
|||
label.setFont(juce::Font(juce::FontOptions(13.0f)));
|
||||
}
|
||||
|
||||
void MonoSlicerEditor::attachSlider(juce::Slider& slider, juce::Label& label, const juce::String& name,
|
||||
void MonoslicerEditor::attachSlider(juce::Slider& slider, juce::Label& label, const juce::String& name,
|
||||
const juce::String& paramId, std::unique_ptr<SliderAttachment>& attachment)
|
||||
{
|
||||
setupSlider(slider, label, name);
|
||||
attachment = std::make_unique<SliderAttachment>(processorRef.getAPVTS(), paramId, slider);
|
||||
}
|
||||
|
||||
void MonoSlicerEditor::paint(juce::Graphics& g)
|
||||
void MonoslicerEditor::paint(juce::Graphics& g)
|
||||
{
|
||||
g.fillAll(juce::Colour(0xff0f0f1a));
|
||||
|
||||
|
|
@ -232,7 +234,7 @@ void MonoSlicerEditor::paint(juce::Graphics& g)
|
|||
g.drawHorizontalLine(40, 0.0f, static_cast<float>(getWidth()));
|
||||
}
|
||||
|
||||
void MonoSlicerEditor::resized()
|
||||
void MonoslicerEditor::resized()
|
||||
{
|
||||
float scaleX = static_cast<float>(getWidth()) / static_cast<float>(baseWidth);
|
||||
float scaleY = static_cast<float>(getHeight()) / static_cast<float>(baseHeight);
|
||||
|
|
@ -249,6 +251,7 @@ void MonoSlicerEditor::resized()
|
|||
};
|
||||
|
||||
placeBtn(loadSampleButton, 44);
|
||||
placeBtn(clearSampleButton, 44);
|
||||
placeBtn(prevSampleButton, 24);
|
||||
placeBtn(nextSampleButton, 24);
|
||||
|
||||
|
|
@ -339,7 +342,7 @@ void MonoSlicerEditor::resized()
|
|||
waveformDisplay.setBounds(mainArea);
|
||||
}
|
||||
|
||||
void MonoSlicerEditor::timerCallback()
|
||||
void MonoslicerEditor::timerCallback()
|
||||
{
|
||||
if (processorRef.stateRestored.exchange(false))
|
||||
{
|
||||
|
|
@ -362,7 +365,7 @@ void MonoSlicerEditor::timerCallback()
|
|||
}
|
||||
}
|
||||
|
||||
void MonoSlicerEditor::buttonClicked(juce::Button* button)
|
||||
void MonoslicerEditor::buttonClicked(juce::Button* button)
|
||||
{
|
||||
if (button == &loadSampleButton)
|
||||
{
|
||||
|
|
@ -378,6 +381,11 @@ void MonoSlicerEditor::buttonClicked(juce::Button* button)
|
|||
}
|
||||
});
|
||||
}
|
||||
else if (button == &clearSampleButton)
|
||||
{
|
||||
processorRef.clearSample();
|
||||
waveformDisplay.setSampleBuffer(&processorRef.getSampleBuffer(), processorRef.getSampleRateLoaded());
|
||||
}
|
||||
else if (button == &prevSampleButton)
|
||||
{
|
||||
processorRef.loadPreviousSample();
|
||||
|
|
@ -440,7 +448,7 @@ void MonoSlicerEditor::buttonClicked(juce::Button* button)
|
|||
}
|
||||
}
|
||||
|
||||
void MonoSlicerEditor::comboBoxChanged(juce::ComboBox* comboBoxThatHasChanged)
|
||||
void MonoslicerEditor::comboBoxChanged(juce::ComboBox* comboBoxThatHasChanged)
|
||||
{
|
||||
if (comboBoxThatHasChanged == &scaleComboBox)
|
||||
{
|
||||
|
|
@ -454,7 +462,7 @@ void MonoSlicerEditor::comboBoxChanged(juce::ComboBox* comboBoxThatHasChanged)
|
|||
}
|
||||
}
|
||||
|
||||
bool MonoSlicerEditor::isInterestedInFileDrag(const juce::StringArray& files)
|
||||
bool MonoslicerEditor::isInterestedInFileDrag(const juce::StringArray& files)
|
||||
{
|
||||
for (const auto& f : files)
|
||||
if (f.endsWithIgnoreCase(".wav") || f.endsWithIgnoreCase(".aiff") ||
|
||||
|
|
@ -463,7 +471,7 @@ bool MonoSlicerEditor::isInterestedInFileDrag(const juce::StringArray& files)
|
|||
return false;
|
||||
}
|
||||
|
||||
void MonoSlicerEditor::filesDropped(const juce::StringArray& files, int, int)
|
||||
void MonoslicerEditor::filesDropped(const juce::StringArray& files, int, int)
|
||||
{
|
||||
for (const auto& f : files)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue