|
1 /* |
|
2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: smilmediarendererinterface declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef SMILMEDIARENDERERINTERFACE_H |
|
21 #define SMILMEDIARENDERERINTERFACE_H |
|
22 |
|
23 #include <e32std.h> |
|
24 #include <gdi.h> |
|
25 |
|
26 #include <smiltime.h> |
|
27 #include <smilmediainterface.h> |
|
28 #include <smilfocusinterface.h> |
|
29 |
|
30 class CSmilTransitionFilter; |
|
31 |
|
32 /** |
|
33 * Interface for concrete media renderers. Each media |
|
34 * renderer class is responsible of playback of some |
|
35 * media type. |
|
36 */ |
|
37 class MSmilMediaRenderer |
|
38 { |
|
39 public: |
|
40 |
|
41 /** |
|
42 * Called by the engine to signal a renderer that the engine is |
|
43 * no more referencing it. Renderer may be deleted in this call. |
|
44 */ |
|
45 virtual void Close() = 0; |
|
46 |
|
47 /** |
|
48 * Returns TRUE if the media type is visual. Anything that draws |
|
49 * its content is visual media. Audio is an example of non-visual media. |
|
50 */ |
|
51 virtual TBool IsVisual() const = 0; |
|
52 |
|
53 /** |
|
54 * Returns TRUE if a visual media covers every pixel of its |
|
55 * drawing surface fully |
|
56 */ |
|
57 virtual TBool IsOpaque() const = 0; |
|
58 |
|
59 /** |
|
60 * Returns TRUE if a visual media is scrollable |
|
61 */ |
|
62 virtual TBool IsScrollable() const = 0; |
|
63 |
|
64 /** |
|
65 * Returns TRUE if the media renderer has care of updating its |
|
66 * drawing area itself, asynchronously to the SMIL engine. A video or |
|
67 * audio renderer might work like this. |
|
68 */ |
|
69 virtual TBool IsControl() const = 0; |
|
70 |
|
71 /** |
|
72 * Returns the intrinsic (unscaled) size of a visual media object in pixels. |
|
73 */ |
|
74 virtual TInt IntrinsicWidth() const = 0; |
|
75 |
|
76 /** |
|
77 * Returns the intrinsic (unscaled) size of a visual media object in pixels. |
|
78 */ |
|
79 virtual TInt IntrinsicHeight() const = 0; |
|
80 |
|
81 /** |
|
82 * Returns the intrinsic duration of a media object. This value can also be |
|
83 * Indefinite (for media that continues indefinitely, like repeating animation) |
|
84 * or Unresolved (for media that's length is not known, like streamed video). |
|
85 * Discrete media (like images) have intrinsic duration of zero. |
|
86 */ |
|
87 virtual TSmilTime IntrinsicDuration() const = 0; |
|
88 |
|
89 /** |
|
90 * Called by the engine to signal the renderer that the media is going to |
|
91 * be played soon (this might involve reserving some resource, opening |
|
92 * connections, decoding headers to find out intrinsic media values, etc) |
|
93 */ |
|
94 virtual void PrepareMediaL() = 0; |
|
95 |
|
96 |
|
97 /** |
|
98 * Called by the engine to seek media to given position |
|
99 * on its local timeline |
|
100 */ |
|
101 virtual void SeekMediaL(const TSmilTime& aTime) = 0; |
|
102 |
|
103 /** |
|
104 * Called by the engine to start media playback and to |
|
105 * make visual media visible. The playback is started from the current |
|
106 * position on the media timeline. |
|
107 */ |
|
108 virtual void ShowMediaL() = 0; |
|
109 |
|
110 /** |
|
111 * Called by the engine to stop the media playback and remove |
|
112 * visual media from the screen. Timeline can be reset. |
|
113 */ |
|
114 virtual void HideMedia() = 0; |
|
115 |
|
116 /** |
|
117 * Called by the engine to pause the media playback while keeping the |
|
118 * visual presentation (for example the current video frame) visible. |
|
119 */ |
|
120 virtual void FreezeMedia() = 0; |
|
121 |
|
122 /** |
|
123 * Called by the engine to continue the media playback after freeze |
|
124 */ |
|
125 virtual void ResumeMedia() = 0; |
|
126 |
|
127 |
|
128 /** |
|
129 * The engine calls this method to make a media renderer to |
|
130 * draw its content. The graphics context to draw to is passed as a |
|
131 * parameter. In addition, the exact rectangle that needs updating is |
|
132 * provided, relative to the graphics context. Renderer may use this |
|
133 * information to optimize drawing.All drawing must be performed |
|
134 * synchronously during this method call. |
|
135 * |
|
136 * Renderer should do the drawing using the transition filter passed as |
|
137 * a parameter and draw the focus indicator if needed. Both these |
|
138 * parameters may be null. |
|
139 */ |
|
140 virtual void Draw(CGraphicsContext& aGc, const TRect& aRect, CSmilTransitionFilter* aTransitionFilter, const MSmilFocus* aFocus) = 0; |
|
141 |
|
142 |
|
143 /** |
|
144 * Move scrollable media to given direction (-1=left/up, 1=down/right) |
|
145 */ |
|
146 virtual void Scroll(TInt aDirX, TInt aDirY) = 0; |
|
147 |
|
148 /** |
|
149 * Set volume of audio media (0-100). |
|
150 */ |
|
151 virtual void SetVolume(TInt aVolume) = 0; |
|
152 |
|
153 /** |
|
154 * Handle pointer events inside the renderer. If this method return ETrue |
|
155 * the event is consumed and not processed by the SMIL engine. If it returns |
|
156 * EFalse, the event is processed normally. |
|
157 */ |
|
158 virtual TBool ConsumePointerEventL(const TPointerEvent& /*aPointerEvent*/) {return EFalse;} |
|
159 |
|
160 |
|
161 }; |
|
162 |
|
163 |
|
164 #endif |