|
1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CMCECOMAVSINK_H |
|
22 #define CMCECOMAVSINK_H |
|
23 |
|
24 #include <e32std.h> |
|
25 #include "mcecommediasink.h" |
|
26 #include "mcecomendpointproxy.h" |
|
27 |
|
28 /** |
|
29 * |
|
30 * |
|
31 * @lib |
|
32 */ |
|
33 NONSHARABLE_CLASS( CMceComAvSink ) : public CMceComMediaSink, |
|
34 public MMceComEndPointProxy |
|
35 |
|
36 { |
|
37 |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Constructor |
|
42 */ |
|
43 static CMceComAvSink* NewL(); |
|
44 |
|
45 /** |
|
46 * Constructor |
|
47 */ |
|
48 static CMceComAvSink* NewLC(); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 ~CMceComAvSink(); |
|
54 |
|
55 public: // from CMceComMediaSink |
|
56 |
|
57 /** |
|
58 * Internalizes flat data |
|
59 * @param aReadStream read stream |
|
60 */ |
|
61 void InternalizeFlatL( RReadStream& aReadStream ); |
|
62 |
|
63 /** |
|
64 * Externalizes flat data |
|
65 * @param aWriteStream write stream |
|
66 */ |
|
67 void ExternalizeFlatL( RWriteStream& aWriteStream ); |
|
68 |
|
69 /** |
|
70 * Traversal event handler |
|
71 * @param aEvent the event |
|
72 * @return status, if event was consumed or not or object needs update |
|
73 */ |
|
74 TInt EventReceivedL( TMceComEvent& aEvent ); |
|
75 |
|
76 /** |
|
77 * Clones this object |
|
78 * @return the cloned object |
|
79 */ |
|
80 CMceComMediaSink* CloneL(); |
|
81 |
|
82 /** |
|
83 * Updates this object |
|
84 * @param aUpdate object updates this |
|
85 */ |
|
86 void UpdateL( CMceComMediaSink& aUpdate ); |
|
87 |
|
88 public: // from MMceComEndPointProxy |
|
89 |
|
90 /** |
|
91 * Does proxy serve client |
|
92 * @param aClient a client |
|
93 * @return ETrue, if proxy serves client |
|
94 */ |
|
95 TBool ServesProxyClient( const CMceComEndpoint& aClient ) const; |
|
96 |
|
97 /** |
|
98 * Adds client to proxy |
|
99 * @param aClient a client |
|
100 */ |
|
101 void AddProxyClientL( CMceComEndpoint& aClient ); |
|
102 |
|
103 /** |
|
104 * Removes client from proxy |
|
105 * @param aClient a client |
|
106 */ |
|
107 void RemoveProxyClient( CMceComEndpoint& aClient ); |
|
108 |
|
109 |
|
110 |
|
111 #ifdef MCE_COMMON_SERVER_SIDE |
|
112 |
|
113 /** |
|
114 * Returns mcc type for mcc endpoint |
|
115 * @return mcc type |
|
116 */ |
|
117 const TUid MccType(); |
|
118 |
|
119 /** |
|
120 * Returns init param for mcc endpoint |
|
121 * @return mcc type |
|
122 */ |
|
123 const TDesC8& InitParamL( const CMceComCodec& aCodec ); |
|
124 |
|
125 /** |
|
126 * Prepares this endpoint |
|
127 */ |
|
128 void PrepareL(); |
|
129 |
|
130 public: |
|
131 |
|
132 /** |
|
133 * Enables defined client |
|
134 * @return KMceSrvStreamDefaultSequence if client does not support |
|
135 * client enabling, otherwise returns KMceSrvStreamAlternativeSequence |
|
136 */ |
|
137 TBool ClientEnableL( CMceComEndpoint& aClient, const CMceComCodec& aCodec ); |
|
138 |
|
139 /** |
|
140 * Disables defined client |
|
141 * @return KMceSrvStreamDefaultSequence if client does not support |
|
142 * client disabling, otherwise returns KMceSrvStreamAlternativeSequence |
|
143 */ |
|
144 TBool ClientDisableL( CMceComEndpoint& aClient ); |
|
145 |
|
146 /** |
|
147 * Client wants to change settings |
|
148 * @param aClient a client |
|
149 * @param aParam parameter name |
|
150 * @param aValue parameter value |
|
151 * @return KMceSrvStreamDefaultSequence if client does not support |
|
152 * this setting, otherwise returns KMceSrvStreamAlternativeSequence |
|
153 */ |
|
154 TBool SetParameterL( const CMceComEndpoint& aClient, |
|
155 TUint32 aParam, |
|
156 const TDesC8& aValue ); |
|
157 |
|
158 |
|
159 #endif//MCE_COMMON_SERVER_SIDE |
|
160 |
|
161 protected: |
|
162 |
|
163 /** |
|
164 * C++ default constructor. |
|
165 */ |
|
166 CMceComAvSink(); |
|
167 |
|
168 |
|
169 public: // Data |
|
170 |
|
171 RPointerArray<CMceComEndpoint> iProxyClients; |
|
172 |
|
173 |
|
174 private: // Data |
|
175 |
|
176 HBufC8* iSettings; |
|
177 |
|
178 TInt iVolume; |
|
179 |
|
180 }; |
|
181 |
|
182 |
|
183 #endif //CMCECOMAVSINK_H |