Opened 18 years ago
Closed 18 years ago
#1753 closed enhancement (fixed)
MythMediaMonitor for Darwin and OS X
Reported by: | Nigel | Owned by: | Nigel |
---|---|---|---|
Priority: | minor | Milestone: | 0.21 |
Component: | mythtv | Version: | 0.19 |
Severity: | medium | Keywords: | OSX media monitor mtd |
Cc: | nigel@… | Ticket locked: | no |
Description
Darwin's IO is very different to other Unixes. There is no /dev/cdrom or /dev/dvd. The operating system creates /dev/disk? when a mountable volume is inserted/attached. This makes the drive detection code very different.
Apple has a Disk Arbitration framework that uses a daemon (/usr/sbin/diskarbitrationd), and can call user code when a volume is inserted/removed/formatted/et c. This is a fairly close match to what MythMediaMonitor does.
Please create a darwin-specific MythMediaMonitor class (e.g. mythmediamonitor-darwin.cpp) which is compiled in place of the existing Unix one (I think this is better than subclassing). For extra points, modify mythdvd/mtd to use MythMediaMonitor instead of its own device polling.
Attachments (16)
Change History (27)
Changed 18 years ago by
Attachment: | mythcdrom-darwin.cpp added |
---|
Changed 18 years ago by
Attachment: | mythmediamonitor-darwin.h added |
---|
libs/libmyth/mythmediamonitor-darwin.cpp - new darwin specific media insertion/removal handlers
Changed 18 years ago by
Attachment: | mythmediamonitor-darwin.cpp added |
---|
libs/libmyth/mythmediamonitor-darwin.cpp - new darwin specific media insertion/removal handlers
Changed 18 years ago by
Attachment: | mythcdrom.h.patch added |
---|
libs/libmyth/mythcdrom.h - patch for Darwin CD subclass
Changed 18 years ago by
Attachment: | mythcdrom.cpp.patch added |
---|
libs/libmyth/mythcdrom.cpp - patch to create Darwin CD subclass
Changed 18 years ago by
Attachment: | mythmediamonitor.h.patch added |
---|
libs/libmyth/mythmediamonitor.h - patch for Darwin specific methods.
Changed 18 years ago by
Attachment: | mythmediamonitor.cpp.patch added |
---|
libs/libmyth/mythmediamonitor.cpp - patch for Darwin specific methods.
Changed 18 years ago by
Attachment: | libmyth.pro.patch added |
---|
libs/libmyth/libmyth.pro - patch to add Darwin headers and sources
comment:1 Changed 18 years ago by
Owner: | changed from awk@… to anonymous |
---|---|
Status: | new → assigned |
The attached patches and new files enable mythfrontend to detect when a DVD is inserted and to carry out the users selected 'on insertion' action (rip, play etc). Ejecting the DVD will remove the device from the media monitor list.
This code 'should' work for audio CD's too - but I don't have a mythmusic build to test this with.
comment:2 Changed 18 years ago by
Owner: | changed from anonymous to Nigel |
---|---|
Status: | assigned → new |
Changed 18 years ago by
Attachment: | mythmediamonitor.h.2.patch added |
---|
mythmediamonitor.h.patch V2 - 'cleanup' removes some Mac OS X header dependancies
Changed 18 years ago by
Attachment: | mythmediamonitor.cpp.2.patch added |
---|
mythmediamonitor.cpp.patch V2 - 'cleanup' removes some Mac OS X header dependancies
Changed 18 years ago by
Attachment: | mythmediamonitor-darwin.2.h added |
---|
mythmediamonitor-darwin.cpp V2 - 'cleanup' removes some Mac OS X header dependancies
Changed 18 years ago by
Attachment: | mythmediamonitor-darwin.2.cpp added |
---|
mythmediamonitor-darwin.cpp V2 - 'cleanup' removes some Mac OS X header dependancies
comment:3 Changed 18 years ago by
The 'V2' patches and new 'darwin' files attached remove the inclusion of mac specfic headers in mediamonitor and the friend fucntions by adding new 'callback' methods which use Qt types to MonitorThread?. They in turn can all MediaMonitor::AddDevice? (etc) to get the new devices added/removed.
comment:4 Changed 18 years ago by
(In [9898]) OS X framework check, will be used by MythMediaMonitor check in. See #1753
comment:5 Changed 18 years ago by
Status: | new → assigned |
---|
I was doing the svn checkin of the final code, when I remembered the many times Isaac asked people to rework their patches because they had too many #ifdefs. "Always better to sub-class."
So I will. But, so that it isn't lost forever... svn diff libs/libmyth >../patch.mediamon.2
Changed 18 years ago by
Attachment: | patch.mediamon.2 added |
---|
Last version before I subclass MythediaMonitor?
comment:6 Changed 18 years ago by
comment:7 Changed 18 years ago by
Milestone: | 0.20 → 0.21 |
---|
Sorry Andrew, I didn't get the subclassing tidied up in time.
comment:8 Changed 18 years ago by
New patch attached which subclasses MediaMonitor? for Darwin. The subclass handles the Darwin specific thread and also overrides AddDevice?() to remove the stat() calls (which don't apply on Mac OS X).
Note that a couple of methods in MediaMonitor? needed to become virtual to allow the subclassing to work correctly.
Changed 18 years ago by
Attachment: | mythmediamonitor.patch added |
---|
Patches to mythmediamonitor, cdrom classes and .pro file to support Darwin Disk arbitration
Changed 18 years ago by
Attachment: | mythmediamonitor-darwin.3.h added |
---|
Updated Darwin specific media monitor subclass
Changed 18 years ago by
Attachment: | mythmediamonitor-darwin.3.cpp added |
---|
Updated Darwin specific media monitor subclass
comment:9 Changed 18 years ago by
I also have some patches that allows the 'eject disk' option to work from the menu too.
However this ticket already has enought overlaid/redundant patches so I think I'll wait until we get this one sorted out and then open a new one for 'Support Eject operation on Mac OS X'
comment:10 Changed 18 years ago by
(In [11285]) At long last, Mac OS X DiskArbitration? based MediaMonitor?. See #1753 Also a small change to ChooseAndEjectMedia?() (it would call eject() twice)
comment:11 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
libs/libmyth/mythcdrom-darwin.cpp - new darwin specific cd/dvd subclass