2 * Copyright (C) 2012, BMW AG
4 * This file is part of GENIVI Project AudioManager.
6 * Contributions are licensed to the GENIVI Alliance under one or more
7 * Contribution License Agreements.
10 * This Source Code Form is subject to the terms of the
11 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
12 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
17 * \file CAmDatabaseObserver.h
18 * For further information see http://www.genivi.org/.
22 #ifndef DATABASEOBSERVER_H_
23 #define DATABASEOBSERVER_H_
25 #include "audiomanagertypes.h"
27 #include "shared/CAmSerializer.h"
32 class CAmTelnetServer;
33 class CAmCommandSender;
34 class CAmRoutingSender;
35 class CAmSocketHandler;
38 * This class observes the Database and notifies other classes about important events, mainly the CommandSender.
40 class CAmDatabaseObserver
43 CAmDatabaseObserver(CAmCommandSender *iCommandSender, CAmRoutingSender *iRoutingSender, CAmSocketHandler *iSocketHandler);
44 CAmDatabaseObserver(CAmCommandSender *iCommandSender, CAmRoutingSender *iRoutingSender, CAmSocketHandler *iSocketHandler, CAmTelnetServer *iTelnetServer);
45 ~CAmDatabaseObserver();
46 void numberOfSinkClassesChanged();
47 void numberOfSourceClassesChanged();
48 void newSink(const am_Sink_s& sink);
49 void newSource(const am_Source_s& source);
50 void newDomain(const am_Domain_s& domain);
51 void newGateway(const am_Gateway_s& gateway);
52 void newCrossfader(const am_Crossfader_s& crossfader);
53 void newMainConnection(const am_MainConnectionType_s& mainConnection);
54 void removedMainConnection(const am_mainConnectionID_t mainConnection);
55 void removedSink(const am_sinkID_t sinkID, const bool visible);
56 void removedSource(const am_sourceID_t sourceID, const bool visible);
57 void removeDomain(const am_domainID_t domainID);
58 void removeGateway(const am_gatewayID_t gatewayID);
59 void removeCrossfader(const am_crossfaderID_t crossfaderID);
60 void mainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState);
61 void mainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& SoundProperty);
62 void mainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& SoundProperty);
63 void sinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability);
64 void sourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s& availability);
65 void volumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume);
66 void sinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState);
67 void systemPropertyChanged(const am_SystemProperty_s& SystemProperty);
68 void timingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time);
69 void sinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties, const bool visible);
70 void sourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties, const bool visible);
71 void sinkMainNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s mainNotificationConfiguration);
72 void sourceMainNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s mainNotificationConfiguration);
75 CAmCommandSender *mCommandSender; //!< pointer to the comandSender
76 CAmRoutingSender* mRoutingSender; //!< pointer to the routingSender
77 CAmTelnetServer* mTelnetServer; //!< pointer to the telnetserver
78 CAmSerializer mSerializer; //!< serializer to handle the CommandInterface via the mainloop
83 #endif /* DATABASEOBSERVER_H_ */