- Transform a filename into a URI like that:
Use g_filename_to_uri() instead. Same goes for the opposite direction, where stripping "file://" isn't good enough to transform a URI into a local filename. Use g_filename_from_uri(), or g_file_get_path() if you're actually going to be opening the files.
- Use GStreamer to play a single small pop sound:
Bruno, you should get a Bugzilla component for Garfunkel.
Is there a python binding for this
Heh - I was just going to ask the same Python-binding question :-)
Also: in one case I want to check if a file name is on a local directory (ie. not on gvfs mount) and then get the directory of the file... Currently I use this:
theDir = os.path.dirname(theUri[7:])
Not elegant, and uses a hardcoded file:/ prefix... Any suggestion how to improve this?
You can also use g_file_get_path() if it returns Non-NULL its a local path. If you do it this way it can return local paths for gvfs mounts too, via fuse. (but is_native() will return FALSE even if fuse is availible).
Thank you, Bastien!
> Use libcanberra instead.
Or Phonon. :-)
Post a Comment