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