File Selection without freezing

Hi there everyone, I know a lot of people around here ask about how to avoid having VVVV freeze when a file open dialog box is open. Well over the weekend I decided to finally do something to address the issue.

I made a little program seperate from VVVV that listens for and replies to requests for filenames over OSC. Then I made a little VVVV module that interfaces with it and launches it automagically when you create the first instance of it.

So if you download Selektor from e-mu.org and unzip it into the modules directory you can create selektor (file) instances and attach the output to nodes that need a filename.

Enjoy file browsing without freezing!

Note that this was a quick and dirty hack so I wouldn’t be surprised if there is a bug or two, if you find one please tell me and I’ll try to fix it.
[http://e-mu.org|
http://e-mu.org]

wow, this is great, thanks! but anyway, its a shame that finally a user has to take care by himselve about this…

Application cannot find MFC71.DLL

but
great idea!

Well what do you know. That’s why you get people to test your stuff! There I put the file in the zip and re-uploaded it, try downloading it again from e-mu.org kalle.

Now how can I update the file I just uploaded to the user modules here…?

Hey!
I’ve just tried it and this is very nice to finally have such a simple and interruption-free file selector!
But a help patch would be really great!
;)

Wow, it works, tested it with some textures, and my LFO keeps running, while it would freeze doing it the old way.

Great work :)

Up it on the Wiki, put it on the next release, I don’t care, as long as it doesn’t get lost!!

Owh… and great website you have there!! :)

yes, should be included in the next release…

Thanks, thats really cool.
You can even select multiple files with it, its perfect.

i tiedid up your patch a little bit and did some small changes.

  • added a togedge below the “select file” inlet to avoid endless opening dialogs when setting the inlet permanent to 1.

  • turned off “show window with shell” execute to have less windows in every day usage.

-added a helpfile

download: http://vvvv.org/tiki-download_file.php?fileId=929

now were waiting for asynchronous textureloading ;)

Great! Thanks elektromeier. I just uploaded your new version to my site (slightly modified to give you credit of course).
Now if only asynchronous texture loading was so easy to fix ;)

Can I request an addition to this?

It would be great if you could control the position of the file dialog - at the moment there is a risk that it opens in a position that obscures something important.

If the sources are available in Visual C++ I could probably do the edit myself!

Thanks

Hi AlphaBetter,

Actually it’s a deadly simple python program. Here’s the code:

{CODE(ln=>1)}
import osc
import sys, os, time
import win32ui
import win32con

def GetFiles(msg):
print “gettingfies”
replyPort = msg02
directory = msg03
filetypes = msg04
dlg = win32ui.CreateFileDialog(1,
None,
None,
(win32con.OFN_FILEMUSTEXIST|
win32con.OFN_EXPLORER|
win32con.OFN_ALLOWMULTISELECT),
‘User Files (’ + filetypes + ‘)|’+filetypes+’|All Files (
.)|.*||’)
if len(directory):
dlg.SetOFNInitialDir(directory)
dlg.SetOFNTitle(‘Select Files’)
testvalue = dlg.DoModal()
if testvalue == win32con.IDOK:
for path in dlg.GetPathNames():
print “Sending back “, path
osc.sendMsg(”/filedialog/reply”, dlg.GetPathNames(), “127.0.0.1”, int(replyPort)) # send normal msg

def myTest():
osc.init()
inSocket = osc.createListener(“127.0.0.1”, 10406) # in this case just using one socket

# bind addresses to functions -> printStuff() function will be triggered everytime a
# "/test" labeled message arrives
osc.bind(GetFiles, "/filedialog/request")

while 1:
    osc.getOSC(inSocket) 
    time.sleep(0.1) 

if name == ‘main’:
print “Welcome to Selektor, your silly little OSC file manager”
print “A quick and dirty hack by Rob King, 2006”
myTest()
^

Feel free to modify as you like!

Would anyone know how to change the code so the selektor could also be used to select a directory and not just a specific file?