New CD Monitoring code (was Re: [mythtv] Revamping the plugin system.)
J. Donavan Stanley
jdonavan at gorpe.com
Mon Dec 1 06:17:03 EST 2003
thor wrote:
>On Thursday 27 November 2003 20:00, J. Donavan Stanley wrote:
>
>
>
>> I'll start working on the MediaHandler
>>stuff as an optional extension to the existing plguins.
>>
>>
>
> I'm looking forward to that code, as it's exactly what I need for
>dynamic build up and tear down of metadata collections in the mfd. :-)
>
>
>
I've rewritten the actual monitoring of the CD media so that all of the
logic for the mounting/unmounting and notification takes place within
the object itself. I've also refactored it into two classes
MythMediaDevice and MythCDROM. The former contains baseline logic and
functionality that's needed for any removable media, the latter contains
CD specific stuff (like audio/DVD detection and locking the CDROM
tray). MythMediaDevices send their state changes via signals now
instead of callbacks.
Unfortunately I've not had as much time for things as I'd wanted during
my time off so I still need to sit down and rewrite the monitor object
and get it plugged into the frontend. Initially I plan on hooking into
the jump off logic from Issac and having it jump to the appropriate
plugin. Then, I'll start looking into adding the media actions into the
existing plugin framework. Though, with what you're working on, I'm not
sure that's needed...
The way I see it working is this: At startup the MediaMonitor will
create MythMediaDevices for the removable drives in fstab. It'll then
create a separate thread that sits loops calling CheckDevices and
usleep. Whenever a MythMediaDevice raises it's signal the MediaMonitor
will post an event to itself so that it can take action once the main
thread processes it's message queue. During the handling of that event,
is when the switch to the proper plugin will take place.
Depending on what direction you're going with things, I'll either start
working on the media actions so that we're not limited to one plugin per
media type. Or I'll start working on new subclasses of MythMediaDevice
to handle different media types. Since I've gotten my flash card reader
up an running under Linux this weekend I'll start with removable SCSI
devices I imagine. Extra media types aren't very useful without the
media actions though since they're all going to have a media type of
"MEDIATYPE_DATA".
Question: Does anyone have one of those USB flash drives like they sell
at ThinkGeek? I'm wondering if they work the same as normal flash
readers under Linux (i.e. usb-storage with SCSI emulation).
More information about the mythtv-dev
mailing list