2 * Copyright (C) 2012, GENIVI Alliance, Inc.
\r
3 * Copyright (C) 2012, BMW AG
\r
5 * This file is part of GENIVI Project AudioManager.
\r
7 * Contributions are licensed to the GENIVI Alliance under one or more
\r
8 * Contribution License Agreements.
\r
11 * This Source Code Form is subject to the terms of the
\r
12 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
\r
13 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
\r
16 * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
\r
18 * \file CAmCommandReceiver.h
\r
19 * For further information see http://www.genivi.org/.
\r
21 * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
\r
23 #if !defined(EA_399CFD88_31F4_4806_9747_4F98FB938FFD__INCLUDED_)
\r
24 #define EA_399CFD88_31F4_4806_9747_4F98FB938FFD__INCLUDED_
\r
28 #include "audiomanagertypes.h"
\r
30 class CAmDbusWrapper;
\r
31 class CAmSocketHandler;
\r
35 #define CommandReceiveVersion "1.0"
38 * 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
39 * There are two rules that have to be kept in mind when implementing against this interface:\n
\r
41 * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
\r
42 * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.\n
\r
44 * 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
45 * For more information, please check CAmSerializer
46 * @author Christian Mueller
47 * @created 06-Mar-2012 9:46:48 AM
49 class IAmCommandReceive
57 virtual ~IAmCommandReceive() {
62 * connects a source to sink
\r
63 * @return E_OK on success, E_NOT_POSSIBLE on failure, E_ALREADY_EXISTS if the connection does already exists
67 * @param mainConnectionID
69 virtual am_Error_e connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID) =0;
71 * disconnects a mainConnection
\r
72 * @return E_OK on successes, E_NON_EXISTENT if the connection does not exist, E_NOT_POSSIBLE on error.
74 * @param mainConnectionID
76 virtual am_Error_e disconnect(const am_mainConnectionID_t mainConnectionID) =0;
78 * sets the volume for a sink
\r
79 * @return E_OK on success, E_UNKOWN on error, E_OUT_OF_RANGE in case the value is out of range
81 * @param sinkID the sink
82 * @param volume the volume
84 virtual am_Error_e setVolume(const am_sinkID_t sinkID, const am_mainVolume_t volume) =0;
86 * This function is used to increment or decrement the current volume for a sink.
\r
87 * @return E_OK on success, E_UNKNOWN on error and E_OUT_OF_RANGE if the value is not in the given volume range.
90 * @param volumeStep indicated the number of steps that should be incremented or decremented. Positive values here inkrement, negative values decrement
92 virtual am_Error_e volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep) =0;
94 * sets the mute state of a sink
\r
95 * @return E_OK on success, E_UNKNOWN on error. If the mute state is already the desired one, the Daemon will return E_OK.
100 virtual am_Error_e setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState) =0;
102 * 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
103 * @return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in case of an error
105 * @param soundProperty
108 virtual am_Error_e setMainSinkSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID) =0;
110 * 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
111 * @return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in case of an error
113 * @param soundProperty
116 virtual am_Error_e setMainSourceSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID) =0;
118 * is used to set a specific system property.
\r
119 * @return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in case of an error
121 * @param property the property that shall be set
123 virtual am_Error_e setSystemProperty(const am_SystemProperty_s& property) =0;
125 * returns the actual list of MainConnections
\r
126 * @return E_OK on success, E_DATABASE_ERROR on error
128 * @param listConnections returns a list of all connections
130 virtual am_Error_e getListMainConnections(std::vector<am_MainConnectionType_s>& listConnections) const =0;
132 * returns the actual list of Sinks
\r
133 * @return E_OK on success, E_DATABASE_ERROR on error
135 * @param listMainSinks the list of the sinks
137 virtual am_Error_e getListMainSinks(std::vector<am_SinkType_s>& listMainSinks) const =0;
139 * returns the actual list of Sources
\r
140 * @return E_OK on success, E_DATABASE_ERROR on error
142 * @param listMainSources the list of sources
144 virtual am_Error_e getListMainSources(std::vector<am_SourceType_s>& listMainSources) const =0;
146 * 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
147 * @return E_OK on success, E_DATABASE_ERROR on error
150 * @param listSoundProperties
152 virtual am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties) const =0;
154 * This is used to retrieve all source sound properties related to a source.
\r
155 * @return E_OK on success, E_DATABASE_ERROR on error
158 * @param listSourceProperties
160 virtual am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties) const =0;
162 * This is used to retrieve SourceClass Information of all source classes
\r
163 * @return E_OK on success, E_DATABASE_ERROR on error
165 * @param listSourceClasses
167 virtual am_Error_e getListSourceClasses(std::vector<am_SourceClass_s>& listSourceClasses) const =0;
169 * This is used to retrieve SinkClass Information of all sink classes
\r
170 * @return E_OK on success, E_DATABASE_ERROR on error
172 * @param listSinkClasses
174 virtual am_Error_e getListSinkClasses(std::vector<am_SinkClass_s>& listSinkClasses) const =0;
176 * Retrieves a complete list of all systemProperties.
\r
177 * @return E_OK on success, E_DATABASE_ERROR on error
179 * @param listSystemProperties
181 virtual am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const =0;
183 * returns the delay in ms that the audiopath for the given mainConnection has
\r
184 * @return E_OK on success, E_NOT_POSSIBLE if timing information is not yet retrieved, E_DATABASE_ERROR on read error on the database
186 * @param mainConnectionID
189 virtual am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const =0;
191 * this function is used to retrieve a pointer to the dBusConnectionWrapper
\r
192 * @return E_OK if pointer is valid, E_UKNOWN if AudioManager was compiled without DBus Support
194 * @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)
196 virtual am_Error_e getDBusConnectionWrapper(CAmDbusWrapper*& dbusConnectionWrapper) const =0;
198 * 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
199 * returns E_OK if pointer is valid, E_UNKNOWN in case AudioManager was compiled without socketHandler support,
201 * @param socketHandler
203 virtual am_Error_e getSocketHandler(CAmSocketHandler*& socketHandler) const =0;
205 * This function returns the version of the interface.
209 virtual void getInterfaceVersion(std::string& version) const =0;
211 * asynchronous confirmation of setCommandReady.
213 * @param handle the handle that was handed over by setCommandReady
215 virtual void confirmCommandReady(const uint16_t handle) =0;
217 * asynchronous confirmation of setCommandRundown
219 * @param handle the handle that was given via setCommandRundown
221 virtual void confirmCommandRundown(const uint16_t handle) =0;
225 #endif // !defined(EA_399CFD88_31F4_4806_9747_4F98FB938FFD__INCLUDED_)