Drag and drop tracks

Does JUCE support any ability to do what’s happening in this Reaktor VST. Access to full tracks, but with a drag and drop capability, as opposed to file loading.

If this is not possible, let’s make it a feature request, and get that stuff in there! Let’s JUCE it up!

JUCE does support drag and drop stuff (also to external applications). Everything should be in here: JUCE: DragAndDropContainer Class Reference

I’d suggest trying that and check if there is anything coming in. I’d suspect Reaktor to create a tmp audio file and then drag and drop that to a plugin (or into the file manager of the OS). In that case, the drag and drop container should receive that information via the external stuff I mentioned.

1 Like

Excellent! I suppose I should of RTFDs :wink: I’ll let you know if my use case presents any more blockers.

You can definitively do it, have a look on github there’ll be several projects that do that, a particularly interesting one is this one:

Yeah I got it, thanks. I needed to understand more how DAWs actually store files and flattened track, etc. And FilesDragAndDropTarget was the key.

Could you share a few key details on this topic? Was I correct about the temp file?

Sure. In order to gain access to the OSes drag and drop, and therefor “external” sources of drag and drop, you need to inherit from FilesDragAndDropTarget, and use the

void filesDropped(const juce::StringArray& files, int x, int y);

method to snag the file names from files StringArray.

The main concepts have more to do with how the DAW turns tracks into files. All of them will provide a slightly different interface or name but it’s all the same idea. The DAWs provide some method to turn raw tracks into “flattened”, “frozen”, or “consolidated” forms, which simply means the DAW has converted it into some usable file format and saved it off onto disk. It seems any file that’s on disk, will come through filesDropped with a filename. If you attempt to drag effects or samples with weird file formats, the filepath doesn’t seem to appear in files, although I haven’t experimented with that as far.

All the OS or DAW is really doing is giving filenames of the items it’s dropping. From there you must manage loading the files yourself.

Here’s a good explanation for Ableton:

1 Like