mirror of
https://codeberg.org/armin/monoslicer.git
synced 2026-09-01 04:10:45 +02:00
add new screenshot; slight adaptatioins to PluginEditor
This commit is contained in:
parent
93c8c73399
commit
6588549e80
3 changed files with 49 additions and 10 deletions
|
|
@ -57,13 +57,22 @@ MonoslicerEditor::MonoslicerEditor(MonoslicerProcessor& p)
|
||||||
|
|
||||||
addAndMakeVisible(waveformDisplay);
|
addAndMakeVisible(waveformDisplay);
|
||||||
|
|
||||||
// Status bar
|
// Status bar labels
|
||||||
addAndMakeVisible(statusBar);
|
fileInfoLabel.setButtonText("No file loaded");
|
||||||
statusBar.setText("Build: " GIT_VERSION " (" __DATE__ ", " __TIME__ ")",
|
fileInfoLabel.setColour(juce::TextButton::buttonColourId, juce::Colours::transparentBlack);
|
||||||
juce::dontSendNotification);
|
fileInfoLabel.setColour(juce::TextButton::textColourOffId, juce::Colour(0xff666688));
|
||||||
statusBar.setColour(juce::Label::textColourId, juce::Colour(0xff666688));
|
fileInfoLabel.setColour(juce::TextButton::textColourOnId, juce::Colour(0xff88aacc));
|
||||||
statusBar.setFont(juce::Font(juce::FontOptions(11.0f)));
|
fileInfoLabel.setTooltip("Click to show file in Finder");
|
||||||
statusBar.setJustificationType(juce::Justification::centredRight);
|
fileInfoLabel.setMouseClickGrabsKeyboardFocus(false);
|
||||||
|
fileInfoLabel.addListener(this);
|
||||||
|
addAndMakeVisible(fileInfoLabel);
|
||||||
|
|
||||||
|
addAndMakeVisible(buildInfoLabel);
|
||||||
|
buildInfoLabel.setText("Build: " GIT_VERSION " (" __DATE__ ", " __TIME__ ")",
|
||||||
|
juce::dontSendNotification);
|
||||||
|
buildInfoLabel.setColour(juce::Label::textColourId, juce::Colour(0xff666688));
|
||||||
|
buildInfoLabel.setFont(juce::Font(juce::FontOptions(11.0f)));
|
||||||
|
buildInfoLabel.setJustificationType(juce::Justification::centredRight);
|
||||||
|
|
||||||
// Slice knobs
|
// Slice knobs
|
||||||
attachSlider(bassSlider, bassLabel, "Bass", "bass", bassAttachment);
|
attachSlider(bassSlider, bassLabel, "Bass", "bass", bassAttachment);
|
||||||
|
|
@ -209,6 +218,7 @@ MonoslicerEditor::~MonoslicerEditor()
|
||||||
zoomResetButton.removeListener(this);
|
zoomResetButton.removeListener(this);
|
||||||
scrollLeftButton.removeListener(this);
|
scrollLeftButton.removeListener(this);
|
||||||
scrollRightButton.removeListener(this);
|
scrollRightButton.removeListener(this);
|
||||||
|
fileInfoLabel.removeListener(this);
|
||||||
stretchButton.removeListener(this);
|
stretchButton.removeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -254,8 +264,11 @@ void MonoslicerEditor::resized()
|
||||||
|
|
||||||
auto bounds = getLocalBounds();
|
auto bounds = getLocalBounds();
|
||||||
auto titleBar = bounds.removeFromTop(40);
|
auto titleBar = bounds.removeFromTop(40);
|
||||||
auto statusBarArea = bounds.removeFromBottom(18).withTrimmedRight(5);
|
auto statusBarArea = bounds.removeFromBottom(18);
|
||||||
statusBar.setBounds(statusBarArea);
|
fileInfoLabel.setBounds(statusBarArea.getX() + 5, statusBarArea.getY(),
|
||||||
|
statusBarArea.getWidth() / 2 - 5, statusBarArea.getHeight());
|
||||||
|
buildInfoLabel.setBounds(statusBarArea.getCentreX(), statusBarArea.getY(),
|
||||||
|
statusBarArea.getWidth() / 2 - 5, statusBarArea.getHeight());
|
||||||
|
|
||||||
int tx = 120;
|
int tx = 120;
|
||||||
|
|
||||||
|
|
@ -366,6 +379,25 @@ void MonoslicerEditor::timerCallback()
|
||||||
waveformDisplay.setSampleBuffer(&processorRef.getSampleBuffer(), processorRef.getSampleRateLoaded());
|
waveformDisplay.setSampleBuffer(&processorRef.getSampleBuffer(), processorRef.getSampleRateLoaded());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto& file = processorRef.getCurrentFile();
|
||||||
|
if (file != currentLoadedFile)
|
||||||
|
{
|
||||||
|
currentLoadedFile = file;
|
||||||
|
if (file.existsAsFile())
|
||||||
|
{
|
||||||
|
double duration = static_cast<double>(processorRef.getSampleBuffer().getNumSamples())
|
||||||
|
/ processorRef.getSampleRateLoaded();
|
||||||
|
int mins = static_cast<int>(duration) / 60;
|
||||||
|
int secs = static_cast<int>(duration) % 60;
|
||||||
|
fileInfoLabel.setButtonText(file.getFileName() + " "
|
||||||
|
+ juce::String(mins) + ":" + juce::String(secs).paddedLeft('0', 2));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fileInfoLabel.setButtonText("No file loaded");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
waveformDisplay.setPlaybackPosition(processorRef.currentPlaybackSample.load());
|
waveformDisplay.setPlaybackPosition(processorRef.currentPlaybackSample.load());
|
||||||
waveformDisplay.setActiveSliceIndex(processorRef.currentActiveSlice.load());
|
waveformDisplay.setActiveSliceIndex(processorRef.currentActiveSlice.load());
|
||||||
waveformDisplay.setSelectedSlice(processorRef.selectedSlice.load());
|
waveformDisplay.setSelectedSlice(processorRef.selectedSlice.load());
|
||||||
|
|
@ -471,6 +503,11 @@ void MonoslicerEditor::buttonClicked(juce::Button* button)
|
||||||
{
|
{
|
||||||
waveformDisplay.scrollRight();
|
waveformDisplay.scrollRight();
|
||||||
}
|
}
|
||||||
|
else if (button == &fileInfoLabel)
|
||||||
|
{
|
||||||
|
if (currentLoadedFile.existsAsFile())
|
||||||
|
currentLoadedFile.startAsProcess();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MonoslicerEditor::comboBoxChanged(juce::ComboBox* comboBoxThatHasChanged)
|
void MonoslicerEditor::comboBoxChanged(juce::ComboBox* comboBoxThatHasChanged)
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,9 @@ private:
|
||||||
std::unique_ptr<ComboBoxAttachment> filterTypeAttachment;
|
std::unique_ptr<ComboBoxAttachment> filterTypeAttachment;
|
||||||
|
|
||||||
juce::FileChooser fileChooser { "Load Audio File", juce::File{}, "*.wav;*.aiff;*.flac;*.ogg" };
|
juce::FileChooser fileChooser { "Load Audio File", juce::File{}, "*.wav;*.aiff;*.flac;*.ogg" };
|
||||||
juce::Label statusBar;
|
juce::TextButton fileInfoLabel;
|
||||||
|
juce::Label buildInfoLabel;
|
||||||
|
juce::File currentLoadedFile;
|
||||||
|
|
||||||
void setupSlider(juce::Slider& slider, juce::Label& label, const juce::String& name);
|
void setupSlider(juce::Slider& slider, juce::Label& label, const juce::String& name);
|
||||||
void attachSlider(juce::Slider& slider, juce::Label& label, const juce::String& name,
|
void attachSlider(juce::Slider& slider, juce::Label& label, const juce::String& name,
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 423 KiB After Width: | Height: | Size: 270 KiB |
Loading…
Add table
Add a link
Reference in a new issue