[mythtv] [PATCH] MediaMonitor data and MythVideo support

Xavier Hervy maxpower44 at tiscali.fr
Wed Jun 30 12:50:41 EDT 2004


Xavier Hervy wrote:

> J. Donavan Stanley wrote:
> 
>> Xavier Hervy wrote:
>>
>>> J. Donavan Stanley wrote:
>>>
>>>>
>>>> As it turns out, the only disks I stick in my machines are either 
>>>> DVDs or Music CDs so the current handlers work well enough for me.  
>>>> I tried to plan ahead to make it fairly easy to extend this, it's 
>>>> just not been on my radar.
>>>
>>>
>>>
>>>
>>> Media handler is not enougth. for example (in my patch) when you try 
>>> to play a movie on a cd, mythvideo ask for cd , but when i insert it, 
>>> mythvideo is closed and open a new time.
>>
>>
>>
>>
>> How about adding the notion of a "currentHandler" to the 
>> Mediamonitor?  That way the notification system could do something 
>> like "If I found a handler and it's not the same handler as is 
>> currently active then fire the event"..
>>
>> This would take care of quite a few "isms" I've seen..
> 
> 
> create a QMediaEvent send by mediamonitor
> 
> MyDialog::contentsMediaChangeEvent( QMediaEvent *me )
> {
>      //if the event interest my dialog then
>      if (me->MediaType == MEDIATYPE_DATA)
>          // do something
>      else
>         MythDialog::contentsMediaChangeEvent( me );
> }
> 
> and  MythDialog implement like this
> MythDialog::contentsMediaChangeEvent( QMediaEvent *me )
> {
>     // nobody catch this event then run appropriate mediahandler
> 
> }
> 
> Xavier
> 
> 
Or simply create a virtual function in MythDialog like this :
bool MythDialog::onMediaEvent(MythMediaDevice * mediadevice)
{
      return false;
}

Then mediamonitor can made something like that :
bool iscatched = gContext->GetCurrentWindow()->onMediaEvent(mymedia);
if (!iscaatched){
     //run mediahandler like before
}

And a specific dialog can do that, example with VideoTree

bool VideoTree::onMediaEvent(MythMediaDevice * mediaevent){
    emit slotMediaEvent(mediadevice);
    return true;
}

with slot :
VideoTree::slotMediaEvent(MythMediaDevice * mediadevice){
    //here do what i should do with mediadevice
}

any comment about that ?

Xavier



More information about the mythtv-dev mailing list