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_89F9440C_319B_486f_BAB5_91FED9A658C2__INCLUDED_)
\r
23 #define EA_89F9440C_319B_486f_BAB5_91FED9A658C2__INCLUDED_
\r
27 #include "audiomanagertypes.h"
\r
30 class IAmControlReceive;
\r
33 #include "IAmControlReceive.h"
34 #include "audiomanagertypes.h"
35 #include "NodeStateManager.h"
37 #define ControlSendVersion "2.0"
40 * This interface is presented by the AudioManager controller.
41 * All the hooks represent system events that need to be handled. The callback functions are used to handle for example
42 * answers to function calls on the AudioManagerCoreInterface.
43 * There are two rules that have to be kept in mind when implementing against this interface:\n
45 * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
46 * 2. YOU MAY NOT CALL THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.\n
48 * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-
49 * call pattern described on the wiki which also helps to implement calls that are forbidden.\n
50 * For more information, please check CAmSerializer
51 * @author Christian Mueller
52 * @created 17-Jan-2013 10:00:25
62 virtual ~IAmControlSend() {
67 * This function returns the version of the interface
68 * returns E_OK, E_UNKOWN if version is unknown.
72 virtual void getInterfaceVersion(std::string& version) const =0;
74 * Starts up the controller.
76 * @param controlreceiveinterface This is a pointer to the ControlReceiveInterface so that the controller knows to whom
79 virtual am_Error_e startupController(IAmControlReceive* controlreceiveinterface) =0;
81 * this message is used tell the controller that it should get ready. This message must be acknowledged via
82 * confirmControllerReady.
84 virtual void setControllerReady() =0;
86 * This message tells the controller that he should prepare everything for the power to be switched off. This message must
87 * be acknowledged via confirmControllerRundown.
88 * The method will give the signal as integer that was responsible for calling the setControllerRundown.
89 * This function is called from the signal handler, either direct (when the program is killed) or from within the mainloop
90 * (if the program is terminated).
92 * @param signal The signal NO that was responsible for the rundown. Can be:
98 virtual void setControllerRundown(const int16_t signal) =0;
100 * is called when a connection request comes in via the command interface
101 * @return E_OK on success, E_NOT_POSSIBLE on error, E_ALREADY_EXISTENT if already exists
105 * @param mainConnectionID
107 virtual am_Error_e hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID) =0;
109 * is called when a disconnection request comes in via the command interface
110 * @return E_OK on success, E_NOT_POSSIBLE on error, E_NON_EXISTENT if connection does not exists
112 * @param connectionID
114 virtual am_Error_e hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID) =0;
116 * sets a user MainSinkSoundProperty
117 * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
120 * @param soundProperty
122 virtual am_Error_e hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty) =0;
124 * sets a user MainSourceSoundProperty
125 * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
128 * @param soundProperty
130 virtual am_Error_e hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty) =0;
132 * sets a user SystemProperty
133 * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
137 virtual am_Error_e hookUserSetSystemProperty(const am_SystemProperty_s& property) =0;
140 * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
145 virtual am_Error_e hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume) =0;
147 * sets a user volume as increment
148 * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
151 * @param increment the steps
153 virtual am_Error_e hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment) =0;
155 * sets the mute state of a sink
156 * @return E_OK on success, E_UNKNOWN on error
159 * @param muteState true=muted
161 virtual am_Error_e hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState) =0;
163 * is called when a routing adaptor registers its domain
164 * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXISTENT if already exists
166 * @param domainData ID is omitted here since it has not been created yet
169 virtual am_Error_e hookSystemRegisterDomain(const am_Domain_s& domainData, am_domainID_t& domainID) =0;
171 * is called when a routing adaptor wants to derigister a domain
172 * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if not found
176 virtual am_Error_e hookSystemDeregisterDomain(const am_domainID_t domainID) =0;
178 * is called when a domain registered all the elements
182 virtual void hookSystemDomainRegistrationComplete(const am_domainID_t domainID) =0;
184 * is called when a routing adaptor registers a sink
185 * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXISTENT if already exists
187 * @param sinkData Id is omitted here, since it has not been created yet
190 virtual am_Error_e hookSystemRegisterSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID) =0;
192 * is called when a routing adaptor deregisters a sink
193 * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if not found
197 virtual am_Error_e hookSystemDeregisterSink(const am_sinkID_t sinkID) =0;
199 * is called when a routing adaptor registers a source
200 * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXISTENT if already exists
202 * @param sourceData ID is omitted here since it is not yet created
205 virtual am_Error_e hookSystemRegisterSource(const am_Source_s& sourceData, am_sourceID_t& sourceID) =0;
207 * is called when a routing adaptor deregisters a source
208 * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if not found
212 virtual am_Error_e hookSystemDeregisterSource(const am_sourceID_t sourceID) =0;
214 * is called when a routing adaptor registers a gateway
215 * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXISTENT if already exists
217 * @param gatewayData gatewayID is not set here since it is not created at this point of time
220 virtual am_Error_e hookSystemRegisterGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID) =0;
222 * is called when a routing adaptor deregisters a gateway
223 * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if not found
227 virtual am_Error_e hookSystemDeregisterGateway(const am_gatewayID_t gatewayID) =0;
229 * is called when a routing adaptor registers a crossfader
230 * @return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXISTENT if already exists
232 * @param crossfaderData gatewayID is not set here since it is not created at this point of time
233 * @param crossfaderID
235 virtual am_Error_e hookSystemRegisterCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID) =0;
237 * is called when a routing adaptor deregisters a crossfader
238 * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if not found
240 * @param crossfaderID
242 virtual am_Error_e hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID) =0;
244 * volumeticks. therse are used to indicate volumechanges during a ramp
250 virtual void hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume) =0;
252 * volumeticks. therse are used to indicate volumechanges during a ramp
258 virtual void hookSystemSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume) =0;
260 * is called when an low level interrupt changed its state
263 * @param interruptState
265 virtual void hookSystemInterruptStateChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState) =0;
267 * id called when a sink changed its availability
270 * @param availability
272 virtual void hookSystemSinkAvailablityStateChange(const am_sinkID_t sinkID, const am_Availability_s& availability) =0;
274 * id called when a source changed its availability
277 * @param availability
279 virtual void hookSystemSourceAvailablityStateChange(const am_sourceID_t sourceID, const am_Availability_s& availability) =0;
281 * id called when domainstate was changed
286 virtual void hookSystemDomainStateChange(const am_domainID_t domainID, const am_DomainState_e state) =0;
288 * when early data was received
292 virtual void hookSystemReceiveEarlyData(const std::vector<am_EarlyData_s>& data) =0;
294 * this hook provides information about speed changes.
295 * The quantization and sampling rate of the speed can be adjusted at compile time of the AudioManagerDaemon.
299 virtual void hookSystemSpeedChange(const am_speed_t speed) =0;
301 * this hook is fired whenever the timing information of a mainconnection has changed.
303 * @param mainConnectionID
306 virtual void hookSystemTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time) =0;
313 virtual void cbAckConnect(const am_Handle_s handle, const am_Error_e errorID) =0;
320 virtual void cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID) =0;
322 * ack for crossfading
328 virtual void cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error) =0;
330 * ack for sink volume changes
336 virtual void cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) =0;
338 * ack for source volume changes
340 * @param handle the handle that is connected to the volume change
341 * @param voulme the volume after the action ended (the desired volume if everything went right, the actual one in case
345 virtual void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error) =0;
347 * ack for setting of source states
352 virtual void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error) =0;
354 * ack for setting of sourcesoundproperties
359 virtual void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
361 * ack for setting of sourcesoundproperties
366 virtual void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
368 * ack for setting of sinksoundproperties
373 virtual void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
375 * ack for setting of sinksoundproperties
380 virtual void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
382 * This function is used by the routing algorithm to retrieve a priorized list of connectionFormats from the Controller.
383 * @return E_OK in case of successfull priorisation.
385 * @param sourceID sourceID of source that shall be connected
386 * @param sinkID sinkID of sink that shall be connected
387 * @param listRoute This route is the one the priorized connectionFormats is for.
388 * @param listPossibleConnectionFormats list of possible connectionformats
389 * @param listPrioConnectionFormats the list return with prioos from the controller. Best choice on first position.
391 virtual am_Error_e getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector<am_ConnectionFormat_e> listPossibleConnectionFormats, std::vector<am_ConnectionFormat_e>& listPrioConnectionFormats) =0;
393 * confirms the setCommandReady call
395 * @param error E_OK if everything went right. If a plugin returns an error, it will be forwared here
397 virtual void confirmCommandReady(const am_Error_e error) =0;
399 * confirms the setRoutingReady call
401 * @param error E_OK if everything went right. If a plugin returns an error, it will be forwared here
403 virtual void confirmRoutingReady(const am_Error_e error) =0;
405 * confirms the setCommandRundown call
407 * @param error E_OK if everything went right. If a plugin returns an error, it will be forwared here
409 virtual void confirmCommandRundown(const am_Error_e error) =0;
411 * confirms the setRoutingRundown command
413 * @param error E_OK if everything went right. If a plugin returns an error, it will be forwared here
415 virtual void confirmRoutingRundown(const am_Error_e error) =0;
417 * update form the SinkData
419 * @param sinkID the sinkID
421 * @param listSoundProperties
422 * @param listConnectionFormats
423 * @param listMainSoundProperties
425 virtual am_Error_e hookSystemUpdateSink(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;
427 * update from the source Data
429 * @param sourceID the sourceID
430 * @param sourceClassID
431 * @param listSoundProperties
432 * @param listConnectionFormats
433 * @param listMainSoundProperties
435 virtual am_Error_e hookSystemUpdateSource(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;
437 * updates the Gateway Data
439 * @param gatewayID the gatewayID
440 * @param listSourceConnectionFormats
441 * @param listSinkConnectionFormats
442 * @param convertionMatrix
444 virtual am_Error_e hookSystemUpdateGateway(const am_gatewayID_t gatewayID, const std::vector<am_ConnectionFormat_e>& listSourceConnectionFormats, const std::vector<am_ConnectionFormat_e>& listSinkConnectionFormats, const std::vector<bool>& convertionMatrix) =0;
446 * ack for mulitple volume changes
449 * @param listVolumes the list of volumes with the current status
452 virtual void cbAckSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes, const am_Error_e error) =0;
454 * The acknowledge of the sink notification configuration
456 * @param handle the handle
457 * @param error the error
459 virtual void cbAckSetSinkNotificationConfiguration(const am_Handle_s handle, const am_Error_e error) =0;
461 * The acknowledge of the source notification configuration
463 * @param handle the handle
464 * @param error the error
466 virtual void cbAckSetSourceNotificationConfiguration(const am_Handle_s handle, const am_Error_e error) =0;
468 * new sinkNotification data is there!
470 * @param sinkID the sinkID of the changed notification
471 * @param payload the payload
473 virtual void hookSinkNotificationDataChanged(const am_sinkID_t sinkID, const am_NotificationPayload_s& payload) =0;
475 * new sourceNotification data is there!
477 * @param sourceID the sourceID of the changed notification
478 * @param payload the payload
480 virtual void hookSourceNotificationDataChanged(const am_sourceID_t sourceID, const am_NotificationPayload_s& payload) =0;
482 * sets a user MainSinkNotificationConfiguration
483 * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
486 * @param notificationConfiguration
488 virtual am_Error_e hookUserSetMainSinkNotificationConfiguration(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration) =0;
490 * sets a user MainSourceNotificationConfiguration
491 * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
494 * @param notificationConfiguration
496 virtual am_Error_e hookUserSetMainSourceNotificationConfiguration(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration) =0;
498 * This hook is connected to the NodeState signal of the NodeStateManager
500 * @param NodeStateId The new current state of the node
502 virtual void hookSystemNodeStateChanged(const NsmNodeState_e NodeStateId) =0;
504 * This hook is connected to the NodeApplicationMode signal of the NodeStateManager
506 * @param ApplicationModeId The new ApplicationMode
508 virtual void hookSystemNodeApplicationModeChanged(const NsmApplicationMode_e ApplicationModeId) =0;
510 * the sessionstate change was send by the NSM
514 * @param sessionStateID
516 virtual void hookSystemSessionStateChanged(const std::string& sessionName, const NsmSeat_e seatID, const NsmSessionState_e sessionStateID) =0;
518 * A lifecycle request comes in from the NSM and must be processed.
519 * @return NsmErrorStatus_Ok if successful
520 * The controller has to respond to this message with LifecycleRequestComplete.
522 * @param Request the shutdown request from the NSM. One of the types
524 * NSM_SHUTDOWNTYPE_RUNUP, NSM_SHUTDOWNTYPE_NORMAL
525 * NSM_SHUTDOWNTYPE_FAST
527 * In order to receive this request, the controller needs to register for this request first via RegisterShutdownClient
528 * @param RequestId the requestID
530 virtual NsmErrorStatus_e hookSystemLifecycleRequest(const uint32_t Request, const uint32_t RequestId) =0;
534 #endif // !defined(EA_89F9440C_319B_486f_BAB5_91FED9A658C2__INCLUDED_)