|
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 <tms.h> |
|
19 #include "tmsvolumeeffectimpl.h" |
|
20 #include "tmsgaineffectimpl.h" |
|
21 #include "tmsglobalvoleffectimpl.h" |
|
22 #include "tmsglobalgaineffectimpl.h" |
|
23 #include "tmsutility.h" |
|
24 #include "tmseffectimpl.h" |
|
25 |
|
26 using namespace TMS; |
|
27 |
|
28 EXPORT_C gint TMSEffectImpl::Create(TMSEffectType effecttype, |
|
29 TMSEffect*& tmseffect) |
|
30 { |
|
31 gint ret(TMS_RESULT_INSUFFICIENT_MEMORY); |
|
32 TRACE_PRN_FN_ENT; |
|
33 switch (effecttype) |
|
34 { |
|
35 case TMS_EFFECT_VOLUME: |
|
36 ret = TMSVolumeEffectImpl::Create(tmseffect); |
|
37 break; |
|
38 case TMS_EFFECT_GAIN: |
|
39 ret = TMSGainEffectImpl::Create(tmseffect); |
|
40 break; |
|
41 case TMS_EFFECT_GLOBAL_VOL: |
|
42 ret = TMSGlobalVolEffectImpl::Create(tmseffect); |
|
43 break; |
|
44 case TMS_EFFECT_GLOBAL_GAIN: |
|
45 ret = TMSGlobalGainEffectImpl::Create(tmseffect); |
|
46 break; |
|
47 default: |
|
48 ret = TMS_RESULT_EFFECT_TYPE_NOT_SUPPORTED; |
|
49 break; |
|
50 } |
|
51 |
|
52 TRACE_PRN_FN_EXT; |
|
53 return ret; |
|
54 } |
|
55 |
|
56 EXPORT_C gint TMSEffectImpl::Delete(TMSEffect*& tmseffect) |
|
57 { |
|
58 gint ret(TMS_RESULT_INVALID_ARGUMENT); |
|
59 TRACE_PRN_FN_ENT; |
|
60 TMSEffectType effecttype; |
|
61 ret = tmseffect->GetType(effecttype); |
|
62 switch (effecttype) |
|
63 { |
|
64 case TMS_EFFECT_VOLUME: |
|
65 delete (TMSVolumeEffectImpl*) (tmseffect); |
|
66 tmseffect = NULL; |
|
67 break; |
|
68 case TMS_EFFECT_GAIN: |
|
69 delete (TMSGainEffectImpl*) (tmseffect); |
|
70 tmseffect = NULL; |
|
71 break; |
|
72 case TMS_EFFECT_GLOBAL_VOL: |
|
73 delete (TMSGlobalVolEffectImpl*) (tmseffect); |
|
74 tmseffect = NULL; |
|
75 break; |
|
76 case TMS_EFFECT_GLOBAL_GAIN: |
|
77 delete (TMSGlobalGainEffectImpl*) (tmseffect); |
|
78 tmseffect = NULL; |
|
79 break; |
|
80 default: |
|
81 ret = TMS_RESULT_EFFECT_TYPE_NOT_SUPPORTED; |
|
82 break; |
|
83 } |
|
84 |
|
85 TRACE_PRN_FN_EXT; |
|
86 return ret; |
|
87 } |
|
88 |
|
89 // End of file |