update on dbus
[profile/ivi/audiomanager.git] / AudioManagerDaemon / routinginterface.h
1 /**\r
2  * Copyright (C) 2011, BMW AG\r
3  *\r
4  * AudioManangerDeamon\r
5  *\r
6  * \file routinginterface.h\r
7  *\r
8  * \date 20.05.2011\r
9  * \author Christian Müller (christian.ei.mueller@bmw.de)\r
10  *\r
11  * \section License\r
12  * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)\r
13  * Copyright (C) 2011, BMW AG – Christian Müller  Christian.ei.mueller@bmw.de\r
14  *\r
15  * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.\r
16  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.\r
17  * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.\r
18  * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.\r
19  * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.\r
20  * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.\r
21  * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.\r
22  *\r
23  *\r
24  */\r
25 \r
26 #ifndef ROUTINGINTERFACE_H_\r
27 #define ROUTINGINTERFACE_H_\r
28 \r
29 #include "dataTypes.h"\r
30 \r
31 class RoutingSendInterface;\r
32 class dbusRoothandler;\r
33 \r
34 /** Routing Receive sendInterface description.\r
35  * This class implements everything from RoutingAdapter -> Audiomanager\r
36  */\r
37 class RoutingReceiveInterface {\r
38 public:\r
39 \r
40         /**\r
41          * What happens now?\r
42          */\r
43         virtual domain_t registerDomain(char* name, char* busname, char* node, bool earlymode) =0;\r
44 \r
45         /** Registers a Gateway at the Audiomanager\r
46          * \return a unique ID of the gateway   */\r
47         virtual gateway_t registerGateway(char* name, char* sink, char* source, char* domainSource, char* domainSink, char* controlDomain) =0;\r
48 \r
49         /** registers a Sink at the Audiomanager\r
50          * \return a unique ID of the sink.*/\r
51         virtual sink_t registerSink(char* name, char* sinkclass, char* domain) =0;\r
52 \r
53         /** registers a Source at the Audiomanager *\r
54          * \return unique ID of the source      */\r
55         virtual source_t registerSource(char* name, char* audioclass, char* domain) =0;\r
56 \r
57         /** just get the ID of a domain without registering it. This is used to register Gateways.\r
58          * During the time of registration it is unclear if the other Domain already exists. This function will either\r
59          * return the already existing ID or reserve an ID with is then used later when the domain is registered. *\r
60          * \return the unique Id of the domain. */\r
61         virtual domain_t peekDomain(char* name) =0;\r
62 \r
63         /**Acknowledgement of a connect. This function shall be called when a connect event is finished\r
64          *\r
65          * @param handle the the handle for the connection\r
66          * @param error reads GEN_OK on success, other errors in case of problems\r
67          */\r
68         virtual void ackConnect(genHandle_t handle, genError_t error)=0;\r
69         /**\r
70          * Just check me out I am the comment\r
71          */\r
72         virtual void ackDisconnect(genHandle_t handle, genError_t error)=0;\r
73 \r
74 };\r
75 \r
76 /** Routing Send sendInterface\r
77  *  This class implements everything from Audiomanager -> RoutingAdapter\r
78  */\r
79 class RoutingSendInterface {\r
80 public:\r
81 \r
82         /** starts up the interface. In the implementations, here is the best place for\r
83          * init routines.\r
84          */\r
85         virtual void startup_interface(RoutingReceiveInterface * action,  dbusRoothandler* dbushandler\r
86         )=0;\r
87 \r
88         /** connect a source to a sink\r
89          *  \return the unique ID of the connection.\r
90          */\r
91         virtual genError_t connect(source_t source, sink_t sink, connection_t con_ID) =0;\r
92 \r
93         /** disconnect a connection\r
94          *      \return true on success\r
95          */\r
96         virtual genError_t disconnect(connection_t connection_ID) =0;\r
97 \r
98         /** this method is used to retrieve the busname during startup of the plugin.\r
99          *      Needs to be implemented\r
100          */\r
101         virtual void return_BusName(char* BusName) =0;\r
102 \r
103         /** this method is used to set the volume of a sink\r
104          *  \return returns the new value or -1 on error or impossible.\r
105          *  It is not mandatory that a Plugin implements this feature.\r
106          */\r
107         virtual genError_t setSinkVolume(volume_t volume, sink_t sinkID) =0;\r
108 \r
109         /** this method is used to set the volume of a source\r
110          *  \return returns the new value or -1 on error or impossible.\r
111          *  It is not mandatory that a Plugin implements this feature.\r
112          */\r
113         virtual genError_t setSourceVolume(volume_t volume, source_t sourceID) =0;\r
114 \r
115         /** this method is used to mute a source\r
116          *\r
117          * \return true if succeeded\r
118          * \todo add error codes to answers\r
119          */\r
120         virtual genError_t muteSource(source_t sourceID) =0;\r
121 \r
122         /** this method is used to mute a sink\r
123          *\r
124          * \return true if succeeded\r
125          * \todo add error codes to answers\r
126          */\r
127         virtual genError_t muteSink(sink_t sinkID) =0;\r
128 \r
129         /** this method is used to unmute a source\r
130          *\r
131          * \return true if succeeded\r
132          * \todo add error codes to answers\r
133          */\r
134         virtual genError_t unmuteSource(source_t sourceID) =0;\r
135 \r
136         /** this method is used to unmute a sink\r
137          *\r
138          * \return true if succeeded\r
139          * \todo add error codes to answers\r
140          */\r
141         virtual genError_t unmuteSink(sink_t sinkID) =0;\r
142 \r
143         /**\r
144          * connect a source to a sink \return the unique ID of the connection.\r
145          */\r
146 //      virtual genError_t asyncConnect(source_t source, sink_t sink, connection_t con_ID) =0;\r
147         /**\r
148          * disconnect a connection \return true on success\r
149          */\r
150 //      virtual genError_t asyncDisconnect(connection_t connection_ID) =0;\r
151         /** signal that tells the plugin that the system is ready. Is used to trigger a registration of Domains, etc..*/\r
152         virtual void system_ready()=0;\r
153 };\r
154 \r
155 #endif /* ROUTINGINTERFACE_H_ */\r