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: | 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)
Change History (9)
Changed 14 years ago by
Attachment: | 1057-mediamonitor-medias.diff added |
---|
Changed 14 years ago by
Attachment: | 80-gallery-mediamon-medias.diff added |
---|
comment:1 Changed 14 years ago by
Component: | Plugin - MythMusic → MythTV - General |
---|
comment:2 Changed 14 years ago by
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
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
Owner: | changed from paulh to Nigel |
---|---|
Status: | new → assigned |
comment:5 Changed 13 years ago by
Owner: | changed from Nigel to beirdo |
---|
comment:6 Changed 13 years ago by
Milestone: | unknown → 0.25 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Tweak the handling of MythMediaType? to be a bitfield
Closes #9520
Based on patches originally by: Lawrence Rust <lvr@…
Branch: master Changeset: 7ec5a7e8df34c42de7929c2e74455832c94f8a4c
mistagged as mythmusic.