bd76d3519611b25d0f3bb8c7544e73df07e37f10
[profile/ivi/audiomanager.git] / include / command / IAmCommandReceive.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_1D908AFD_101D_4782_AA75_196D1BE1ED96__INCLUDED_)\r
21 #define EA_1D908AFD_101D_4782_AA75_196D1BE1ED96__INCLUDED_\r
22 \r
23 #include <vector>\r
24 #include <string>\r
25 #include "audiomanagertypes.h"\r
26 namespace am {\r
27 class CAmDbusWrapper;\r
28 class CAmSocketHandler;\r
29 }\r
30
31
32 #define CommandReceiveVersion "1.0" 
33 namespace am {
34         /**
35          * The interface towards the Controlling Instance (e.g HMI). It handles the communication towards the HMI and other system components who need to interact with the audiomanagement.\r
36          * There are two rules that have to be kept in mind when implementing against this interface:\n\r
37          * \warning\r
38          * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n\r
39          * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.\n\r
40          * \details\r
41          * 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
42          * For more information, please check CAmSerializer
43          * @author Christian Mueller
44          * @created 05-Mar-2012 9:02:07 PM
45          */
46         class IAmCommandReceive
47         {
48
49         public:
50                 IAmCommandReceive() {
51
52                 }
53
54                 virtual ~IAmCommandReceive() {
55
56                 }
57
58                 /**
59                  * connects a source to sink\r
60                  * @return E_OK on success, E_NOT_POSSIBLE on failure, E_ALREADY_EXISTS if the connection does already exists
61                  * 
62                  * @param sourceID
63                  * @param sinkID
64                  * @param mainConnectionID
65                  */
66                 virtual am_Error_e connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID) =0;
67                 /**
68                  * disconnects a mainConnection\r
69                  * @return E_OK on successes, E_NON_EXISTENT if the connection does not exist, E_NOT_POSSIBLE on error.
70                  * 
71                  * @param mainConnectionID
72                  */
73                 virtual am_Error_e disconnect(const am_mainConnectionID_t mainConnectionID) =0;
74                 /**
75                  * sets the volume for a sink\r
76                  * @return E_OK on success, E_UNKOWN on error, E_OUT_OF_RANGE in case the value is out of range
77                  * 
78                  * @param sinkID    the sink
79                  * @param volume    the volume
80                  */
81                 virtual am_Error_e setVolume(const am_sinkID_t sinkID, const am_mainVolume_t volume) =0;
82                 /**
83                  * This function is used to increment or decrement the current volume for a sink.\r
84                  * @return E_OK on success, E_UNKNOWN on error and E_OUT_OF_RANGE if the value is not in the given volume range.
85                  * 
86                  * @param sinkID
87                  * @param volumeStep    indicated the number of steps that should be incremented or decremented. Positive values here inkrement, negative values decrement
88                  */
89                 virtual am_Error_e volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep) =0;
90                 /**
91                  * sets the mute state of a sink\r
92                  * @return E_OK on success, E_UNKNOWN on error. If the mute state is already the desired one, the Daemon will return E_OK.
93                  * 
94                  * @param sinkID
95                  * @param muteState
96                  */
97                 virtual am_Error_e setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState) =0;
98                 /**
99                  * This method is used to set sound properties, e.g. Equalizer Values. Since the capabilities of the system can differ, the exact key value pairs can be extended in each product\r
100                  * @return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in case of an error
101                  * 
102                  * @param soundProperty
103                  * @param sinkID
104                  */
105                 virtual am_Error_e setMainSinkSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID) =0;
106                 /**
107                  * This method is used to set sound properties, e.g. Equalizer Values. Since the capabilities of the system can differ, the exact key value pairs can be extended in each product\r
108                  * @return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in case of an error
109                  * 
110                  * @param soundProperty
111                  * @param sourceID
112                  */
113                 virtual am_Error_e setMainSourceSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID) =0;
114                 /**
115                  * is used to set a specific system property.\r
116                  * @return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in case of an error
117                  * 
118                  * @param property    the property that shall be set
119                  */
120                 virtual am_Error_e setSystemProperty(const am_SystemProperty_s& property) =0;
121                 /**
122                  * returns the actual list of MainConnections\r
123                  * @return E_OK on success, E_DATABASE_ERROR on error 
124                  * 
125                  * @param listConnections    returns a list of all connections
126                  */
127                 virtual am_Error_e getListMainConnections(std::vector<am_MainConnectionType_s>& listConnections) const =0;
128                 /**
129                  * returns the actual list of Sinks\r
130                  * @return E_OK on success, E_DATABASE_ERROR on error 
131                  * 
132                  * @param listMainSinks    the list of the sinks
133                  */
134                 virtual am_Error_e getListMainSinks(std::vector<am_SinkType_s>& listMainSinks) const =0;
135                 /**
136                  * returns the actual list of Sources\r
137                  * @return E_OK on success, E_DATABASE_ERROR on error 
138                  * 
139                  * @param listMainSources    the list of sources
140                  */
141                 virtual am_Error_e getListMainSources(std::vector<am_SourceType_s>& listMainSources) const =0;
142                 /**
143                  * This is used to retrieve all source sound properties related to a source. Returns a vector of the sound properties and values as pair\r
144                  * @return E_OK on success, E_DATABASE_ERROR on error 
145                  * 
146                  * @param sinkID
147                  * @param listSoundProperties
148                  */
149                 virtual am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties) const =0;
150                 /**
151                  * This is used to retrieve all source sound properties related to a source.\r
152                  * @return E_OK on success, E_DATABASE_ERROR on error 
153                  * 
154                  * @param sourceID
155                  * @param listSourceProperties
156                  */
157                 virtual am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties) const =0;
158                 /**
159                  * This is used to retrieve SourceClass Information of all source classes \r
160                  * @return E_OK on success, E_DATABASE_ERROR on error 
161                  * 
162                  * @param listSourceClasses
163                  */
164                 virtual am_Error_e getListSourceClasses(std::vector<am_SourceClass_s>& listSourceClasses) const =0;
165                 /**
166                  * This is used to retrieve SinkClass Information of all sink classes \r
167                  * @return E_OK on success, E_DATABASE_ERROR on error 
168                  * 
169                  * @param listSinkClasses
170                  */
171                 virtual am_Error_e getListSinkClasses(std::vector<am_SinkClass_s>& listSinkClasses) const =0;
172                 /**
173                  * Retrieves a complete list of all systemProperties.\r
174                  * @return E_OK on success, E_DATABASE_ERROR on error 
175                  * 
176                  * @param listSystemProperties
177                  */
178                 virtual am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const =0;
179                 /**
180                  * returns the delay in ms that the audiopath for the given mainConnection has\r
181                  * @return E_OK on success, E_NOT_POSSIBLE if timing information is not yet retrieved, E_DATABASE_ERROR on read error on the database
182                  * 
183                  * @param mainConnectionID
184                  * @param delay
185                  */
186                 virtual am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const =0;
187                 /**
188                  * this function is used to retrieve a pointer to the dBusConnectionWrapper\r
189                  * @return E_OK if pointer is valid, E_UKNOWN if AudioManager was compiled without DBus Support
190                  * 
191                  * @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)
192                  */
193                 virtual am_Error_e getDBusConnectionWrapper(CAmDbusWrapper*& dbusConnectionWrapper) const =0;
194                 /**
195                  * 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
196                  * returns E_OK if pointer is valid, E_UNKNOWN in case AudioManager was compiled without socketHandler support,
197                  * 
198                  * @param socketHandler
199                  */
200                 virtual am_Error_e getSocketHandler(CAmSocketHandler*& socketHandler) const =0;
201                 /**
202                  * This function returns the version of the interface.
203                  * 
204                  * @param version
205                  */
206                 virtual void getInterfaceVersion(std::string& version) const =0;
207                 /**
208                  * asynchronous confirmation of setCommandReady.
209                  * 
210                  * @param handle    the handle that was handed over by setCommandReady
211                  */
212                 virtual void confirmCommandReady(const uint16_t handle) =0;
213                 /**
214                  * asynchronous confirmation of setCommandRundown
215                  * 
216                  * @param handle    the handle that was given via setCommandRundown
217                  */
218                 virtual void confirmCommandRundown(const uint16_t handle) =0;
219
220         };
221 }
222 #endif // !defined(EA_1D908AFD_101D_4782_AA75_196D1BE1ED96__INCLUDED_)