|
1 /* |
|
2 * Copyright (c) 2009 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: Telephony Multimedia Service |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <tmsstream.h> |
|
19 #include "tmsstreambody.h" |
|
20 |
|
21 using namespace TMS; |
|
22 |
|
23 EXPORT_C TMSStream::TMSStream(void) : |
|
24 iBody(NULL) |
|
25 { |
|
26 } |
|
27 |
|
28 EXPORT_C TMSStream::~TMSStream() |
|
29 { |
|
30 delete iBody; |
|
31 } |
|
32 |
|
33 EXPORT_C gint TMSStream::AddObserver(TMSStreamObserver& obsrvr, |
|
34 gpointer user_data) |
|
35 { |
|
36 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
37 if (iBody) |
|
38 { |
|
39 status = iBody->AddObserver(obsrvr, user_data); |
|
40 } |
|
41 return status; |
|
42 } |
|
43 |
|
44 EXPORT_C gint TMSStream::RemoveObserver(TMSStreamObserver& obsrvr) |
|
45 { |
|
46 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
47 if (iBody) |
|
48 { |
|
49 status = iBody->RemoveObserver(obsrvr); |
|
50 } |
|
51 return status; |
|
52 } |
|
53 |
|
54 EXPORT_C gint TMSStream::AddSource(TMSSource* source) |
|
55 { |
|
56 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
57 if (iBody) |
|
58 { |
|
59 status = iBody->AddSource(source); |
|
60 } |
|
61 return status; |
|
62 } |
|
63 |
|
64 EXPORT_C gint TMSStream::RemoveSource(TMSSource* source) |
|
65 { |
|
66 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
67 if (iBody) |
|
68 { |
|
69 status = iBody->RemoveSource(source); |
|
70 } |
|
71 return status; |
|
72 } |
|
73 |
|
74 EXPORT_C gint TMSStream::AddSink(TMSSink* sink) |
|
75 { |
|
76 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
77 if (iBody) |
|
78 { |
|
79 status = iBody->AddSink(sink); |
|
80 } |
|
81 return status; |
|
82 } |
|
83 |
|
84 EXPORT_C gint TMSStream::RemoveSink(TMSSink* sink) |
|
85 { |
|
86 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
87 if (iBody) |
|
88 { |
|
89 status = iBody->RemoveSink(sink); |
|
90 } |
|
91 return status; |
|
92 } |
|
93 |
|
94 EXPORT_C gint TMSStream::SetFormat(TMSFormat* format) |
|
95 { |
|
96 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
97 if (iBody) |
|
98 { |
|
99 status = iBody->SetFormat(format); |
|
100 } |
|
101 return status; |
|
102 } |
|
103 |
|
104 EXPORT_C gint TMSStream::ResetFormat(TMSFormat* format) |
|
105 { |
|
106 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
107 if (iBody) |
|
108 { |
|
109 status = iBody->ResetFormat(format); |
|
110 } |
|
111 return status; |
|
112 } |
|
113 |
|
114 EXPORT_C gint TMSStream::AddEffect(TMSEffect* effect) |
|
115 { |
|
116 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
117 if (iBody) |
|
118 { |
|
119 status = iBody->AddEffect(effect); |
|
120 } |
|
121 return status; |
|
122 } |
|
123 |
|
124 EXPORT_C gint TMSStream::RemoveEffect(TMSEffect* effect) |
|
125 { |
|
126 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
127 if (iBody) |
|
128 { |
|
129 status = iBody->RemoveEffect(effect); |
|
130 } |
|
131 return status; |
|
132 } |
|
133 |
|
134 EXPORT_C gint TMSStream::GetState() |
|
135 { |
|
136 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
137 if (iBody) |
|
138 { |
|
139 status = iBody->GetState(); |
|
140 } |
|
141 return status; |
|
142 } |
|
143 |
|
144 EXPORT_C gint TMSStream::GetStreamType() |
|
145 { |
|
146 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
147 if (iBody) |
|
148 { |
|
149 status = iBody->GetStreamType(); |
|
150 } |
|
151 return status; |
|
152 } |
|
153 |
|
154 EXPORT_C gint TMSStream::GetStreamId() |
|
155 { |
|
156 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
157 if (iBody) |
|
158 { |
|
159 status = iBody->GetStreamId(); |
|
160 } |
|
161 return status; |
|
162 } |
|
163 |
|
164 EXPORT_C gint TMSStream::Init() |
|
165 { |
|
166 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
167 if (iBody) |
|
168 { |
|
169 status = iBody->Init(); |
|
170 } |
|
171 return status; |
|
172 } |
|
173 |
|
174 EXPORT_C gint TMSStream::Pause() |
|
175 { |
|
176 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
177 if (iBody) |
|
178 { |
|
179 status = iBody->Pause(); |
|
180 } |
|
181 return status; |
|
182 } |
|
183 |
|
184 EXPORT_C gint TMSStream::Start() |
|
185 { |
|
186 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
187 if (iBody) |
|
188 { |
|
189 status = iBody->Start(); |
|
190 } |
|
191 return status; |
|
192 } |
|
193 |
|
194 EXPORT_C gint TMSStream::Stop() |
|
195 { |
|
196 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
197 if (iBody) |
|
198 { |
|
199 status = iBody->Stop(); |
|
200 } |
|
201 return status; |
|
202 } |
|
203 |
|
204 EXPORT_C void TMSStream::Deinit() |
|
205 { |
|
206 if (iBody) |
|
207 { |
|
208 iBody->Deinit(); |
|
209 } |
|
210 } |
|
211 |