* wrapping DLT calls in a new Class because of performance, codesize and lazyness...
[profile/ivi/audiomanager.git] / includes / routing / RoutingReceiveInterface.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_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_)\r
26 #define EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__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 DBusWrapper;\r
34 class SocketHandler;\r
35 }\r
36
37
38 #define RoutingReceiveVersion 1
39 namespace am {
40         /**
41          * Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
42          * @author christian
43          * @version 1.0
44          * @created 30-Jan-2012 6:29:29 PM
45          */
46         class RoutingReceiveInterface
47         {
48
49         public:
50                 RoutingReceiveInterface() {
51
52                 }
53
54                 virtual ~RoutingReceiveInterface() {
55
56                 }
57
58                 /**
59                  * acknowledges a asyncConnect
60                  * 
61                  * @param handle
62                  * @param connectionID
63                  * @param error    E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
64                  */
65                 virtual void ackConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error) =0;
66                 /**
67                  * acknowledges a asyncDisconnect
68                  * 
69                  * @param handle
70                  * @param connectionID
71                  * @param error    E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
72                  */
73                 virtual void ackDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error) =0;
74                 /**
75                  * acknowledges a asyncsetSinkVolume 
76                  * 
77                  * @param handle
78                  * @param volume    The current actual value that is set 
79                  * @param error    E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
80                  */
81                 virtual void ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) =0;
82                 /**
83                  * acknowledges a asyncsetSourceVolume
84                  * 
85                  * @param handle    handle that belongs to the change 
86                  * @param volume    the current volume
87                  * @param error    E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
88                  */
89                 virtual void ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) =0;
90                 /**
91                  * acknowlegde for asyncSetSourceState
92                  * 
93                  * @param handle
94                  * @param error    E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
95                  */
96                 virtual void ackSetSourceState(const am_Handle_s handle, const am_Error_e error) =0;
97                 /**
98                  * acknowledges asyncSetSinkSoundProperties
99                  * 
100                  * @param handle
101                  * @param error    E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
102                  */
103                 virtual void ackSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
104                 /**
105                  * acknowledges asyncSetSinkSoundProperty
106                  * 
107                  * @param handle
108                  * @param error    E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
109                  */
110                 virtual void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
111                 /**
112                  * acknowledges asyncSetSourceSoundProperties
113                  * 
114                  * @param handle
115                  * @param error    E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
116                  */
117                 virtual void ackSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
118                 /**
119                  * acknowledges asyncSetSourceSoundProperty
120                  * 
121                  * @param handle
122                  * @param error    E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
123                  */
124                 virtual void ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
125                 /**
126                  * acknowledges asyncCrossFade
127                  * 
128                  * @param handle
129                  * @param hotSink    this is the current hot sink, HS_INTERMEDIATE is here when a crossfading action did not reach the end
130                  * @param error    E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
131                  */
132                 virtual void ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error) =0;
133                 /**
134                  * acknowledges a volume tick. This can be used to display volumechanges during ramps
135                  * 
136                  * @param handle
137                  * @param sourceID
138                  * @param volume
139                  */
140                 virtual void ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume) =0;
141                 /**
142                  * acknowledges a volume tick. This can be used to display volumechanges during ramps
143                  * 
144                  * @param handle
145                  * @param sinkID
146                  * @param volume
147                  */
148                 virtual void ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume) =0;
149                 /**
150                  * This function returns the ID to the given domainName. If already a domain is registered with this name, it will return the corresponding ID, if not it will reserve an ID but not register the domain. The other parameters of the domain will be overwritten when the domain is registered.\r
151                  * @return E_OK on success, E_UNKNOWN on error
152                  * 
153                  * @param name
154                  * @param domainID
155                  */
156                 virtual am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID) =0;
157                 /**
158                  * registers a domain\r
159                  * @return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
160                  * 
161                  * @param domainData    domainID in am_Domain_s must be 0!
162                  * @param domainID
163                  */
164                 virtual am_Error_e registerDomain(const am_Domain_s& domainData, am_domainID_t& domainID) =0;
165                 /**
166                  * deregisters a domain. All sources, sinks, gateways and crossfaders from that domain will be removed as well.\r
167                  * @return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
168                  * 
169                  * @param domainID    < the nonde of the bus
170                  */
171                 virtual am_Error_e deregisterDomain(const am_domainID_t domainID) =0;
172                 /**
173                  * registers a gateway. @return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
174                  * 
175                  * @param gatewayData    In a fixed setup, the gatewayID must be below 100. In a dynamic setup, the gatewayID shall be 0. listSourceFormats and listSinkFormats are empty at registration time. Values are taken over when sources and sinks are registered.\r
176                  * \r
177                  * 
178                  * @param gatewayID
179                  */
180                 virtual am_Error_e registerGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID) =0;
181                 /**
182                  * deregisters a gateway. Also removes all sinks and sources of the controlling domain.\r
183                  * @return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
184                  * 
185                  * @param gatewayID    domainID of the control domain
186                  */
187                 virtual am_Error_e deregisterGateway(const am_gatewayID_t gatewayID) =0;
188                 /**
189                  * This function returns the ID to the given sinkName. If already a sink is registered with this name, it will return the corresponding ID, if not it will reserve an ID but not register the sink. The other parameters of the sink will be overwritten when the sink is registered.\r
190                  * @return E_OK on success, E_UNKNOWN on error
191                  * 
192                  * @param name    ID is not valid since not created yet
193                  * @param sinkID
194                  */
195                 virtual am_Error_e peekSink(const std::string& name, am_sinkID_t& sinkID) =0;
196                 /**
197                  * Registers a sink. If the sink is part of a gateway, the listconnectionFormats is copied to the gatewayInformation\r
198                  * @return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
199                  * 
200                  * @param sinkData    In a fixed setup, the sinkID within am_Sink_s must be below 100. In a dynamic setup the sinkID must be 0 in am_Sink_s.
201                  * @param sinkID
202                  */
203                 virtual am_Error_e registerSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID) =0;
204                 /**
205                  * deregisters a sink.\r
206                  * @return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
207                  * 
208                  * @param sinkID
209                  */
210                 virtual am_Error_e deregisterSink(const am_sinkID_t sinkID) =0;
211                 /**
212                  * This function returns the ID to the given sourceName. If already a source is registered with this name, it will return the corresponding ID, if not it will reserve an ID but not register the source. The other parameters of the source will be overwritten when the source is registered.\r
213                  * @return E_OK on success, E_UNKNOWN on error
214                  * 
215                  * @param name
216                  * @param sourceID
217                  */
218                 virtual am_Error_e peekSource(const std::string& name, am_sourceID_t& sourceID) =0;
219                 /**
220                  * registers a source.  If the source is part of a gateway, the listconnectionFormats is copied to the gatewayInformation\r
221                  * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXIST if either name or sourceID already exists
222                  * 
223                  * @param sourceData    In a fixed setup, the sourceID within am_Source_s must be below 100. In a dynamic setup the sourceID must be 0 in am_Source_s
224                  * @param sourceID
225                  */
226                 virtual am_Error_e registerSource(const am_Source_s& sourceData, am_sourceID_t& sourceID) =0;
227                 /**
228                  * deregisters a source\r
229                  * @return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
230                  * 
231                  * @param sourceID
232                  */
233                 virtual am_Error_e deregisterSource(const am_sourceID_t sourceID) =0;
234                 /**
235                  * this function registers a crossfader.\r
236                  * @return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
237                  * 
238                  * @param crossfaderData    in a fixed setup, the crossfaderID must be below 100. In a dynamic setup the crossfasderID shall be 0
239                  * @param crossfaderID
240                  */
241                 virtual am_Error_e registerCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID) =0;
242                 /**
243                  * this function deregisters a crossfader. removes all sources and sinks assiated as well.\r
244                  * @return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
245                  * 
246                  * @param crossfaderID
247                  */
248                 virtual am_Error_e deregisterCrossfader(const am_crossfaderID_t crossfaderID) =0;
249                 /**
250                  * this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.\r
251                  * @return E_OK on succes, E_DATABASE_ERROR on error
252                  * 
253                  * @param name
254                  * @param sourceClassID
255                  */
256                 virtual am_Error_e peekSourceClassID(const std::string& name, const am_sourceClass_t& sourceClassID) =0;
257                 /**
258                  * this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.\r
259                  * @return E_OK on succes, E_DATABASE_ERROR on error
260                  * 
261                  * @param name
262                  * @param sinkClassID
263                  */
264                 virtual am_Error_e peekSinkClassID(const std::string& name, const am_sinkClass_t& sinkClassID) =0;
265                 /**
266                  * is called when a low level interrupt changes it status.
267                  * 
268                  * @param sourceID
269                  * @param interruptState
270                  */
271                 virtual void hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState) =0;
272                 /**
273                  * This hook is called when all elements from a domain are registered.\r
274                  * Is used by the Controller to know when all expected domains are finally registered
275                  * 
276                  * @param domainID
277                  */
278                 virtual void hookDomainRegistrationComplete(const am_domainID_t domainID) =0;
279                 /**
280                  * is called when a sink changes its availability
281                  * 
282                  * @param sinkID
283                  * @param availability
284                  */
285                 virtual void hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s& availability) =0;
286                 /**
287                  * is called when a source changes its availability
288                  * 
289                  * @param sourceID
290                  * @param availability
291                  */
292                 virtual void hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s& availability) =0;
293                 /**
294                  * is called when a domain changes its status. This used for early domains only
295                  * 
296                  * @param domainID
297                  * @param domainState
298                  */
299                 virtual void hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState) =0;
300                 /**
301                  * is called when the timinginformation (delay) changed for a connection.
302                  * 
303                  * @param connectionID
304                  * @param delay
305                  */
306                 virtual void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay) =0;
307                 /**
308                  * this function is used to send out all data that has been changed in an early state.\r
309                  * @return E_OK on success, E_UNKNOWN on error
310                  * 
311                  * @param earlyData
312                  */
313                 virtual am_Error_e sendChangedData(const std::vector<am_EarlyData_s>& earlyData) =0;
314                 /**
315                  * this function is used to retrieve a pointer to the dBusConnectionWrapper\r
316                  * @return E_OK if pointer is valid, E_UKNOWN if AudioManager was compiled without DBus Support
317                  * 
318                  * @param dbusConnectionWrapper    This is a wrapper class that is needed to keep dbus inclusions away from the interface. The DBusWrapperClass will return the pointer to the DbusConnection call (getDBusConnection)
319                  */
320                 virtual am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const =0;
321                 /**
322                  * This function returns the pointer to the socketHandler. This can be used to integrate socket-based activites like communication with the mainloop of the AudioManager.\r
323                  * returns E_OK if pointer is valid, E_UNKNOWN in case AudioManager was compiled without socketHandler support,
324                  * 
325                  * @param socketHandler
326                  */
327                 virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) const =0;
328                 /**
329                  * This function returns the version of the interface
330                  */
331                 virtual uint16_t getInterfaceVersion() const =0;
332
333         };
334 }
335 #endif // !defined(EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_)