* Every new connection ID is initilized with the next available number.
[profile/ivi/genivi/genivi-audio-manager.git] / include / routing / IAmRoutingSend.h
1 /**\r
2  * Copyright (C) 2012, BMW AG\r
3  *\r
4  * This file is part of GENIVI Project AudioManager.\r
5  *\r
6  * Contributions are licensed to the GENIVI Alliance under one or more\r
7  * Contribution License Agreements.\r
8  *\r
9  * \copyright\r
10  * This Source Code Form is subject to the terms of the\r
11  * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with\r
12  * this file, You can obtain one at http://mozilla.org/MPL/2.0/.\r
13  *\r
14  *\r
15  * \author Christian Mueller, christian.linke@bmw.de BMW 2011,2012\r
16  *\r
17  * \file\r
18  * For further information see http://www.genivi.org/.\r
19  *\r
20  * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
21  */\r
22 #if !defined(EA_19B3916A_5323_4939_B585_FE9193DA3FAD__INCLUDED_)\r
23 #define EA_19B3916A_5323_4939_B585_FE9193DA3FAD__INCLUDED_\r
24 \r
25 #include <vector>\r
26 #include <string>\r
27 #include "audiomanagertypes.h"\r
28 \r
29 namespace am {\r
30 class IAmRoutingReceive;\r
31 }
32
33 #include "audiomanagertypes.h"
34 #include "IAmRoutingReceive.h"
35 #include "projecttypes.h"
36
37 #define RoutingSendVersion "2.0" 
38 namespace am {
39         /**
40          * This class implements everything from Audiomanager -> RoutingAdapter
41          * There are two rules that have to be kept in mind when implementing against this interface:\n
42          * \warning
43          * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
44          * 2. YOU MAY NOT CALL THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.\n
45          * \details
46          * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-
47          * call pattern described on the wiki which also helps to implement calls that are forbidden.\n
48          * For more information, please check CAmSerializer
49          * @author Christian Mueller
50          * @created 17-Jan-2013 10:00:26
51          */
52         class IAmRoutingSend
53         {
54
55         public:
56                 IAmRoutingSend() {
57
58                 }
59
60                 virtual ~IAmRoutingSend() {
61
62                 }
63
64                 /**
65                  * This function returns the version of the interface
66                  * 
67                  * @param version
68                  */
69                 virtual void getInterfaceVersion(std::string& version) const =0;
70                 /**
71                  * starts up the interface. In the implementations, here is the best place for init routines.
72                  * 
73                  * @param routingreceiveinterface    pointer to the receive interface
74                  */
75                 virtual am_Error_e startupInterface(IAmRoutingReceive* routingreceiveinterface) =0;
76                 /**
77                  * indicates that the routing now ready to be used. Should be used as trigger to register all sinks, sources, etc...
78                  * 
79                  * @param handle    handle that uniquely identifies the request
80                  */
81                 virtual void setRoutingReady(const uint16_t handle) =0;
82                 /**
83                  * indicates that the routing plugins need to be prepared to switch the power off or be ready again.
84                  * 
85                  * @param handle    the handle that uniquely identifies the request
86                  */
87                 virtual void setRoutingRundown(const uint16_t handle) =0;
88                 /**
89                  * aborts an asynchronous action.
90                  * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if handle was not found
91                  * 
92                  * @param handle
93                  */
94                 virtual am_Error_e asyncAbort(const am_Handle_s handle) =0;
95                 /**
96                  * connects a source to a sink
97                  * @return E_OK on success, E_UNKNOWN on error, E_WRONG_FORMAT in case am_ConnectionFormat_e does not match
98                  * 
99                  * @param handle
100                  * @param connectionID
101                  * @param sourceID
102                  * @param sinkID
103                  * @param connectionFormat
104                  */
105                 virtual am_Error_e asyncConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat) =0;
106                 /**
107                  * disconnect a connection with given connectionID
108                  * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if connection was not found
109                  * 
110                  * @param handle
111                  * @param connectionID
112                  */
113                 virtual am_Error_e asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID) =0;
114                 /**
115                  * this method is used to set the volume of a sink. This function is used to drive ramps, to mute or unmute or directly
116                  * set the value. The difference is made through the ramptype.
117                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if new volume is out of range
118                  * 
119                  * @param handle
120                  * @param sinkID
121                  * @param volume
122                  * @param ramp
123                  * @param time
124                  */
125                 virtual am_Error_e asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) =0;
126                 /**
127                  * sets the volume of a source. This method is used to set the volume of a sink. This function is used to drive ramps, to
128                  * mute or unmute or directly set the value. The difference is made through the ramptype.
129                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if volume is out of range.
130                  * triggers the acknowledge ackSourceVolumeChange
131                  * 
132                  * @param handle
133                  * @param sourceID
134                  * @param volume
135                  * @param ramp
136                  * @param time
137                  */
138                 virtual am_Error_e asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) =0;
139                 /**
140                  * This function is used to set the source state of a particular source.
141                  * @return E_OK on success, E_UNKNOWN on error
142                  * 
143                  * @param handle
144                  * @param sourceID
145                  * @param state
146                  */
147                 virtual am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state) =0;
148                 /**
149                  * this function sets the sinksoundproperty.
150                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
151                  * 
152                  * @param handle
153                  * @param sinkID
154                  * @param listSoundProperties
155                  */
156                 virtual am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties) =0;
157                 /**
158                  * this function sets the sinksoundproperty.
159                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
160                  * 
161                  * @param handle
162                  * @param sinkID
163                  * @param soundProperty
164                  */
165                 virtual am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) =0;
166                 /**
167                  * this function sets the sourcesoundproperty.
168                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
169                  * 
170                  * @param handle
171                  * @param sourceID
172                  * @param listSoundProperties
173                  */
174                 virtual am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties) =0;
175                 /**
176                  * this function sets the sourcesoundproperty.
177                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
178                  * 
179                  * @param handle
180                  * @param sourceID
181                  * @param soundProperty
182                  */
183                 virtual am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) =0;
184                 /**
185                  * this function triggers crossfading.
186                  * @return E_OK on success, E_UNKNOWN on error
187                  * 
188                  * @param handle
189                  * @param crossfaderID
190                  * @param hotSink
191                  * @param rampType
192                  * @param time
193                  */
194                 virtual am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time) =0;
195                 /**
196                  * this function is used for early and late audio functions to set the domain state
197                  * @return E_OK on success, E_UNKNOWN on error
198                  * 
199                  * @param domainID
200                  * @param domainState
201                  */
202                 virtual am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) =0;
203                 /**
204                  * this method is used to retrieve the busname during startup of the plugin. Needs to be implemented
205                  * @return E_OK on success, E_UNKNOWN on error
206                  * 
207                  * @param BusName
208                  */
209                 virtual am_Error_e returnBusName(std::string& BusName) const =0;
210                 /**
211                  * This command sets multiple source or and sink volumes within a domain at a time. It can be used to synchronize volume
212                  * setting events.
213                  * @return E_OK on success, E_UNKNOWN on error.
214                  * 
215                  * @param handle    the handle
216                  * @param listVolumes    a list of volumes that shall be set a the same time
217                  */
218                 virtual am_Error_e asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes) =0;
219                 /**
220                  * sets the notification configuration of a sink.
221                  * @return E_OK on success, E_UNKNOWN on error.
222                  * 
223                  * @param handle    The handle for this operation.
224                  * @param sinkID    the sourceID of the source the notification should be set
225                  * @param notificationConfiguration    The notification configuration
226                  */
227                 virtual am_Error_e asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration) =0;
228                 /**
229                  * sets the notification configuration of a source.
230                  * @return E_OK on success, E_UNKNOWN on error.
231                  * 
232                  * @param handle    The handle for this operation.
233                  * @param sourceID    the sourceID of the source the notification should be set
234                  * @param notificationConfiguration    The notification configuration
235                  */
236                 virtual am_Error_e asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration) =0;
237
238         };
239 }
240 #endif // !defined(EA_19B3916A_5323_4939_B585_FE9193DA3FAD__INCLUDED_)