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