update changelog
[profile/ivi/genivi/genivi-audio-manager.git] / include / routing / IAmRoutingSend.h
1 /**
2  * Copyright (C) 2012 - 2014, BMW AG
3  *
4  * This file is part of GENIVI Project AudioManager.
5  *
6  * Contributions are licensed to the GENIVI Alliance under one or more
7  * Contribution License Agreements.
8  *
9  * \copyright
10  * This Source Code Form is subject to the terms of the
11  * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
12  * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
13  *
14  *
15  * \author Christian Linke, christian.linke@bmw.de BMW 2011 - 2014
16  *
17  * \file
18  * For further information see http://projects.genivi.org/audio-manager
19  *
20  * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. 
21  * PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN.
22  */
23 #if !defined(EA_75F8849C_0F4B_4641_B0B9_01DE137E6938__INCLUDED_)
24 #define EA_75F8849C_0F4B_4641_B0B9_01DE137E6938__INCLUDED_
25
26 #include <vector>
27 #include <string>
28 #include "audiomanagertypes.h"
29 namespace am {
30 class IAmRoutingReceive;
31 }
32
33 #include "audiomanagertypes.h"
34 #include "IAmRoutingReceive.h"
35
36 #define RoutingSendVersion "3.0" 
37 namespace am {
38
39 /**
40  * This class implements everything from Audiomanager -> RoutingAdapter
41  * There are two rules that have to be kept in mind when implementing against this
42  * interface:\n
43  * \warning
44  * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
45  * 2. YOU MAY NOT CALL THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS
46  * CALL THAT EXPECTS A RETURN VALUE.\n
47  * \details
48  * Violation these rules may lead to unexpected behavior! Nevertheless you can
49  * implement thread safe by using the deferred-call pattern described on the wiki
50  * which also helps to implement calls that are forbidden.\n
51  * For more information, please check CAmSerializer
52  */
53 class IAmRoutingSend
54 {
55
56 public:
57         IAmRoutingSend() {
58
59         }
60
61         virtual ~IAmRoutingSend() {
62
63         }
64
65         /**
66          * This function returns the version of the interface
67          */
68         virtual void getInterfaceVersion(std::string& version) const =0;
69         /**
70          * starts up the interface. In the implementations, here is the best place for
71          * init routines.
72          */
73         virtual am_Error_e startupInterface(IAmRoutingReceive* routingreceiveinterface) =0;
74         /**
75          * indicates that the routing now ready to be used. Should be used as trigger to
76          * register all sinks, sources, etc...
77          */
78         virtual void setRoutingReady(const uint16_t handle) =0;
79         /**
80          * indicates that the routing plugins need to be prepared to switch the power off
81          * or be ready again.
82          */
83         virtual void setRoutingRundown(const uint16_t handle) =0;
84         /**
85          * aborts an asynchronous action.
86          * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if handle was not
87          * found
88          */
89         virtual am_Error_e asyncAbort(const am_Handle_s handle) =0;
90         /**
91          * connects a source to a sink
92          * @return E_OK on success, E_UNKNOWN on error, E_WRONG_FORMAT in case
93          * am_ConnectionFormat_e does not match
94          */
95         virtual am_Error_e asyncConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomConnectionFormat_t connectionFormat) =0;
96         /**
97          * disconnect a connection with given connectionID
98          * @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if connection was
99          * not found
100          */
101         virtual am_Error_e asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID) =0;
102         /**
103          * this method is used to set the volume of a sink. This function is used to drive
104          * ramps, to mute or unmute or directly set the value. The difference is made
105          * through the ramptype.
106          * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if new volume is
107          * out of range
108          */
109         virtual am_Error_e asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time) =0;
110         /**
111          * sets the volume of a source. This method is used to set the volume of a sink.
112          * This function is used to drive ramps, to mute or unmute or directly set the
113          * value. The difference is made through the ramptype.
114          * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if volume is out of
115          * range.
116          * triggers the acknowledge ackSourceVolumeChange
117          */
118         virtual am_Error_e asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time) =0;
119         /**
120          * This function is used to set the source state of a particular source.
121          * @return E_OK on success, E_UNKNOWN on error
122          */
123         virtual am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state) =0;
124         /**
125          * this function sets the sinksoundproperty.
126          * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery
127          * value is out of range
128          */
129         virtual am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties) =0;
130         /**
131          * this function sets the sinksoundproperty.
132          * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery
133          * value is out of range
134          */
135         virtual am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) =0;
136         /**
137          * this function sets the sourcesoundproperty.
138          * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery
139          * value is out of range
140          */
141         virtual am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties) =0;
142         /**
143          * this function sets the sourcesoundproperty.
144          * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery
145          * value is out of range
146          */
147         virtual am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) =0;
148         /**
149          * this function triggers crossfading.
150          * @return E_OK on success, E_UNKNOWN on error
151          */
152         virtual am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_CustomRampType_t rampType, const am_time_t time) =0;
153         /**
154          * this function is used for early and late audio functions to set the domain
155          * state
156          * @return E_OK on success, E_UNKNOWN on error
157          */
158         virtual am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) =0;
159         /**
160          * this method is used to retrieve the busname during startup of the plugin. Needs
161          * to be implemented
162          * @return E_OK on success, E_UNKNOWN on error
163          */
164         virtual am_Error_e returnBusName(std::string& BusName) const =0;
165         /**
166          * This command sets multiple source or and sink volumes within a domain at a time.
167          * It can be used to synchronize volume setting events.
168          * @return E_OK on success, E_UNKNOWN on error.
169          */
170         virtual am_Error_e asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes) =0;
171         /**
172          * sets the notification configuration of a sink.
173          * @return E_OK on success, E_UNKNOWN on error.
174          */
175         virtual am_Error_e asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration) =0;
176         /**
177          * sets the notification configuration of a source.
178          * @return E_OK on success, E_UNKNOWN on error.
179          */
180         virtual am_Error_e asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration) =0;
181
182 };
183 }
184 #endif // !defined(EA_75F8849C_0F4B_4641_B0B9_01DE137E6938__INCLUDED_)