Opened 16 years ago

Closed 15 years ago

Last modified 11 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@…> 16 years ago.
80-gallery-mediamon-medias.diff (670 bytes ) - added by Lawrence Rust <lvr@…> 16 years ago.

Download all attachments as: .zip

Change History (9)

by Lawrence Rust <lvr@…>, 16 years ago

by Lawrence Rust <lvr@…>, 16 years ago

comment:1 by robertm, 16 years ago

Component: Plugin - MythMusicMythTV - General

mistagged as mythmusic.

comment:2 by Nigel, 16 years ago

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 by Lawrence Rust <lvr@…>, 16 years ago

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 by paulh, 16 years ago

Owner: changed from paulh to Nigel
Status: newassigned

comment:5 by beirdo, 15 years ago

Owner: changed from Nigel to beirdo

comment:6 by Github, 15 years ago

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 by Lawrence Rust <lvr@…>, 11 years ago

In e5b664a242b2b03a40c2a0fce07d69f385238d97/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available
Note: See TracTickets for help on using tickets.