Re: [Rhythmbox-devel] Storage based mp3 players
- From: "Nicholas Gill (mythagel)" <mythagel tpg com au>
- To: teuf gnome org
- Cc: rhythmbox-devel gnome org
- Subject: Re: [Rhythmbox-devel] Storage based mp3 players
- Date: Fri, 17 Jun 2005 18:04:15 +1000
> Would you be able to make the difference with someone doing
> mount /dev/hdc1 /my/windows/partition/with/mp3s ? (ie how would you
> detect that a flash player has been plugged, can hal tell you that, will
> it work without hal, ...) ?
The way that i had written my original (standalone) program is that it
queries HAL (and acts on it via gnome-volume-manager) for when a device
is plugged in. HAL then identifies the device from an XML file that
looks like:
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
<match key="info.bus" string="usb">
<match key="usb.vendor_id" int="0x1332">
<match key="usb.product_id" int="0x1325">
<merge key="info.category"
type="string">portable_audio_player</merge>
<merge key="info.capabilities"
type="string">portable_audio_player</merge>
<merge key="portable_audio_player.access_method"
type="string">storage</merge>
<merge key="portable_audio_player.output_formats"
type="string">audio/mpeg audio/ogg</merge>
</match>
</match>
</match>
</device>
</deviceinfo>
For my IPOS F4. This assigns device categories after identifying the
device with the usb vendor and product id's.
So i can query hal for all devices having category portable_audio_player
and determine the mount point from that.
A generic directory of mp3's i suppose could be handled in g-v-m akin to
how a camera is distinct from a directory containing photos, yet they
are both loaded with gPhoto. A problem being that there is no standard
directory for mp3 music like there is for digital camera media. And i
think scanning for all gstreamer compatible media on a device would be
too slow.
> You should be able to create several item types (item types are
> registered at runtime iirc).
Ok, cool, I'll have to look into this. But why do i have to create a new
item type? E.g. i have two identical players, if i plug them both in,
why would i need to register a new type? I can feel somewhere in my mind
that I'm missing something fundamental here - I may have to review this.
-nick
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]