@@ -24,7 +24,7 @@ MythHDD::MythHDD(QObject *par, const char *DevicePath,
2424 : MythMediaDevice(par, DevicePath, SuperMount, AllowEject)
2525{
2626 LOG (VB_MEDIA, LOG_INFO, " MythHDD::MythHDD " + m_DevicePath);
27- m_Status = MEDIASTAT_UNPLUGGED ;
27+ m_Status = MEDIASTAT_NOTMOUNTED ;
2828 m_MediaType = MEDIATYPE_DATA; // default type is data
2929}
3030
@@ -46,26 +46,29 @@ MythMediaStatus MythHDD::checkMedia(void)
4646 }
4747
4848 // device is not mounted
49- if (m_Status == MEDIASTAT_UNPLUGGED )
49+ switch (m_Status)
5050 {
51+ case MEDIASTAT_NOTMOUNTED:
5152 // a removable device was just plugged in try to mount it.
5253 LOG (VB_MEDIA, LOG_INFO, " MythHDD::checkMedia try mounting " + m_DevicePath);
5354 if (mount ())
5455 {
5556 m_Status = MEDIASTAT_NOTMOUNTED;
5657 return setStatus (MEDIASTAT_MOUNTED);
5758 }
58- else
59- return setStatus (MEDIASTAT_NOTMOUNTED);
60- }
61- else if (m_Status == MEDIASTAT_MOUNTED)
62- {
59+ return m_Status;
60+ case MEDIASTAT_MOUNTED:
6361 // device was mounted and someone unmounted it.
6462 return m_Status = setStatus (MEDIASTAT_NOTMOUNTED);
65- }
66- else
67- {
63+ default :
6864 // leave device state as is
6965 return m_Status;
7066 }
7167}
68+
69+ // virtual
70+ MythMediaError MythHDD::eject (bool )
71+ {
72+ setStatus (MEDIASTAT_UNPLUGGED);
73+ return MEDIAERR_UNSUPPORTED;
74+ }
0 commit comments