Opened 14 years ago

Closed 13 years ago

Last modified 9 years ago

#9520 closed Patch - Feature (fixed)

[PATCH] MediaMonitor::GetMedias - search for multile media types

Reported by: Lawrence Rust <lvr@…> Owned by: beirdo
Priority: minor Milestone: 0.25
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This patch adds the ability to request multiple media types when searching MediaMonitor? disks.

This is useful in the MythGallery plugin which registers specific image filetypes with MediaMonitor?. When a CD/USB is inserted with media containing images, the disk is searched statistically and the media type is set to MEDIATYPE_MGALLERY. However, when MythGallery shows a list of devices with supported media it needs to ask for both MEDIATYPE_MGALLERY and MEDIATYPE_DATA. MythGallery is the only caller of the MediaMonitor::GetMedias? function.

This patch is in 2 parts, the first to libmyth/mythmediamonitor.cpp and the second to mythgallery/iconview.cpp

Attachments (2)

1057-mediamonitor-medias.diff (3.3 KB) - added by Lawrence Rust <lvr@…> 14 years ago.
80-gallery-mediamon-medias.diff (670 bytes) - added by Lawrence Rust <lvr@…> 14 years ago.

Download all attachments as: .zip

Change History (9)

Changed 14 years ago by Lawrence Rust <lvr@…>

Changed 14 years ago by Lawrence Rust <lvr@…>

comment:1 Changed 14 years ago by robertm

Component: Plugin - MythMusicMythTV - General

mistagged as mythmusic.

comment:2 Changed 14 years ago by Nigel

Part of me wonders how useful it is for MythGallery to request, and have actions for, _DATA+_MIXED and _MGALLERY. i.e. it would be easier to just request MEDIATYPE_MGALLERY ? :-)
If we are now using MediaType? as a bitmask, MythMediaDevice::MediaTypeString?() needs to build up and return a compound string?

comment:3 Changed 14 years ago by Lawrence Rust <lvr@…>

As it stands, MythGallery asks for MEDIATYPE_DATA which in the case of a disk containing gifs and jpegs and scanned statistically results in no match. If MythGallery were to request MEDIATYPE_MGALLERY then a disk without gifs or jpegs would not be matched even though the Qt QImageReader might be able to read them. QtImageReader? uses system plugins to decode images so you need to ask at runtime what formats are supported. So it's pragmatic to call GetMedias? with a bit mask of types.

I'm not suggesting a re-definition of MediaType? as a bit mask. That would break a lot of code and weaken type checking. Just change the parameter type of GetMedias?.

I don't think it's necessary for MediaTypeString? to return a list because all the other APIs take an enum MediaType? i.e. a single type. Furthermore, it would unnecessarily complicate the code for no obvious benefit.

comment:4 Changed 14 years ago by paulh

Owner: changed from paulh to Nigel
Status: newassigned

comment:5 Changed 13 years ago by beirdo

Owner: changed from Nigel to beirdo

comment:6 Changed 13 years ago by Github

Milestone: unknown0.25
Resolution: fixed
Status: assignedclosed

Tweak the handling of MythMediaType? to be a bitfield

Closes #9520

Based on patches originally by: Lawrence Rust <lvr@…

Branch: master Changeset: 7ec5a7e8df34c42de7929c2e74455832c94f8a4c

comment:7 Changed 9 years ago by Lawrence Rust <lvr@…>

In e5b664a242b2b03a40c2a0fce07d69f385238d97/mythtv:

MediaMonitor::GetMedias?: Search for multiple media types

Add the ability to request multiple media types when searching MediaMonitor?
disks.

This is useful in the Gallery & MythGallery plugin which registers specific image
filetypes with MediaMonitor?. When a CD/USB is inserted with media
containing images, the disk is searched statistically and the media type
is set to MEDIATYPE_MGALLERY. However, when the galleries show a list of
devices with supported media it needs to ask for both MEDIATYPE_MGALLERY
and MEDIATYPE_DATA.
The Galleries are the only user of the MediaMonitor::GetMedias? function.

Refs #9520

Signed-off-by: Roger Siddons <rsiddons@…>

Note: See TracTickets for help on using tickets.