Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 7 years ago

Closed 7 years ago

#3077 closed patch (fixed)

Default CD Device selection

Reported by: devel@… Owned by: nigel
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords: cd dvd detection default
Cc: Ticket locked: no

Description

mythtv-defaultcddevices.diff (No patch dependencies):
This patch adds entries in General Settings for specifying default CD and DVD devices to use within MythTV. Adds two database settings: defaultCDDevice and defaultDVDDevice.
getCDROMBlockDevices is changed from a protected to a public member in mythmediamonitor.h allowing non class members to enumerate CDROM drives. The stringlist returned from this is used to populate a list of CD/DVD drives in the drive selection comboboxes (comboboxes are left editable should the user wish to manually enter an undetected device).

mythmusic-cddevices.diff (depends on mythtv-defaultcddevices.diff):
This patch modifies cd device selection comboboxes to get list of devices from mediamonitor and adds a "default" entry.
It also modifies areas of the code which use CD devices to check for "default" and use the mythtv default device if set.
cd writer detection using cdrecord --scanbus is removed since this doesn't work on recent kernel versions and instead relies on the user to select a writeable device.

mythvideo-cddevices.diff (depends on mythtv-defaultcddevices.diff):
This patch modifies VCD and DVD device selection comboboxes to get list of devices from mediamonitor and adds a "default" entry.
It also modifies areas of the code which use CD devices to check for "default" and use the mythtv default device if set.

mytharchive-cddevices.diff (depends on mythtv-defaultcddevices.diff):
This patch modifies DVD device selection comboboxes to get list of devices from mediamonitor and adds a "default" entry.
It also modifies mytharchivehelper/main.cpp and mythburn.py to check for "default" and use the mythtv default device if set.

Attachments (8)

mythtv-defaultcddevices.diff (2.5 KB) - added by devel@… 7 years ago.
Add default cd/dvd device selection
mytharchive-cddevices.diff (2.8 KB) - added by devel@… 7 years ago.
Add default cd/dvd device selection to mytharchive
mythmusic-cddevices.diff (6.3 KB) - added by devel@… 7 years ago.
Add default cd/dvd device selection to mythmusic
mythvideo-cddevices.diff (5.4 KB) - added by devel@… 7 years ago.
Add default cd/dvd device selection to mythvideo
mythvideo-cddevices.2.diff (4.9 KB) - added by devel@… 7 years ago.
Mythvideo patch v2 removes "/2" from device that accidently slipped into the patch
default-cd.diff (19.3 KB) - added by nigel 7 years ago.
MythMedia based auto-selection
default-cd.2.diff (25.0 KB) - added by devel@… 7 years ago.
Updated patch
mediamonitor-scd-fix.diff (1.2 KB) - added by devel@… 7 years ago.
Fix model lookup for cd devices with scd0/sr0 device names

Download all attachments as: .zip

Change History (21)

Changed 7 years ago by devel@…

Add default cd/dvd device selection

Changed 7 years ago by devel@…

Add default cd/dvd device selection to mytharchive

Changed 7 years ago by devel@…

Add default cd/dvd device selection to mythmusic

Changed 7 years ago by devel@…

Add default cd/dvd device selection to mythvideo

comment:1 Changed 7 years ago by nigel

Small review

1) I agree that having a default device selector is useful, and having the burning functions seperate is also good. Having four defaults seems overkill, though? Maybe just one DefaultBurner? setting?

2) Most of your code compares the *DeviceLocation? setting to "default", and then looks up another setting. Why not just use the first setting? (i.e. make the UI GetCDROMBlockDevices changes in programs/mythfrontend/globalsettings.cpp)

3) mythvideo/mythvideo/main.cpp adds "/2" onto the URL/URI/MRI/thingy. Why? Doesn't this always force one particular track?

4) Prepending /dev into the paths in the GUI selectors is a bit wasteful, and won't work on Windows or Mac OS X. (Note, however, that I do something equally bad in mythvideo/main.cpp on OS X). Maybe a new method, MythMediaMonitor::GetCDMedias() that already prepends this for appropriate OSs?

5) I am wondering if the user really needs the /dev name in the GUI selector? Ideally, we would present the device name (e.g. "PIONEER DVD-RW DVR-108" or "LITE-ON DVDRW SOHW-832S") parsed from /proc/ide/hd?model

Changed 7 years ago by devel@…

Mythvideo patch v2 removes "/2" from device that accidently slipped into the patch

comment:2 Changed 7 years ago by devel@…

Please mark this ticket as invalid for now since it will no longer apply to head. I need to review the mythmediamonitor changes by Nigel and provide an updated patch.

Changed 7 years ago by nigel

MythMedia based auto-selection

comment:3 Changed 7 years ago by nigel

MythMedia changes attached, only slightly tested.

comment:4 Changed 7 years ago by devel@…

Updated default-cd.diff patch:
-Fixes typo in mytharchive part (defaultDVDWriter->defaultWriter).
-Adds missing bits to mythmusic (playback).

I've tested the CD parts of this, with a single cd drive. It'll be a few days before I can sort out a second drive and a dvd disk to test with. Looks good so far though.

mythburn.py uses MythArchiveDVDLocation which needs to change to use MediaMonitor:defaultWriter somehow - not sure how to do this though given it's a python script.

Changed 7 years ago by devel@…

Updated patch

comment:5 Changed 7 years ago by nigel

(In [13225]) New methods for getting default CD/VCD/DVD/burner, for plugins. See #3077

comment:6 Changed 7 years ago by nigel

(In [13228]) Cut/paste error. See #3077

comment:7 Changed 7 years ago by nigel

(In [13284]) Refine drive selection popup. See #3077. Now lists CDROMs, not ejectables.
Requires RTTI, but that shouldn't be a problem (other parts of MythTV do also)

comment:8 Changed 7 years ago by nigel

  • Owner changed from ijr to nigel
  • Status changed from new to assigned

comment:9 Changed 7 years ago by nigel

(In [13336]) Don't lookup CD device in decoder, set it in the parent. See #2598. See #3077

comment:10 Changed 7 years ago by nigel

(In [13358]) Multi CD drive selection in MythMusic. To test it, you need to set the CDDevice
setting to "default", but in the future this setting will vanish. See #3077

comment:11 Changed 7 years ago by nigel

(In [13362]) Multiple CD drive with media manager in Music Plugin. See #3077. See #2598

comment:12 Changed 7 years ago by nigel

(In [13364]) Multiple DVD drive with media manager in Video Plugin. See #3077. See #2598.
Not real happy about the structure here (TitleDialog? and DVDRipBox need to
share the same dvd_device, and it the needs to get passed to mtd for use?),
but that will have to wait for some extra, um, "brave pills".
Until then, setting DVDDeviceLocation to "default" should let you play
from multiple drives, but will break ripping.

Changed 7 years ago by devel@…

Fix model lookup for cd devices with scd0/sr0 device names

comment:13 Changed 7 years ago by nigel

  • Resolution set to fixed
  • Status changed from assigned to closed

OK. The only parts that I have not committed are the mtd default (which cannot use the defaultDVD method as it stands, because on a multiple DVD machine, it will try and pop up a dialog box), and the removal of the setup (UI) stuff.
[BR]]
The former needs something like a "non-interactive" flag in the methods. I had a reworking of mtd that let callers pass in the drive to monitor, but lost that when a disk image went bad. For now, it can probably stay as is.

The latter? I am still thinking about whether the UI should let the user choose default or a drive from a list, or if it should just be completely missing.

Either way, I think it is time to close this ticket

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.