Better external sub ordering
[xy_vsfilter.git] / src / filters / transform / vsfilter / DirectVobSub.h
blob87affe8794d100715db32a2ad8bbbdffcf9d81b7
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 CStringW m_xy_str_opt[DirectVobSubXyOptions::STRING_COUNT];
99 public:
101 // IDirectVobSubXy
103 STDMETHODIMP XyGetBool (int field, bool *value);
104 STDMETHODIMP XyGetInt (int field, int *value);
105 STDMETHODIMP XyGetSize (int field, SIZE *value);
106 STDMETHODIMP XyGetRect (int field, RECT *value);
107 STDMETHODIMP XyGetUlonglong(int field, ULONGLONG *value);
108 STDMETHODIMP XyGetDouble (int field, double *value);
109 STDMETHODIMP XyGetString (int field, LPWSTR *value, int *chars);
110 STDMETHODIMP XyGetBin (int field, LPVOID *value, int *size );
112 STDMETHODIMP XySetBool (int field, bool value);
113 STDMETHODIMP XySetInt (int field, int value);
114 STDMETHODIMP XySetSize (int field, SIZE value);
115 STDMETHODIMP XySetRect (int field, RECT value);
116 STDMETHODIMP XySetUlonglong(int field, ULONGLONG value);
117 STDMETHODIMP XySetDouble (int field, double value);
118 STDMETHODIMP XySetString (int field, LPWSTR value, int chars);
119 STDMETHODIMP XySetBin (int field, LPVOID value, int size );
121 // IDirectVobSub
123 STDMETHODIMP get_FileName(WCHAR* fn);
124 STDMETHODIMP put_FileName(WCHAR* fn);
125 STDMETHODIMP get_LanguageCount(int* nLangs);
126 STDMETHODIMP get_LanguageName(int iLanguage, WCHAR** ppName);
127 STDMETHODIMP get_SelectedLanguage(int* iSelected);
128 STDMETHODIMP put_SelectedLanguage(int iSelected);
129 STDMETHODIMP get_HideSubtitles(bool* fHideSubtitles);
130 STDMETHODIMP put_HideSubtitles(bool fHideSubtitles);
131 STDMETHODIMP get_PreBuffering(bool* fDoPreBuffering);
132 STDMETHODIMP put_PreBuffering(bool fDoPreBuffering);
135 STDMETHODIMP get_SubPictToBuffer(unsigned int* uSubPictToBuffer)
137 return E_NOTIMPL;
139 STDMETHODIMP put_SubPictToBuffer(unsigned int uSubPictToBuffer)
141 return E_NOTIMPL;
143 STDMETHODIMP get_AnimWhenBuffering(bool* fAnimWhenBuffering)
145 return E_NOTIMPL;
147 STDMETHODIMP put_AnimWhenBuffering(bool fAnimWhenBuffering)
149 return E_NOTIMPL;
151 STDMETHODIMP get_Placement(bool* fOverridePlacement, int* xperc, int* yperc);
152 STDMETHODIMP put_Placement(bool fOverridePlacement, int xperc, int yperc);
153 STDMETHODIMP get_VobSubSettings(bool* fBuffer, bool* fOnlyShowForcedSubs, bool* fPolygonize);
154 STDMETHODIMP put_VobSubSettings(bool fBuffer, bool fOnlyShowForcedSubs, bool fPolygonize);
155 STDMETHODIMP get_TextSettings(void* lf, int lflen, COLORREF* color, bool* fShadow, bool* fOutline, bool* fAdvancedRenderer);
156 STDMETHODIMP put_TextSettings(void* lf, int lflen, COLORREF color, bool fShadow, bool fOutline, bool fAdvancedRenderer);
157 STDMETHODIMP get_Flip(bool* fPicture, bool* fSubtitles);
158 STDMETHODIMP put_Flip(bool fPicture, bool fSubtitles);
159 STDMETHODIMP get_OSD(bool* fShowOSD);
160 STDMETHODIMP put_OSD(bool fShowOSD);
161 STDMETHODIMP get_SaveFullPath(bool* fSaveFullPath);
162 STDMETHODIMP put_SaveFullPath(bool fSaveFullPath);
163 STDMETHODIMP get_SubtitleTiming(int* delay, int* speedmul, int* speeddiv);
164 STDMETHODIMP put_SubtitleTiming(int delay, int speedmul, int speeddiv);
165 STDMETHODIMP get_MediaFPS(bool* fEnabled, double* fps);
166 STDMETHODIMP put_MediaFPS(bool fEnabled, double fps);
167 STDMETHODIMP get_ZoomRect(NORMALIZEDRECT* rect);
168 STDMETHODIMP put_ZoomRect(NORMALIZEDRECT* rect);
169 STDMETHODIMP get_ColorFormat(int* iPosition) {return E_NOTIMPL;}
170 STDMETHODIMP put_ColorFormat(int iPosition) {return E_NOTIMPL;}
172 STDMETHOD (get_CachesInfo)(CachesInfo* caches_info);
173 STDMETHOD (get_XyFlyWeightInfo)(XyFlyWeightInfo* xy_fw_info);
175 STDMETHODIMP UpdateRegistry();
177 STDMETHODIMP HasConfigDialog(int iSelected);
178 STDMETHODIMP ShowConfigDialog(int iSelected, HWND hWndParent);
180 // settings for the rest are stored in the registry
182 STDMETHODIMP IsSubtitleReloaderLocked(bool* fLocked);
183 STDMETHODIMP LockSubtitleReloader(bool fLock);
184 STDMETHODIMP get_SubtitleReloader(bool* fDisabled);
185 STDMETHODIMP put_SubtitleReloader(bool fDisable);
187 // the followings need a partial or full reloading of the filter
189 STDMETHODIMP get_ExtendPicture(int* horizontal, int* vertical, int* resx2, int* resx2minw, int* resx2minh);
190 STDMETHODIMP put_ExtendPicture(int horizontal, int vertical, int resx2, int resx2minw, int resx2minh);
191 STDMETHODIMP get_LoadSettings(int* level, bool* fExternalLoad, bool* fWebLoad, bool* fEmbeddedLoad);
192 STDMETHODIMP put_LoadSettings(int level, bool fExternalLoad, bool fWebLoad, bool fEmbeddedLoad);
194 // IDirectVobSub2
196 STDMETHODIMP AdviseSubClock(ISubClock* pSubClock);
197 STDMETHODIMP_(bool) get_Forced();
198 STDMETHODIMP put_Forced(bool fForced);
199 STDMETHODIMP get_TextSettings(STSStyle* pDefStyle);
200 STDMETHODIMP put_TextSettings(STSStyle* pDefStyle);
201 STDMETHODIMP get_AspectRatioSettings(CSimpleTextSubtitle::EPARCompensationType* ePARCompensationType);
202 STDMETHODIMP put_AspectRatioSettings(CSimpleTextSubtitle::EPARCompensationType* ePARCompensationType);
204 // IFilterVersion
206 STDMETHODIMP_(DWORD) GetFilterVersion();