packaging: set dlt off
[profile/ivi/genivi/genivi-audio-manager.git] / include / audiomanagertypes.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_4FF89D4E_BF3C_465a_85C9_1DC47E4FA742__INCLUDED_)
24 #define EA_4FF89D4E_BF3C_465a_85C9_1DC47E4FA742__INCLUDED_
25
26 #include <stdint.h>
27 #include <string>
28 #include <vector>
29
30 namespace am {
31
32 /**
33  * a domain ID
34  */
35 typedef uint16_t am_domainID_t;
36
37 /**
38  * a crossfader ID
39  */
40 typedef uint16_t am_crossfaderID_t;
41
42 /**
43  * a connection ID 
44  */
45 typedef uint16_t am_connectionID_t;
46
47 /**
48  * a source ID
49  */
50 typedef uint16_t am_sourceID_t;
51
52 /**
53  * a sink ID 
54  */
55 typedef uint16_t am_sinkID_t;
56
57 /**
58  * a gateway ID
59  */
60 typedef uint16_t am_gatewayID_t;
61
62 /**
63  * a mainConnection ID
64  */
65 typedef uint16_t am_mainConnectionID_t;
66
67 /**
68  * speed
69  */
70 typedef uint16_t am_speed_t;
71
72 /**
73  * The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE). The minimum and
74  * maximum can be limited by actual project.
75  */
76 typedef int16_t am_volume_t;
77 static const am_volume_t AM_MUTE = -3000;
78
79 /**
80  * This is the volume presented on the command interface. It is in the duty of the
81  * Controller to change the volumes given here into meaningful values on the
82  * routing interface.
83  * The range of this type is customer specific.
84  */
85 typedef int16_t am_mainVolume_t;
86
87 typedef uint16_t am_sourceClass_t;
88
89 typedef uint16_t am_sinkClass_t;
90
91 /**
92  * time in ms!
93  */
94 typedef uint16_t am_time_t;
95
96 /**
97  * offset time that is introduced in milli seconds.
98  */
99 typedef int16_t am_timeSync_t;
100
101 /**
102  * This type gives the information about reason for reason for Source/Sink change
103  */
104 typedef uint16_t am_CustomAvailabilityReason_t;
105 static const am_CustomAvailabilityReason_t AR_UNKNOWN = 0;
106 /** new media was entered  */
107 static const am_CustomAvailabilityReason_t AR_GENIVI_NEWMEDIA = 1;
108 /** same media was entered */
109 static const am_CustomAvailabilityReason_t AR_GENIVI_SAMEMEDIA = 2;
110 /** there is no media or media is removed */
111 static const am_CustomAvailabilityReason_t AR_GENIVI_NOMEDIA = 3;
112 /** there was a temperature event */
113 static const am_CustomAvailabilityReason_t AR_GENIVI_TEMPERATURE = 4;
114 /** there was a voltage event */
115 static const am_CustomAvailabilityReason_t AR_GENIVI_VOLTAGE = 5;
116 /** fatal errors on reading or accessing media */
117 static const am_CustomAvailabilityReason_t AR_GENIVI_ERRORMEDIA = 6;
118
119 /**
120  * This is a custom specific identifier of property. It can be used to
121  * differentiate between interrupt source/sink, main source/sink, etc.
122  */
123 typedef uint16_t am_CustomClassProperty_t;
124 static const am_CustomClassProperty_t CP_UNKNOWN = 0;
125 static const am_CustomClassProperty_t CP_GENIVI_SOURCE_TYPE = 1;
126 static const am_CustomClassProperty_t CP_GENIVI_SINK_TYPE = 2;
127
128 /**
129  * This type classifies the format in which data is exchanged within a connection.
130  * The type itself is project specific although there are some standard formats
131  * defined.
132  */
133 typedef uint16_t am_CustomConnectionFormat_t;
134 static const am_CustomConnectionFormat_t CF_UNKNOWN = 0;
135 static const am_CustomConnectionFormat_t CF_GENIVI_MONO = 1;
136 static const am_CustomConnectionFormat_t CF_GENIVI_STEREO = 2;
137 static const am_CustomConnectionFormat_t CF_GENIVI_ANALOG = 3;
138 static const am_CustomConnectionFormat_t CF_GENIVI_AUTO = 4;
139
140 /**
141  * Here are all SoundProperties that can be set via the CommandInterface.
142  * This type is product specific and can be changed or extended.
143  */
144 typedef uint16_t am_CustomMainSoundPropertyType_t;
145 static const am_CustomMainSoundPropertyType_t MSP_UNKNOWN = 0;
146 static const am_CustomMainSoundPropertyType_t MSP_GENIVI_TREBLE = 1;
147 static const am_CustomMainSoundPropertyType_t MSP_GENIVI_MID = 2;
148 static const am_CustomMainSoundPropertyType_t MSP_GENIVI_BASS = 3;
149
150 /**
151  * The notification types are project specific.
152  */
153 typedef uint16_t am_CustomNotificationType_t;
154 static const am_CustomNotificationType_t NT_UNKNOWN = 0;
155
156 /**
157  * The given ramp types here are just examples. For products, different ramp types
158  * can be defined here. It is in the responsibility of the product to make sure
159  * that the routing plugins are aware of the ramp types used.
160  */
161 typedef uint16_t am_CustomRampType_t;
162 static const am_CustomRampType_t RAMP_UNKNOWN = 0;
163 /** sets directly the value without a ramp */
164 static const am_CustomRampType_t RAMP_GENIVI_DIRECT = 1;
165 /** Sets the volume as fast as possible */
166 static const am_CustomRampType_t RAMP_GENIVI_NO_PLOP = 2;
167 /** inverted exponential update, high gradient at the start - soft end */
168 static const am_CustomRampType_t RAMP_GENIVI_EXP_INV = 3;
169 /** continues update of volume */
170 static const am_CustomRampType_t RAMP_GENIVI_LINEAR = 4;
171 /** exponential update, soft start - high gradient at the end  */
172 static const am_CustomRampType_t RAMP_GENIVI_EXP = 5;
173
174 /**
175  * Within genivi only the some example properties are defined.
176  * For products these should be changed or extended.
177  */
178 typedef uint16_t am_CustomSoundPropertyType_t;
179 static const am_CustomSoundPropertyType_t SP_UNKNOWN = 0;
180 static const am_CustomSoundPropertyType_t SP_GENIVI_TREBLE = 1;
181 static const am_CustomSoundPropertyType_t SP_GENIVI_MID = 2;
182 static const am_CustomSoundPropertyType_t SP_GENIVI_BASS = 3;
183
184 /**
185  * Describes the different system properties which are project specific.
186  */
187 typedef uint16_t am_CustomSystemPropertyType_t;
188 static const am_CustomSystemPropertyType_t SYP_UNKNOWN = 0;
189
190 /**
191  * describes the active sink of a crossfader.
192  */
193 enum am_HotSink_e
194 {
195         /**
196          * default
197          */
198         HS_UNKNOWN = 0,
199         /**
200          * sinkA is active
201          */
202         HS_SINKA = 1,
203         /**
204          * sinkB is active
205          */
206         HS_SINKB = 2,
207         /**
208          * the crossfader is in the transition state
209          */
210         HS_INTERMEDIATE = 3,
211         HS_MAX
212 };
213
214 /**
215  * with the help of this enum, sinks and sources can report their availability
216  * state
217  */
218 enum am_Availability_e
219 {
220         /**
221          * default
222          */
223         A_UNKNOWN = 0,
224         /**
225          * The source / sink is available
226          */
227         A_AVAILABLE = 1,
228         /**
229          * the source / sink is not available
230          */
231         A_UNAVAILABLE = 2,
232         A_MAX
233 };
234
235 /**
236  * represents the connection state
237  */
238 enum am_ConnectionState_e
239 {
240         CS_UNKNOWN = 0,
241         /**
242          * This means the connection is just building up
243          */
244         CS_CONNECTING = 1,
245         /**
246          * the connection is ready to be used
247          */
248         CS_CONNECTED = 2,
249         /**
250          * the connection is in the course to be knocked down
251          */
252         CS_DISCONNECTING = 3,
253         /**
254          * only relevant for connectionStatechanged. Is send after the connection was
255          * removed
256          */
257         CS_DISCONNECTED = 4,
258         /**
259          * this means the connection is still build up but unused at the moment
260          */
261         CS_SUSPENDED = 5,
262         CS_MAX
263 };
264
265 enum am_DomainState_e
266 {
267         /**
268          * default
269          */
270         DS_UNKNOWN = 0,
271         /**
272          * the domain is controlled by the daemon
273          */
274         DS_CONTROLLED = 1,
275         /**
276          * the domain is independent starting up
277          */
278         DS_INDEPENDENT_STARTUP = 1,
279         /**
280          * the domain is independent running down
281          */
282         DS_INDEPENDENT_RUNDOWN = 2,
283         DS_MAX
284 };
285
286 /**
287  * This enum characterizes the data of the EarlyData_t
288  */
289 enum am_EarlyDataType_e
290 {
291         /**
292          * default
293          */
294         ES_UNKNOWN = 0,
295         /**
296          * the source volume
297          */
298         ED_SOURCE_VOLUME = 1,
299         /**
300          * the sink volume
301          */
302         ED_SINK_VOLUME = 2,
303         /**
304          * a source property
305          */
306         ED_SOURCE_PROPERTY = 3,
307         /**
308          * a sink property
309          */
310         ED_SINK_PROPERTY = 4,
311         /**
312          * The interrupt state
313          */
314         ED_INTERRUPT_STATE = 5,
315         ED_MAX
316 };
317
318 /**
319  * the errors of the audiomanager. All possible errors are in here. This enum is
320  * used widely as return parameter.
321  */
322 enum am_Error_e
323 {
324         /**
325          * no error - positive reply
326          */
327         E_OK = 0,
328         /**
329          * default
330          */
331         E_UNKNOWN = 1,
332         /**
333          * value out of range
334          */
335         E_OUT_OF_RANGE = 2,
336         /**
337          * not used
338          */
339         E_NOT_USED = 3,
340         /**
341          * a database error occurred 
342          */
343         E_DATABASE_ERROR = 4,
344         /**
345          * the desired object already exists
346          */
347         E_ALREADY_EXISTS = 5,
348         /**
349          * there is no change
350          */
351         E_NO_CHANGE = 6,
352         /**
353          * the desired action is not possible
354          */
355         E_NOT_POSSIBLE = 7,
356         /**
357          * the desired object is non existent
358          */
359         E_NON_EXISTENT = 8,
360         /**
361          * the asynchronous action was aborted
362          */
363         E_ABORTED = 9,
364         /**
365          * This error is returned in case a connect is issued with a connectionFormat that
366          * cannot be selected for the connection. This could be either due to the
367          * capabilities of a source or a sink or gateway compatibilities for example
368          */
369         E_WRONG_FORMAT = 10,
370         E_MAX
371 };
372
373 enum am_MuteState_e
374 {
375         /**
376          * default
377          */
378         MS_UNKNOWN = 0,
379         /**
380          * the source / sink is muted
381          */
382         MS_MUTED = 1,
383         /**
384          * the source / sink is unmuted
385          */
386         MS_UNMUTED = 2,
387         MS_MAX
388 };
389
390 /**
391  * The source state reflects the state of the source
392  */
393 enum am_SourceState_e
394 {
395         SS_UNKNNOWN = 0,
396         /**
397          * The source can be activly heared
398          */
399         SS_ON = 1,
400         /**
401          * The source cannot be heared
402          */
403         SS_OFF = 2,
404         /**
405          * The source is paused. Meaning it cannot be heared but should be prepared to
406          * play again soon.
407          */
408         SS_PAUSED = 3,
409         SS_MAX
410 };
411
412 /**
413  * This enumeration is used to define the type of the action that is correlated to
414  * a handle.
415  */
416 enum am_Handle_e
417 {
418         H_UNKNOWN = 0,
419         H_CONNECT = 1,
420         H_DISCONNECT = 2,
421         H_SETSOURCESTATE = 3,
422         H_SETSINKVOLUME = 4,
423         H_SETSOURCEVOLUME = 5,
424         H_SETSINKSOUNDPROPERTY = 6,
425         H_SETSOURCESOUNDPROPERTY = 7,
426         H_SETSINKSOUNDPROPERTIES = 8,
427         H_SETSOURCESOUNDPROPERTIES = 9,
428         H_CROSSFADE = 10,
429         H_SETVOLUMES = 11,
430         H_SETSINKNOTIFICATION = 12,
431         H_SETSOURCENOTIFICATION = 13,
432         H_MAX
433 };
434
435 enum am_InterruptState_e
436 {
437         /**
438          * default
439          */
440         IS_UNKNOWN = 0,
441         /**
442          * the interrupt state is off - no interrupt 
443          */
444         IS_OFF = 1,
445         /**
446          * the interrupt state is interrupted - the interrupt is active
447          */
448         IS_INTERRUPTED = 2,
449         IS_MAX
450 };
451
452 /**
453  * This datatype determines if a sourceID or a sinkID is used in the union
454  * following
455  */
456 enum am_VolumeType_e
457 {
458         VT_UNKNOWN = 0,
459         /**
460          * the following type is a sink
461          */
462         VT_SINK = 1,
463         /**
464          * the following type is a source
465          */
466         VT_SOURCE = 2,
467         VT_MAX
468 };
469
470 enum am_NotificationStatus_e
471 {
472         NS_UNKNOWN = 0,
473         /**
474          * No notification, the function is turned off
475          */
476         NS_OFF = 1,
477         /**
478          * Periodic notifications are sent out. The period in ms is given by
479          * am_NotificationParameter
480          */
481         NS_PERIODIC = 2,
482         /**
483          * The notification is sent out when the minimum given by am_NotificationParameter
484          * is reached.
485          */
486         NS_MINIMUM = 3,
487         /**
488          * The notification is sent out when the maximum given by am_NotificationParameter
489          * is reached.
490          */
491         NS_MAXIMUM = 4,
492         /**
493          * The notification is sent out when a change happened. The Resolution of the
494          * change is defined by am_NotificationParameter.
495          */
496         NS_CHANGE  = 5,
497         NS_MAX
498 };
499
500 /**
501  * this describes the availability of a sink or a source together with the latest
502  * change
503  */
504 struct am_Availability_s
505 {
506
507 public:
508         /**
509          * the current availability state
510          */
511         am_Availability_e availability;
512         /**
513          * the reason for the last change. This can be used to trigger events that deal
514          * with state changes.
515          */
516         am_CustomAvailabilityReason_t availabilityReason;
517
518 };
519
520 /**
521  * describes class properties
522  */
523 struct am_ClassProperty_s
524 {
525
526 public:
527         /**
528          * the property as enum
529          */
530         am_CustomClassProperty_t classProperty;
531         /**
532          * the value of the property
533          */
534         int16_t value;
535
536 };
537
538 /**
539  * This struct describes the attribiutes of a crossfader.
540  */
541 struct am_Crossfader_s
542 {
543
544 public:
545         /**
546          * This is the ID of the crossfader, it is unique in the system. There are 2 ways,
547          * ID can be created: either it is assigned during the registration process (in a
548          * dynamic context, uniqueness will be ensured by the AudioManager daemon), or it
549          * is a fixed (the project has to ensure the uniqueness of the ID).
550          */
551         am_crossfaderID_t crossfaderID;
552         /**
553          * The name of the crossfader. Must be unique in the whole system. 
554          */
555         std::string name;
556         /**
557          * The sinkID of the SinkA. Sinks shall be registered before registering the
558          * crossfader.
559          */
560         am_sinkID_t sinkID_A;
561         /**
562          * The sinkID of the SinkB. Sinks shall be registered before registering the
563          * crossfader.
564          */
565         am_sinkID_t sinkID_B;
566         /**
567          * The sourceID of the crossfader source. The source shall be registered before
568          * the crossfader.
569          */
570         am_sourceID_t sourceID;
571         /**
572          * This enum can have 3 states:
573          * 
574          *    HS_SINKA sinkA is the current hot one, sinkB is not audible
575          *    HS_SINKB sinkB is the current hot one, sinkB is not audible
576          *    HS_INTERMEDIATE the fader is stuck in between a cross-fading action. This
577          * could be due to an abort or an error. Before using the crossfader, it must be
578          * set to either HS_SINKA or HS_SINKB.
579          */
580         am_HotSink_e hotSink;
581
582 };
583
584 /**
585  * This struct describes the attributes of a gateway.
586  */
587 struct am_Gateway_s
588 {
589
590 public:
591         /**
592          * This is the ID of the gateway, it is unique in the system. There are 2 ways, ID
593          * can be created: either it is assigned during the registration process (in a
594          * dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it
595          * is a fixed (the project has to ensure the uniqueness of the ID).
596          */
597         am_gatewayID_t gatewayID;
598         /**
599          * The name of the gateway. Must be unique in the whole system.
600          */
601         std::string name;
602         /**
603          * The sinkID of the gateway sink-end. The sink is a full blown sink with
604          * connectionFormats, sinkClassIDs etc... It makes sense to register the sinks of
605          * a gateway as non-visible. Care needs to be taken that the connectionsFormats
606          * match with the ones in the conversionMatrix. If the sink is located in the
607          * controllingDomain, the ID needs to be retrieved by registering the sink before
608          * registering the gateway. In case the sink is in a different domain, the ID
609          * needs to be retrieved via peeking.
610          */
611         am_sinkID_t sinkID;
612         /**
613          * The sourceID of the gateway sink-end. The sink is a full blown source with
614          * connectionFormats, sinkClassIDs etc... It makes sense to register the sources
615          * of a gateway as non-visible. Care needs to be taken that the connectionsFormats
616          * match with the ones in the conversionMatrix. If the source is located in the
617          * controllingDomain, the ID needs to be retrieved by registering the source
618          * before registering the gateway. In case the source is in a different domain,
619          * the ID needs to be retrieved via peeking.
620          */
621         am_sourceID_t sourceID;
622         /**
623          * The ID of the sink. If the domain is the same like the controlling domain, the
624          * ID is known due to registration. If the domain is different, the ID needs to be
625          * retrieved via peeking.
626          */
627         am_domainID_t domainSinkID;
628         /**
629          * The ID of the source. If the domain is the same like the controlling domain,
630          * the ID is known due to registration. If the domain is different, the ID needs
631          * to be retrieved via peeking.
632          */
633         am_domainID_t domainSourceID;
634         /**
635          * This is the ID of the domain that registers the gateway.
636          */
637         am_domainID_t controlDomainID;
638         /**
639          * This is the list of available formats on the source side of the gateway. It is
640          * not defined during the gateway registration but copied from the source
641          * registration.
642          */
643         std::vector<am_CustomConnectionFormat_t> listSourceFormats;
644         /**
645          * This is the list of available formats on the sink side of the gateway. It is
646          * not defined during the gateway registration but copied from the sink
647          * registration.
648          */
649         std::vector<am_CustomConnectionFormat_t> listSinkFormats;
650         /**
651          * This is matrix holding information about the conversion capability of the
652          * gateway, it's length is defined by the length(listSinkFormats) x
653          * length(listSourceFormats).
654          * If a SinkFormat can be converted into a SourceFormat, the vector will hold a 1,
655          * if no conversion is possible, a 0.
656          * The data is stored row orientated, where the rows are related to the
657          * sinksFormats and the columns to the sourceFormats. The first value will hold
658          * the conversion information from the first sourceFormat to the first sinkFormat
659          * for example and the seventh value the information about the 3rd sinkFormat to
660          * the 1st sourceFormat in case we would have 3 sourceFormats.
661          * 
662          * This matrix
663          * 110 011 000 111 001
664          * 
665          * reads as this:
666          *          Source
667          *      **  1  2  3
668          * *********************
669          * S    1*  1  1  0
670          * i    2*  0  1  1
671          * n    3*  0  0  0
672          * k    4*  1  1  1
673          *      5*  0  0  1
674          */
675         std::vector<bool> convertionMatrix;
676
677 };
678
679 /**
680  * This represents one "hopp" in a route
681  */
682 struct am_RoutingElement_s
683 {
684
685 public:
686         /**
687          * the source ID
688          */
689         am_sourceID_t sourceID;
690         /**
691          * the sinkID
692          */
693         am_sinkID_t sinkID;
694         /**
695          * the domainID the routeElement is in
696          */
697         am_domainID_t domainID;
698         /**
699          * the connectionformat that is used for the route
700          */
701         am_CustomConnectionFormat_t connectionFormat;
702
703 };
704
705 /**
706  * a list of routing elements that lead from source to sink
707  */
708 struct am_Route_s
709 {
710
711 public:
712         /**
713          * the sourceID where the route starts
714          */
715         am_sourceID_t sourceID;
716         /**
717          * the sinkID where the route ends
718          */
719         am_sinkID_t sinkID;
720         /**
721          * the actual route as list of routing elements
722          */
723         std::vector<am_RoutingElement_s> route;
724
725 };
726
727 /**
728  * struct describing the sound property
729  */
730 struct am_SoundProperty_s
731 {
732
733 public:
734         /**
735          * the type of the property - a project specific enum
736          */
737         am_CustomSoundPropertyType_t type;
738         /**
739          * the actual value of the property
740          */
741         int16_t value;
742
743 };
744
745 /**
746  * struct describing system properties
747  */
748 struct am_SystemProperty_s
749 {
750
751 public:
752         /**
753          * the type that is set
754          */
755         am_CustomSystemPropertyType_t type;
756         /**
757          * the value
758          */
759         int16_t value;
760
761 };
762
763 /**
764  * struct describing sinkclasses
765  */
766 struct am_SinkClass_s
767 {
768
769 public:
770         /**
771          * the ID of the sinkClass
772          */
773         am_sinkClass_t sinkClassID;
774         /**
775          * the name of the sinkClass - must be unique in the system
776          */
777         std::string name;
778         /**
779          * the list of the class properties. These are pairs of  a project specific enum
780          * describing the type of the value and an integer holding the real value.
781          */
782         std::vector<am_ClassProperty_s> listClassProperties;
783
784 };
785
786 /**
787  * struct describing source classes
788  */
789 struct am_SourceClass_s
790 {
791
792 public:
793         /**
794          * the source ID
795          */
796         am_sourceClass_t sourceClassID;
797         /**
798          * the name of the sourceClass - must be unique in the system
799          */
800         std::string name;
801         /**
802          * the list of the class properties. These are pairs of  a project specific enum
803          * describing the type of the value and an integer holding the real value.
804          */
805         std::vector<am_ClassProperty_s> listClassProperties;
806
807 };
808
809 /**
810  * this type holds all information of sources relevant to the HMI
811  */
812 struct am_SourceType_s
813 {
814
815 public:
816         /**
817          * This is the ID of the source, it is unique in the system. There are 2 ways, ID
818          * can be created: either it is assigned during the registration process (in a
819          * dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it
820          * is a fixed (the project has to ensure the uniqueness of the ID).
821          */
822         am_sourceID_t sourceID;
823         /**
824          * The name of the source. Must be unique in the whole system.
825          */
826         std::string name;
827         /**
828          * the availability of the source
829          */
830         am_Availability_s availability;
831         /**
832          * the sourceClassID, indicates the class the source is in. This information can
833          * be used by the Controller to implement different behaviour for different
834          * classes.
835          */
836         am_sourceClass_t sourceClassID;
837
838 };
839
840 /**
841  * this type holds all information of sinks relevant to the HMI
842  */
843 struct am_SinkType_s
844 {
845
846 public:
847         /**
848          * This is the ID of the sink, it is unique in the system. There are 2 ways, ID
849          * can be created: either it is assigned during the registration process (in a
850          * dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it
851          * is a fixed (the project has to ensure the uniqueness of the ID).
852          */
853         am_sinkID_t sinkID;
854         /**
855          * The name of the sink. Must be unique in the whole system. 
856          */
857         std::string name;
858         /**
859          * This attribute reflects the availability of the sink. There are several reasons
860          * why a sink could be not available for the moment: for example the shutdown of a
861          * sink because of overtemperature or over- & undervoltage. The availability
862          * consists of two pieces of information:
863          * 
864          *    Availablility: the status itself, can be A_AVAILABLE, A_UNAVAILABLE or
865          * A_UNKNOWN
866          *    AvailabilityReason: this informs about the last reason for a change in
867          * availability. The reasons itself are product specific.
868          */
869         am_Availability_s availability;
870         /**
871          * This is the representation of the Volume for the commandInterface. It is used
872          * by the HMI to set the volume of a sink, the AudioManagerController has to
873          * transform this into real source and sink volumes.
874          */
875         am_mainVolume_t volume;
876         am_MuteState_e muteState;
877         /**
878          * The sinkClassID references to a sinkClass. With the help of classification,
879          * rules can be setup to define the system behaviour.
880          */
881         am_sinkClass_t sinkClassID;
882
883 };
884
885 /**
886  * a handle is used for asynchronous operations and is uniquely assigned for each
887  * of this operations 
888  */
889 struct am_Handle_s
890 {
891
892 public:
893         /**
894          * the handletype
895          */
896         am_Handle_e handleType:6;
897         /**
898          * the handle as value
899          */
900         uint16_t handle:10;
901
902 };
903
904 /**
905  * struct describung mainsound property
906  */
907 struct am_MainSoundProperty_s
908 {
909
910 public:
911         /**
912          * the type of the property 
913          */
914         am_CustomMainSoundPropertyType_t type;
915         /**
916          * the actual value
917          */
918         int16_t value;
919
920 };
921
922 /**
923  * this type holds all information of connections relevant to the HMI
924  */
925 struct am_MainConnectionType_s
926 {
927
928 public:
929         /**
930          * the ID of the mainconnection
931          */
932         am_mainConnectionID_t mainConnectionID;
933         /**
934          * the sourceID where the connection starts
935          */
936         am_sourceID_t sourceID;
937         /**
938          * the sinkID where the connection ends
939          */
940         am_sinkID_t sinkID;
941         /**
942          * the delay of the mainconnection
943          */
944         am_timeSync_t delay;
945         /**
946          * the current connection state
947          */
948         am_ConnectionState_e connectionState;
949
950 };
951
952 /**
953  * struct that holds attribiutes of a mainconnection
954  */
955 struct am_MainConnection_s
956 {
957
958 public:
959         /**
960          * the assigned ID
961          */
962         am_mainConnectionID_t mainConnectionID;
963         /**
964          * the current connection state
965          */
966         am_ConnectionState_e connectionState;
967         /**
968          * the sinkID
969          */
970         am_sinkID_t sinkID;
971         /**
972          * the sourceID
973          */
974         am_sourceID_t sourceID;
975         /**
976          * the delay of the connection
977          */
978         am_timeSync_t delay;
979         /**
980          * the list of sub connection IDs the mainconnection consists of 
981          */
982         std::vector<am_connectionID_t> listConnectionID;
983
984 };
985
986 /**
987  * This struct holds the payload of a notification.
988  */
989 struct am_NotificationPayload_s
990 {
991
992 public:
993         /**
994          * This defines the notification type
995          */
996         am_CustomNotificationType_t type;
997         /**
998          * This is finally the value of the notification. It's meaning depends on the
999          * notificationType
1000          */
1001         int16_t value;
1002
1003 };
1004
1005 /**
1006  * This struct holds information about the configuration for notifications
1007  */
1008 struct am_NotificationConfiguration_s
1009 {
1010
1011 public:
1012         /**
1013          * The notification type of the notification
1014          */
1015         am_CustomNotificationType_t type;
1016         /**
1017          * The Notification status. This can be periodic, min/max value based or even off
1018          * for example
1019          */
1020         am_NotificationStatus_e status;
1021         /**
1022          * This gives additional information to the notification status.
1023          * Relation between notification status and the value:
1024          * NS_PERIODIC - the period in ms
1025          * NS_MINIMUM - the minimum value that triggers the notification
1026          * NS_MAXIMUM - the maximum value that triggers the notifcation
1027          * NS_CHANGE - the resolution of the change value
1028          */
1029         int16_t parameter;
1030
1031 };
1032
1033 /**
1034  * This struct describes the attribiutes of a sink
1035  */
1036 struct am_Sink_s
1037 {
1038
1039 public:
1040         /**
1041          * This is the ID of the sink, it is unique in the system. There are 2 ways, ID
1042          * can be created: either it is assigned during the registration process (in a
1043          * dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it
1044          * is a fixed (the project has to ensure the uniqueness of the ID).
1045          */
1046         am_sinkID_t sinkID;
1047         /**
1048          * The name of the sink. Must be unique in the whole system. 
1049          */
1050         std::string name;
1051         /**
1052          * The domainID is the domain the sink belongs to. A sink can only be in one
1053          * domain.
1054          */
1055         am_domainID_t domainID;
1056         /**
1057          * The sinkClassID references to a sinkClass. With the help of classification,
1058          * rules can be setup to define the system behaviour.
1059          */
1060         am_sinkClass_t sinkClassID;
1061         /**
1062          * This is the volume of the sink. It is set by the AudioManagerController. 
1063          */
1064         am_volume_t volume;
1065         /**
1066          * This Boolean flag indicates whether a sink is visible to the commandInterface
1067          * or not. If the User must have the possibility to choose the source in the HMI,
1068          * it must be visible. But there are also good reasons for invisible sinks, for
1069          * example if the sink is part of a crossfader or gateway. HMI relevant changes in
1070          * visible sinks will be automatically reported by the daemon to the
1071          * commandInterface.
1072          */
1073         bool visible;
1074         /**
1075          * This attribute reflects the availability of the sink. There are several reasons
1076          * why a sink could be not available for the moment: for example the shutdown of a
1077          * sink because of overtemperature or over- & undervoltage. The availability
1078          * consists of two pieces of information:
1079          * 
1080          *    Availablility: the status itself, can be A_AVAILABLE, A_UNAVAILABLE or
1081          * A_UNKNOWN
1082          *    AvailabilityReason: this informs about the last reason for a change in
1083          * availability. The reasons itself are product specific.
1084          */
1085         am_Availability_s available;
1086         /**
1087          * This attribute reflects the muteState of the sink. The information is not the
1088          * "real" state of the sink, but the HMI representation for he commandInterface
1089          * controlled by the AudioManagerController.
1090          */
1091         am_MuteState_e muteState;
1092         /**
1093          * This is the representation of the Volume for the commandInterface. It is used
1094          * by the HMI to set the volume of a sink, the AudioManagerController has to
1095          * transform this into real source and sink volumes.
1096          */
1097         am_mainVolume_t mainVolume;
1098         /**
1099          * This is the list of soundProperties, that the sink is capable of. The
1100          * soundProperties itself are project specific. For sinks, a possible
1101          * soundProperty could be for example settings.
1102          */
1103         std::vector<am_SoundProperty_s> listSoundProperties;
1104         /**
1105          * This list holds information about the formats that the Source is capable of
1106          * supporting when delivering audio.
1107          */
1108         std::vector<am_CustomConnectionFormat_t> listConnectionFormats;
1109         /**
1110          * This is the list of the available mainSoundProperties. The principle is the
1111          * same than with soundProperties, but they are only visible to the
1112          * CommandInterface.
1113          */
1114         std::vector<am_MainSoundProperty_s> listMainSoundProperties;
1115         /**
1116          * This is the list of the MainNotificationConfigurations. These notifications
1117          * work on the level of command interface.
1118          */
1119         std::vector<am_NotificationConfiguration_s> listMainNotificationConfigurations;
1120         /**
1121          * This is the list of the NotificationConfigurations. These notifications work on
1122          * the level of RoutingPlugins.
1123          */
1124         std::vector<am_NotificationConfiguration_s> listNotificationConfigurations;
1125
1126 };
1127
1128 /**
1129  * This struct describes the attribiutes of a source
1130  */
1131 struct am_Source_s
1132 {
1133
1134 public:
1135         /**
1136          * This is the ID of the source, it is unique in the system. There are 2 ways, ID
1137          * can be created: either it is assigned during the registration process (in a
1138          * dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it
1139          * is a fixed (the project has to ensure the uniqueness of the ID).
1140          */
1141         am_sourceID_t sourceID;
1142         /**
1143          * The domainID is the domain the source belongs to. A source can only be in one
1144          * domain.
1145          */
1146         am_domainID_t domainID;
1147         /**
1148          * The name of the source. Must be unique in the whole system.
1149          */
1150         std::string name;
1151         /**
1152          * the sourceClassID, indicates the class the source is in. This information can
1153          * be used by the Controller to implement different behaviour for different
1154          * classes.
1155          */
1156         am_sourceClass_t sourceClassID;
1157         /**
1158          * The source state is an indication towards the source if it is actively heard or
1159          * not. The source can use this information to implement features like automatic
1160          * spin down of CD's in case the CD is not the active source or AF following of a
1161          * tuner that is not actively heard. The source state is set by the
1162          * AudioManagerController.There are 3 possible states:
1163          * 
1164          *    SS_ON: the source is active
1165          *    SS_OFF: the source is off
1166          *    SS_PAUSED: the source is paused and not active.
1167          */
1168         am_SourceState_e sourceState;
1169         /**
1170          * This is the volume of the source. It is set by the AudioManagerController. It
1171          * is used to adopt different audiolevels in a system and mixing of sources (e.g.
1172          * navigation hints & music). 
1173          */
1174         am_volume_t volume;
1175         /**
1176          * This Boolean flag indicates whether a source is visible to the commandInterface
1177          * or not. If the User must have the possibility to choose the source in the HMI,
1178          * it must be visible. But there are also good reasons for invisible sources, for
1179          * example if the source is part of a crossfader or gateway. HMI relevant changes
1180          * in visible sources will be automatically reported by the daemon to the
1181          * commandInterface.
1182          */
1183         bool visible;
1184         /**
1185          * This attribute reflects the availability of the source. There are several
1186          * reasons why a source could be not available for the moment. For example a CD
1187          * player which has no CD entered in the slot can be unavailable, or a USB player
1188          * with no or unreadable stick attached. Other scenarios involve the shutdown of a
1189          * source because of overtemperature or over- & undervoltage. The availability
1190          * consists of two informations:
1191          * 
1192          *    Availablility: the status itself, can be A_AVAILABLE, A_UNAVAILABLE or
1193          * A_UNKNOWN
1194          *    AvailabilityReason: this informs about the last reason for a change in
1195          * availability. The reasons itself are product specific.
1196          */
1197         am_Availability_s available;
1198         /**
1199          * Some special sources can have special behaviors, the are so called "Low Level
1200          * Interrupts". Here the current status is documented. The information can be used
1201          * by the AudioManagerController to react to the changes by for example lowering
1202          * the volume of the mainSources. The two states are
1203          * 
1204          *    IS_OFF: the interrupt is not active at the moment
1205          *    IS_INTERRUPTED: the interrupt is playing at the moment.
1206          */
1207         am_InterruptState_e interruptState;
1208         /**
1209          * This is the list of soundProperties, that the source is capable of. The
1210          * soundProperties itself are project specific. For sources, a possible
1211          * soundProperty could be navigation volume offset, for example. 
1212          */
1213         std::vector<am_SoundProperty_s> listSoundProperties;
1214         /**
1215          * This list holds information about the formats that the Source is capable of
1216          * supporting when delivering audio.
1217          */
1218         std::vector<am_CustomConnectionFormat_t> listConnectionFormats;
1219         /**
1220          * This is the list of the available mainSoundProperties. The principle is the
1221          * same than with soundProperties, but they are only visible to the
1222          * CommandInterface.
1223          */
1224         std::vector<am_MainSoundProperty_s> listMainSoundProperties;
1225         /**
1226          * The list of MainNotificationConfigurations. These notifications work on the
1227          * level of CommandInterface.
1228          */
1229         std::vector<am_NotificationConfiguration_s> listMainNotificationConfigurations;
1230         /**
1231          * The list of MainNotificationConfigurations. These notifications work on the
1232          * level of RoutingInterface.
1233          */
1234         std::vector<am_NotificationConfiguration_s> listNotificationConfigurations;
1235
1236 };
1237
1238 /**
1239  * This struct describes the attribiutes of a domain
1240  */
1241 struct am_Domain_s
1242 {
1243
1244 public:
1245         /**
1246          * the domain ID
1247          */
1248         am_domainID_t domainID;
1249         /**
1250          * the name of the domain
1251          */
1252         std::string name;
1253         /**
1254          * the busname. This is equal to a plugin name and is used to dispatch messages to
1255          * the elements of a plugin
1256          */
1257         std::string busname;
1258         /**
1259          * the name of the node
1260          */
1261         std::string nodename;
1262         /**
1263          * indicated if the domain is independent at startup or not
1264          */
1265         bool early;
1266         /**
1267          * indicates if the domain registration is complete or not
1268          */
1269         bool complete;
1270         /**
1271          * the current domain state
1272          */
1273         am_DomainState_e state;
1274
1275 };
1276
1277 /**
1278  * a connection
1279  */
1280 struct am_Connection_s
1281 {
1282
1283 public:
1284         /**
1285          * the assigned ID
1286          */
1287         am_connectionID_t connectionID;
1288         /**
1289          * the source the audio flows from
1290          */
1291         am_sourceID_t sourceID;
1292         /**
1293          * the sink the audio flows to
1294          */
1295         am_sinkID_t sinkID;
1296         /**
1297          * the delay of the conneciton
1298          */
1299         am_timeSync_t delay;
1300         /**
1301          * the used connectionformat
1302          */
1303         am_CustomConnectionFormat_t connectionFormat;
1304
1305 };
1306
1307 /**
1308  * data type depends of am_EarlyDataType_e:
1309  * volume_t in case of ED_SOURCE_VOLUME, ED_SINK_VOLUME
1310  * soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY 
1311  */
1312 union am_EarlyData_u
1313 {
1314
1315 public:
1316         am_volume_t volume;
1317         am_SoundProperty_s soundProperty;
1318         am_InterruptState_e interruptState;
1319
1320 };
1321
1322 /**
1323  * data type depends of am_EarlyDataType_e:
1324  * sourceID in case of ED_SOURCE_VOLUME, ED_SOURCE_PROPERTY
1325  * sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY 
1326  */
1327 union am_DataType_u
1328 {
1329
1330 public:
1331         am_sinkID_t sink;
1332         am_sourceID_t source;
1333
1334 };
1335
1336 struct am_EarlyData_s
1337 {
1338
1339 public:
1340         am_EarlyDataType_e type;
1341         am_DataType_u sinksource;
1342         am_EarlyData_u data;
1343
1344 };
1345
1346 /**
1347  * This types describe a mixed description for source and sinks volumes.
1348  */
1349 struct am_Volumes_s
1350 {
1351
1352 public:
1353         /**
1354          * describes the type of the volume: source or sink.
1355          */
1356         am_VolumeType_e volumeType;
1357         /**
1358          * either sourceID or sinkID
1359          */
1360         am_DataType_u volumeID;
1361         /**
1362          * The volume
1363          */
1364         am_volume_t volume;
1365         /**
1366          * the ramp that shall be driven
1367          */
1368         am_CustomRampType_t ramp;
1369         /**
1370          * the time for the ramp
1371          */
1372         am_time_t time;
1373
1374 };
1375 }
1376 #endif // !defined(EA_4FF89D4E_BF3C_465a_85C9_1DC47E4FA742__INCLUDED_)