|
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:TMSGlobalRouting class |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TMS_GLOBAL_ROUTING_H |
|
19 #define TMS_GLOBAL_ROUTING_H |
|
20 |
|
21 #include <tms.h> |
|
22 |
|
23 namespace TMS { |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class TMSGlobalRoutingBody; |
|
27 class TMSGlobalRoutingObserver; |
|
28 |
|
29 /** |
|
30 * TMSGlobalRouting class |
|
31 * |
|
32 * This class provides audio routing control in the global TMS scope. |
|
33 * Audio routing changes done by any client are adjusted accross all calls |
|
34 * serviced by the TMS server. |
|
35 * |
|
36 * @lib tmsapi.lib |
|
37 * |
|
38 */ |
|
39 class TMSGlobalRouting |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 IMPORT_C virtual ~TMSGlobalRouting(); |
|
46 |
|
47 /** |
|
48 * Add a client as an observer for global audio routing. |
|
49 * |
|
50 * This function can be called at any time. It is recommended to add |
|
51 * observer before calling any functions on TMSGlobalRouting. Otherwise, |
|
52 * the observer may miss a callback. |
|
53 * |
|
54 * A reference to the obsrvr is stored in the TMSGlobalRouting and |
|
55 * RoutingEvent callback will be called when global routing event occurs. |
|
56 * When TMSGlobalRouting is deleted, all TMSGlobalRoutingObserver references |
|
57 * are automatically released. The ownership of the obsrvr is still |
|
58 * maintained by the client. Should the client need to delete the obsrvr |
|
59 * before deleting the global routing object, it should remove the obsrvr |
|
60 * reference from the global routing by calling RemoveObserver() function. |
|
61 * |
|
62 * @param obsrvr |
|
63 * Listener to be added. |
|
64 * |
|
65 * @param user_data |
|
66 * Any user data passed to the function. |
|
67 * |
|
68 * @return |
|
69 * TMS_RESULT_SUCCESS if the obsrvr is successfully added to the list. |
|
70 * TMS_RESULT_ALREADY_EXIST if the obsrvr is already in the list. |
|
71 * |
|
72 */ |
|
73 IMPORT_C gint AddObserver(TMSGlobalRoutingObserver& obsrvr, |
|
74 gpointer user_data); |
|
75 |
|
76 /** |
|
77 * Remove a client observer from this global routing object. |
|
78 * |
|
79 * This function can be called at any time. |
|
80 * |
|
81 * @param obsrvr |
|
82 * Listener to be removed. |
|
83 * |
|
84 * @return |
|
85 * TMS_RESULT_SUCCESS if the obsrvr is successfully removed. |
|
86 * TMS_RESULT_DOES_NOT_EXIST if trying to remove the obsrvr that has |
|
87 * not been added to the list. |
|
88 * |
|
89 */ |
|
90 IMPORT_C gint RemoveObserver(TMSGlobalRoutingObserver& obsrvr); |
|
91 |
|
92 /** |
|
93 * Set global output device audio should be routed to. |
|
94 * |
|
95 * Settings are call-type dependent. |
|
96 * |
|
97 * Common: |
|
98 * TMS_AUDIO_OUTPUT_NONE |
|
99 * VoIP call type: |
|
100 * TMS_AUDIO_OUTPUT_PUBLIC |
|
101 * TMS_AUDIO_OUTPUT_PRIVATE |
|
102 * CS call type: |
|
103 * TMS_AUDIO_OUTPUT_HANDSET |
|
104 * TMS_AUDIO_OUTPUT_LOUDSPEAKER |
|
105 * TMS_AUDIO_OUTPUT_WIRED_ACCESSORY |
|
106 * TMS_AUDIO_OUTPUT_ACCESSORY |
|
107 * TMS_AUDIO_OUTPUT_ETTY |
|
108 * |
|
109 * @param output |
|
110 * Sets call-specific audio output device. |
|
111 * |
|
112 * @return |
|
113 * TMS_RESULT_INVALID_ARGUMENT if set to TMS_AUDIO_OUTPUT_NONE. |
|
114 * TMS_RESULT_SUCCESS if the operation was successful. |
|
115 * |
|
116 */ |
|
117 IMPORT_C gint SetOutput(const TMSAudioOutput output); |
|
118 |
|
119 /** |
|
120 * Return current global audio output device settings. |
|
121 * |
|
122 * Settings are call-type dependent. |
|
123 * See SetOutput() (above) |
|
124 * |
|
125 * @param output |
|
126 * Current audio output device. |
|
127 * |
|
128 * @return |
|
129 * TMS_RESULT_SUCCESS if the operation was successful. |
|
130 * |
|
131 */ |
|
132 IMPORT_C gint GetOutput(TMSAudioOutput& output); |
|
133 |
|
134 /** |
|
135 * Return previous audio output device. |
|
136 * |
|
137 * Settings are call-type dependent. |
|
138 * See SetOutput() (above) |
|
139 * |
|
140 * @param output |
|
141 * Previous audio output device. |
|
142 * |
|
143 * @return |
|
144 * TMS_RESULT_SUCCESS if the operation was successful. |
|
145 * |
|
146 */ |
|
147 IMPORT_C gint GetPreviousOutput(TMSAudioOutput& output); |
|
148 |
|
149 /** |
|
150 * Return list of supported audio output devices. |
|
151 * |
|
152 * Settings are call-type dependent. |
|
153 * See SetOutput() (above) |
|
154 * |
|
155 * @param outputs |
|
156 * The typedef std::vector<guint> OutputVector; list of supported |
|
157 * audio output devices (TMSAudioOutput-type). |
|
158 * |
|
159 * @return |
|
160 * TMS_RESULT_SUCCESS if the operation was successful. |
|
161 * |
|
162 */ |
|
163 IMPORT_C gint GetAvailableOutputs(OutputVector& outputs); |
|
164 |
|
165 protected: |
|
166 /** |
|
167 * Constructor |
|
168 */ |
|
169 IMPORT_C TMSGlobalRouting(); |
|
170 |
|
171 protected: |
|
172 TMSGlobalRoutingBody* iBody; |
|
173 }; |
|
174 |
|
175 } //namespace TMS |
|
176 |
|
177 #endif //TMS_GLOBAL_ROUTING_H |