Drag and drop sources and destinations?

Hi all, trying to plan the UI / UX for my plugin based on what’s possible in JUCE. so asking here about what’s possible.

my plugin will take an audio file (.wav or .mp3) as input, process it, and let the user put it back into their DAW. I’d love if these interactions could all happen over “drag and drop”, but if only some subset can, I’ll need to figure out other widgets (file selector, etc).

which of these are easily doable for a VST built with JUCE?

  1. drag audio file from DAW → VST
  2. drag audio file from OS file explorer → VST
  3. drag a processed audio file from VST → DAW
  4. drag a processed audio from from VST → OS file explorer

Ideally (1) and (3) are possible, as that’s the least friction for my users.

(Targeting primarily Ableton, but would like it to work on FL, Logic, ProTools as well.)

Bonus points for any example plugin github repos or tutorials I can look in for the respective routes above that are possible <3

Thanks so much!!

Update, I see that dragging from the file browser in a DAW is possible here:

So (1) is not only possible, but pretty easy.

It would seem likely that (2) is possible, but haven’t tried it yet.

Still no evidence for (3) or (4) yet. Will keep searching.

What you need for 3 and 4 is DragAndDropContainer::performExternalDragDropOfFiles()

I used it like this: when the user initiates the “drag file outside” gesture, I create the file in a temporary place on disk, then pass it to performExternalDragDropOfFiles() to put that file “on the mouse cursor” for the user to drop it where it wants.
I believe that should cover your needs both for 3 and 4.

1 Like

that worked! thank you

1 Like