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
|
|
@ -216,6 +216,10 @@ MonoslicerEditor::MonoslicerEditor(MonoslicerProcessor& p)
|
|||
processorRef.triggerSlice(sliceIdx, 0.8f);
|
||||
});
|
||||
|
||||
addChildComponent(dropOverlay);
|
||||
dropOverlay.setInterceptsMouseClicks(false, false);
|
||||
dropOverlay.setVisible(false);
|
||||
|
||||
startTimerHz(30);
|
||||
}
|
||||
|
||||
|
|
@ -286,6 +290,7 @@ void MonoslicerEditor::resized()
|
|||
statusBarArea.getWidth() / 2 - 5, statusBarArea.getHeight());
|
||||
buildInfoLabel.setBounds(statusBarArea.getCentreX(), statusBarArea.getY(),
|
||||
statusBarArea.getWidth() / 2 - 5, statusBarArea.getHeight());
|
||||
dropOverlay.setBounds(getLocalBounds());
|
||||
|
||||
int tx = 120;
|
||||
|
||||
|
|
@ -547,17 +552,58 @@ void MonoslicerEditor::comboBoxChanged(juce::ComboBox* comboBoxThatHasChanged)
|
|||
}
|
||||
}
|
||||
|
||||
// [EDITOR DIAG] temporary
|
||||
static void ediag(const char* what, const juce::StringArray& files, int accept)
|
||||
{
|
||||
FILE* f = fopen("/tmp/monoslicer_drag.log", "a");
|
||||
if (f == nullptr) return;
|
||||
fprintf(f, "[editor] %s accept=%d files=%d", what, accept, (int)files.size());
|
||||
for (const auto& x : files) fprintf(f, " \"%s\"", x.toUTF8().getAddress());
|
||||
fprintf(f, "\n");
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
bool MonoslicerEditor::isInterestedInFileDrag(const juce::StringArray& files)
|
||||
{
|
||||
for (const auto& f : files)
|
||||
if (f.endsWithIgnoreCase(".wav") || f.endsWithIgnoreCase(".aiff") ||
|
||||
f.endsWithIgnoreCase(".flac") || f.endsWithIgnoreCase(".ogg"))
|
||||
{
|
||||
ediag("isInterested", files, 1);
|
||||
return true;
|
||||
}
|
||||
ediag("isInterested", files, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
void MonoslicerEditor::fileDragEnter(const juce::StringArray& files, int, int)
|
||||
{
|
||||
ediag("enter", files, isInterestedInFileDrag(files) ? 1 : 0);
|
||||
if (isInterestedInFileDrag(files))
|
||||
{
|
||||
dropOverlay.setVisible(true);
|
||||
dropOverlay.toFront(false);
|
||||
dropOverlay.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
void MonoslicerEditor::fileDragMove(const juce::StringArray& files, int, int)
|
||||
{
|
||||
if (isInterestedInFileDrag(files))
|
||||
dropOverlay.setVisible(true);
|
||||
}
|
||||
|
||||
void MonoslicerEditor::fileDragExit(const juce::StringArray&)
|
||||
{
|
||||
ediag("exit", juce::StringArray(), 0);
|
||||
dropOverlay.setVisible(false);
|
||||
}
|
||||
|
||||
void MonoslicerEditor::filesDropped(const juce::StringArray& files, int, int)
|
||||
{
|
||||
ediag("drop", files, 1);
|
||||
dropOverlay.setVisible(false);
|
||||
|
||||
for (const auto& f : files)
|
||||
{
|
||||
juce::File file(f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue