sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef MMFVIDEOSUBTITLECUSTOMCOMMANDS_H
|
sl@0
|
17 |
#define MMFVIDEOSUBTITLECUSTOMCOMMANDS_H
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <mmf/common/mmfcontroller.h>
|
sl@0
|
20 |
#include <mmf/common/mmfvideo.h>
|
sl@0
|
21 |
#include <gdi.h>
|
sl@0
|
22 |
#include <w32std.h>
|
sl@0
|
23 |
|
sl@0
|
24 |
/**
|
sl@0
|
25 |
* Unique identifier for subtitle custom command interface
|
sl@0
|
26 |
* @publishedPartner
|
sl@0
|
27 |
* @prototype
|
sl@0
|
28 |
*/
|
sl@0
|
29 |
const TUid KUidInterfaceMMFVideoPlaySubtitleSupport = {0x10285C9D};
|
sl@0
|
30 |
|
sl@0
|
31 |
/**
|
sl@0
|
32 |
* Identifier for subtitle message Crp Ready, used by AviController to indicate
|
sl@0
|
33 |
* the CRP is ready to be drawn.
|
sl@0
|
34 |
* @publishedPartner
|
sl@0
|
35 |
* @prototype
|
sl@0
|
36 |
*/
|
sl@0
|
37 |
const TUid KMMFEventCategoryVideoSubtitleCrpReady = {0x10285C9E};
|
sl@0
|
38 |
|
sl@0
|
39 |
/**
|
sl@0
|
40 |
* Class encapsulates all window information required for DevSubtitle to initialize the CRP.
|
sl@0
|
41 |
* @publishedPartner
|
sl@0
|
42 |
* @prototype
|
sl@0
|
43 |
* This class is used to send subtitle window client configuration to controller
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
class TMMFSubtitleWindowConfig
|
sl@0
|
46 |
{
|
sl@0
|
47 |
public:
|
sl@0
|
48 |
/** Window unique identifier */
|
sl@0
|
49 |
TInt iWindowId;
|
sl@0
|
50 |
|
sl@0
|
51 |
/** Video window clip rectangle */
|
sl@0
|
52 |
TRect iWindowClipRect;
|
sl@0
|
53 |
|
sl@0
|
54 |
/** Video window display mode */
|
sl@0
|
55 |
TDisplayMode iDisplayMode;
|
sl@0
|
56 |
|
sl@0
|
57 |
/** Video rotation angle */
|
sl@0
|
58 |
TVideoRotation iRotation;
|
sl@0
|
59 |
};
|
sl@0
|
60 |
|
sl@0
|
61 |
/**
|
sl@0
|
62 |
* @publishedPartner
|
sl@0
|
63 |
* @prototype
|
sl@0
|
64 |
*
|
sl@0
|
65 |
* Mixin class for subtitle custom commands implemented by the controller. The custom
|
sl@0
|
66 |
* command parser calls methods in this class to deliver the requests to the
|
sl@0
|
67 |
* controller.
|
sl@0
|
68 |
*/
|
sl@0
|
69 |
class MMMFVideoPlaySubtitleSupportCustomCommandImplementor
|
sl@0
|
70 |
{
|
sl@0
|
71 |
public:
|
sl@0
|
72 |
/**
|
sl@0
|
73 |
* Gets the CRP parameters associated with a display
|
sl@0
|
74 |
*
|
sl@0
|
75 |
* @param aWindowId Unique identifier of the window.
|
sl@0
|
76 |
* @param aId Return the CRP id associated with the given display id
|
sl@0
|
77 |
* @param aCrpRect Return the subtitle region for drawing the CRP
|
sl@0
|
78 |
*/
|
sl@0
|
79 |
virtual void MvpsusGetCrpParametersL(TInt aWindowId, TWsGraphicId& aId, TRect& aCrpRect) = 0;
|
sl@0
|
80 |
|
sl@0
|
81 |
/**
|
sl@0
|
82 |
* Adds subtitle configuration data for a window.
|
sl@0
|
83 |
*
|
sl@0
|
84 |
* @param aConfig Subtitle configuration data for a window.
|
sl@0
|
85 |
*/
|
sl@0
|
86 |
virtual void MvpsusAddSubtitleConfigL(const TMMFSubtitleWindowConfig& aConfig) = 0;
|
sl@0
|
87 |
|
sl@0
|
88 |
/**
|
sl@0
|
89 |
* Removes the subtitle configuration data associated with the given window.
|
sl@0
|
90 |
*
|
sl@0
|
91 |
* @param aWindowId Unique identifier of the window associated with the
|
sl@0
|
92 |
* configuration data being removed.
|
sl@0
|
93 |
*/
|
sl@0
|
94 |
virtual void MvpsusRemoveSubtitleConfigL(TInt aWindowId) = 0;
|
sl@0
|
95 |
|
sl@0
|
96 |
/**
|
sl@0
|
97 |
* Reconfigures the subtitle configuration.
|
sl@0
|
98 |
*
|
sl@0
|
99 |
* @param aConfig Subtitle configuration data for a window.
|
sl@0
|
100 |
*/
|
sl@0
|
101 |
virtual void MvpsusUpdateSubtitleConfigL(const TMMFSubtitleWindowConfig& aConfig) = 0;
|
sl@0
|
102 |
|
sl@0
|
103 |
/**
|
sl@0
|
104 |
* Checks if subtitles are available in the current video stream.
|
sl@0
|
105 |
*
|
sl@0
|
106 |
* @param aAvailable When this method returns, this is set the ETrue if the
|
sl@0
|
107 |
* current video stream subtitles.
|
sl@0
|
108 |
* @leave KErrNotSupported if the controller does not support subtitles. Otherwise
|
sl@0
|
109 |
* another system-wide error code.
|
sl@0
|
110 |
*/
|
sl@0
|
111 |
virtual void MvpsusGetSubtitlesAvailableL(TBool& aAvailable) = 0;
|
sl@0
|
112 |
|
sl@0
|
113 |
/**
|
sl@0
|
114 |
* Disables subtitles during video playback.
|
sl@0
|
115 |
*
|
sl@0
|
116 |
* @leave System wide error code
|
sl@0
|
117 |
*/
|
sl@0
|
118 |
virtual void MvpsusDisableSubtitlesL() = 0;
|
sl@0
|
119 |
|
sl@0
|
120 |
/**
|
sl@0
|
121 |
* Enables subtitles during video playback.
|
sl@0
|
122 |
*
|
sl@0
|
123 |
* @leave KErrNotSupported if subtitles are not supported
|
sl@0
|
124 |
* @leave KErrNotFound if subtitle data is not found
|
sl@0
|
125 |
* @leave Otherwise leaves with any of the system wide error codes.
|
sl@0
|
126 |
*/
|
sl@0
|
127 |
virtual void MvpsusEnableSubtitlesL() = 0;
|
sl@0
|
128 |
|
sl@0
|
129 |
/**
|
sl@0
|
130 |
* Gets the current subtitle language
|
sl@0
|
131 |
*
|
sl@0
|
132 |
* @param aLanguage When this method returns, this is set the the current subtitle language.
|
sl@0
|
133 |
* @leave KErrNotSupported The enabled subtitle does not contain language
|
sl@0
|
134 |
* information.
|
sl@0
|
135 |
* @leave Otherwise leaves with any of the system wide error codes.
|
sl@0
|
136 |
*/
|
sl@0
|
137 |
virtual void MvpsusGetSubtitleLanguageL(TLanguage& aLanguage) = 0;
|
sl@0
|
138 |
|
sl@0
|
139 |
/**
|
sl@0
|
140 |
* Gets array of all supported languages that are available in the current
|
sl@0
|
141 |
* video player.
|
sl@0
|
142 |
*
|
sl@0
|
143 |
* @param aAvailable When this function returns, this array will hold the
|
sl@0
|
144 |
* supported languages.
|
sl@0
|
145 |
* @leave KErrNotSupported The enabled subtitle does not contain language
|
sl@0
|
146 |
* information
|
sl@0
|
147 |
* @leave Otherwise leaves with any of the system wide error codes.
|
sl@0
|
148 |
*/
|
sl@0
|
149 |
virtual void MvpsusGetSupportedSubtitleLanguagesL(RArray<TLanguage>& aAvailable) = 0;
|
sl@0
|
150 |
|
sl@0
|
151 |
/**
|
sl@0
|
152 |
* Sets the current subtitle language
|
sl@0
|
153 |
*
|
sl@0
|
154 |
* @param aLanguage Language to be used for subtitle stream.
|
sl@0
|
155 |
* @leave KErrNotSupported The enabled subtitle does not support the requested
|
sl@0
|
156 |
* language.
|
sl@0
|
157 |
* @leave Otherwise leaves with any of the system wide error codes.
|
sl@0
|
158 |
*/
|
sl@0
|
159 |
virtual void MvpsusSetSubtitleLanguageL(TLanguage aLanguage) = 0;
|
sl@0
|
160 |
};
|
sl@0
|
161 |
|
sl@0
|
162 |
/**
|
sl@0
|
163 |
* @publishedPartner
|
sl@0
|
164 |
* @prototype
|
sl@0
|
165 |
*
|
sl@0
|
166 |
* Custom command parser class to be used by controller plugins wishing to support
|
sl@0
|
167 |
* custom subtitle commands in a video play controller.
|
sl@0
|
168 |
*
|
sl@0
|
169 |
* The controller plugin must be derived from
|
sl@0
|
170 |
* MMMFVideoPlaySubtitleSupportCustomCommandImplementor to use this class. The
|
sl@0
|
171 |
* controller plugin should create an object of this type and add it to the list of
|
sl@0
|
172 |
* custom command parsers in the controller framework.
|
sl@0
|
173 |
*
|
sl@0
|
174 |
* @see MMMFVideoPlaySubtitleSupportCustomCommandImplementor
|
sl@0
|
175 |
* @see RMMFVideoPlaySubtitleSupportCustomCommands
|
sl@0
|
176 |
*/
|
sl@0
|
177 |
class CMMFVideoPlaySubtitleSupportCustomCommandParser : public CMMFCustomCommandParserBase
|
sl@0
|
178 |
{
|
sl@0
|
179 |
public:
|
sl@0
|
180 |
IMPORT_C static CMMFVideoPlaySubtitleSupportCustomCommandParser* NewL(MMMFVideoPlaySubtitleSupportCustomCommandImplementor& aImplementor);
|
sl@0
|
181 |
IMPORT_C ~CMMFVideoPlaySubtitleSupportCustomCommandParser();
|
sl@0
|
182 |
void HandleRequest(TMMFMessage& aMessage);
|
sl@0
|
183 |
|
sl@0
|
184 |
private:
|
sl@0
|
185 |
CMMFVideoPlaySubtitleSupportCustomCommandParser(MMMFVideoPlaySubtitleSupportCustomCommandImplementor& aImplementor);
|
sl@0
|
186 |
|
sl@0
|
187 |
void DoHandleRequestL(TMMFMessage& aMessage);
|
sl@0
|
188 |
|
sl@0
|
189 |
void DoAddSubtitleConfigL(TMMFMessage& aMessage);
|
sl@0
|
190 |
void DoRemoveSubtitleConfigL(TMMFMessage& aMessage);
|
sl@0
|
191 |
void DoUpdateSubtitleConfigL(TMMFMessage& aMessage);
|
sl@0
|
192 |
void DoGetSubtitlesAvailableL(TMMFMessage& aMessage);
|
sl@0
|
193 |
void DoDisableSubtitlesL(TMMFMessage& aMessage);
|
sl@0
|
194 |
void DoEnableSubtitlesL(TMMFMessage& aMessage);
|
sl@0
|
195 |
void DoGetSupportedLanguagesDataL(TMMFMessage& aMessage);
|
sl@0
|
196 |
void DoGetSupportedLanguagesCountL(TMMFMessage& aMessage);
|
sl@0
|
197 |
void DoGetSubtitleLanguageL(TMMFMessage& aMessage);
|
sl@0
|
198 |
void DoSetSubtitleLanguageL(TMMFMessage& aMessage);
|
sl@0
|
199 |
void DoGetCrpParametersL(TMMFMessage& aMessage);
|
sl@0
|
200 |
|
sl@0
|
201 |
private:
|
sl@0
|
202 |
MMMFVideoPlaySubtitleSupportCustomCommandImplementor& iImplementor;
|
sl@0
|
203 |
RArray<TLanguage> iAvailableLanguages;
|
sl@0
|
204 |
};
|
sl@0
|
205 |
|
sl@0
|
206 |
/**
|
sl@0
|
207 |
* @publishedPartner
|
sl@0
|
208 |
* @prototype
|
sl@0
|
209 |
*
|
sl@0
|
210 |
* Client class to access functionality specific to a subtitle supported playback
|
sl@0
|
211 |
* controller. The class uses the custom command function of the controller plugin,
|
sl@0
|
212 |
* and removes the necessity for the client to formulate the custom commands.
|
sl@0
|
213 |
*/
|
sl@0
|
214 |
class RMMFVideoPlaySubtitleSupportCustomCommands : public RMMFCustomCommandsBase
|
sl@0
|
215 |
{
|
sl@0
|
216 |
public:
|
sl@0
|
217 |
|
sl@0
|
218 |
IMPORT_C RMMFVideoPlaySubtitleSupportCustomCommands(RMMFController& aController);
|
sl@0
|
219 |
IMPORT_C TInt AddSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig);
|
sl@0
|
220 |
IMPORT_C TInt RemoveSubtitleConfig(TInt aWindowId);
|
sl@0
|
221 |
IMPORT_C TInt UpdateSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig);
|
sl@0
|
222 |
IMPORT_C TInt GetSubtitlesAvailable(TBool& aAvailable);
|
sl@0
|
223 |
IMPORT_C TInt DisableSubtitles();
|
sl@0
|
224 |
IMPORT_C TInt EnableSubtitles();
|
sl@0
|
225 |
IMPORT_C TInt GetCrpParameters(TInt aWindowId, TWsGraphicId& aId, TRect& aCrpRect);
|
sl@0
|
226 |
IMPORT_C TInt GetSubtitleLanguage(TLanguage& aLanguage);
|
sl@0
|
227 |
IMPORT_C void GetSupportedSubtitleLanguagesL(RArray<TLanguage>& aSubtitleLanguages);
|
sl@0
|
228 |
IMPORT_C TInt SetSubtitleLanguage(TLanguage aSubtitleLanguage);
|
sl@0
|
229 |
};
|
sl@0
|
230 |
|
sl@0
|
231 |
#endif // MMFVIDEOSUBTITLECUSTOMCOMMANDS_H
|