Exemplo n.º 1
0
int eServiceDVD::getInfo(int w)
{
	eDebug("[eServiceDVD] getInfo: %d", w); 
	switch (w)
	{
		case sCurrentChapter:
		{
			struct ddvd_time info;
			ddvd_get_last_time(m_ddvdconfig, &info);
			return info.pos_chapter;
		}
		case sTotalChapters:
		{
			struct ddvd_time info;
			ddvd_get_last_time(m_ddvdconfig, &info);
			return info.end_chapter;
		}
		case sCurrentTitle:
		{
			struct ddvd_time info;
			ddvd_get_last_time(m_ddvdconfig, &info);
			return info.pos_title;
		}
		case sTotalTitles:
		{
			struct ddvd_time info;
			ddvd_get_last_time(m_ddvdconfig, &info);
			return info.end_title;
		}
		case sTXTPID:	// we abuse HAS_TELEXT icon in InfoBar to signalize subtitles status
		{
			int spu_id;
			uint16_t spu_lang;
			ddvd_get_last_spu(m_ddvdconfig, &spu_id, &spu_lang);
			return spu_id;
		}
		case sUser+6:
		case sUser+7:
		case sUser+8:
			return resIsPyObject;
#ifdef DDVD_SUPPORTS_PICTURE_INFO
		case sVideoWidth:
			return m_width;
		case sVideoHeight:
			return m_height;
		case sAspect:
			return m_aspect;
		case sProgressive:
			return m_progressive;
		case sFrameRate:
			return m_framerate;
#endif
		default:
			return resNA;
	}
}
Exemplo n.º 2
0
PyObject *eServiceDVD::getInfoObject(int w)
{
	switch(w)
	{
		case sUser+6:
		{
			ePyObject tuple = PyTuple_New(3);
			int audio_id,audio_type;
			uint16_t audio_lang;
			ddvd_get_last_audio(m_ddvdconfig, &audio_id, &audio_lang, &audio_type);
			char audio_string[3]={audio_lang >> 8, audio_lang, 0};
			PyTuple_SetItem(tuple, 0, PyInt_FromLong(audio_id+1));
			PyTuple_SetItem(tuple, 1, PyString_FromString(audio_string));
			switch(audio_type)
			{
				case DDVD_MPEG:
					PyTuple_SetItem(tuple, 2, PyString_FromString("MPEG"));
					break;
				case DDVD_AC3:
					PyTuple_SetItem(tuple, 2, PyString_FromString("AC3"));
					break;
				case DDVD_DTS:
					PyTuple_SetItem(tuple, 2, PyString_FromString("DTS"));
					break;
				case DDVD_LPCM:
					PyTuple_SetItem(tuple, 2, PyString_FromString("LPCM"));
					break;
				default:
					PyTuple_SetItem(tuple, 2, PyString_FromString(""));
			}
			return tuple;
		}
		case sUser+7:
		{
			ePyObject tuple = PyTuple_New(2);
			int spu_id;
			uint16_t spu_lang;
			ddvd_get_last_spu(m_ddvdconfig, &spu_id, &spu_lang);
			char spu_string[3]={spu_lang >> 8, spu_lang, 0};
			if (spu_id == -1)
			{
				PyTuple_SetItem(tuple, 0, PyInt_FromLong(0));
				PyTuple_SetItem(tuple, 1, PyString_FromString(""));
			}
			else
			{
				PyTuple_SetItem(tuple, 0, PyInt_FromLong(spu_id+1));
				PyTuple_SetItem(tuple, 1, PyString_FromString(spu_string));
			}				
			return tuple;
		}
		case sUser+8:
		{
			ePyObject tuple = PyTuple_New(2);
			int current, num;
			ddvd_get_angle_info(m_ddvdconfig, &current, &num);
			PyTuple_SetItem(tuple, 0, PyInt_FromLong(current));
			PyTuple_SetItem(tuple, 1, PyInt_FromLong(num));

			return tuple;
		}
		default:
			eDebug("unhandled getInfoObject(%d)", w);
	}
	Py_RETURN_NONE;
}
Exemplo n.º 3
0
ePtr<iServiceInfoContainer> eServiceDVD::getInfoObject(int w)
{
	eServiceDVDInfoContainer *container = new eServiceDVDInfoContainer;
	ePtr<iServiceInfoContainer> retval = container;
	switch (w)
	{
		case sUser + 6:
		{
			int audio_id,audio_type;
			uint16_t audio_lang;
			ddvd_get_last_audio(m_ddvdconfig, &audio_id, &audio_lang, &audio_type);
			char audio_string[3] = {audio_lang >> 8, audio_lang, 0};
	                eDebug("[eServiceDVD] getInfoObject sUser+6:  audio_id=%d lang=%X type=%d", audio_id, audio_lang, audio_type);
			container->addInteger(audio_id + 1);
			container->addString(audio_string);
			switch (audio_type)
			{
			case DDVD_MPEG:
				container->addString("MPEG");
				break;
			case DDVD_AC3:
				container->addString("AC3");
				break;
			case DDVD_DTS:
				container->addString("DTS");
				break;
			case DDVD_LPCM:
				container->addString("LPCM");
				break;
			}
			break;
		}
		case sUser + 7:
		{
			int spu_id;
			uint16_t spu_lang;
			ddvd_get_last_spu(m_ddvdconfig, &spu_id, &spu_lang);
	                eDebug("[eServiceDVD] getInfoObject sUser+7:  spu_id=%d lang=%X", spu_id, spu_lang);
			char spu_string[3] = {spu_lang >> 8, spu_lang, 0};
			if (spu_id == -1)
			{
				container->addInteger(0);
				container->addString("");
			}
			else
			{
				container->addInteger(spu_id + 1);
				container->addString(spu_string);
			}
			break;
		}
		case sUser + 8:
		{
			int current, num;
			ddvd_get_angle_info(m_ddvdconfig, &current, &num);
	                eDebug("[eServiceDVD] getInfoObject sUser+8:  angle=%d num=%X", current, num);
			container->addInteger(current);
			container->addInteger(num);
			break;
		}
		default:
			eDebug("[eServiceDVD] getInfoObject %d unsupported", w);
	}
	return retval;
}