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: | 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)
by , 16 years ago
| Attachment: | 1057-mediamonitor-medias.diff added |
|---|
by , 16 years ago
| Attachment: | 80-gallery-mediamon-medias.diff added |
|---|
comment:1 by , 16 years ago
| Component: | Plugin - MythMusic → MythTV - General |
|---|
comment:2 by , 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 , 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 , 16 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:5 by , 15 years ago
| Owner: | changed from to |
|---|
comment:6 by , 15 years ago
| 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.