Re: [Utopia] Finding device capabilities



On Tue, 2005-04-12 at 07:49 +1000, Nicholas Gill (mythagel) wrote:
> Good idea with the transcoding audio, i'll have to implement it!

Sweet, sounds good, the portable_audio_player.output_formats property
should help here, it contains the MIME types of files the player will
accept. So doing a "players = libhal_find_device_by_capability (hal_ctx,
"portable_audio_player", &num_devices, &error)" should give you all
attached music players.

For devices that are storage based just go ahead and find all hal device
objects for which 

 a) block.storage_device equals the string value you retrieved from
    portable_audio_player.storage_device; and

 b) block.is_volume is TRUE

should yield the partitions on the storage device and other properties
e.g. volume.mount_point tells you where it's mounted. You can probably
start assuming that there is only one partition but for things like
iPod's you need to check for certain directories [1]. Using
hal-device-manager should help clear all this up :-)

[1] : and maintain a database so iPod's aren't simple to handle. IIRC
there are a few libraries to help here though.

> To clarify i have implemented it (atm) as a standalone application, but
> i am happy to implement it as a RB patch (which would allow some more
> interesting progress display i expect)
> 
> I'll have a first run at playing with hal and gvm from the info you've
> provided and see what i come up with.

That sounds good. I think it's sensible to add code to gnome-volume-
manager such that the user can specify what application to invoke [1],
but of course that is ultimately up to Robert.

Cheers,
David

[1] : and we still need to put some work to sort out how to specify
this, cf. 

 http://www.gnome.org/~fherrera/blog/Applications_instead_of_commands.html
 http://www.gnome.org/~fherrera/blog/apps_handling_devices_revisited.html





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]