|
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 #ifndef TMS_VOLUME_EFFECT_H |
|
19 #define TMS_VOLUME_EFFECT_H |
|
20 |
|
21 #include <tms.h> |
|
22 #include <tmseffect.h> |
|
23 |
|
24 namespace TMS { |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class TMSVolumeEffectBody; |
|
28 class TMSEffectObserver; |
|
29 |
|
30 /** |
|
31 * TMSVolumeEffect class |
|
32 * |
|
33 * This class provides volume level control in the stream scope. |
|
34 * |
|
35 * @lib tmsapi.lib |
|
36 * |
|
37 */ |
|
38 class TMSVolumeEffect : public TMSEffect |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Destructor |
|
43 */ |
|
44 IMPORT_C virtual ~TMSVolumeEffect(); |
|
45 |
|
46 /** |
|
47 * Add client as an observer to events generated by this object. |
|
48 * |
|
49 * This function can be called at any time. It is recommended adding |
|
50 * observer before calling any functions on the Effect. Otherwise, the |
|
51 * observer may miss a callback. |
|
52 * |
|
53 * A reference to the obsrvr is stored in the effect. EffectsEvent callback |
|
54 * will be called when an effect event occurs. When the effect instance is |
|
55 * deleted, all TMSEffectObserver references are automatically released. |
|
56 * The ownership of the obsrvr is still maintained by the client. Should |
|
57 * the client need to delete the obsrvr before deleting the effect, it |
|
58 * should remove the obsrvr reference from the effect by calling |
|
59 * RemoveObserver() function. |
|
60 * |
|
61 * @param obsrvr |
|
62 * Listener to be added to the effect. |
|
63 * |
|
64 * @param user_data |
|
65 * Any user data passed to the function. |
|
66 * |
|
67 * @return |
|
68 * TMS_RESULT_SUCCESS if the obsrvr is successfully added to the list. |
|
69 * TMS_RESULT_ALREADY_EXIST if the obsrvr is already in the list. |
|
70 * |
|
71 */ |
|
72 IMPORT_C gint AddObserver(TMSEffectObserver& obsrvr, gpointer user_data); |
|
73 |
|
74 /** |
|
75 * Remove client observer from the Effect. |
|
76 * |
|
77 * This function can be called at any time. |
|
78 * |
|
79 * @param obsrvr |
|
80 * Listener to be removed from the effect. |
|
81 * |
|
82 * @return |
|
83 * TMS_RESULT_SUCCESS if the obsrvr is successfully removed from the |
|
84 * list. |
|
85 * TMS_RESULT_DOES_NOT_EXIST if trying to remove the obsrvr that has |
|
86 * not been added to the list. |
|
87 * |
|
88 */ |
|
89 IMPORT_C gint RemoveObserver(TMSEffectObserver& obsrvr); |
|
90 |
|
91 /** |
|
92 * Set audio volume level. The volume level should not be higher than |
|
93 * the value returned by GetMaxLevel(). |
|
94 * |
|
95 * @param level |
|
96 * Volume level to be set. |
|
97 * |
|
98 * @return |
|
99 * TMS_RESULT_SUCCESS if the operation was successful. |
|
100 * |
|
101 */ |
|
102 IMPORT_C gint SetLevel(const guint level); |
|
103 |
|
104 /** |
|
105 * Return current audio volume level settings. |
|
106 * |
|
107 * @param level |
|
108 * Volume level. |
|
109 * |
|
110 * @return |
|
111 * TMS_RESULT_SUCCESS if the operation was successful. |
|
112 * |
|
113 */ |
|
114 IMPORT_C gint GetLevel(guint& level); |
|
115 |
|
116 /** |
|
117 * Return max volume level supported by the device. |
|
118 * |
|
119 * @param level |
|
120 * Max volume level. |
|
121 * |
|
122 * @return |
|
123 * TMS_RESULT_SUCCESS if the operation was successful. |
|
124 * |
|
125 */ |
|
126 IMPORT_C gint GetMaxLevel(guint& level); |
|
127 |
|
128 /** |
|
129 * Returns type of the effect. |
|
130 * |
|
131 * This function can be called at any time. |
|
132 * |
|
133 * @param effecttype |
|
134 * Variable that contains the effect type on return. |
|
135 * |
|
136 * @return |
|
137 * TMS_RESULT_SUCCESS if the operation was successful. |
|
138 * |
|
139 */ |
|
140 IMPORT_C gint GetType(TMSEffectType& effecttype); |
|
141 |
|
142 protected: |
|
143 /** |
|
144 * Constructor |
|
145 */ |
|
146 IMPORT_C TMSVolumeEffect(); |
|
147 |
|
148 protected: |
|
149 TMSVolumeEffectBody *iBody; |
|
150 }; |
|
151 |
|
152 } //namespace TMS |
|
153 |
|
154 #endif //TMS_VOLUME_EFFECT_H |