2 * Copyright (C) 2012, BMW AG
\r
4 * This file is part of GENIVI Project AudioManager.
\r
6 * Contributions are licensed to the GENIVI Alliance under one or more
\r
7 * Contribution License Agreements.
\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
15 * \author Christian Mueller, christian.linke@bmw.de BMW 2011,2012
\r
18 * For further information see http://www.genivi.org/.
\r
20 * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
\r
22 #if !defined(EA_B7A11CC8_9777_4421_8677_D9CE084D5E2B__INCLUDED_)
\r
23 #define EA_B7A11CC8_9777_4421_8677_D9CE084D5E2B__INCLUDED_
\r
27 #include "audiomanagertypes.h"
\r
30 class CAmDbusWrapper;
\r
31 class CAmSocketHandler;
\r
35 #include "audiomanagertypes.h"
37 #define RoutingReceiveVersion "2.0"
40 * Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
41 * There are two rules that have to be kept in mind when implementing against this interface:\n
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
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:25
52 class IAmRoutingReceive
60 virtual ~IAmRoutingReceive() {
65 * This function returns the version of the interface
67 * @param version retrieves the verison of the interface
69 virtual void getInterfaceVersion(std::string& version) const =0;
71 * acknowledges a asyncConnect
75 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
77 virtual void ackConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error) =0;
79 * acknowledges a asyncDisconnect
83 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
85 virtual void ackDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error) =0;
87 * acknowledges a asyncsetSinkVolume
90 * @param volume The current actual value that is set
91 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
93 virtual void ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) =0;
95 * acknowledges a asyncsetSourceVolume
97 * @param handle handle that belongs to the change
98 * @param volume the current volume
99 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
101 virtual void ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) =0;
103 * acknowlegde for asyncSetSourceState
106 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
108 virtual void ackSetSourceState(const am_Handle_s handle, const am_Error_e error) =0;
110 * acknowledges asyncSetSinkSoundProperties
113 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
115 virtual void ackSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
117 * acknowledges asyncSetSinkSoundProperty
120 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
122 virtual void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
124 * acknowledges asyncSetSourceSoundProperties
127 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
129 virtual void ackSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
131 * acknowledges asyncSetSourceSoundProperty
134 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
136 virtual void ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
138 * acknowledges asyncCrossFade
141 * @param hotSink this is the current hot sink, HS_INTERMEDIATE is here when a crossfading action did not reach the end
142 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
144 virtual void ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error) =0;
146 * acknowledges a volume tick. This can be used to display volumechanges during ramps
152 virtual void ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume) =0;
154 * acknowledges a volume tick. This can be used to display volumechanges during ramps
160 virtual void ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume) =0;
162 * This function returns the ID to the given domainName. If already a domain is registered with this name, it will return
163 * the corresponding ID, if not it will reserve an ID but not register the domain. The other parameters of the domain will
164 * be overwritten when the domain is registered.
165 * @return E_OK on success, E_UNKNOWN on error
170 virtual am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID) =0;
173 * @return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
175 * @param domainData domainID in am_Domain_s must be 0!
178 virtual am_Error_e registerDomain(const am_Domain_s& domainData, am_domainID_t& domainID) =0;
180 * deregisters a domain. All sources, sinks, gateways and crossfaders from that domain will be removed as well.
181 * @return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
183 * @param domainID < the nonde of the bus
185 virtual am_Error_e deregisterDomain(const am_domainID_t domainID) =0;
187 * registers a gateway. @return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
189 * @param gatewayData In a fixed setup, the gatewayID must be below 100. In a dynamic setup, the gatewayID shall be 0.
190 * listSourceFormats and listSinkFormats are empty at registration time. Values are taken over when sources and sinks are
196 virtual am_Error_e registerGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID) =0;
198 * deregisters a gateway. Also removes all sinks and sources of the controlling domain.
199 * @return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
201 * @param gatewayID domainID of the control domain
203 virtual am_Error_e deregisterGateway(const am_gatewayID_t gatewayID) =0;
205 * This function returns the ID to the given sinkName. If already a sink is registered with this name, it will return the
206 * corresponding ID, if not it will reserve an ID but not register the sink. The other parameters of the sink will be
207 * overwritten when the sink is registered.
208 * @return E_OK on success, E_UNKNOWN on error
210 * @param name ID is not valid since not created yet
213 virtual am_Error_e peekSink(const std::string& name, am_sinkID_t& sinkID) =0;
215 * Registers a sink. If the sink is part of a gateway, the listconnectionFormats is copied to the gatewayInformation
216 * @return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
218 * @param sinkData In a fixed setup, the sinkID within am_Sink_s must be below 100. In a dynamic setup the sinkID must
222 virtual am_Error_e registerSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID) =0;
224 * deregisters a sink.
225 * @return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
229 virtual am_Error_e deregisterSink(const am_sinkID_t sinkID) =0;
231 * This function returns the ID to the given sourceName. If already a source is registered with this name, it will return
232 * the corresponding ID, if not it will reserve an ID but not register the source. The other parameters of the source will
233 * be overwritten when the source is registered.
234 * @return E_OK on success, E_UNKNOWN on error
239 virtual am_Error_e peekSource(const std::string& name, am_sourceID_t& sourceID) =0;
241 * registers a source. If the source is part of a gateway, the listconnectionFormats is copied to the gatewayInformation
242 * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXIST if either name or sourceID already exists
244 * @param sourceData In a fixed setup, the sourceID within am_Source_s must be below 100. In a dynamic setup the
245 * sourceID must be 0 in am_Source_s
248 virtual am_Error_e registerSource(const am_Source_s& sourceData, am_sourceID_t& sourceID) =0;
250 * deregisters a source
251 * @return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
255 virtual am_Error_e deregisterSource(const am_sourceID_t sourceID) =0;
257 * this function registers a crossfader.
258 * @return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
260 * @param crossfaderData in a fixed setup, the crossfaderID must be below 100. In a dynamic setup the crossfasderID
262 * @param crossfaderID
264 virtual am_Error_e registerCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID) =0;
266 * this function deregisters a crossfader. removes all sources and sinks assiated as well.
267 * @return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
269 * @param crossfaderID
271 virtual am_Error_e deregisterCrossfader(const am_crossfaderID_t crossfaderID) =0;
273 * this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
274 * @return E_OK on succes, E_DATABASE_ERROR on error
277 * @param sourceClassID
279 virtual am_Error_e peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID) =0;
281 * this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
282 * @return E_OK on succes, E_DATABASE_ERROR on error
287 virtual am_Error_e peekSinkClassID(const std::string& name, am_sinkClass_t& sinkClassID) =0;
289 * is called when a low level interrupt changes it status.
292 * @param interruptState
294 virtual void hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState) =0;
296 * This hook is called when all elements from a domain are registered.
297 * Is used by the Controller to know when all expected domains are finally registered
301 virtual void hookDomainRegistrationComplete(const am_domainID_t domainID) =0;
303 * is called when a sink changes its availability
306 * @param availability
308 virtual void hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s& availability) =0;
310 * is called when a source changes its availability
313 * @param availability
315 virtual void hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s& availability) =0;
317 * is called when a domain changes its status. This used for early domains only
322 virtual void hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState) =0;
324 * is called when the timinginformation (delay) changed for a connection.
326 * @param connectionID
329 virtual void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay) =0;
331 * this function is used to send out all data that has been changed in an early state.
332 * @return E_OK on success, E_UNKNOWN on error
336 virtual void sendChangedData(const std::vector<am_EarlyData_s>& earlyData) =0;
338 * this function is used to retrieve a pointer to the dBusConnectionWrapper
339 * @return E_OK if pointer is valid, E_UKNOWN if AudioManager was compiled without DBus Support
341 * @param dbusConnectionWrapper This is a wrapper class that is needed to keep dbus inclusions away from the interface.
342 * The DBusWrapperClass will return the pointer to the DbusConnection call (getDBusConnection)
344 virtual am_Error_e getDBusConnectionWrapper(CAmDbusWrapper*& dbusConnectionWrapper) const =0;
346 * This function returns the pointer to the socketHandler. This can be used to integrate socket-based activites like
347 * communication with the mainloop of the AudioManager.
348 * returns E_OK if pointer is valid, E_UNKNOWN in case AudioManager was compiled without socketHandler support,
350 * @param socketHandler
352 virtual am_Error_e getSocketHandler(CAmSocketHandler*& socketHandler) const =0;
354 * confirms the setRoutingReady Command
356 * @param handle the handle that was given via setRoutingReady
357 * @param error E_OK if the ready command succeeded. E_UNKNOWN if an error happened.
359 virtual void confirmRoutingReady(const uint16_t handle, const am_Error_e error) =0;
361 * confirms the setRoutingRundown Command
363 * @param handle handle that was given via setRoutingRundown
364 * @param error E_OK if the ready command succeeded. E_UNKNOWN if an error happened.
366 virtual void confirmRoutingRundown(const uint16_t handle, const am_Error_e error) =0;
368 * updates data of an gateway. @return E_OK on success, E_NON_EXISTENT if the gatewayID is not valid.
370 * @param gatewayID This is the new gateway data that has been updated. Please note that changing source and sink IDs,
372 * @param listSourceFormats
373 * @param listSinkFormats
374 * @param convertionMatrix
376 virtual am_Error_e updateGateway(const am_gatewayID_t gatewayID, const std::vector<am_ConnectionFormat_e>& listSourceFormats, const std::vector<am_ConnectionFormat_e>& listSinkFormats, const std::vector<bool>& convertionMatrix) =0;
378 * updates data of an gateway. @return E_OK on success, E_NON_EXISTENT if the sinkID is not valid.
380 * @param sinkID The sinkID of the sink
382 * @param listSoundProperties
383 * @param listConnectionFormats
384 * @param listMainSoundProperties
386 virtual am_Error_e updateSink(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_ConnectionFormat_e>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties) =0;
388 * updates data of an source. @return E_OK on success, E_NON_EXISTENT if the sourceID in the struct is not valid.
389 * Please note that only the following data out of am_Source_s have effect when they are changed:
391 * listSoundProperties,
392 * listConnectionFormats,
393 * listMainSoundProperties
395 * @param sourceID the sourceID of the source
396 * @param sourceClassID
397 * @param listSoundProperties
398 * @param listConnectionFormats
399 * @param listMainSoundProperties
401 virtual am_Error_e updateSource(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_ConnectionFormat_e>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties) =0;
403 * acknowledges a asyncSetSinkVolumes
406 * @param listvolumes The list of volumes that have been set. ramp and time values have no meaning when the struct is
408 * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
410 virtual void ackSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listvolumes, const am_Error_e error) =0;
412 * The acknowledge of the SinkNotificationConfiguration
417 virtual void ackSinkNotificationConfiguration(const am_Handle_s handle, const am_Error_e error) =0;
419 * The acknowledge of the SourceNotificationConfiguration
424 virtual void ackSourceNotificationConfiguration(const am_Handle_s handle, const am_Error_e error) =0;
426 * is called whenever a notified value needs to be send
428 * @param sinkID The sinkID of the sink where the data changed
429 * @param payload The payload
431 virtual void hookSinkNotificationDataChange(const am_sinkID_t sinkID, const am_NotificationPayload_s& payload) =0;
433 * is called whenever a notified value needs to be send
435 * @param sourceID The sinkID of the sink where the data changed
436 * @param payload The payload
438 virtual void hookSourceNotificationDataChange(const am_sourceID_t sourceID, const am_NotificationPayload_s& payload) =0;
442 #endif // !defined(EA_B7A11CC8_9777_4421_8677_D9CE084D5E2B__INCLUDED_)