2d495936ac76552001398e0b310bab411241d70c
[profile/ivi/audiomanager.git] / includes / control / ControlSendInterface.h
1 /**\r
2 * Copyright (C) 2011, BMW AG\r
3 *\r
4 * GeniviAudioMananger\r
5 *\r
6 * \file  \r
7 *\r
8 * \date 20-Oct-2011 3:42:04 PM\r
9 * \author Christian Mueller (christian.ei.mueller@bmw.de)\r
10 *\r
11 * \section License\r
12 * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)\r
13 * Copyright (C) 2011, BMW AG Christian M?ller  Christian.ei.mueller@bmw.de\r
14 *\r
15 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.\r
16 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.\r
17 * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.\r
18 * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.\r
19 * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.\r
20 * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.\r
21 * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.\r
22 *\r
23 * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
24 */\r
25 #if !defined(EA_F931365D_53A0_4830_8B3E_29C95C767ADC__INCLUDED_)\r
26 #define EA_F931365D_53A0_4830_8B3E_29C95C767ADC__INCLUDED_\r
27 \r
28 #include <vector>\r
29 #include <string>\r
30 #include "audiomanagertypes.h"\r
31 \r
32 namespace am {\r
33 class ControlReceiveInterface;\r
34 }
35
36 #define ControlSendVersion 1
37 namespace am {
38         /**
39          * This interface is presented by the AudioManager controller.\r
40          * All the hooks represent system events that need to be handled. The callback functions are used to handle for example answers to function calls on the AudioManagerCoreInterface.
41          * @author christian
42          * @version 1.0
43          * @created 10-Feb-2012 1:31:06 PM
44          */
45         class ControlSendInterface
46         {
47
48         public:
49                 ControlSendInterface() {
50
51                 }
52
53                 virtual ~ControlSendInterface() {
54
55                 }
56
57                 /**
58                  * Starts up the controller.
59                  * 
60                  * @param controlreceiveinterface    This is a pointer to the ControlReceiveInterface so that the controller knows to whom to communicate.
61                  */
62                 virtual am_Error_e startupController(ControlReceiveInterface* controlreceiveinterface) =0;
63                 /**
64                  * stops the controller
65                  */
66                 virtual am_Error_e stopController() =0;
67                 /**
68                  * This hook is fired when all plugins have been loaded.
69                  */
70                 virtual void hookAllPluginsLoaded() =0;
71                 /**
72                  * is called when a connection request comes in via the command interface\r
73                  * @return E_OK on success, E_NOT_POSSIBLE on error, E_ALREADY_EXISTENT if already exists
74                  * 
75                  * @param sourceID
76                  * @param sinkID
77                  * @param mainConnectionID
78                  */
79                 virtual am_Error_e hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID) =0;
80                 /**
81                  * is called when a disconnection request comes in via the command interface\r
82                  * @return E_OK on success, E_NOT_POSSIBLE on error, E_NON_EXISTENT if connection does not exists
83                  * 
84                  * @param connectionID
85                  */
86                 virtual am_Error_e hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID) =0;
87                 /**
88                  * sets a user MainSinkSoundProperty\r
89                  * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
90                  * 
91                  * @param sinkID
92                  * @param soundProperty
93                  */
94                 virtual am_Error_e hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty) =0;
95                 /**
96                  * sets a user MainSourceSoundProperty\r
97                  * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
98                  * 
99                  * @param sourceID
100                  * @param soundProperty
101                  */
102                 virtual am_Error_e hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty) =0;
103                 /**
104                  * sets a user SystemProperty\r
105                  * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
106                  * 
107                  * @param property
108                  */
109                 virtual am_Error_e hookUserSetSystemProperty(const am_SystemProperty_s& property) =0;
110                 /**
111                  * sets a user volume\r
112                  * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
113                  * 
114                  * @param SinkID
115                  * @param newVolume
116                  */
117                 virtual am_Error_e hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume) =0;
118                 /**
119                  * sets a user volume as increment \r
120                  * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
121                  * 
122                  * @param SinkID
123                  * @param increment    the steps
124                  */
125                 virtual am_Error_e hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment) =0;
126                 /**
127                  * sets the mute state of a sink\r
128                  * @return E_OK on success, E_UNKNOWN on error
129                  * 
130                  * @param sinkID
131                  * @param muteState    true=muted
132                  */
133                 virtual am_Error_e hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState) =0;
134                 /**
135                  * is called when a routing adaptor registers its domain\r
136                  * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXISTENT if already exists
137                  * 
138                  * @param domainData    ID is omitted here since it has not been created yet
139                  * @param domainID
140                  */
141                 virtual am_Error_e hookSystemRegisterDomain(const am_Domain_s& domainData, am_domainID_t& domainID) =0;
142                 /**
143                  * is called when a routing adaptor wants to derigister a domain\r
144                  * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if not found
145                  * 
146                  * @param domainID
147                  */
148                 virtual am_Error_e hookSystemDeregisterDomain(const am_domainID_t domainID) =0;
149                 /**
150                  * is called when a domain registered all the elements
151                  * 
152                  * @param domainID
153                  */
154                 virtual void hookSystemDomainRegistrationComplete(const am_domainID_t domainID) =0;
155                 /**
156                  * is called when a routing adaptor registers a sink\r
157                  * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXISTENT if already exists
158                  * 
159                  * @param sinkData    Id is omitted here, since it has not been created yet
160                  * @param sinkID
161                  */
162                 virtual am_Error_e hookSystemRegisterSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID) =0;
163                 /**
164                  * is called when a routing adaptor deregisters a sink\r
165                  * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if not found
166                  * 
167                  * @param sinkID
168                  */
169                 virtual am_Error_e hookSystemDeregisterSink(const am_sinkID_t sinkID) =0;
170                 /**
171                  * is called when a routing adaptor registers a source\r
172                  * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXISTENT if already exists
173                  * 
174                  * @param sourceData    ID is omitted here since it is not yet created
175                  * @param sourceID
176                  */
177                 virtual am_Error_e hookSystemRegisterSource(const am_Source_s& sourceData, am_sourceID_t& sourceID) =0;
178                 /**
179                  * is called when a routing adaptor deregisters a source\r
180                  * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if not found
181                  * 
182                  * @param sourceID
183                  */
184                 virtual am_Error_e hookSystemDeregisterSource(const am_sourceID_t sourceID) =0;
185                 /**
186                  * is called when a routing adaptor registers a gateway\r
187                  * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXISTENT if already exists
188                  * 
189                  * @param gatewayData    gatewayID is not set here since it is not created at this point of time
190                  * @param gatewayID
191                  */
192                 virtual am_Error_e hookSystemRegisterGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID) =0;
193                 /**
194                  * is called when a routing adaptor deregisters a gateway\r
195                  * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if not found
196                  * 
197                  * @param gatewayID
198                  */
199                 virtual am_Error_e hookSystemDeregisterGateway(const am_gatewayID_t gatewayID) =0;
200                 /**
201                  * is called when a routing adaptor registers a crossfader\r
202                  * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXISTENT if already exists
203                  * 
204                  * @param crossfaderData    gatewayID is not set here since it is not created at this point of time
205                  * @param crossfaderID
206                  */
207                 virtual am_Error_e hookSystemRegisterCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID) =0;
208                 /**
209                  * is called when a routing adaptor deregisters a crossfader\r
210                  * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if not found
211                  * 
212                  * @param crossfaderID
213                  */
214                 virtual am_Error_e hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID) =0;
215                 /**
216                  * volumeticks. therse are used to indicate volumechanges during a ramp
217                  * 
218                  * @param handle
219                  * @param sinkID
220                  * @param volume
221                  */
222                 virtual void hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume) =0;
223                 /**
224                  * volumeticks. therse are used to indicate volumechanges during a ramp
225                  * 
226                  * @param handle
227                  * @param sourceID
228                  * @param volume
229                  */
230                 virtual void hookSystemSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume) =0;
231                 /**
232                  * is called when an low level interrupt changed its state
233                  * 
234                  * @param sourceID
235                  * @param interruptState
236                  */
237                 virtual void hookSystemInterruptStateChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState) =0;
238                 /**
239                  * id called when a sink changed its availability
240                  * 
241                  * @param sinkID
242                  * @param availability
243                  */
244                 virtual void hookSystemSinkAvailablityStateChange(const am_sinkID_t sinkID, const am_Availability_s& availability) =0;
245                 /**
246                  * id called when a source changed its availability
247                  * 
248                  * @param sourceID
249                  * @param availability
250                  */
251                 virtual void hookSystemSourceAvailablityStateChange(const am_sourceID_t sourceID, const am_Availability_s& availability) =0;
252                 /**
253                  * id called when domainstate was changed
254                  * 
255                  * @param domainID
256                  * @param state
257                  */
258                 virtual void hookSystemDomainStateChange(const am_domainID_t domainID, const am_DomainState_e state) =0;
259                 /**
260                  * when early data was received
261                  * 
262                  * @param data
263                  */
264                 virtual void hookSystemReceiveEarlyData(const std::vector<am_EarlyData_s>& data) =0;
265                 /**
266                  * this hook provides information about speed changes.\r
267                  * The quantization and sampling rate of the speed can be adjusted at compile time of the AudioManagerDaemon.
268                  * 
269                  * @param speed
270                  */
271                 virtual void hookSystemSpeedChange(const am_speed_t speed) =0;
272                 /**
273                  * this hook is fired whenever the timing information of a mainconnection has changed.
274                  * 
275                  * @param mainConnectionID
276                  * @param time
277                  */
278                 virtual void hookSystemTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time) =0;
279                 /**
280                  * ack for connect
281                  * 
282                  * @param handle
283                  * @param errorID
284                  */
285                 virtual void cbAckConnect(const am_Handle_s handle, const am_Error_e errorID) =0;
286                 /**
287                  * ack for disconnect
288                  * 
289                  * @param handle
290                  * @param errorID
291                  */
292                 virtual void cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID) =0;
293                 /**
294                  * ack for crossfading
295                  * 
296                  * @param handle
297                  * @param hostsink
298                  * @param error
299                  */
300                 virtual void cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error) =0;
301                 /**
302                  * ack for sink volume changes
303                  * 
304                  * @param handle
305                  * @param volume
306                  * @param error
307                  */
308                 virtual void cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) =0;
309                 /**
310                  * ack for source volume changes
311                  * 
312                  * @param handle    the handle that is connected to the volume change
313                  * @param voulme    the volume after the action ended (the desired volume if everything went right, the actual one in case of abortion)
314                  * @param error
315                  */
316                 virtual void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error) =0;
317                 /**
318                  * ack for setting of source states
319                  * 
320                  * @param handle
321                  * @param error
322                  */
323                 virtual void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error) =0;
324                 /**
325                  * ack for setting of sourcesoundproperties
326                  * 
327                  * @param handle
328                  * @param error
329                  */
330                 virtual void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
331                 /**
332                  * ack for setting of sourcesoundproperties
333                  * 
334                  * @param handle
335                  * @param error
336                  */
337                 virtual void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
338                 /**
339                  * ack for setting of sinksoundproperties
340                  * 
341                  * @param handle
342                  * @param error
343                  */
344                 virtual void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
345                 /**
346                  * ack for setting of sinksoundproperties
347                  * 
348                  * @param handle
349                  * @param error
350                  */
351                 virtual void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
352                 /**
353                  * This function is used by the routing algorithm to retrieve a priorized list of connectionFormats from the Controller.\r
354                  * @return E_OK in case of successfull priorisation.
355                  * 
356                  * @param sourceID    sourceID of source that shall be connected
357                  * @param sinkID    sinkID of sink that shall be connected
358                  * @param listPossibleConnectionFormats    list of possible connectionformats
359                  * @param listPrioConnectionFormats    the list return with prioos from the controller. Best choice on first position.
360                  */
361                 virtual am_Error_e getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const std::vector<am_ConnectionFormat_e> listPossibleConnectionFormats, std::vector<am_ConnectionFormat_e>& listPrioConnectionFormats) =0;
362                 /**
363                  * This function returns the version of the interface\r
364                  * returns E_OK, E_UNKOWN if version is unknown.
365                  */
366                 virtual uint16_t getInterfaceVersion() const =0;
367
368         };
369 }
370 #endif // !defined(EA_F931365D_53A0_4830_8B3E_29C95C767ADC__INCLUDED_)