Subtitles.cpp
上传用户:tuheem
上传日期:2007-05-01
资源大小:21889k
文件大小:2k
- /**************************************************************************************
- * *
- * *
- **************************************************************************************/
- #include "Subtitles.h"
- MediaSubtitler::MediaSubtitler()
- {
- this->microDVDSubtitler = new MediaSubtitlerMicroDVD();
- this->subtitler = NULL;
- }
- MediaSubtitler::~MediaSubtitler()
- {
- delete this->microDVDSubtitler;
- }
- media_type_t MediaSubtitler::GetType()
- {
- return MEDIA_TYPE_SUBTITLER;
- }
- char *MediaSubtitler::GetName()
- {
- if(this->subtitler) {
- return this->subtitler->GetName();
- }
- return "Subtitler Wrapper";
- }
- MP_RESULT MediaSubtitler::Connect(MediaItem *item)
- {
- if(this->subtitler)
- return this->subtitler->Connect(item);
- return MP_RESULT_ERROR;
- }
- MP_RESULT MediaSubtitler::ReleaseConnections()
- {
- if(this->subtitler)
- return this->subtitler->ReleaseConnections();
- return MP_RESULT_ERROR;
- }
- DWORD MediaSubtitler::GetCaps()
- {
- return 0;
- }
- MP_RESULT MediaSubtitler::Configure(HINSTANCE hInstance, HWND hwnd)
- {
- return MP_RESULT_ERROR;
- }
- MP_RESULT MediaSubtitler::Open(char *lpFilename)
- {
- if(this->microDVDSubtitler->Open(lpFilename) == MP_RESULT_OK) {
- this->subtitler = (MediaItemSubtitler *) this->microDVDSubtitler;
- return MP_RESULT_OK;
- }
- return MP_RESULT_ERROR;
- }
- subtitles_t *MediaSubtitler::GetSubtitles(DWORD frameNumber)
- {
- if(this->subtitler)
- return this->subtitler->GetSubtitles(frameNumber);
- return NULL;
- }
- MP_RESULT MediaSubtitler::Close()
- {
- if(this->subtitler)
- return this->subtitler->Close();
- return MP_RESULT_ERROR;
- }