X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/56ac7a4a764a4251a851778df09967405aa9a930..00586dbca9bd75b5093512603156a1d2c0ee0ee8:/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp index d726be20..ea1afec4 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp +++ b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp @@ -103,7 +103,10 @@ eServiceDVD::eServiceDVD(const char *filename): // create handle ddvd_set_dvd_path(m_ddvdconfig, filename); ddvd_set_ac3thru(m_ddvdconfig, 0); - ddvd_set_language(m_ddvdconfig, "de"); + + std::string ddvd_language; + if (!ePythonConfigQuery::getConfigValue("config.osd.language", ddvd_language)) + ddvd_set_language(m_ddvdconfig, (ddvd_language.substr(0,2)).c_str()); int fd = open("/proc/stb/video/aspect", O_RDONLY); if (fd > -1) @@ -179,7 +182,7 @@ void eServiceDVD::gotMessage(int /*what*/) if (m_subtitle_widget) { int x1,x2,y1,y2; ddvd_get_last_blit_area(m_ddvdconfig, &x1, &x2, &y1, &y2); - m_subtitle_widget->setPixmap(m_pixmap, eRect(x1, y1, x2-x1, y2-y1)); + m_subtitle_widget->setPixmap(m_pixmap, eRect(x1, y1, (x2-x1)+1, (y2-y1)+1)); } break; case DDVD_SHOWOSD_STATE_PLAY: @@ -234,6 +237,14 @@ void eServiceDVD::gotMessage(int /*what*/) eDebug("DVD_SOF_REACHED!"); m_event(this, evSOF); break; + case DDVD_SHOWOSD_ANGLE: + { + int current, num; + ddvd_get_angle_info(m_ddvdconfig, ¤t, &num); + eDebug("DVD_ANGLE_INFO: %d / %d", current, num); + m_event(this, evUser+13); + break; + } case DDVD_SHOWOSD_TIME: { static struct ddvd_time last_info; @@ -291,7 +302,7 @@ RESULT eServiceDVD::connectEvent(const Slot2 &event, RESULT eServiceDVD::start() { - assert(m_state == stIdle); + ASSERT(m_state == stIdle); m_state = stRunning; eDebug("eServiceDVD starting"); // m_event(this, evStart); @@ -300,7 +311,7 @@ RESULT eServiceDVD::start() RESULT eServiceDVD::stop() { - assert(m_state != stIdle); + ASSERT(m_state != stIdle); if (m_state == stStopped) return -1; eDebug("DVD: stop %s", m_filename.c_str()); @@ -458,6 +469,7 @@ int eServiceDVD::getInfo(int w) } case sUser+6: case sUser+7: + case sUser+8: return resIsPyObject; default: return resNA; @@ -527,6 +539,16 @@ PyObject *eServiceDVD::getInfoObject(int w) } return tuple; } + case sUser+8: + { + ePyObject tuple = PyTuple_New(2); + int current, num; + ddvd_get_angle_info(m_ddvdconfig, ¤t, &num); + PyTuple_SetItem(tuple, 0, PyInt_FromLong(current)); + PyTuple_SetItem(tuple, 1, PyInt_FromLong(num)); + + return tuple; + } default: eDebug("unhandled getInfoObject(%d)", w); } @@ -540,11 +562,11 @@ RESULT eServiceDVD::enableSubtitles(eWidget *parent, SWIG_PYOBJECT(ePyObject) /* m_subtitle_widget = new eSubtitleWidget(parent); m_subtitle_widget->resize(parent->size()); - eSize size = parent->size(); + eSize size = eSize(720, 576); if (!m_pixmap) { - m_pixmap = new gPixmap(size, 32); + m_pixmap = new gPixmap(size, 32, 1); /* allocate accel surface (if possible) */ ddvd_set_lfb(m_ddvdconfig, (unsigned char *)m_pixmap->surface->data, size.width(), size.height(), 4, size.width()*4); run(); // start the thread } @@ -686,6 +708,9 @@ RESULT eServiceDVD::keyPressed(int key) case iServiceKeys::keyUser+7: ddvd_send_key(m_ddvdconfig, DDVD_KEY_MENU); break; + case iServiceKeys::keyUser+8: + ddvd_send_key(m_ddvdconfig, DDVD_KEY_ANGLE); + break; default: return -1; }