1 /* |
|
2 * Copyright (c) 2006-2007 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IRMEDIAENGINEINTERFACE_H |
|
20 #define IRMEDIAENGINEINTERFACE_H |
|
21 |
|
22 #include <ecom.h> |
|
23 #include <mdaaudiooutputstream.h> |
|
24 |
|
25 class CIRCtrlCmdObserver; |
|
26 class TConfig; |
|
27 |
|
28 // UID of this interface |
|
29 const TUid KMediaEngineInterfaceUid = {0x200087E8}; |
|
30 |
|
31 //========================================class declaration CIRMediaEngineInterface============================================ |
|
32 |
|
33 /** |
|
34 * |
|
35 * This is interface class for media engine, This has pure virtual function |
|
36 * which the player implementation in the media engine should have. The default |
|
37 * data typically can be mime type like audio/mpeg etc. |
|
38 * It has virtual implementation like |
|
39 * Play() for play implementation |
|
40 * Stop() for stop implemtation |
|
41 * SetVolume(TInt aVolume) for setting implementation |
|
42 * Volume() for setting the volume |
|
43 * MaxVolume() for setting the maximum volume |
|
44 * BufferFilled() is call back to intimate buffer is filled |
|
45 * Intialize(TConfig& ,TUint8* ,CIRCtrlCmdObserver* ) |
|
46 * TConfig is structure the congfiguration data if required is supposed to pass |
|
47 * by this way, TUint8* refers to buffer and CIRCtrlCmdObserver* is instance to |
|
48 * CIRCtrlCmdObserver defined in IRCommandChannel.lib |
|
49 * and also functions like StopPlayerBuffering() and StartPlayerBuffering() to |
|
50 * start and stop buffering. |
|
51 * |
|
52 */ |
|
53 |
|
54 |
|
55 class CIRMediaEngineInterface : public CBase |
|
56 { |
|
57 //Member Function |
|
58 public: |
|
59 |
|
60 /** |
|
61 * Function : NewL |
|
62 * function to creates an instance of CIRMediaEngineInterface |
|
63 * Two phase constructor |
|
64 * @param matching string |
|
65 */ |
|
66 static CIRMediaEngineInterface* NewL(const TDesC8& aMatchString); |
|
67 |
|
68 /** |
|
69 * Function : ~CIRMediaEngineInterface |
|
70 * Default Destructor |
|
71 */ |
|
72 ~CIRMediaEngineInterface(); |
|
73 |
|
74 // Pure interface method |
|
75 |
|
76 /** |
|
77 * Function : Play |
|
78 * function to which intiate the player |
|
79 */ |
|
80 virtual void Play() = 0; |
|
81 |
|
82 /** |
|
83 * Function : Stop |
|
84 * function to which stop the player |
|
85 */ |
|
86 virtual void Stop() = 0; |
|
87 |
|
88 /** |
|
89 * Function : SetVolume |
|
90 * function to set the volume |
|
91 * @param integer level of volume is the input |
|
92 */ |
|
93 virtual void SetVolume(TInt aVolume) = 0; |
|
94 |
|
95 /** |
|
96 * Function : Volume |
|
97 * function to returns the volume, integer level of voume is the Output |
|
98 * @return integer value is the Output |
|
99 */ |
|
100 virtual TInt Volume() const = 0; |
|
101 |
|
102 /** |
|
103 * Function : MaxVolume |
|
104 * function to returns the maximum volume |
|
105 * @return integer value is the Output |
|
106 */ |
|
107 virtual TInt MaxVolume() const = 0; |
|
108 |
|
109 /** |
|
110 * Function: Intialize |
|
111 * Set the codec type and sampling rate channel of stream |
|
112 * This is set to initial settings which is required to start the player |
|
113 * @param configuration infomation and instance of stream source |
|
114 * @param instance of data buffer, whose size is defined in IRMediaEngineBuffer.h |
|
115 * @param instance of the channel through with information is sent to UI |
|
116 */ |
|
117 virtual void Intialize(TConfig& aConfig,TUint8* aInitParams,CIRCtrlCmdObserver* aChannel) = 0; |
|
118 |
|
119 /** |
|
120 * Function: BufferFilled |
|
121 * Function which is called when network gets the buffer filled with data |
|
122 */ |
|
123 virtual void BufferFilled() = 0; |
|
124 |
|
125 /** |
|
126 * Function: StopPlayerBuffering |
|
127 * Function is used to stop bufferring |
|
128 */ |
|
129 virtual void StopPlayerBuffering() = 0; |
|
130 |
|
131 /** |
|
132 * Function: GetAudioPlayer() |
|
133 * Function is used to Return the Current Audio Player |
|
134 */ |
|
135 virtual CMdaAudioOutputStream* GetAudioPlayer() = 0; |
|
136 //Data Members |
|
137 protected: |
|
138 //Default c'tor |
|
139 inline CIRMediaEngineInterface(); |
|
140 |
|
141 protected: |
|
142 |
|
143 /* Size of a play buffer. */ |
|
144 TInt iPlayBufferSize; |
|
145 |
|
146 /* Total size of input buffer(s). */ |
|
147 TInt iInputBufferSize; |
|
148 |
|
149 /* Offset address of the buffers. */ |
|
150 TInt iBufferOffset; |
|
151 |
|
152 /* The level of current volume */ |
|
153 TInt iCurrentVolume; |
|
154 |
|
155 private: |
|
156 // Unique instance identifier key |
|
157 TUid iDtor_ID_Key; |
|
158 }; |
|
159 |
|
160 #include "irmediaengineinterface.inl" |
|
161 |
|
162 #endif//IRMEDIAENGINEINTERFACE_H |
|
163 |
|