We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Drag and Drop File Import
Page Index Toggle Pages: 1
Drag and Drop File Import (Read 715 times)
Drag and Drop File Import
Apr 5th, 2008, 9:22am
 
Hi all,

I'm working on creating an application that can do some analysis and play audio files.  To do that, I need to import the audio files from within the GUI.  I'm open to the idea of using a file browser to import the object (which I don't know how to implement), but I'd rather be able to drag and drop the audio file onto the processing application and have it load.  I have no idea how to do that either.  

I'm not an experienced programmer, but I've been experimenting with processing for the past couple months and feel like there's enough out there for me to put together what I'm trying to do and have it work on multiple platforms.  

Any help would be appreciated.  Thanks much.
Re: Drag and Drop File Import
Reply #1 - Apr 5th, 2008, 11:55am
 
for drag and drop events you can try sDrop. the examples DropBasics or DropOnTarget can guide you into a direction how to handle drop events. for now it has only been tested for osx, but should be fine for windows and linux as well.
dragging sound files onto your sketch only gives you the path to the sound file, you would then need to load the sample with the sound implementation you are using in your program.
hope this helps. best,
andi
Re: Drag and Drop File Import
Reply #2 - Apr 6th, 2008, 12:14am
 
Thanks a lot.  I didn't realize you had a drag and drop library.  I use the oscP5 library and the controlP5 library all the time.  Really wonderful stuff.  Thanks for your help.
Re: Drag and Drop File Import
Reply #3 - Apr 24th, 2008, 8:50pm
 
This is amazing!
Page Index Toggle Pages: 1