22 #include "qtmsfactoryimpl.h" |
22 #include "qtmsfactoryimpl.h" |
23 |
23 |
24 using namespace QTMS; |
24 using namespace QTMS; |
25 |
25 |
26 QTMSFactory::QTMSFactory() |
26 QTMSFactory::QTMSFactory() |
27 { |
27 { |
28 impl = new QTMSFactoryImpl(); |
28 impl = new QTMSFactoryImpl(); |
29 } |
29 } |
30 |
30 |
31 QTMSFactory::~QTMSFactory() |
31 QTMSFactory::~QTMSFactory() |
32 { |
32 { |
33 delete impl; |
33 delete impl; |
34 } |
34 } |
35 |
35 |
36 gint QTMSFactory::CreateFactory(QTMSFactory*& tmsfactory, QTMSVer& /*ver*/) |
36 gint QTMSFactory::CreateFactory(QTMSFactory*& tmsfactory, QTMSVer& /*ver*/) |
37 { |
37 { |
38 QTMSFactory* self = new QTMSFactory(); |
38 QTMSFactory* self = new QTMSFactory(); |
39 tmsfactory = self; |
39 tmsfactory = self; |
40 return QTMS_RESULT_SUCCESS; |
40 return QTMS_RESULT_SUCCESS; |
41 } |
41 } |
42 |
42 |
43 gint QTMSFactory::CreateCall(QTMSCallType ctype, QTMSCall*& tmscall, |
43 gint QTMSFactory::CreateCall(QTMSCallType ctype, QTMSCall*& tmscall, guint ctxid) |
44 guint ctxid) |
44 { |
45 { |
45 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
46 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
46 if (impl) { |
47 if (impl) |
|
48 { |
|
49 status = impl->CreateCall(ctype, tmscall, ctxid); |
47 status = impl->CreateCall(ctype, tmscall, ctxid); |
50 } |
48 } |
51 return status; |
49 return status; |
52 } |
50 } |
53 |
51 |
54 gint QTMSFactory::DeleteCall(QTMSCall*& tmscall) |
52 gint QTMSFactory::DeleteCall(QTMSCall*& tmscall) |
55 { |
53 { |
56 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
54 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
57 if (impl) |
55 if (impl) { |
58 { |
|
59 status = impl->DeleteCall(tmscall); |
56 status = impl->DeleteCall(tmscall); |
60 } |
57 } |
61 return status; |
58 return status; |
62 } |
59 } |
63 |
60 |
64 gint QTMSFactory::IsCallTypeSupported(QTMSCallType ctype, gboolean& flag) |
61 gint QTMSFactory::IsCallTypeSupported(QTMSCallType ctype, gboolean& flag) |
65 { |
62 { |
66 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
63 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
67 if (impl) |
64 if (impl) { |
68 { |
|
69 status = impl->IsCallTypeSupported(ctype, flag); |
65 status = impl->IsCallTypeSupported(ctype, flag); |
70 } |
66 } |
71 return status; |
67 return status; |
72 } |
68 } |
73 |
69 |
74 gint QTMSFactory::GetSupportedFormats(const QTMSStreamType strmtype, |
70 gint QTMSFactory::GetSupportedFormats(const QTMSStreamType strmtype, FormatVector& fmtlist) |
75 FormatVector& fmtlist) |
71 { |
76 { |
72 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
77 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
73 if (impl) { |
78 if (impl) |
|
79 { |
|
80 status = impl->GetSupportedFormats(strmtype, fmtlist); |
74 status = impl->GetSupportedFormats(strmtype, fmtlist); |
81 } |
75 } |
82 return status; |
76 return status; |
83 } |
77 } |
84 |
78 |
85 gint QTMSFactory::CreateFormat(QTMSFormatType qfmttype, QTMSFormat*& qfmt) |
79 gint QTMSFactory::CreateFormat(QTMSFormatType qfmttype, QTMSFormat*& qfmt) |
86 { |
80 { |
87 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
81 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
88 if (impl) |
82 if (impl) { |
89 { |
|
90 status = impl->CreateFormat(qfmttype, qfmt); |
83 status = impl->CreateFormat(qfmttype, qfmt); |
91 } |
84 } |
92 return status; |
85 return status; |
93 |
86 |
94 } |
87 } |
95 |
88 |
96 gint QTMSFactory::DeleteFormat(QTMSFormat*& qfmt) |
89 gint QTMSFactory::DeleteFormat(QTMSFormat*& qfmt) |
97 { |
90 { |
98 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
91 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
99 if (impl) |
92 if (impl) { |
100 { |
|
101 status = impl->DeleteFormat(qfmt); |
93 status = impl->DeleteFormat(qfmt); |
102 } |
94 } |
103 return status; |
95 return status; |
104 } |
96 } |
105 |
97 |
106 gint QTMSFactory::CreateEffect(QTMSEffectType tmseffecttype, |
98 gint QTMSFactory::CreateEffect(QTMSEffectType tmseffecttype, QTMSEffect*& tmseffect) |
107 QTMSEffect*& tmseffect) |
99 { |
108 { |
100 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
109 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
101 if (impl) { |
110 if (impl) |
|
111 { |
|
112 status = impl->CreateEffect(tmseffecttype, tmseffect); |
102 status = impl->CreateEffect(tmseffecttype, tmseffect); |
113 } |
103 } |
114 return status; |
104 return status; |
115 } |
105 } |
116 |
106 |
117 gint QTMSFactory::DeleteEffect(QTMSEffect*& qtmseffect) |
107 gint QTMSFactory::DeleteEffect(QTMSEffect*& qtmseffect) |
118 { |
108 { |
119 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
109 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
120 if (impl) |
110 if (impl) { |
121 { |
|
122 impl->DeleteEffect(qtmseffect); |
111 impl->DeleteEffect(qtmseffect); |
123 } |
112 } |
124 return status; |
113 return status; |
125 } |
114 } |
126 |
115 |
127 gint QTMSFactory::CreateBuffer(QTMSBufferType buffertype, guint size, |
116 gint QTMSFactory::CreateBuffer(QTMSBufferType buffertype, guint size, QTMSBuffer*& qbuffer) |
128 QTMSBuffer*& qbuffer) |
117 { |
129 { |
118 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
130 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
119 if (impl) { |
131 if (impl) |
|
132 { |
|
133 status = impl->CreateBuffer(buffertype, size, qbuffer); |
120 status = impl->CreateBuffer(buffertype, size, qbuffer); |
134 } |
121 } |
135 return status; |
122 return status; |
136 } |
123 } |
137 |
124 |
138 gint QTMSFactory::DeleteBuffer(QTMSBuffer*& qbuffer) |
125 gint QTMSFactory::DeleteBuffer(QTMSBuffer*& qbuffer) |
139 { |
126 { |
140 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
127 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
141 if (impl) |
128 if (impl) { |
142 { |
|
143 status = impl->DeleteBuffer(qbuffer); |
129 status = impl->DeleteBuffer(qbuffer); |
144 } |
130 } |
145 return status; |
131 return status; |
146 } |
132 } |
147 |
133 |
148 gint QTMSFactory::CreateSource(QTMSSourceType srctype, QTMSSource*& qtmssrc) |
134 gint QTMSFactory::CreateSource(QTMSSourceType srctype, QTMSSource*& qtmssrc) |
149 { |
135 { |
150 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
136 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
151 if (impl) |
137 if (impl) { |
152 { |
|
153 status = impl->CreateSource(srctype, qtmssrc); |
138 status = impl->CreateSource(srctype, qtmssrc); |
154 } |
139 } |
155 return status; |
140 return status; |
156 } |
141 } |
157 |
142 |
158 gint QTMSFactory::DeleteSource(QTMSSource*& qtmssrc) |
143 gint QTMSFactory::DeleteSource(QTMSSource*& qtmssrc) |
159 { |
144 { |
160 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
145 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
161 if (impl) |
146 if (impl) { |
162 { |
|
163 status = impl->DeleteSource(qtmssrc); |
147 status = impl->DeleteSource(qtmssrc); |
164 } |
148 } |
165 return status; |
149 return status; |
166 } |
150 } |
167 |
151 |
168 gint QTMSFactory::CreateSink(QTMSSinkType sinktype, QTMSSink*& qtmssink) |
152 gint QTMSFactory::CreateSink(QTMSSinkType sinktype, QTMSSink*& qtmssink) |
169 { |
153 { |
170 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
154 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
171 if (impl) |
155 if (impl) { |
172 { |
|
173 status = impl->CreateSink(sinktype, qtmssink); |
156 status = impl->CreateSink(sinktype, qtmssink); |
174 } |
157 } |
175 return status; |
158 return status; |
176 } |
159 } |
177 |
160 |
178 gint QTMSFactory::DeleteSink(QTMSSink*& qtmssink) |
161 gint QTMSFactory::DeleteSink(QTMSSink*& qtmssink) |
179 { |
162 { |
180 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
163 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
181 if (impl) |
164 if (impl) { |
182 { |
|
183 status = impl->DeleteSink(qtmssink); |
165 status = impl->DeleteSink(qtmssink); |
184 } |
166 } |
185 return status; |
167 return status; |
186 } |
168 } |
187 |
169 |
188 gint QTMSFactory::CreateGlobalRouting(QTMSGlobalRouting*& globalrouting) |
170 gint QTMSFactory::CreateGlobalRouting(QTMSGlobalRouting*& globalrouting) |
189 { |
171 { |
190 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
172 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
191 if (impl) |
173 if (impl) { |
192 { |
|
193 status = impl->CreateGlobalRouting(globalrouting); |
174 status = impl->CreateGlobalRouting(globalrouting); |
194 } |
175 } |
195 return status; |
176 return status; |
196 } |
177 } |
197 |
178 |
198 gint QTMSFactory::DeleteGlobalRouting(QTMSGlobalRouting*& globrouting) |
179 gint QTMSFactory::DeleteGlobalRouting(QTMSGlobalRouting*& globrouting) |
199 { |
180 { |
200 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
181 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
201 if (impl) |
182 if (impl) { |
202 { |
|
203 status = impl->DeleteGlobalRouting(globrouting); |
183 status = impl->DeleteGlobalRouting(globrouting); |
204 } |
184 } |
205 return status; |
185 return status; |
206 } |
186 } |
207 |
187 |
208 gint QTMSFactory::CreateDTMF(QTMSStreamType streamtype, QTMSDTMF*& dtmf) |
188 gint QTMSFactory::CreateDTMF(QTMSStreamType streamtype, QTMSDTMF*& dtmf) |
209 { |
189 { |
210 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
190 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
211 if (impl) |
191 if (impl) { |
212 { |
|
213 status = impl->CreateDTMF(streamtype, dtmf); |
192 status = impl->CreateDTMF(streamtype, dtmf); |
214 } |
193 } |
215 return status; |
194 return status; |
216 } |
195 } |
217 |
196 |
218 gint QTMSFactory::DeleteDTMF(QTMSDTMF*& dtmf) |
197 gint QTMSFactory::DeleteDTMF(QTMSDTMF*& dtmf) |
219 { |
198 { |
220 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
199 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
221 if (impl) |
200 if (impl) { |
222 { |
|
223 status = impl->DeleteDTMF(dtmf); |
201 status = impl->DeleteDTMF(dtmf); |
224 } |
202 } |
225 return status; |
203 return status; |
226 } |
204 } |
227 |
205 |
228 gint QTMSFactory::CreateRingTonePlayer(QTMSRingTone*& rt) |
206 gint QTMSFactory::CreateRingTonePlayer(QTMSRingTone*& rt) |
229 { |
207 { |
230 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
208 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
231 if (impl) |
209 if (impl) { |
232 { |
|
233 status = impl->CreateRingTonePlayer(rt); |
210 status = impl->CreateRingTonePlayer(rt); |
234 } |
211 } |
235 return status; |
212 return status; |
236 } |
213 } |
237 |
214 |
238 gint QTMSFactory::DeleteRingTonePlayer(QTMSRingTone*& rt) |
215 gint QTMSFactory::DeleteRingTonePlayer(QTMSRingTone*& rt) |
239 { |
216 { |
240 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
217 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
241 if (impl) |
218 if (impl) { |
242 { |
|
243 status = impl->DeleteRingTonePlayer(rt); |
219 status = impl->DeleteRingTonePlayer(rt); |
244 } |
220 } |
245 return status; |
221 return status; |
246 } |
222 } |
247 |
223 |
248 gint QTMSFactory::CreateInbandTonePlayer(QTMSInbandTone*& inbandtone) |
224 gint QTMSFactory::CreateInbandTonePlayer(QTMSInbandTone*& inbandtone) |
249 { |
225 { |
250 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
226 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
251 if (impl) |
227 if (impl) { |
252 { |
|
253 status = impl->CreateInbandTonePlayer(inbandtone); |
228 status = impl->CreateInbandTonePlayer(inbandtone); |
254 } |
229 } |
255 return status; |
230 return status; |
256 } |
231 } |
257 |
232 |
258 gint QTMSFactory::DeleteInbandTonePlayer(QTMSInbandTone*& inbandtone) |
233 gint QTMSFactory::DeleteInbandTonePlayer(QTMSInbandTone*& inbandtone) |
259 { |
234 { |
260 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
235 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
261 if (impl) |
236 if (impl) { |
262 { |
|
263 status = impl->DeleteInbandTonePlayer(inbandtone); |
237 status = impl->DeleteInbandTonePlayer(inbandtone); |
264 } |
238 } |
265 return status; |
239 return status; |
266 } |
240 } |