228c848fef50e77868f1125d782336f547502b73
[profile/ivi/genivi/genivi-audio-manager.git] / includes / audiomanagertypes.h
1 /**\r
2 * Copyright (C) 2011, BMW AG\r
3 *\r
4 * GeniviAudioMananger\r
5 *\r
6 * \file  \r
7 *\r
8 * \date 20-Oct-2011 3:42:04 PM\r
9 * \author Christian Mueller (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 * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
24 */\r
25 #if !defined(EA_3B272E4F_E824_49e3_862F_3C86FD59D14B__INCLUDED_)\r
26 #define EA_3B272E4F_E824_49e3_862F_3C86FD59D14B__INCLUDED_\r
27 \r
28 #include <stdint.h>\r
29 #include "projecttypes.h"\r
30 #include <string>\r
31 #include <vector>\r
32 \r
33 #define AM_MUTE -3000
34
35 namespace am {
36         /**
37          * This is the domain type. Each domain has a unique identifier.\r
38          * \r
39          * \mainpage\r
40          * \image html "Bild1.png"\r
41          * Copyright Copyright (C) 2011, BMW AG\r
42          * \r
43          * \date 22.06.2011\r
44          * \r
45          * \author Christian Mueller (christian.ei.mueller@bmw.de)\r
46          * \r
47          * \par About AudioManagerInterfaces\r
48          * The AudioManager is a Deamon that manages all Audio Connections in a GENIVI headunit.\r
49          * It is a managing instance that uses so called RoutingAdaptors to control AudioDomains that then do the "real" connections.\r
50          * \r
51          * \par More information\r
52          * can be found at https://collab.genivi.org/wiki/display/genivi/GENIVI+Home \n \n \n \n\r
53          * \r
54          * \section architecture Architecture Overview\r
55          * \r
56          * The architecture concept bases on the partition of management (logic) and routing (action). Sinks and sources are clustered into independent parts which are capable of exchanging audio with each other (AudioDomains). Between these AudioDomains, Audio can be interchanged via Gateways. \n\r
57          * Since the routing and the management shall be independent from the actual used system, it is realized as an OwnedComponent, the AudioManager. Each AudioDomain has a Routing Adapter which implements some necessary logic and is the interface between the AudioManager and the AudioDomains.\r
58          * \r
59          * \section domains Audio Domains\r
60          * \r
61          * An Audio Domain consists of sinks and sources that can exchange audio with each other. To make the most out of the concept, AudioDomains shall be chosen in such a way that they are implemented by already existing audio routing engines.\r
62          * \r
63          * The AudioManager assumes that there are no restrictions in interconnection of sinks and sources. One or more sources can be connected to one sink and one or more sinks can be connected to one source. Since real hardware or software might end up in having restrictions, the knowledge of this must exist in the AudioManager and handled by him accordingly. This shall be accomplished via a plug-in mechanism. An AudioDomain is not tied to a hardware or software implementation. It can be software or hardware or even a combination of both. \n\r
64          * \r
65          * Examples for possible audio domains:\n\r
66          * PulseAudio, Alsa, Jack, DSP, FPGA, MOST, In-chip switching matrix\n\r
67          * \r
68          * The clustering and usage of the AudioDomains will vary from each product. Care must be taken while choosing the right AudioDomains in regards to system load (due to resampling), latency and of course flexibility.\n\r
69          * In special implementations of the AudioDomain, it is capable of operation a certain time without interaction to the AudioManager. This is needed to fulfill the requirements for Early & Late Audio, more information can be found below.\r
70          * \r
71          * \section routing_adaptor Routing Adapter\r
72          * \r
73          * Via this adapter, the interconnection from the AudioManager to the AudioDomains is accomplished. An AudioDomain shall have exactly one RoutingAdapter. In the terms of GENIVI, a RoutingAdapter is an AbstractComponent, this means that we define an API and a certain behavior in UML models but do not maintain components itself. Existing implementations from Proof of Concepts are shipped as example Adapters "as is" but cannot be seen as maintained components.\n\r
74          * The implementation of a routing adapter can and will vary from each project to another since the combination of sinks and sources, the used hardware etc has influence on the adapters. Besides interchanging and abstracting information between the AudioManager and the sinks and sources, the Adapters also need to implement some business logic in order to interact with the AudioManager. This includes for example the registering of components, managing the current state, error handling etc.\n\r
75          * In the special case of an EarlyDomain, the routing adapter also has to manage start-up and rundown including persistence for his domain while the AudioManager is not started or already stopped. During this periods of time, these special adapters have to be able to fulfill basic tasks like changing volumes, for example (this implies that the Adapter is implemented on a different piece of hardware, e.g. vehicle processor).\r
76          * \r
77          * \section Gateway\r
78          * \r
79          * Gateways are used to let audio flow between two domains. They always have a direction and can only transport one stream at a time. Several gateways connecting the same domains together can exist in parallel so that more than one source can be connected to more than one sink from the same domains at the same time.\n\r
80          * The representation of a Gateway in the domain which originates the audio is a sink. In the receiving domain, the gateway appears as a source. The AudioManager knows about the Gateways, in terms of connection, it handles it as simple sources and sinks.\r
81          * \r
82          * \section AudioManagerDaemon\r
83          * \r
84          * The AudioManager is the central managing instance of the Audio architecture. It is designed as an OwnedComponent, this means that the software is maintained within GENIVI as open source component. The AudioManager consists of 4 central components.\n\r
85          * \r
86          * GOwnedComponent: AudioManager Daemon\n\r
87          * \r
88          * This component is owned and maintained by Genivi. It is the central audio framework component. There can be only one daemon in a system (singleton).\r
89          * \r
90          * \subsection controlinterface Control Interface Plugin\r
91          * \r
92          * This describes the interface towards the Controlling Instances of the AudioManagerDaemon. This is the HMI and interrupt sources that use this interface to start their interrupt and stop it again. The interface shall be asynchronous. Via this interface all user interactions are handled.\r
93          * \r
94          * \subsection routinginterface Routing Interface Plugin\r
95          * \r
96          * This interface is used by the AudioManager to control the RoutingAdapters and communicate with them. The communication is based on two interfaces, one is provided by the AudioManager for communication from the adapters towards the AudioManager and one for the opposite direction. The design of the AudioManager shall be done in such a way that several Interfaces are supported at the same time via a plug-in mechanism. The plug-ins are (either statically - due to performance reasons or dynamically) loaded at start-up. Due to this architecture, the number of buses and routing adapters that are supported are as low as possible for each system and as high as needed without the need of changing the AudioManager itself. The AudioManager expects a bus-like structure behind each plug-in, so that a plug-in can implement a bus interface and proxy the messages to the routing adapters - the AudioManager will be capable of addressing more than one adapter one each plug-in. The interface shall is asynchronous for all timely critical commands.\r
97          * \r
98          * \section sources_sinks Sources & Sinks\r
99          * \subsection Visibility\r
100          * Sources and sinks can either be visible or not. If they are visible, the HMI is informed about their existence and can use them. \n\r
101          * Invisible Sources and Sinks either are system only relevant (e.g. an audio processing that has a source and a sink) or belong to a gateway.\r
102          * \r
103          * \subsection Availability\r
104          * It can be the case, that sources and sinks are present in the system but cannot be used at the moment. This is indicated via the availability. A sample use-case for this feature is CD drive that shall only be available if a CD is inserted.\r
105          * \r
106          * \section Interrupts\r
107          * \subsection llinterrupts Low level interrupts\r
108          * \todo write low level Interrupts description\r
109          * \r
110          * \subsection Interrupts\r
111          * \todo write Interrupts description\r
112          * \r
113          * \section Persistency\r
114          * It is the job of the AudioManagerController to handle the persistency. It is planned to expose an interface via the ControlInterface to accomplish this but the GENIVI persistance is not ready yet. \n\r
115          * \r
116          * \r
117          * \section speed Speed dependent volume\r
118          * The adjustments for the speed are done product specific in the controller. The speed information itself is retrieved by the AudioManagerDaemon, sampled and quantified and forwarded to the controller.\n\r
119          * Turning speed controlled volume on/off and possible settings are achieved via SinkSoundProperty settings.\r
120          * \r
121          * \section Lipsync\r
122          * It is the job of the AudioManager to retrieve all latency timing information from each connection, to aggregate this information and provide a latency information on a per MainConnection Basis. It is not the task of the AudioManager to actually delay or speed up video or audio signals to achieve a lipsync. The actual correction shall be done in the videoplayer with the information provided by the AudioManager.\r
123          * The time information is always reported by the routingadaptors for each connection. Delays that are introduced in a sink or a gateway are counting for the connection that connects to this sink or gateway.\n\r
124          * After the buildup of a connection the first timing information needs to be sent within 5 seconds, the timing information from the routing adaptors need to be sent via 4 seconds. If the latency for a connection is variable and changes over lifetime of the connection, the routing adaptors shall resend the value and the audiomanger will correct the over all latency.\n
125          * @author christian
126          * @version 1.0
127          * @created 19-Jan-2012 4:31:47 PM
128          */
129         typedef uint16_t am_domainID_t;
130
131         /**
132          * @author christian
133          * @version 1.0
134          * @created 19-Jan-2012 4:31:47 PM
135          */
136         typedef uint16_t am_sourceID_t;
137
138         /**
139          * @author christian
140          * @version 1.0
141          * @created 19-Jan-2012 4:31:48 PM
142          */
143         typedef uint16_t am_sinkID_t;
144
145         /**
146          * @author christian
147          * @version 1.0
148          * @created 19-Jan-2012 4:31:48 PM
149          */
150         typedef uint16_t am_gatewayID_t;
151
152         /**
153          * @author christian
154          * @version 1.0
155          * @created 19-Jan-2012 4:31:48 PM
156          */
157         typedef uint16_t am_crossfaderID_t;
158
159         /**
160          * @author christian
161          * @version 1.0
162          * @created 19-Jan-2012 4:31:48 PM
163          */
164         typedef uint16_t am_connectionID_t;
165
166         /**
167          * @author christian
168          * @version 1.0
169          * @created 19-Jan-2012 4:31:49 PM
170          */
171         typedef uint16_t am_mainConnectionID_t;
172
173         /**
174          * @author christian
175          * @version 1.0
176          * @created 19-Jan-2012 4:31:49 PM
177          */
178         typedef uint16_t am_speed_t;
179
180         /**
181          * The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE). The minimum and maximum can be limited by actual project.
182          * @author christian
183          * @version 1.0
184          * @created 19-Jan-2012 4:31:49 PM
185          */
186         typedef int16_t am_volume_t;
187
188         /**
189          * This is the volume presented on the command interface. It is in the duty of the Controller to change the volumes given here into meaningful values on the routing interface.\r
190          * The range of this type is customer specific.
191          * @author christian
192          * @version 1.0
193          * @created 19-Jan-2012 4:31:49 PM
194          */
195         typedef int16_t am_mainVolume_t;
196
197         /**
198          * @author christian
199          * @version 1.0
200          * @created 19-Jan-2012 4:31:50 PM
201          */
202         typedef uint16_t am_sourceClass_t;
203
204         /**
205          * @author christian
206          * @version 1.0
207          * @created 19-Jan-2012 4:31:50 PM
208          */
209         typedef uint16_t am_sinkClass_t;
210
211         /**
212          * time in ms!
213          * @author christian
214          * @version 1.0
215          * @created 19-Jan-2012 4:31:50 PM
216          */
217         typedef uint16_t am_time_t;
218
219         /**
220          * offset time that is introduced in milli seconds.
221          * @author christian
222          * @version 1.0
223          * @created 19-Jan-2012 4:31:50 PM
224          */
225         typedef int16_t am_timeSync_t;
226
227         /**
228          * with the help of this enum, sinks and sources can report their availability state
229          * @author christian
230          * @version 1.0
231          * @created 19-Jan-2012 4:31:50 PM
232          */
233         enum am_Availablility_e
234         {
235                 A_AVAILABLE = 0,
236                 A_UNAVAILABLE = 1,
237                 A_UNKNOWN = 2,
238                 A_MAX = 3,
239                 A_MIN = A_AVAILABLE
240         };
241
242         /**
243          * represents the connection state
244          * @author christian
245          * @version 1.0
246          * @created 19-Jan-2012 4:31:50 PM
247          */
248         enum am_ConnectionState_e
249         {
250                 /**
251                  * This means the connection is just building up
252                  */
253                 CS_CONNECTING = 0,
254                 /**
255                  * the connection is ready to be used
256                  */
257                 CS_CONNECTED = 1,
258                 /**
259                  * the connection is in the course to be knocked down
260                  */
261                 CS_DISCONNECTING = 2,
262                 /**
263                  * only relevant for connectionStatechanged. Is send after the connection was removed
264                  */
265                 CS_DISCONNECTED = 3,
266                 /**
267                  * this means the connection is still build up but unused at the moment
268                  */
269                 CS_SUSPENDED = 4,
270                 CS_MAX = 5,
271                 CS_MIN = CS_CONNECTING
272         };
273
274         /**
275          * @author christian
276          * @version 1.0
277          * @created 19-Jan-2012 4:31:51 PM
278          */
279         enum am_DomainState_e
280         {
281                 DS_CONTROLLED = 0,
282                 DS_INDEPENDENT_STARTUP = 1,
283                 DS_INDEPENDENT_RUNDOWN = 2,
284                 DS_MAX = 3,
285                 DS_MIN = DS_CONTROLLED
286         };
287
288         /**
289          * This enum characterizes the data of the EarlyData_t
290          * @author christian
291          * @version 1.0
292          * @created 19-Jan-2012 4:31:51 PM
293          */
294         enum am_EarlyDataType_e
295         {
296                 ED_SOURCE_VOLUME = 0,
297                 ED_SINK_VOLUME = 1,
298                 ED_SOURCE_PROPERTY = 2,
299                 ED_SINK_PROPERTY = 3,
300                 ED_MAX = 4,
301                 ES_MIN = ED_SOURCE_VOLUME
302         };
303
304         /**
305          * the errors of the audiomanager. All possible errors are in here. This enum is used widely as return parameter.
306          * @author christian
307          * @version 1.0
308          * @created 19-Jan-2012 4:31:51 PM
309          */
310         enum am_Error_e
311         {
312                 E_OK = 0,
313                 E_UNKNOWN = 1,
314                 E_OUT_OF_RANGE = 2,
315                 E_NOT_USED = 3,
316                 E_DATABASE_ERROR = 4,
317                 E_ALREADY_EXISTS = 5,
318                 E_NO_CHANGE = 6,
319                 E_NOT_POSSIBLE = 7,
320                 E_NON_EXISTENT = 8,
321                 E_ABORTED = 9,
322                 /**
323                  * This error is returned in case a connect is issued with a connectionFormat that cannot be selected for the connection. This could be either due to the capabilities of a source or a sink or gateway compatibilities for example
324                  */
325                 E_WRONG_FORMAT = 10,
326                 E_MAX = 11,
327                 E_MIN = E_OK
328         };
329
330         /**
331          * @author christian
332          * @version 1.0
333          * @created 19-Jan-2012 4:31:51 PM
334          */
335         enum am_MuteState_e
336         {
337                 MS_MUTED = 0,
338                 MS_UNMUTED = 1,
339                 MS_MAX = 2,
340                 MS_MIN = MS_MUTED
341         };
342
343         /**
344          * The source state reflects the state of the source
345          * @author christian
346          * @version 1.0
347          * @created 19-Jan-2012 4:31:52 PM
348          */
349         enum am_SourceState_e
350         {
351                 /**
352                  * The source can be activly heared
353                  */
354                 SS_ON = 0,
355                 /**
356                  * The source cannot be heared
357                  */
358                 SS_OFF = 1,
359                 /**
360                  * The source is paused. Meaning it cannot be heared but should be prepared to play again soon.
361                  */
362                 SS_PAUSED = 2,
363                 SS_MAX = 3,
364                 SS_MIN = SS_ON
365         };
366
367         /**
368          * This enumeration is used to define the type of the action that is correlated to a handle.
369          * @author christian
370          * @version 1.0
371          * @created 19-Jan-2012 4:31:52 PM
372          */
373         enum am_Handle_e
374         {
375                 H_CONNECT = 0,
376                 H_DISCONNECT = 1,
377                 H_SETSOURCESTATE = 2,
378                 H_SETSINKVOLUME = 3,
379                 H_SETSOURCEVOLUME = 4,
380                 H_SETSINKSOUNDPROPERTY = 5,
381                 H_SETSOURCESOUNDPROPERTY = 6,
382                 H_SETSINKSOUNDPROPERTIES = 7,
383                 H_SETSOURCESOUNDPROPERTIES = 8,
384                 H_CROSSFADE = 9,
385                 H_MAX = 10,
386                 H_MIN = H_CONNECT
387         };
388
389         /**
390          * @author christian
391          * @version 1.0
392          * @created 19-Jan-2012 4:31:52 PM
393          */
394         enum am_InterruptState_e
395         {
396                 IS_OFF = 0,
397                 IS_INTERRUPTED = 1,
398                 IS_MAX = 2,
399                 IS_MIN = IS_OFF
400         };
401
402         /**
403          * describes the active sink of a crossfader.
404          * @author christian
405          * @version 1.0
406          * @created 19-Jan-2012 4:31:52 PM
407          */
408         enum am_HotSink_e
409         {
410                 HS_SINKA = 0,
411                 HS_SINKB = 1,
412                 HS_INTERMEDIATE = 2,
413                 HS_MAX = 3,
414                 HS_MIN = HS_SINKA
415         };
416
417         /**
418          * this describes the availability of a sink or a source together with the latest change
419          * @author christian
420          * @version 1.0
421          * @created 19-Jan-2012 4:31:52 PM
422          */
423         struct am_Availability_s
424         {
425
426         public:
427                 /**
428                  * the current availability state
429                  */
430                 am_Availablility_e availability;
431                 /**
432                  * the reason for the last change. This can be used to trigger events that deal with state changes.
433                  */
434                 am_AvailabilityReason_e availabilityReason;
435
436         };
437
438         /**
439          * @author christian
440          * @version 1.0
441          * @created 19-Jan-2012 4:31:53 PM
442          */
443         struct am_ClassProperty_s
444         {
445
446         public:
447                 am_ClassProperty_e classProperty;
448                 int16_t value;
449
450         };
451
452         /**
453          * @author christian
454          * @version 1.0
455          * @created 19-Jan-2012 4:31:53 PM
456          */
457         struct am_Crossfader_s
458         {
459
460         public:
461                 am_crossfaderID_t crossfaderID;
462                 std::string name;
463                 am_sinkID_t sinkID_A;
464                 am_sinkID_t sinkID_B;
465                 am_sourceID_t sourceID;
466                 am_HotSink_e hotSink;
467
468         };
469
470         /**
471          * @author christian
472          * @version 1.0
473          * @created 19-Jan-2012 4:31:53 PM
474          */
475         struct am_Gateway_s
476         {
477
478         public:
479                 am_gatewayID_t gatewayID;
480                 std::string name;
481                 am_sinkID_t sinkID;
482                 am_sourceID_t sourceID;
483                 am_domainID_t domainSinkID;
484                 am_domainID_t domainSourceID;
485                 am_domainID_t controlDomainID;
486                 std::vector<am_ConnectionFormat_e> listSourceFormats;
487                 std::vector<am_ConnectionFormat_e> listSinkFormats;
488                 /**
489                  * This is matrix holding information about the conversion capability of the gateway, it's length is defined by the length(listSinkFormats) x length(listSourceFormats).\r
490                  * If a SinkFormat can be converted into a SourceFormat, the vector will hold a 1, if no conversion is possible, a 0.\r
491                  * The data is stored row orientated, where the rows are related to the sinksFormats and the columns to the sourceFormats. The first value will hold the conversion information from the first sourceFormat to the first sinkFormat for example and the seventh value the information about the 3rd sinkFormat to the 1st sourceFormat in case we would have 3 sourceFormats.\r
492                  * \r
493                  * This matrix \r
494                  * 110 011 000 111 001\r
495                  * \r
496                  * reads as this:\r
497                  *           Source\r
498                  *      **  1  2  3 \r
499                  * *********************\r
500                  * S    1*  1  1  0 \r
501                  * i    2*  0  1  1\r
502                  * n    3*  0  0  0\r
503                  * k    4*  1  1  1\r
504                  *      5*  0  0  1
505                  */
506                 std::vector<bool> convertionMatrix;
507
508         };
509
510         /**
511          * This represents one "hopp" in a route
512          * @author christian
513          * @version 1.0
514          * @created 19-Jan-2012 4:31:54 PM
515          */
516         struct am_RoutingElement_s
517         {
518
519         public:
520                 am_sourceID_t sourceID;
521                 am_sinkID_t sinkID;
522                 am_domainID_t domainID;
523                 am_ConnectionFormat_e connectionFormat;
524
525         };
526
527         /**
528          * @author christian
529          * @version 1.0
530          * @created 19-Jan-2012 4:31:54 PM
531          */
532         struct am_Route_s
533         {
534
535         public:
536                 am_sourceID_t sourceID;
537                 am_sinkID_t sinkID;
538                 std::vector<am_RoutingElement_s> route;
539
540         };
541
542         /**
543          * @author christian
544          * @version 1.0
545          * @created 19-Jan-2012 4:31:54 PM
546          */
547         struct am_SoundProperty_s
548         {
549
550         public:
551                 am_SoundPropertyType_e type;
552                 int16_t value;
553
554         };
555
556         /**
557          * @author christian
558          * @version 1.0
559          * @created 19-Jan-2012 4:31:55 PM
560          */
561         struct am_SystemProperty_s
562         {
563
564         public:
565                 /**
566                  * the type that is set
567                  */
568                 am_SystemPropertyType_e type;
569                 /**
570                  * the value
571                  */
572                 int16_t value;
573
574         };
575
576         /**
577          * @author christian
578          * @version 1.0
579          * @created 19-Jan-2012 4:31:55 PM
580          */
581         struct am_SinkClass_s
582         {
583
584         public:
585                 am_sinkClass_t sinkClassID;
586                 std::string name;
587                 std::vector<am_ClassProperty_s> listClassProperties;
588
589         };
590
591         /**
592          * @author christian
593          * @version 1.0
594          * @created 19-Jan-2012 4:31:55 PM
595          */
596         struct am_SourceClass_s
597         {
598
599         public:
600                 /**
601                  * the source ID
602                  */
603                 am_sourceClass_t sourceClassID;
604                 std::string name;
605                 std::vector<am_ClassProperty_s> listClassProperties;
606
607         };
608
609         /**
610          * this type holds all information of sources relevant to the HMI
611          * @author christian
612          * @version 1.0
613          * @created 19-Jan-2012 4:31:55 PM
614          */
615         struct am_SourceType_s
616         {
617
618         public:
619                 am_sourceID_t sourceID;
620                 std::string name;
621                 am_Availability_s availability;
622                 am_sourceClass_t sourceClassID;
623
624         };
625
626         /**
627          * this type holds all information of sinks relevant to the HMI
628          * @author christian
629          * @version 1.0
630          * @created 19-Jan-2012 4:31:56 PM
631          */
632         struct am_SinkType_s
633         {
634
635         public:
636                 am_sinkID_t sinkID;
637                 std::string name;
638                 am_Availability_s availability;
639                 am_mainVolume_t volume;
640                 am_MuteState_e muteState;
641                 am_sinkClass_t sinkClassID;
642
643         };
644
645         /**
646          * @author christian
647          * @version 1.0
648          * @created 19-Jan-2012 4:31:56 PM
649          */
650         struct am_Handle_s
651         {
652
653         public:
654                 am_Handle_e handleType:4;
655                 uint16_t handle:12;
656
657         };
658
659         /**
660          * @author christian
661          * @version 1.0
662          * @created 19-Jan-2012 4:31:56 PM
663          */
664         struct am_MainSoundProperty_s
665         {
666
667         public:
668                 am_MainSoundPropertyType_e type;
669                 int16_t value;
670
671         };
672
673         /**
674          * this type holds all information of connections relevant to the HMI
675          * @author christian
676          * @version 1.0
677          * @created 19-Jan-2012 4:31:57 PM
678          */
679         struct am_MainConnectionType_s
680         {
681
682         public:
683                 am_mainConnectionID_t mainConnectionID;
684                 am_sourceID_t sourceID;
685                 am_sinkID_t sinkID;
686                 am_timeSync_t delay;
687                 am_ConnectionState_e connectionState;
688
689         };
690
691         /**
692          * @author christian
693          * @version 1.0
694          * @created 19-Jan-2012 4:31:57 PM
695          */
696         struct am_MainConnection_s
697         {
698
699         public:
700                 am_mainConnectionID_t connectionID;
701                 am_ConnectionState_e connectionState;
702                 am_Route_s route;
703                 am_timeSync_t delay;
704
705         };
706
707         /**
708          * @author christian
709          * @version 1.0
710          * @created 19-Jan-2012 4:31:57 PM
711          */
712         struct am_Sink_s
713         {
714
715         public:
716                 am_sinkID_t sinkID;
717                 std::string name;
718                 am_domainID_t domainID;
719                 am_sinkClass_t sinkClassID;
720                 am_volume_t volume;
721                 bool visible;
722                 am_Availability_s available;
723                 am_MuteState_e muteState;
724                 am_mainVolume_t mainVolume;
725                 std::vector<am_SoundProperty_s> listSoundProperties;
726                 std::vector<am_ConnectionFormat_e> listConnectionFormats;
727                 std::vector<am_MainSoundProperty_s> listMainSoundProperties;
728
729         };
730
731         /**
732          * @author christian
733          * @version 1.0
734          * @created 19-Jan-2012 4:31:58 PM
735          */
736         struct am_Source_s
737         {
738
739         public:
740                 am_sourceID_t sourceID;
741                 am_domainID_t domainID;
742                 std::string name;
743                 am_sourceClass_t sourceClassID;
744                 am_SourceState_e sourceState;
745                 am_volume_t volume;
746                 bool visible;
747                 am_Availability_s available;
748                 am_InterruptState_e interruptState;
749                 /**
750                  * This list holds all soundProperties of the source
751                  */
752                 std::vector<am_SoundProperty_s> listSoundProperties;
753                 /**
754                  * list of the supported ConnectionFormats
755                  */
756                 std::vector<am_ConnectionFormat_e> listConnectionFormats;
757                 /**
758                  * This list holds all MainSoundProperties of the source (all the ones that can be set via the HMI)
759                  */
760                 std::vector<am_MainSoundProperty_s> listMainSoundProperties;
761
762         };
763
764         /**
765          * @author christian
766          * @version 1.0
767          * @created 19-Jan-2012 4:31:58 PM
768          */
769         struct am_Domain_s
770         {
771
772         public:
773                 am_domainID_t domainID;
774                 std::string name;
775                 std::string busname;
776                 std::string nodename;
777                 bool early;
778                 bool complete;
779                 am_DomainState_e state;
780
781         };
782
783         /**
784          * @author christian
785          * @version 1.0
786          * @created 19-Jan-2012 4:31:59 PM
787          */
788         struct am_Connection_s
789         {
790
791         public:
792                 am_connectionID_t connectionID;
793                 am_sourceID_t sourceID;
794                 am_sinkID_t sinkID;
795                 am_timeSync_t delay;
796                 am_ConnectionFormat_e connectionFormat;
797
798         };
799
800         /**
801          * data type depends of am_EarlyDataType_e:\r
802          * volume_t in case of ED_SOURCE_VOLUME, ED_SINK_VOLUME \r
803          * soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY 
804          * @author christian
805          * @version 1.0
806          * @created 19-Jan-2012 4:31:59 PM
807          */
808         union am_EarlyData_u
809         {
810
811         public:
812                 am_volume_t volume;
813                 am_SoundProperty_s soundProperty;
814
815         };
816
817         /**
818          * data type depends of am_EarlyDataType_e:\r
819          * sourceID in case of ED_SOURCE_VOLUME, ED_SOURCE_PROPERTY\r
820          * sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY 
821          * @author christian
822          * @version 1.0
823          * @created 19-Jan-2012 4:31:59 PM
824          */
825         union am_DataType_u
826         {
827
828         public:
829                 am_sinkID_t sink;
830                 am_sourceID_t source;
831
832         };
833
834         /**
835          * @author christian
836          * @version 1.0
837          * @created 19-Jan-2012 4:31:59 PM
838          */
839         struct am_EarlyData_s
840         {
841
842         public:
843                 am_EarlyDataType_e type;
844                 am_DataType_u sinksource;
845                 am_EarlyData_u data;
846
847         };
848 }
849 #endif // !defined(EA_3B272E4F_E824_49e3_862F_3C86FD59D14B__INCLUDED_)