Subtitles.cpp
资源名称:VC++视频传输.rar [点击查看]
上传用户:hxb_1234
上传日期:2010-03-30
资源大小:8328k
文件大小:2k
源码类别:
VC书籍
开发平台:
Visual C++
- /**************************************************************************************
- * *
- * *
- **************************************************************************************/
- #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;
- }