Fix naming.
[xy_vsfilter.git] / src / filters / transform / vsfilter / DirectVobSub.h
blobb6a23312488fb3f72d3fa46aa92b126ca7d6bb8b
1 /*
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)
8 * any later version.
9 *
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
22 #pragma once
24 #include "IDirectVobSub.h"
25 #include "IDirectVobSubXy.h"
26 #include "..\..\..\..\include\IFilterVersion.h"
27 #include "version.h"
29 class CDirectVobSub : public IDirectVobSub2, public IDirectVobSubXy, public IFilterVersion
31 public:
32 enum ColorSpaceOption
34 YuvMatrix_AUTO = 0
35 ,BT_601
36 ,BT_709
37 ,GUESS
39 enum YuvRange
41 YuvRange_Auto = 0
42 ,YuvRange_TV
43 ,YuvRange_PC
46 static const int REQUIRED_CONFIG_VERSION = 39;
47 static const int CUR_SUPPORTED_FILTER_VERSION = 39;
49 typedef DirectVobSubXyOptions::CachesInfo CachesInfo;
50 typedef DirectVobSubXyOptions::XyFlyWeightInfo XyFlyWeightInfo;
51 typedef DirectVobSubXyOptions::ColorSpaceOpt ColorSpaceOpt;
52 protected:
53 CDirectVobSub();
54 virtual ~CDirectVobSub();
56 bool is_compatible();
57 UINT GetCompatibleProfileInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, int nDefault);
58 protected:
59 CCritSec m_propsLock;
61 CString m_FileName;
62 int m_iSelectedLanguage;
63 bool m_fHideSubtitles;
64 bool m_fDoPreBuffering;
66 int m_bt601Width, m_bt601Height;//for AUTO_GUESS
68 bool m_fOverridePlacement;
69 int m_PlacementXperc, m_PlacementYperc;
70 bool m_fBufferVobSub, m_fOnlyShowForcedVobSubs, m_fPolygonize;
71 CSimpleTextSubtitle::EPARCompensationType m_ePARCompensationType;
73 static int const MAX_COLOR_SPACE = 256;
74 ColorSpaceOpt m_outputColorSpace[MAX_COLOR_SPACE];
75 ColorSpaceOpt m_inputColorSpace[MAX_COLOR_SPACE];
77 STSStyle m_defStyle;
79 bool m_fAdvancedRenderer;
80 bool m_fFlipPicture, m_fFlipSubtitles;
81 bool m_fOSD;
82 int m_nReloaderDisableCount;
83 int m_SubtitleDelay, m_SubtitleSpeedMul, m_SubtitleSpeedDiv;
84 bool m_fMediaFPSEnabled;
85 double m_MediaFPS;
86 bool m_fSaveFullPath;
87 NORMALIZEDRECT m_ZoomRect;
89 int m_supported_filter_verion;
90 int m_config_info_version;
92 CComPtr<ISubClock> m_pSubClock;
93 bool m_fForced;
95 int m_xy_int_opt[DirectVobSubXyOptions::INT_COUNT];
96 bool m_xy_bool_opt[DirectVobSubXyOptions::BOOL_COUNT];
97 CSize m_xy_size_opt[DirectVobSubXyOptions::SIZE_COUNT];
98 public:
100 // IDirectVobSubXy
102 STDMETHODIMP XyGetBool (int field, bool *value);
103 STDMETHODIMP XyGetInt (int field, int *value);
104 STDMETHODIMP XyGetSize (int field, SIZE *value);
105 STDMETHODIMP XyGetRect (int field, RECT *value);
106 STDMETHODIMP XyGetUlonglong(int field, ULONGLONG *value);
107 STDMETHODIMP XyGetDouble (int field, double *value);
108 STDMETHODIMP XyGetString (int field, LPWSTR *value, int *chars);
109 STDMETHODIMP XyGetBin (int field, LPVOID *value, int *size );
111 STDMETHODIMP XySetBool (int field, bool value);
112 STDMETHODIMP XySetInt (int field, int value);
113 STDMETHODIMP XySetSize (int field, SIZE value);
114 STDMETHODIMP XySetRect (int field, RECT value);
115 STDMETHODIMP XySetUlonglong(int field, ULONGLONG value);
116 STDMETHODIMP XySetDouble (int field, double value);
117 STDMETHODIMP XySetString (int field, LPWSTR value, int chars);
118 STDMETHODIMP XySetBin (int field, LPVOID value, int size );
120 // IDirectVobSub
122 STDMETHODIMP get_FileName(WCHAR* fn);
123 STDMETHODIMP put_FileName(WCHAR* fn);
124 STDMETHODIMP get_LanguageCount(int* nLangs);
125 STDMETHODIMP get_LanguageName(int iLanguage, WCHAR** ppName);
126 STDMETHODIMP get_SelectedLanguage(int* iSelected);
127 STDMETHODIMP put_SelectedLanguage(int iSelected);
128 STDMETHODIMP get_HideSubtitles(bool* fHideSubtitles);
129 STDMETHODIMP put_HideSubtitles(bool fHideSubtitles);
130 STDMETHODIMP get_PreBuffering(bool* fDoPreBuffering);
131 STDMETHODIMP put_PreBuffering(bool fDoPreBuffering);
134 STDMETHODIMP get_SubPictToBuffer(unsigned int* uSubPictToBuffer)
136 return E_NOTIMPL;
138 STDMETHODIMP put_SubPictToBuffer(unsigned int uSubPictToBuffer)
140 return E_NOTIMPL;
142 STDMETHODIMP get_AnimWhenBuffering(bool* fAnimWhenBuffering)
144 return E_NOTIMPL;
146 STDMETHODIMP put_AnimWhenBuffering(bool fAnimWhenBuffering)
148 return E_NOTIMPL;
150 STDMETHODIMP get_Placement(bool* fOverridePlacement, int* xperc, int* yperc);
151 STDMETHODIMP put_Placement(bool fOverridePlacement, int xperc, int yperc);
152 STDMETHODIMP get_VobSubSettings(bool* fBuffer, bool* fOnlyShowForcedSubs, bool* fPolygonize);
153 STDMETHODIMP put_VobSubSettings(bool fBuffer, bool fOnlyShowForcedSubs, bool fPolygonize);
154 STDMETHODIMP get_TextSettings(void* lf, int lflen, COLORREF* color, bool* fShadow, bool* fOutline, bool* fAdvancedRenderer);
155 STDMETHODIMP put_TextSettings(void* lf, int lflen, COLORREF color, bool fShadow, bool fOutline, bool fAdvancedRenderer);
156 STDMETHODIMP get_Flip(bool* fPicture, bool* fSubtitles);
157 STDMETHODIMP put_Flip(bool fPicture, bool fSubtitles);
158 STDMETHODIMP get_OSD(bool* fShowOSD);
159 STDMETHODIMP put_OSD(bool fShowOSD);
160 STDMETHODIMP get_SaveFullPath(bool* fSaveFullPath);
161 STDMETHODIMP put_SaveFullPath(bool fSaveFullPath);
162 STDMETHODIMP get_SubtitleTiming(int* delay, int* speedmul, int* speeddiv);
163 STDMETHODIMP put_SubtitleTiming(int delay, int speedmul, int speeddiv);
164 STDMETHODIMP get_MediaFPS(bool* fEnabled, double* fps);
165 STDMETHODIMP put_MediaFPS(bool fEnabled, double fps);
166 STDMETHODIMP get_ZoomRect(NORMALIZEDRECT* rect);
167 STDMETHODIMP put_ZoomRect(NORMALIZEDRECT* rect);
168 STDMETHODIMP get_ColorFormat(int* iPosition) {return E_NOTIMPL;}
169 STDMETHODIMP put_ColorFormat(int iPosition) {return E_NOTIMPL;}
171 STDMETHOD (get_CachesInfo)(CachesInfo* caches_info);
172 STDMETHOD (get_XyFlyWeightInfo)(XyFlyWeightInfo* xy_fw_info);
174 STDMETHODIMP UpdateRegistry();
176 STDMETHODIMP HasConfigDialog(int iSelected);
177 STDMETHODIMP ShowConfigDialog(int iSelected, HWND hWndParent);
179 // settings for the rest are stored in the registry
181 STDMETHODIMP IsSubtitleReloaderLocked(bool* fLocked);
182 STDMETHODIMP LockSubtitleReloader(bool fLock);
183 STDMETHODIMP get_SubtitleReloader(bool* fDisabled);
184 STDMETHODIMP put_SubtitleReloader(bool fDisable);
186 // the followings need a partial or full reloading of the filter
188 STDMETHODIMP get_ExtendPicture(int* horizontal, int* vertical, int* resx2, int* resx2minw, int* resx2minh);
189 STDMETHODIMP put_ExtendPicture(int horizontal, int vertical, int resx2, int resx2minw, int resx2minh);
190 STDMETHODIMP get_LoadSettings(int* level, bool* fExternalLoad, bool* fWebLoad, bool* fEmbeddedLoad);
191 STDMETHODIMP put_LoadSettings(int level, bool fExternalLoad, bool fWebLoad, bool fEmbeddedLoad);
193 // IDirectVobSub2
195 STDMETHODIMP AdviseSubClock(ISubClock* pSubClock);
196 STDMETHODIMP_(bool) get_Forced();
197 STDMETHODIMP put_Forced(bool fForced);
198 STDMETHODIMP get_TextSettings(STSStyle* pDefStyle);
199 STDMETHODIMP put_TextSettings(STSStyle* pDefStyle);
200 STDMETHODIMP get_AspectRatioSettings(CSimpleTextSubtitle::EPARCompensationType* ePARCompensationType);
201 STDMETHODIMP put_AspectRatioSettings(CSimpleTextSubtitle::EPARCompensationType* ePARCompensationType);
203 // IFilterVersion
205 STDMETHODIMP_(DWORD) GetFilterVersion();