Ticket #9520 (closed Patch - Feature: fixed)
Opened 2 years ago
Last modified 16 months ago
[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
Change History
comment:1 Changed 2 years ago by robertm
- Component changed from Plugin - MythMusic to MythTV - General
mistagged as mythmusic.
comment:2 Changed 2 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 2 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 2 years ago by paulh
- Owner changed from paulh to nigel
- Status changed from new to assigned
comment:6 Changed 16 months ago by Github
- Status changed from assigned to closed
- Resolution set to fixed
- Milestone changed from unknown to 0.25
Tweak the handling of MythMediaType? to be a bitfield
Closes #9520
Based on patches originally by: Lawrence Rust <lvr@…
Branch: master Changeset: 7ec5a7e8df34c42de7929c2e74455832c94f8a4c
