mirror of
https://codeberg.org/armin/monoslicer.git
synced 2026-10-11 21:11:53 +02:00
Fix GCC build (Clang-only flag), add note mapping + drag/drop overlay, UI tweaks
This commit is contained in:
parent
fd23c92a5d
commit
ca6f1ff0ee
7 changed files with 97 additions and 7 deletions
|
|
@ -65,8 +65,8 @@ public:
|
|||
|
||||
auto drawBar = [&](float y, float level, float peak, const juce::String& legend)
|
||||
{
|
||||
float frac = juce::jlimit(0.0f, 1.0f, level);
|
||||
float peakFrac = juce::jlimit(0.0f, 1.0f, peak);
|
||||
float frac = juce::jlimit(0.0f, 1.0f, level) * 0.95f;
|
||||
float peakFrac = juce::jlimit(0.0f, 1.0f, peak) * 0.95f;
|
||||
|
||||
// Legend text
|
||||
g.setColour(juce::Colour(0xff888888));
|
||||
|
|
@ -114,12 +114,29 @@ public:
|
|||
void resized() override;
|
||||
|
||||
bool isInterestedInFileDrag(const juce::StringArray& files) override;
|
||||
void fileDragEnter(const juce::StringArray& files, int x, int y) override;
|
||||
void fileDragMove(const juce::StringArray& files, int x, int y) override;
|
||||
void fileDragExit(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:
|
||||
class DropOverlay : public juce::Component
|
||||
{
|
||||
public:
|
||||
void paint(juce::Graphics& g) override
|
||||
{
|
||||
auto b = getLocalBounds().toFloat();
|
||||
g.setColour(juce::Colour(0x66003a8c));
|
||||
g.fillRoundedRectangle(b.reduced(3.0f), 8.0f);
|
||||
g.setColour(juce::Colour(0xcc88ccff));
|
||||
g.drawRoundedRectangle(b.reduced(3.0f), 8.0f, 2.0f);
|
||||
g.setFont(juce::Font(18.0f, juce::Font::bold));
|
||||
g.drawText(TRANS("Drop audio file to load"), b, juce::Justification::centred, true);
|
||||
}
|
||||
};
|
||||
MonoslicerLookAndFeel lnf;
|
||||
MonoslicerProcessor& processorRef;
|
||||
|
||||
|
|
@ -199,6 +216,7 @@ private:
|
|||
const juce::String& paramId, std::unique_ptr<SliderAttachment>& attachment);
|
||||
|
||||
int keyClickNote = -1;
|
||||
DropOverlay dropOverlay;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MonoslicerEditor)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue