RESULT eServiceFactoryDVD::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
{
// check resources...
- ptr = new eServiceDVD(ref.path.c_str());
+ ptr = new eServiceDVD(ref);
return 0;
}
DEFINE_REF(eServiceDVD);
-eServiceDVD::eServiceDVD(const char *filename):
- m_filename(filename),
+eServiceDVD::eServiceDVD(eServiceReference ref):
+ m_ref(ref),
m_ddvdconfig(ddvd_create()),
m_subtitle_widget(0),
m_state(stIdle),
m_sn = eSocketNotifier::create(eApp, ddvd_get_messagepipe_fd(m_ddvdconfig), eSocketNotifier::Read|eSocketNotifier::Priority|eSocketNotifier::Error|eSocketNotifier::Hungup);
eDebug("SERVICEDVD construct!");
// create handle
- ddvd_set_dvd_path(m_ddvdconfig, filename);
+ ddvd_set_dvd_path(m_ddvdconfig, ref.path.c_str());
ddvd_set_ac3thru(m_ddvdconfig, 0);
std::string ddvd_language;
ASSERT(m_state != stIdle);
if (m_state == stStopped)
return -1;
- eDebug("DVD: stop %s", m_filename.c_str());
+ eDebug("DVD: stop %s", m_ref.path.c_str());
m_state = stStopped;
ddvd_send_key(m_ddvdconfig, DDVD_KEY_EXIT);
if ( m_ddvd_titlestring[0] != '\0' )
name = m_ddvd_titlestring;
else
- name = m_filename;
+ name = m_ref.path;
return 0;
}
switch(w)
{
case sServiceref:
- break;
+ return m_ref.toString();
default:
eDebug("unhandled getInfoString(%d)", w);
}
if ( m_ddvd_titlestring[0] != '\0' )
snprintf(filename, 128, "/home/root/dvd-%s.cuts", m_ddvd_titlestring);
else
- snprintf(filename, 128, "%s/dvd.cuts", m_filename.c_str());
+ snprintf(filename, 128, "%s/dvd.cuts", m_ref.path.c_str());
eDebug("eServiceDVD::loadCuesheet() filename=%s",filename);
if ( m_ddvd_titlestring[0] != '\0' )
snprintf(filename, 128, "/home/root/dvd-%s.cuts", m_ddvd_titlestring);
else
- snprintf(filename, 128, "%s/dvd.cuts", m_filename.c_str());
+ snprintf(filename, 128, "%s/dvd.cuts", m_ref.path.c_str());
FILE *f = fopen(filename, "wb");