79d268c0a723705430cd7f85cb6e630a5bc3d4c5
[profile/ivi/audiomanager.git] / include / routing / IAmRoutingSend.h
1 /** Copyright (c) 2012 GENIVI Alliance\r
2  *  Copyright (c) 2012 BMW\r
3  *\r
4  *  \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012\r
5  *\r
6  *  \copyright\r
7  *  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,\r
8  *  including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,\r
9  *  subject to the following conditions:\r
10  *  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r
11  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
12  *  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR\r
13  *  THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
14  \r
15  *  For further information see http://www.genivi.org/.\r
16  *\r
17  * \r
18  * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
19  */\r
20 #if !defined(EA_D9F37547_FAF0_4337_9048_07D8EDDE0AB0__INCLUDED_)\r
21 #define EA_D9F37547_FAF0_4337_9048_07D8EDDE0AB0__INCLUDED_\r
22 \r
23 #include <vector>\r
24 #include <string>\r
25 #include "audiomanagertypes.h"\r
26 \r
27 namespace am {\r
28 class IAmRoutingReceive;\r
29 }
30
31 #include "IAmRoutingReceive.h"
32
33 #define RoutingSendVersion "1.0" 
34 namespace am {
35         /**
36          * This class implements everything from Audiomanager -> RoutingAdapter\r
37          * There are two rules that have to be kept in mind when implementing against this interface:\n\r
38          * \warning\r
39          * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n\r
40          * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.\n\r
41          * \details\r
42          * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n\r
43          * For more information, please check CAmSerializer
44          * @author Christian Mueller
45          * @created 05-Mar-2012 9:02:09 PM
46          */
47         class IAmRoutingSend
48         {
49
50         public:
51                 IAmRoutingSend() {
52
53                 }
54
55                 virtual ~IAmRoutingSend() {
56
57                 }
58
59                 /**
60                  * starts up the interface. In the implementations, here is the best place for init routines.
61                  * 
62                  * @param routingreceiveinterface    pointer to the receive interface
63                  */
64                 virtual am_Error_e startupInterface(IAmRoutingReceive* routingreceiveinterface) =0;
65                 /**
66                  * indicates that the routing now ready to be used. Should be used as trigger to register all sinks, sources, etc...
67                  * 
68                  * @param handle    handle that uniquely identifies the request
69                  */
70                 virtual void setRoutingReady(const uint16_t handle) =0;
71                 /**
72                  * indicates that the routing plugins need to be prepared to switch the power off or be ready again.
73                  * 
74                  * @param handle    the handle that uniquely identifies the request
75                  */
76                 virtual void setRoutingRundown(const uint16_t handle) =0;
77                 /**
78                  * aborts an asynchronous action.\r
79                  * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if handle was not found
80                  * 
81                  * @param handle
82                  */
83                 virtual am_Error_e asyncAbort(const am_Handle_s handle) =0;
84                 /**
85                  * connects a source to a sink\r
86                  * @return E_OK on success, E_UNKNOWN on error, E_WRONG_FORMAT in case am_ConnectionFormat_e does not match
87                  * 
88                  * @param handle
89                  * @param connectionID
90                  * @param sourceID
91                  * @param sinkID
92                  * @param connectionFormat
93                  */
94                 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;
95                 /**
96                  * disconnect a connection with given connectionID\r
97                  * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if connection was not found
98                  * 
99                  * @param handle
100                  * @param connectionID
101                  */
102                 virtual am_Error_e asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID) =0;
103                 /**
104                  * this method is used to set the volume of a sink. This function is used to drive ramps, to mute or unmute or directly set the value. The difference is made through the ramptype.\r
105                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if new volume is out of range
106                  * 
107                  * @param handle
108                  * @param sinkID
109                  * @param volume
110                  * @param ramp
111                  * @param time
112                  */
113                 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;
114                 /**
115                  * 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 mute or unmute or directly set the value. The difference is made through the ramptype.\r
116                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if volume is out of range.\r
117                  * triggers the acknowledge ackSourceVolumeChange
118                  * 
119                  * @param handle
120                  * @param sourceID
121                  * @param volume
122                  * @param ramp
123                  * @param time
124                  */
125                 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;
126                 /**
127                  * This function is used to set the source state of a particular source.\r
128                  * @return E_OK on success, E_UNKNOWN on error
129                  * 
130                  * @param handle
131                  * @param sourceID
132                  * @param state
133                  */
134                 virtual am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state) =0;
135                 /**
136                  * this function sets the sinksoundproperty.\r
137                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
138                  * 
139                  * @param handle
140                  * @param sinkID
141                  * @param listSoundProperties
142                  */
143                 virtual am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties) =0;
144                 /**
145                  * this function sets the sinksoundproperty.\r
146                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
147                  * 
148                  * @param handle
149                  * @param sinkID
150                  * @param soundProperty
151                  */
152                 virtual am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) =0;
153                 /**
154                  * this function sets the sourcesoundproperty.\r
155                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
156                  * 
157                  * @param handle
158                  * @param sourceID
159                  * @param listSoundProperties
160                  */
161                 virtual am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties) =0;
162                 /**
163                  * this function sets the sourcesoundproperty.\r
164                  * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
165                  * 
166                  * @param handle
167                  * @param sourceID
168                  * @param soundProperty
169                  */
170                 virtual am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) =0;
171                 /**
172                  * this function triggers crossfading.\r
173                  * @return E_OK on success, E_UNKNOWN on error
174                  * 
175                  * @param handle
176                  * @param crossfaderID
177                  * @param hotSink
178                  * @param rampType
179                  * @param time
180                  */
181                 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;
182                 /**
183                  * this function is used for early and late audio functions to set the domain state\r
184                  * @return E_OK on success, E_UNKNOWN on error
185                  * 
186                  * @param domainID
187                  * @param domainState
188                  */
189                 virtual am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) =0;
190                 /**
191                  * this method is used to retrieve the busname during startup of the plugin. Needs to be implemented\r
192                  * @return E_OK on success, E_UNKNOWN on error
193                  * 
194                  * @param BusName
195                  */
196                 virtual am_Error_e returnBusName(std::string& BusName) const =0;
197                 /**
198                  * This function returns the version of the interface
199                  * 
200                  * @param version
201                  */
202                 virtual void getInterfaceVersion(std::string& version) const =0;
203
204         };
205 }
206 #endif // !defined(EA_D9F37547_FAF0_4337_9048_07D8EDDE0AB0__INCLUDED_)