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