|
1 /* |
|
2 * Copyright (c) 2002-2006 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: CustomInterface Utility Proxy implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CustomInterfaceUtility.h" |
|
22 #include <ProxyCustomInterfaceUtility.h> |
|
23 #include "CustomCommandUtility.h" |
|
24 #include <sounddevice.h> |
|
25 #include <mdaaudioinputstream.h> |
|
26 #include <DrmAudioSamplePlayer.h> |
|
27 #include <videoplayer.h> |
|
28 #include <videorecorder.h> |
|
29 |
|
30 EXPORT_C CCustomInterfaceUtility* CCustomInterfaceUtility::NewL(CMdaAudioConvertUtility& aUtility) |
|
31 { |
|
32 CCustomCommandUtility* customCommandUtility = CCustomCommandUtility::NewL(aUtility); |
|
33 CProxyCustomInterfaceUtility* util = CProxyCustomInterfaceUtility::NewL(customCommandUtility); |
|
34 |
|
35 return util; |
|
36 } |
|
37 |
|
38 EXPORT_C CCustomInterfaceUtility* CCustomInterfaceUtility::NewL(CMdaAudioPlayerUtility& aUtility) |
|
39 { |
|
40 CCustomCommandUtility* customCommandUtility = CCustomCommandUtility::NewL(aUtility); |
|
41 CProxyCustomInterfaceUtility* util = CProxyCustomInterfaceUtility::NewL(customCommandUtility); |
|
42 |
|
43 return util; |
|
44 } |
|
45 |
|
46 EXPORT_C CCustomInterfaceUtility* CCustomInterfaceUtility::NewL(CMdaAudioRecorderUtility& aUtility, |
|
47 TBool aRecordStream) |
|
48 { |
|
49 CCustomCommandUtility* customCommandUtility = CCustomCommandUtility::NewL(aUtility,aRecordStream); |
|
50 CProxyCustomInterfaceUtility* util = CProxyCustomInterfaceUtility::NewL(customCommandUtility); |
|
51 |
|
52 return util; |
|
53 } |
|
54 |
|
55 EXPORT_C CCustomInterfaceUtility* CCustomInterfaceUtility::NewL(CCustomCommandUtility* aCustomCommandUtility) |
|
56 { |
|
57 //CCustomInterfaceUtility* self = new(ELeave) CCustomInterfaceUtility(); |
|
58 //CleanupStack::PushL(self); |
|
59 //self->ConstructL(aCustomCommandUtility); |
|
60 //CleanupStack::Pop(self); |
|
61 CProxyCustomInterfaceUtility* util = CProxyCustomInterfaceUtility::NewL(aCustomCommandUtility); |
|
62 return util; |
|
63 } |
|
64 EXPORT_C CCustomInterfaceUtility* CCustomInterfaceUtility::NewL(CMMFDevSound& /*aDevSound*/) |
|
65 { |
|
66 User::Leave(KErrNotSupported); |
|
67 CCustomInterfaceUtility* self = NULL; |
|
68 return self; |
|
69 /***** |
|
70 CCustomInterfaceUtility* self = new(ELeave) CCustomInterfaceUtility(); |
|
71 CleanupStack::PushL(self); |
|
72 self->ConstructL(aDevSound); |
|
73 CleanupStack::Pop(self); |
|
74 return self; |
|
75 *****/ |
|
76 } |
|
77 |
|
78 EXPORT_C CCustomInterfaceUtility* CCustomInterfaceUtility::NewL(CMidiClientUtility& aUtility) |
|
79 { |
|
80 CCustomCommandUtility* customCommandUtility = CCustomCommandUtility::NewL(aUtility); |
|
81 CProxyCustomInterfaceUtility* util = CProxyCustomInterfaceUtility::NewL(customCommandUtility); |
|
82 |
|
83 return util; |
|
84 } |
|
85 |
|
86 EXPORT_C CCustomInterfaceUtility* CCustomInterfaceUtility::NewL(MCustomCommand& aUtility) |
|
87 { |
|
88 CProxyCustomInterfaceUtility* util = CProxyCustomInterfaceUtility::NewL(aUtility); |
|
89 |
|
90 return util; |
|
91 } |
|
92 |
|
93 EXPORT_C CCustomInterfaceUtility* CCustomInterfaceUtility::NewL(CDrmPlayerUtility& aUtility) |
|
94 { |
|
95 CCustomCommandUtility* customCommandUtility = CCustomCommandUtility::NewL(aUtility); |
|
96 CProxyCustomInterfaceUtility* util = CProxyCustomInterfaceUtility::NewL(customCommandUtility); |
|
97 |
|
98 return util; |
|
99 } |
|
100 |
|
101 EXPORT_C CCustomInterfaceUtility* CCustomInterfaceUtility::NewL(CVideoPlayerUtility& aUtility) |
|
102 { |
|
103 CCustomCommandUtility* customCommandUtility = CCustomCommandUtility::NewL(aUtility); |
|
104 CProxyCustomInterfaceUtility* util = CProxyCustomInterfaceUtility::NewL(customCommandUtility); |
|
105 |
|
106 return util; |
|
107 } |
|
108 |
|
109 EXPORT_C CCustomInterfaceUtility* CCustomInterfaceUtility::NewL(CVideoRecorderUtility& aUtility) |
|
110 { |
|
111 CCustomCommandUtility* customCommandUtility = CCustomCommandUtility::NewL(aUtility); |
|
112 CProxyCustomInterfaceUtility* util = CProxyCustomInterfaceUtility::NewL(customCommandUtility); |
|
113 |
|
114 return util; |
|
115 } |
|
116 |
|
117 EXPORT_C CCustomInterfaceUtility::CCustomInterfaceUtility() |
|
118 { |
|
119 } |
|
120 |
|
121 void CCustomInterfaceUtility::ConstructL(CCustomCommandUtility* aCustomCommandUtility) |
|
122 { |
|
123 iProxyFactory = CProxyCustomInterfaceUtility::NewL(aCustomCommandUtility); |
|
124 } |
|
125 |
|
126 void CCustomInterfaceUtility::ConstructL(CMMFDevSound& aDevSound) |
|
127 { |
|
128 iDevSound = &aDevSound; |
|
129 } |
|
130 EXPORT_C CCustomInterfaceUtility::~CCustomInterfaceUtility() |
|
131 { |
|
132 delete iProxyFactory; |
|
133 } |
|
134 |
|
135 TAny* CCustomInterfaceUtility::CustomInterface(TUid aInterfaceId) |
|
136 { |
|
137 TAny* result; |
|
138 |
|
139 if (iDevSound) |
|
140 { |
|
141 result = iDevSound->CustomInterface(aInterfaceId); |
|
142 // delete this; //protect from memory leaks in clients |
|
143 } |
|
144 else |
|
145 { |
|
146 result = iProxyFactory->CustomInterface(aInterfaceId); |
|
147 } |
|
148 return result; |
|
149 } |
|
150 |
|
151 void CCustomInterfaceUtility::RemoveCustomInterface(TMMFMessageDestinationPckg aMessageHandler) |
|
152 { |
|
153 |
|
154 iProxyFactory->RemoveCustomInterface(aMessageHandler); |
|
155 |
|
156 } |
|
157 |
|
158 |
|
159 // End of File |