2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
24 #include "IDirectVobSub.h"
25 #include "IDirectVobSubXy.h"
26 #include "..\..\..\..\include\IFilterVersion.h"
29 class CDirectVobSub
: public IDirectVobSub2
, public IDirectVobSubXy
, public IFilterVersion
46 static const int REQUIRED_CONFIG_VERSION
= 39;
47 static const int CUR_SUPPORTED_FILTER_VERSION
= 39;
49 typedef DirectVobSubXyIntOptions::CachesInfo CachesInfo
;
50 typedef DirectVobSubXyIntOptions::ColorSpaceOpt ColorSpaceOpt
;
53 virtual ~CDirectVobSub();
56 UINT
GetCompatibleProfileInt(LPCTSTR lpszSection
, LPCTSTR lpszEntry
, int nDefault
);
61 int m_iSelectedLanguage
;
62 bool m_fHideSubtitles
;
63 bool m_fDoPreBuffering
;
65 int m_bt601Width
, m_bt601Height
;//for AUTO_GUESS
67 bool m_fOverridePlacement
;
68 int m_PlacementXperc
, m_PlacementYperc
;
69 bool m_fBufferVobSub
, m_fOnlyShowForcedVobSubs
, m_fPolygonize
;
70 CSimpleTextSubtitle::EPARCompensationType m_ePARCompensationType
;
72 static int const MAX_COLOR_SPACE
= 256;
73 ColorSpaceOpt m_outputColorSpace
[MAX_COLOR_SPACE
];
74 ColorSpaceOpt m_inputColorSpace
[MAX_COLOR_SPACE
];
78 bool m_fAdvancedRenderer
;
79 bool m_fFlipPicture
, m_fFlipSubtitles
;
81 int m_nReloaderDisableCount
;
82 int m_SubtitleDelay
, m_SubtitleSpeedMul
, m_SubtitleSpeedDiv
;
83 bool m_fMediaFPSEnabled
;
86 NORMALIZEDRECT m_ZoomRect
;
88 int m_supported_filter_verion
;
89 int m_config_info_version
;
91 CComPtr
<ISubClock
> m_pSubClock
;
94 int m_xy_int_opt
[DirectVobSubXyIntOptions::INT_COUNT
];
95 bool m_xy_bool_opt
[DirectVobSubXyIntOptions::BOOL_COUNT
];
96 ULONGLONG m_xy_ulonglong_opt
[DirectVobSubXyIntOptions::ULONGLONG_COUNT
];
101 STDMETHODIMP
XyGetBool (int field
, bool *value
);
102 STDMETHODIMP
XyGetInt (int field
, int *value
);
103 STDMETHODIMP
XyGetSize (int field
, SIZE
*value
);
104 STDMETHODIMP
XyGetRect (int field
, RECT
*value
);
105 STDMETHODIMP
XyGetUlonglong(int field
, ULONGLONG
*value
);
106 STDMETHODIMP
XyGetDouble (int field
, double *value
);
107 STDMETHODIMP
XyGetString (int field
, LPWSTR
*value
, int *chars
);
108 STDMETHODIMP
XyGetBin (int field
, LPVOID
*value
, int *size
);
110 STDMETHODIMP
XySetBool (int field
, bool value
);
111 STDMETHODIMP
XySetInt (int field
, int value
);
112 STDMETHODIMP
XySetSize (int field
, SIZE value
);
113 STDMETHODIMP
XySetRect (int field
, RECT value
);
114 STDMETHODIMP
XySetUlonglong(int field
, ULONGLONG value
);
115 STDMETHODIMP
XySetDouble (int field
, double value
);
116 STDMETHODIMP
XySetString (int field
, LPWSTR value
, int chars
);
117 STDMETHODIMP
XySetBin (int field
, LPVOID value
, int size
);
121 STDMETHODIMP
get_FileName(WCHAR
* fn
);
122 STDMETHODIMP
put_FileName(WCHAR
* fn
);
123 STDMETHODIMP
get_LanguageCount(int* nLangs
);
124 STDMETHODIMP
get_LanguageName(int iLanguage
, WCHAR
** ppName
);
125 STDMETHODIMP
get_SelectedLanguage(int* iSelected
);
126 STDMETHODIMP
put_SelectedLanguage(int iSelected
);
127 STDMETHODIMP
get_HideSubtitles(bool* fHideSubtitles
);
128 STDMETHODIMP
put_HideSubtitles(bool fHideSubtitles
);
129 STDMETHODIMP
get_PreBuffering(bool* fDoPreBuffering
);
130 STDMETHODIMP
put_PreBuffering(bool fDoPreBuffering
);
133 STDMETHODIMP
get_SubPictToBuffer(unsigned int* uSubPictToBuffer
)
137 STDMETHODIMP
put_SubPictToBuffer(unsigned int uSubPictToBuffer
)
141 STDMETHODIMP
get_AnimWhenBuffering(bool* fAnimWhenBuffering
)
145 STDMETHODIMP
put_AnimWhenBuffering(bool fAnimWhenBuffering
)
149 STDMETHODIMP
get_Placement(bool* fOverridePlacement
, int* xperc
, int* yperc
);
150 STDMETHODIMP
put_Placement(bool fOverridePlacement
, int xperc
, int yperc
);
151 STDMETHODIMP
get_VobSubSettings(bool* fBuffer
, bool* fOnlyShowForcedSubs
, bool* fPolygonize
);
152 STDMETHODIMP
put_VobSubSettings(bool fBuffer
, bool fOnlyShowForcedSubs
, bool fPolygonize
);
153 STDMETHODIMP
get_TextSettings(void* lf
, int lflen
, COLORREF
* color
, bool* fShadow
, bool* fOutline
, bool* fAdvancedRenderer
);
154 STDMETHODIMP
put_TextSettings(void* lf
, int lflen
, COLORREF color
, bool fShadow
, bool fOutline
, bool fAdvancedRenderer
);
155 STDMETHODIMP
get_Flip(bool* fPicture
, bool* fSubtitles
);
156 STDMETHODIMP
put_Flip(bool fPicture
, bool fSubtitles
);
157 STDMETHODIMP
get_OSD(bool* fShowOSD
);
158 STDMETHODIMP
put_OSD(bool fShowOSD
);
159 STDMETHODIMP
get_SaveFullPath(bool* fSaveFullPath
);
160 STDMETHODIMP
put_SaveFullPath(bool fSaveFullPath
);
161 STDMETHODIMP
get_SubtitleTiming(int* delay
, int* speedmul
, int* speeddiv
);
162 STDMETHODIMP
put_SubtitleTiming(int delay
, int speedmul
, int speeddiv
);
163 STDMETHODIMP
get_MediaFPS(bool* fEnabled
, double* fps
);
164 STDMETHODIMP
put_MediaFPS(bool fEnabled
, double fps
);
165 STDMETHODIMP
get_ZoomRect(NORMALIZEDRECT
* rect
);
166 STDMETHODIMP
put_ZoomRect(NORMALIZEDRECT
* rect
);
167 STDMETHODIMP
get_ColorFormat(int* iPosition
) {return E_NOTIMPL
;}
168 STDMETHODIMP
put_ColorFormat(int iPosition
) {return E_NOTIMPL
;}
170 STDMETHOD (get_CachesInfo
)(CachesInfo
* caches_info
);
172 STDMETHODIMP
UpdateRegistry();
174 STDMETHODIMP
HasConfigDialog(int iSelected
);
175 STDMETHODIMP
ShowConfigDialog(int iSelected
, HWND hWndParent
);
177 // settings for the rest are stored in the registry
179 STDMETHODIMP
IsSubtitleReloaderLocked(bool* fLocked
);
180 STDMETHODIMP
LockSubtitleReloader(bool fLock
);
181 STDMETHODIMP
get_SubtitleReloader(bool* fDisabled
);
182 STDMETHODIMP
put_SubtitleReloader(bool fDisable
);
184 // the followings need a partial or full reloading of the filter
186 STDMETHODIMP
get_ExtendPicture(int* horizontal
, int* vertical
, int* resx2
, int* resx2minw
, int* resx2minh
);
187 STDMETHODIMP
put_ExtendPicture(int horizontal
, int vertical
, int resx2
, int resx2minw
, int resx2minh
);
188 STDMETHODIMP
get_LoadSettings(int* level
, bool* fExternalLoad
, bool* fWebLoad
, bool* fEmbeddedLoad
);
189 STDMETHODIMP
put_LoadSettings(int level
, bool fExternalLoad
, bool fWebLoad
, bool fEmbeddedLoad
);
193 STDMETHODIMP
AdviseSubClock(ISubClock
* pSubClock
);
194 STDMETHODIMP_(bool) get_Forced();
195 STDMETHODIMP
put_Forced(bool fForced
);
196 STDMETHODIMP
get_TextSettings(STSStyle
* pDefStyle
);
197 STDMETHODIMP
put_TextSettings(STSStyle
* pDefStyle
);
198 STDMETHODIMP
get_AspectRatioSettings(CSimpleTextSubtitle::EPARCompensationType
* ePARCompensationType
);
199 STDMETHODIMP
put_AspectRatioSettings(CSimpleTextSubtitle::EPARCompensationType
* ePARCompensationType
);
203 STDMETHODIMP_(DWORD
) GetFilterVersion();