|
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 #ifndef CMCEMEDIASINK_H |
|
20 #define CMCEMEDIASINK_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <badesca.h> |
|
25 |
|
26 // DATA TYPES |
|
27 typedef TUint TMceSinkType; |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class TMceSinkFactory; |
|
31 class CMceMediaStream; |
|
32 class TMceIds; |
|
33 class TMceEvent; |
|
34 class TMceMediaId; |
|
35 class CMceManager; |
|
36 |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Base class for the MCE media sinks. |
|
42 * |
|
43 * Media sinks represent the destination of data. |
|
44 * CMceMediaSink gets it data from CMceMediaSource through |
|
45 * CMceMediaStream. |
|
46 * |
|
47 * CMceMediaSink has a type that defines how it can connected to other |
|
48 * sources and streams. |
|
49 * |
|
50 * Enable and Disable operations to sinks are considered to be local, |
|
51 * so they are not signalled to remote terminal. |
|
52 * |
|
53 * @lib mceclient.lib |
|
54 */ |
|
55 class CMceMediaSink: public CBase |
|
56 { |
|
57 |
|
58 public: // Destructor |
|
59 |
|
60 IMPORT_C ~CMceMediaSink(); |
|
61 |
|
62 public: // Functions |
|
63 |
|
64 /** |
|
65 * Returns the type of the sink. |
|
66 * @return The type of the sink. |
|
67 */ |
|
68 IMPORT_C TMceSinkType Type() const; |
|
69 |
|
70 /** |
|
71 * Enables streaming explicitly. |
|
72 */ |
|
73 virtual void EnableL() = 0; |
|
74 |
|
75 /** |
|
76 * Disables streaming explicitly. |
|
77 */ |
|
78 virtual void DisableL() = 0; |
|
79 |
|
80 /** |
|
81 * Returns the state of the sink. |
|
82 * @return ETrue if enabled, EFalse if disabled. |
|
83 */ |
|
84 IMPORT_C TBool IsEnabled() const; |
|
85 |
|
86 public: //internal |
|
87 |
|
88 /** |
|
89 * Initializes |
|
90 * @param aParent the parent |
|
91 */ |
|
92 virtual void InitializeL( CMceMediaStream& aParent ); |
|
93 |
|
94 /** |
|
95 * Initializes |
|
96 * @param aManager the manager. Ownership is NOT transferred |
|
97 */ |
|
98 virtual void InitializeL( CMceManager* aManager ); |
|
99 |
|
100 /** |
|
101 * Sets and gets reference count describing to how many |
|
102 * streams sink is associated |
|
103 * @return reference count reference |
|
104 */ |
|
105 TInt& ReferenceCount(); |
|
106 |
|
107 protected: |
|
108 |
|
109 /** |
|
110 * C++ default constructor. |
|
111 */ |
|
112 CMceMediaSink(); |
|
113 |
|
114 /** |
|
115 * Enables streaming explicitly. |
|
116 */ |
|
117 void DoEnableL(); |
|
118 |
|
119 /** |
|
120 * Disables streaming explicitly. |
|
121 */ |
|
122 void DoDisableL(); |
|
123 |
|
124 |
|
125 protected: // NOT owned data |
|
126 |
|
127 /** |
|
128 * stream |
|
129 */ |
|
130 CMceMediaStream* iStream; |
|
131 |
|
132 public: // stub data |
|
133 |
|
134 TMceSinkType iType; |
|
135 |
|
136 TBool iIsEnabled; |
|
137 |
|
138 TInt iReferenceCount; |
|
139 |
|
140 }; |
|
141 |
|
142 |
|
143 #endif |