Help - Search - Members - Calendar
Full Version: Drag & Drop --> detecting dropped folder name etc.
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
mixcherry
There's an example of implementing Drag&Drop in foosion's tutorial (part 4). How should I modify it so that I could detect that *folder* was dropped, and do something with it (for example, create new playlist with the same name as dropped folder)? Or maybe the only way is to compare all dropped items' parent directories (and if they are equal, set the 'folder' to their name)? Anyway, is there any simple way to achieve this? I even don't know how I could do something with dropped items...

I also wonder, what is checking 'if some track is playing' for? Do I have to check this when I only need the Drop Place? (I mean, there will be only option to drop some files into my window, no option to drag anything from it)
foosion
QUOTE(mixcherry @ May 19 2006, 10:23) *
There's an example of implementing Drag&Drop in foosion's tutorial (part 4). How should I modify it so that I could detect that *folder* was dropped, and do something with it (for example, create new playlist with the same name as dropped folder)? Or maybe the only way is to compare all dropped items' parent directories (and if they are equal, set the 'folder' to their name)? Anyway, is there any simple way to achieve this? I even don't know how I could do something with dropped items...
Well, that's one way to do it. Alternatively, you could parse the contents of the data object yourself to determine where to put the contained items, and then let the core resolve them to metadb handles. If you want to take this (quite likely more complex) approach, here are some useful links:
QUOTE(mixcherry @ May 19 2006, 10:23) *
I also wonder, what is checking 'if some track is playing' for? Do I have to check this when I only need the Drop Place? (I mean, there will be only option to drop some files into my window, no option to drag anything from it)
This is for the drag source part of the tutorial window. Since it displays data about the currently playing track, there is nothing you could drag off it, if playback is stopped.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.