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