summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/include
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-02-27 10:11:08 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2012-02-27 19:10:59 +0100
commitaa93713377d28a8ce7821466ef828f79a18e982d (patch)
treef1efc6d524ef4656f93977e746d75428e06ac236 /AudioManagerDaemon/include
parent02b17a992e900ad82df8edf02e5e51e750ece36b (diff)
downloadaudiomanager-aa93713377d28a8ce7821466ef828f79a18e982d.tar.gz
* [GAM-4] updated interfaces
* shifted mainpage doxygen from EA generated to mainpage.h * added logo to doxygen documentation * fixed compile bug in cmakelists when no plugins are build * [ GAM-23 ]fixed plugin version recognition in cmake * first working CAmSerializer with DatabaseObserver
Diffstat (limited to 'AudioManagerDaemon/include')
-rw-r--r--AudioManagerDaemon/include/CommandReceiver.h16
-rw-r--r--AudioManagerDaemon/include/CommandSender.h26
-rw-r--r--AudioManagerDaemon/include/ControlReceiver.h24
-rw-r--r--AudioManagerDaemon/include/ControlSender.h90
-rw-r--r--AudioManagerDaemon/include/DatabaseObserver.h131
-rw-r--r--AudioManagerDaemon/include/RoutingReceiver.h22
-rw-r--r--AudioManagerDaemon/include/RoutingSender.h11
-rw-r--r--AudioManagerDaemon/include/mainpage.h115
8 files changed, 246 insertions, 189 deletions
diff --git a/AudioManagerDaemon/include/CommandReceiver.h b/AudioManagerDaemon/include/CommandReceiver.h
index c7154f1..a8f7400 100644
--- a/AudioManagerDaemon/include/CommandReceiver.h
+++ b/AudioManagerDaemon/include/CommandReceiver.h
@@ -64,13 +64,27 @@ public:
am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const;
am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const;
am_Error_e getSocketHandler(SocketHandler*& socketHandler) const;
- uint16_t getInterfaceVersion() const;
+ void getInterfaceVersion(std::string& version) const;
+ void confirmCommandReady(const uint16_t handle);
+ void confirmCommandRundown(const uint16_t handle);
+
+ uint16_t getStartupHandle(); //!< returns a startup handle
+ uint16_t getRundownHandle(); //!< returns a rundown handle
+
+ void waitOnStartup(bool startup); //!< tells the ComandReceiver to start waiting for all handles to be confirmed
+ void waitOnRundown(bool rundown); //!< tells the ComandReceiver to start waiting for all handles to be confirmed
private:
DatabaseHandler* mDatabaseHandler; //!< pointer to the databasehandler
ControlSender* mControlSender; //!< pointer to the control sender
DBusWrapper* mDBusWrapper; //!< pointer to the dbuswrapper
SocketHandler* mSocketHandler; //!< pointer to the SocketHandler
+
+ uint16_t handleCount; //!< counts all handles
+ std::vector<uint16_t> mListStartupHandles; //!< list of handles that wait for a confirm
+ std::vector<uint16_t> mListRundownHandles; //!< list of handles that wait for a confirm
+ bool mWaitStartup; //!< if true confirmation will be sent if list of handles = 0
+ bool mWaitRundown; //!< if true confirmation will be sent if list of handles = 0
};
}
diff --git a/AudioManagerDaemon/include/CommandSender.h b/AudioManagerDaemon/include/CommandSender.h
index 1a17134..57362f0 100644
--- a/AudioManagerDaemon/include/CommandSender.h
+++ b/AudioManagerDaemon/include/CommandSender.h
@@ -34,6 +34,9 @@
namespace am
{
+class CommandReceiver;
+
+
/**
* This class is used to send data to the CommandInterface.
* All loaded plugins will be called when a callback is invoked.
@@ -43,20 +46,19 @@ class CommandSender
public:
CommandSender(const std::vector<std::string>& listOfPluginDirectories);
virtual ~CommandSender();
- am_Error_e startupInterface(CommandReceiveInterface* commandreceiveinterface);
- am_Error_e stopInterface();
- am_Error_e cbCommunicationReady();
- am_Error_e cbCommunicationRundown();
+ am_Error_e startupInterfaces(CommandReceiver* iCommandReceiver);
+ void setCommandReady();
+ void setCommandRundown();
void cbNewMainConnection(const am_MainConnectionType_s mainConnection);
- void cbRemovedMainConnection(const am_MainConnectionType_s mainConnection);
- void cbNewSink(const am_SinkType_s sink);
- void cbRemovedSink(const am_SinkType_s sink);
+ void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection);
+ void cbNewSink(am_SinkType_s sink);
+ void cbRemovedSink(const am_sinkID_t sink);
void cbNewSource(const am_SourceType_s source);
- void cbRemovedSource(const am_SourceType_s source);
+ void cbRemovedSource(const am_sourceID_t source);
void cbNumberOfSinkClassesChanged();
void cbNumberOfSourceClassesChanged();
void cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState);
- void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s soundProperty);
+ void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty);
void cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty);
void cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability);
void cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s& availability);
@@ -64,7 +66,7 @@ public:
void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState);
void cbSystemPropertyChanged(const am_SystemProperty_s& systemProperty);
void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time);
- uint16_t getInterfaceVersion() const;
+ void getInterfaceVersion(std::string& version) const;
am_Error_e getListPlugins(std::vector<std::string>& interfaces) const;
#ifdef UNIT_TEST
friend class CommandInterfaceBackdoor; //this is to get access to the loaded plugins and be able to exchange the interfaces
@@ -73,7 +75,9 @@ private:
void unloadLibraries(void); //!< unload the shared libraries
std::vector<CommandSendInterface*> mListInterfaces; //!< list of all interfaces
std::vector<void*> mListLibraryHandles; //!< list of all library handles. This information is used to unload the plugins correctly.
- std::vector<std::string> mListLibraryNames; //!< list of all library anmes. This information is used for getListPlugins.
+ std::vector<std::string> mListLibraryNames; //!< list of all library names. This information is used for getListPlugins.
+
+ CommandReceiver *mCommandReceiver;
};
}
diff --git a/AudioManagerDaemon/include/ControlReceiver.h b/AudioManagerDaemon/include/ControlReceiver.h
index c67e0d9..03e36d8 100644
--- a/AudioManagerDaemon/include/ControlReceiver.h
+++ b/AudioManagerDaemon/include/ControlReceiver.h
@@ -49,23 +49,25 @@ public:
am_Error_e connect(am_Handle_s& handle, am_connectionID_t& connectionID, const am_ConnectionFormat_e format, const am_sourceID_t sourceID, const am_sinkID_t sinkID);
am_Error_e disconnect(am_Handle_s& handle, const am_connectionID_t connectionID);
am_Error_e crossfade(am_Handle_s& handle, const am_HotSink_e hotSource, const am_crossfaderID_t crossfaderID, const am_RampType_e rampType, const am_time_t rampTime);
+ am_Error_e abortAction(const am_Handle_s handle);
am_Error_e setSourceState(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SourceState_e state);
am_Error_e setSinkVolume(am_Handle_s& handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time);
am_Error_e setSourceVolume(am_Handle_s& handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e rampType, const am_time_t time);
- am_Error_e setSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty);
am_Error_e setSinkSoundProperties(am_Handle_s& handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& soundProperty);
- am_Error_e setSourceSoundProperty(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty);
+ am_Error_e setSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty);
am_Error_e setSourceSoundProperties(am_Handle_s& handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& soundProperty);
+ am_Error_e setSourceSoundProperty(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty);
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState);
- am_Error_e abortAction(const am_Handle_s handle);
am_Error_e enterDomainDB(const am_Domain_s& domainData, am_domainID_t& domainID);
am_Error_e enterMainConnectionDB(const am_MainConnection_s& mainConnectionData, am_mainConnectionID_t& connectionID);
am_Error_e enterSinkDB(const am_Sink_s& sinkData, am_sinkID_t& sinkID);
am_Error_e enterCrossfaderDB(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID);
am_Error_e enterGatewayDB(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID);
am_Error_e enterSourceDB(const am_Source_s& sourceData, am_sourceID_t& sourceID);
- am_Error_e enterSinkClassDB(const am_SinkClass_s & sinkClass, am_sinkClass_t & sinkClassID);
- am_Error_e enterSourceClassDB(am_sourceClass_t & sourceClassID, const am_SourceClass_s & sourceClass);
+ am_Error_e enterSinkClassDB(const am_SinkClass_s& sinkClass, am_sinkClass_t& sinkClassID);
+ am_Error_e enterSourceClassDB(am_sourceClass_t& sourceClassID, const am_SourceClass_s& sourceClass);
+ am_Error_e changeSinkClassInfoDB(const am_SinkClass_s& sinkClass);
+ am_Error_e changeSourceClassInfoDB(const am_SourceClass_s& sourceClass);
am_Error_e enterSystemPropertiesListDB(const std::vector<am_SystemProperty_s>& listSystemProperties);
am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID);
am_Error_e changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState);
@@ -77,8 +79,6 @@ public:
am_Error_e changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID);
am_Error_e changeSourceAvailabilityDB(const am_Availability_s& availability, const am_sourceID_t sourceID);
am_Error_e changeSystemPropertyDB(const am_SystemProperty_s& property);
- am_Error_e changeSinkClassInfoDB(const am_SinkClass_s& classInfo);
- am_Error_e changeSourceClassInfoDB(const am_SourceClass_s& classInfo);
am_Error_e removeMainConnectionDB(const am_mainConnectionID_t mainConnectionID);
am_Error_e removeSinkDB(const am_sinkID_t sinkID);
am_Error_e removeSourceDB(const am_sourceID_t sourceID);
@@ -96,25 +96,27 @@ public:
am_Error_e getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s& mainConnectionData) const;
am_Error_e getListSinksOfDomain(const am_domainID_t domainID, std::vector<am_sinkID_t>& listSinkID) const;
am_Error_e getListSourcesOfDomain(const am_domainID_t domainID, std::vector<am_sourceID_t>& listSourceID) const;
- am_Error_e getListCrossfadersOfDomain(const am_domainID_t domainID, std::vector<am_crossfaderID_t>& listGatewaysID) const;
+ am_Error_e getListCrossfadersOfDomain(const am_domainID_t domainID, std::vector<am_crossfaderID_t>& listCrossfadersID) const;
am_Error_e getListGatewaysOfDomain(const am_domainID_t domainID, std::vector<am_gatewayID_t>& listGatewaysID) const;
am_Error_e getListMainConnections(std::vector<am_MainConnection_s>& listMainConnections) const;
am_Error_e getListDomains(std::vector<am_Domain_s>& listDomains) const;
am_Error_e getListConnections(std::vector<am_Connection_s>& listConnections) const;
am_Error_e getListSinks(std::vector<am_Sink_s>& listSinks) const;
- am_Error_e getListSources(std::vector<am_Source_s>& lisSources) const;
+ am_Error_e getListSources(std::vector<am_Source_s>& listSources) const;
am_Error_e getListSourceClasses(std::vector<am_SourceClass_s>& listSourceClasses) const;
am_Error_e getListHandles(std::vector<am_Handle_s>& listHandles) const;
am_Error_e getListCrossfaders(std::vector<am_Crossfader_s>& listCrossfaders) const;
am_Error_e getListGateways(std::vector<am_Gateway_s>& listGateways) const;
am_Error_e getListSinkClasses(std::vector<am_SinkClass_s>& listSinkClasses) const;
am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const;
- void setRoutingReady();
void setCommandReady();
void setCommandRundown();
+ void setRoutingReady();
void setRoutingRundown();
+ void confirmControllerReady();
+ void confirmControllerRundown();
am_Error_e getSocketHandler(SocketHandler*& socketHandler);
- uint16_t getInterfaceVersion() const;
+ void getInterfaceVersion(std::string& version) const;
private:
DatabaseHandler* mDatabaseHandler; //!< pointer tto the databasehandler
diff --git a/AudioManagerDaemon/include/ControlSender.h b/AudioManagerDaemon/include/ControlSender.h
index 66db61c..cb9ff36 100644
--- a/AudioManagerDaemon/include/ControlSender.h
+++ b/AudioManagerDaemon/include/ControlSender.h
@@ -42,49 +42,53 @@ class ControlSender
public:
ControlSender(std::string controlPluginFile);
virtual ~ControlSender();
- am_Error_e startupController(ControlReceiveInterface* controlreceiveinterface);
- am_Error_e stopController();
- am_Error_e hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID);
- am_Error_e hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID);
- am_Error_e hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty);
- am_Error_e hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty);
- am_Error_e hookUserSetSystemProperty(const am_SystemProperty_s& property);
- am_Error_e hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume);
- am_Error_e hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment);
- am_Error_e hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState);
- am_Error_e hookSystemRegisterDomain(const am_Domain_s& domainData, am_domainID_t& domainID);
- am_Error_e hookSystemDeregisterDomain(const am_domainID_t domainID);
- am_Error_e hookSystemRegisterSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID);
- am_Error_e hookSystemDeregisterSink(const am_sinkID_t sinkID);
- am_Error_e hookSystemRegisterSource(const am_Source_s& sourceData, am_sourceID_t& sourceID);
- am_Error_e hookSystemDeregisterSource(const am_sourceID_t sourceID);
- am_Error_e hookSystemRegisterGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID);
- am_Error_e hookSystemDeregisterGateway(const am_gatewayID_t gatewayID);
- am_Error_e hookSystemRegisterCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID);
- am_Error_e hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID);
- void hookAllPluginsLoaded();
- void hookSystemDomainRegistrationComplete(const am_domainID_t domainID);
- void hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume);
- void hookSystemSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume);
- void hookSystemInterruptStateChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState);
- void hookSystemSinkAvailablityStateChange(const am_sinkID_t sinkID, const am_Availability_s& availability);
- void hookSystemSourceAvailablityStateChange(const am_sourceID_t sourceID, const am_Availability_s& availability);
- void hookSystemDomainStateChange(const am_domainID_t domainID, const am_DomainState_e state);
- void hookSystemReceiveEarlyData(const std::vector<am_EarlyData_s>& data);
- void hookSystemSpeedChange(const am_speed_t speed);
- void hookSystemTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time);
- void cbAckConnect(const am_Handle_s handle, const am_Error_e errorID);
- void cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID);
- void cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error);
- void cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error);
- void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error);
- void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error);
- void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error);
- void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error);
- void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error);
- void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error);
- am_Error_e getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector<am_ConnectionFormat_e> listPossibleConnectionFormats, std::vector<am_ConnectionFormat_e> & listPrioConnectionFormats);
- uint16_t getInterfaceVersion() const;
+ am_Error_e startupController(ControlReceiveInterface* controlreceiveinterface) ;
+ void setControllerReady() ;
+ void setControllerRundown() ;
+ am_Error_e hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID) ;
+ am_Error_e hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID) ;
+ am_Error_e hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty) ;
+ am_Error_e hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty) ;
+ am_Error_e hookUserSetSystemProperty(const am_SystemProperty_s& property) ;
+ am_Error_e hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume) ;
+ am_Error_e hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment) ;
+ am_Error_e hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState) ;
+ am_Error_e hookSystemRegisterDomain(const am_Domain_s& domainData, am_domainID_t& domainID) ;
+ am_Error_e hookSystemDeregisterDomain(const am_domainID_t domainID) ;
+ void hookSystemDomainRegistrationComplete(const am_domainID_t domainID) ;
+ am_Error_e hookSystemRegisterSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID) ;
+ am_Error_e hookSystemDeregisterSink(const am_sinkID_t sinkID) ;
+ am_Error_e hookSystemRegisterSource(const am_Source_s& sourceData, am_sourceID_t& sourceID) ;
+ am_Error_e hookSystemDeregisterSource(const am_sourceID_t sourceID) ;
+ am_Error_e hookSystemRegisterGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID) ;
+ am_Error_e hookSystemDeregisterGateway(const am_gatewayID_t gatewayID) ;
+ am_Error_e hookSystemRegisterCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID) ;
+ am_Error_e hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID) ;
+ void hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume) ;
+ void hookSystemSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume) ;
+ void hookSystemInterruptStateChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState) ;
+ void hookSystemSinkAvailablityStateChange(const am_sinkID_t sinkID, const am_Availability_s& availability) ;
+ void hookSystemSourceAvailablityStateChange(const am_sourceID_t sourceID, const am_Availability_s& availability) ;
+ void hookSystemDomainStateChange(const am_domainID_t domainID, const am_DomainState_e state) ;
+ void hookSystemReceiveEarlyData(const std::vector<am_EarlyData_s>& data) ;
+ void hookSystemSpeedChange(const am_speed_t speed) ;
+ void hookSystemTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time) ;
+ void cbAckConnect(const am_Handle_s handle, const am_Error_e errorID) ;
+ void cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID) ;
+ void cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error) ;
+ void cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) ;
+ void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error) ;
+ void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error) ;
+ void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
+ void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
+ void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ am_Error_e getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector<am_ConnectionFormat_e> listPossibleConnectionFormats, std::vector<am_ConnectionFormat_e>& listPrioConnectionFormats) ;
+ void getInterfaceVersion(std::string& version) const ;
+ void confirmCommandReady() ;
+ void confirmRoutingReady() ;
+ void confirmCommandRundown() ;
+ void confirmRoutingRundown() ;
#ifdef UNIT_TEST
friend class ControlInterfaceBackdoor;
diff --git a/AudioManagerDaemon/include/DatabaseObserver.h b/AudioManagerDaemon/include/DatabaseObserver.h
index 75fed77..0657b9d 100644
--- a/AudioManagerDaemon/include/DatabaseObserver.h
+++ b/AudioManagerDaemon/include/DatabaseObserver.h
@@ -26,8 +26,8 @@
#define DATABASEOBSERVER_H_
#include <audiomanagertypes.h>
-#include <SocketHandler.h>
#include <queue>
+#include "CAmSerializer.h"
namespace am
{
@@ -35,6 +35,7 @@ namespace am
class TelnetServer;
class CommandSender;
class RoutingSender;
+class SocketHandler;
/**
* This class observes the Database and notifies other classes about important events, mainly the CommandSender.
@@ -46,21 +47,22 @@ public:
DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender, SocketHandler *iSocketHandler);
DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender, SocketHandler *iSocketHandler, TelnetServer *iTelnetServer);
virtual ~DatabaseObserver();
- void numberOfMainConnectionsChanged();
void numberOfSinkClassesChanged();
void numberOfSourceClassesChanged();
- void newSink(am_Sink_s sink);
- void newSource(am_Source_s source);
- void newDomain(am_Domain_s domain);
- void newGateway(am_Gateway_s gateway);
- void newCrossfader(am_Crossfader_s crossfader);
- void removedSink(am_sinkID_t sinkID);
- void removedSource(am_sourceID_t sourceID);
- void removeDomain(am_domainID_t domainID);
- void removeGateway(am_gatewayID_t gatewayID);
- void removeCrossfader(am_crossfaderID_t crossfaderID);
+ void newSink(const am_Sink_s& sink);
+ void newSource(const am_Source_s& source);
+ void newDomain(const am_Domain_s& domain);
+ void newGateway(const am_Gateway_s& gateway);
+ void newCrossfader(const am_Crossfader_s& crossfader);
+ void newMainConnection(const am_MainConnectionType_s& mainConnection);
+ void removedMainConnection(const am_mainConnectionID_t mainConnection);
+ void removedSink(const am_sinkID_t sinkID, const bool visible);
+ void removedSource(const am_sourceID_t sourceID, const bool visible);
+ void removeDomain(const am_domainID_t domainID);
+ void removeGateway(const am_gatewayID_t gatewayID);
+ void removeCrossfader(const am_crossfaderID_t crossfaderID);
void mainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState);
- void mainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s SoundProperty);
+ void mainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& SoundProperty);
void mainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& SoundProperty);
void sinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability);
void sourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s& availability);
@@ -69,112 +71,11 @@ public:
void systemPropertyChanged(const am_SystemProperty_s& SystemProperty);
void timingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time);
- void receiverCallback(const pollfd pollfd, const sh_pollHandle_t handle, void* userData);
- bool dispatcherCallback(const sh_pollHandle_t handle, void* userData);
- bool checkerCallback(const sh_pollHandle_t handle, void* userData);
-
- shPollFired_T<DatabaseObserver> receiverCallbackT;
- shPollDispatch_T<DatabaseObserver> dispatcherCallbackT;
- shPollCheck_T<DatabaseObserver> checkerCallbackT;
-
private:
-
- enum do_msgID_e
- {
- MDO_cbNumberOfSinksChanged, //
- MDO_cbNumberOfSourcesChanged, //
- MDO_cbNumberOfMainConnectionsChanged, //
- MDO_cbNumberOfSinkClassesChanged, //
- MDO_cbNumberOfSourceClassesChanged, //
- MDO_cbMainConnectionStateChanged, //
- MDO_cbMainSinkSoundPropertyChanged, //
- MDO_cbMainSourceSoundPropertyChanged, //
- MDO_cbSinkAvailabilityChanged, //
- MDO_cbSourceAvailabilityChanged, //
- MDO_cbVolumeChanged, //
- MDO_cbSinkMuteStateChanged, //
- MDO_cbSystemPropertyChanged, //
- MDO_cbTimingInformationChanged
- };
-
- struct do_connectionStateChanged_s
- {
- am_mainConnectionID_t connectionID;
- am_ConnectionState_e connectionState;
- };
-
- struct do_mainSinkSoundPropertyChanged_s
- {
- am_sinkID_t sinkID;
- am_MainSoundProperty_s SoundProperty;
- };
-
- struct do_mainSourceSoundPropertyChanged_s
- {
- am_sourceID_t sourceID;
- am_MainSoundProperty_s SoundProperty;
- };
-
- struct do_sinkAvailabilityChanged_s
- {
- am_sinkID_t sinkID;
- am_Availability_s availability;
- };
-
- struct do_sourceAvailabilityChanged_s
- {
- am_sourceID_t sourceID;
- am_Availability_s availability;
- };
-
- struct do_volumeChanged_s
- {
- am_sinkID_t sinkID;
- am_mainVolume_t volume;
- };
-
- struct do_sinkMuteStateChanged_s
- {
- am_sinkID_t sinkID;
- am_MuteState_e muteState;
- };
-
- struct do_timingInformationChanged_s
- {
- am_mainConnectionID_t mainConnection;
- am_timeSync_t time;
- };
-
- union do_parameter_u
- {
- do_connectionStateChanged_s connectionStateChanged;
- do_mainSinkSoundPropertyChanged_s mainSinkSoundPropertyChanged;
- do_mainSourceSoundPropertyChanged_s mainSourceSoundPropertyChanged;
- do_sinkAvailabilityChanged_s sinkAvailabilityChanged;
- do_sourceAvailabilityChanged_s sourceAvailabilityChanged;
- do_volumeChanged_s volumeChanged;
- do_sinkMuteStateChanged_s sinkMuteStateChanged;
- do_timingInformationChanged_s timingInformationChanged;
- am_SystemProperty_s systemProperty;
- };
-
- struct do_msg_s
- {
- do_msgID_e msgID;
- do_parameter_u parameters;
- };
-
- void pipeCommand(const do_msg_s& message);
-
- void commonConstructor(); //!< this is called from both constructors
CommandSender *mCommandSender; //!< pointer to the comandSender
RoutingSender* mRoutingSender; //!< pointer to the routingSender
TelnetServer* mTelnetServer; //!< pointer to the telnetserver
- SocketHandler* mSocketHandler; //!< pointer to the sockethandler
-
- int mPipe[2];
- sh_pollHandle_t mHandle;
- std::queue<do_msg_s> mQueue;
+ CAmSerializer mSerializer;
};
}
diff --git a/AudioManagerDaemon/include/RoutingReceiver.h b/AudioManagerDaemon/include/RoutingReceiver.h
index 08af182..3803ff4 100644
--- a/AudioManagerDaemon/include/RoutingReceiver.h
+++ b/AudioManagerDaemon/include/RoutingReceiver.h
@@ -51,10 +51,10 @@ public:
void ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error);
void ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error);
void ackSetSourceState(const am_Handle_s handle, const am_Error_e error);
- void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error);
void ackSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error);
- void ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error);
+ void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error);
void ackSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error);
+ void ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error);
void ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error);
void ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume);
void ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume);
@@ -71,8 +71,8 @@ public:
am_Error_e deregisterSource(const am_sourceID_t sourceID);
am_Error_e registerCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID);
am_Error_e deregisterCrossfader(const am_crossfaderID_t crossfaderID);
- am_Error_e peekSinkClassID(const std::string& name, am_sinkClass_t& sinkClassID);
am_Error_e peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID);
+ am_Error_e peekSinkClassID(const std::string& name, am_sinkClass_t& sinkClassID);
void hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState);
void hookDomainRegistrationComplete(const am_domainID_t domainID);
void hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s& availability);
@@ -82,7 +82,15 @@ public:
void sendChangedData(const std::vector<am_EarlyData_s>& earlyData);
am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const;
am_Error_e getSocketHandler(SocketHandler*& socketHandler) const;
- uint16_t getInterfaceVersion() const;
+ void getInterfaceVersion(std::string& version) const;
+ void confirmRoutingReady(const uint16_t handle) const;
+ void confirmRoutingRundown(const uint16_t handle) const;
+
+ uint16_t getStartupHandle(); //!< returns a startup handle
+ uint16_t getRundownHandle(); //!< returns a rundown handle
+
+ void waitOnStartup(bool startup); //!< tells the RoutingReceiver to start waiting for all handles to be confirmed
+ void waitOnRundown(bool rundown); //!< tells the RoutingReceiver to start waiting for all handles to be confirmed
private:
DatabaseHandler *mDatabaseHandler; //!< pointer to the databaseHandler
@@ -91,6 +99,12 @@ private:
SocketHandler *mSocketHandler; //!< pointer to sockethandler
DBusWrapper *mDBusWrapper; //!< pointer to dbuswrapper
+ uint16_t handleCount; //!< counts all handles
+ std::vector<uint16_t> mListStartupHandles; //!< list of handles that wait for a confirm
+ std::vector<uint16_t> mListRundownHandles; //!< list of handles that wait for a confirm
+ bool mWaitStartup; //!< if true confirmation will be sent if list of handles = 0
+ bool mWaitRundown; //!< if true confirmation will be sent if list of handles = 0
+
};
}
diff --git a/AudioManagerDaemon/include/RoutingSender.h b/AudioManagerDaemon/include/RoutingSender.h
index 0888b6a..308d5e5 100644
--- a/AudioManagerDaemon/include/RoutingSender.h
+++ b/AudioManagerDaemon/include/RoutingSender.h
@@ -35,6 +35,8 @@
namespace am
{
+class RoutingReceiver;
+
/**
* Implements the RoutingSendInterface. Loads all plugins and dispatches calls to the plugins
*/
@@ -95,9 +97,9 @@ public:
* this removes the Crossfader to the lookup table of the Router. This must be done everytime a crossfader is deregistered.
*/
am_Error_e removeCrossfaderLookup(const am_crossfaderID_t crossfaderID);
- void startupRoutingInterface(RoutingReceiveInterface* routingreceiveinterface);
- void routingInterfacesReady();
- void routingInterfacesRundown();
+ am_Error_e startupInterfaces(RoutingReceiver* iRoutingReceiver);
+ void setRoutingReady();
+ void setRoutingRundown();
am_Error_e asyncAbort(const am_Handle_s& handle);
am_Error_e asyncConnect(am_Handle_s& handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat);
am_Error_e asyncDisconnect(am_Handle_s& handle, const am_connectionID_t connectionID);
@@ -112,7 +114,7 @@ public:
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState);
am_Error_e getListHandles(std::vector<am_Handle_s> & listHandles) const;
am_Error_e getListPlugins(std::vector<std::string>& interfaces) const;
- uint16_t getInterfaceVersion() const;
+ void getInterfaceVersion(std::string& version) const;
//!< is used to pair interfaces with busnames
struct InterfaceNamePairs
@@ -192,6 +194,7 @@ private:
SinkInterfaceMap mMapSinkInterface; //!< map of sinks to interfaces
SourceInterfaceMap mMapSourceInterface; //!< map of sources to interfaces
HandleInterfaceMap mMapHandleInterface; //!< map of handles to interfaces
+ RoutingReceiver *mRoutingReceiver;
};
}
diff --git a/AudioManagerDaemon/include/mainpage.h b/AudioManagerDaemon/include/mainpage.h
new file mode 100644
index 0000000..8d8fdab
--- /dev/null
+++ b/AudioManagerDaemon/include/mainpage.h
@@ -0,0 +1,115 @@
+/**
+ * \mainpage
+ *
+ *
+ * \image html genivilogo.png
+ *
+ * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ *
+ * \par Copyright
+ * Copyright Copyright (C) 2011,2012 GENIVI Alliance\n
+ * Copyright Copyright (C) 2011,2012 BMW AG
+ *
+ * \par License
+ * Contributions are licensed to the GENIVI Alliance under one or more Contribution License Agreements.
+ * This file is licensed under the terms of the Mozilla Public License 2.0.\n
+ * A copy of the license text has been included in the “LICENSE” file in the root directory of the source distribution.
+ * You can also obtain a copy of the license text at\n
+ * http://mozilla.org/MPL/2.0/.
+ *
+ * \par More information
+ * can be found at https://collab.genivi.org/wiki/display/genivi/GENIVI+Home \n
+ *
+ * \par About AudioManager
+ * The AudioManager is a Deamon that manages all Audio Connections in a GENIVI headunit.
+ * It is a managing instance that uses so called RoutingAdaptors to control AudioDomains that then do the "real" connections.
+ * \n\n\n
+ *
+ *
+ * \section architecture Architecture Overview
+ *
+ * The architecture concept bases on the partition of management (logic) and routing (action). Sinks and sources are clustered into independent parts which are capable of exchanging audio with each other (AudioDomains). Between these AudioDomains, Audio can be interchanged via Gateways. \n
+ * Since the routing and the management shall be independent from the actual used system, it is realized as an OwnedComponent, the AudioManager. Each AudioDomain has a Routing Adapter which implements some necessary logic and is the interface between the AudioManager and the AudioDomains.
+ *
+ * \section domains Audio Domains
+ *
+ * An Audio Domain consists of sinks and sources that can exchange audio with each other. To make the most out of the concept, AudioDomains shall be chosen in such a way that they are implemented by already existing audio routing engines.
+ *
+ * The AudioManager assumes that there are no restrictions in interconnection of sinks and sources. One or more sources can be connected to one sink and one or more sinks can be connected to one source. Since real hardware or software might end up in having restrictions, the knowledge of this must exist in the AudioManager and handled by him accordingly. This shall be accomplished via a plug-in mechanism. An AudioDomain is not tied to a hardware or software implementation. It can be software or hardware or even a combination of both. \n
+ *
+ * Examples for possible audio domains:\n
+ * PulseAudio, Alsa, Jack, DSP, FPGA, MOST, In-chip switching matrix\n
+ *
+ * The clustering and usage of the AudioDomains will vary from each product. Care must be taken while choosing the right AudioDomains in regards to system load (due to resampling), latency and of course flexibility.\n
+ * In special implementations of the AudioDomain, it is capable of operation a certain time without interaction to the AudioManager. This is needed to fulfill the requirements for Early & Late Audio, more information can be found below.
+ *
+ * \section routing_adaptor Routing Adapter
+ *
+ * Via this adapter, the interconnection from the AudioManager to the AudioDomains is accomplished. An AudioDomain shall have exactly one RoutingAdapter. In the terms of GENIVI, a RoutingAdapter is an AbstractComponent, this means that we define an API and a certain behavior in UML models but do not maintain components itself. Existing implementations from Proof of Concepts are shipped as example Adapters "as is" but cannot be seen as maintained components.\n
+ * The implementation of a routing adapter can and will vary from each project to another since the combination of sinks and sources, the used hardware etc has influence on the adapters. Besides interchanging and abstracting information between the AudioManager and the sinks and sources, the Adapters also need to implement some business logic in order to interact with the AudioManager. This includes for example the registering of components, managing the current state, error handling etc.\n
+ * In the special case of an EarlyDomain, the routing adapter also has to manage start-up and rundown including persistence for his domain while the AudioManager is not started or already stopped. During this periods of time, these special adapters have to be able to fulfill basic tasks like changing volumes, for example (this implies that the Adapter is implemented on a different piece of hardware, e.g. vehicle processor).
+ *
+ * \section Gateway
+ *
+ * Gateways are used to let audio flow between two domains. They always have a direction and can only transport one stream at a time. Several gateways connecting the same domains together can exist in parallel so that more than one source can be connected to more than one sink from the same domains at the same time.\n
+ * The representation of a Gateway in the domain which originates the audio is a sink. In the receiving domain, the gateway appears as a source. The AudioManager knows about the Gateways, in terms of connection, it handles it as simple sources and sinks.
+ *
+ * \section AudioManagerDaemon
+ *
+ * The AudioManager is the central managing instance of the Audio architecture. It is designed as an OwnedComponent, this means that the software is maintained within GENIVI as open source component. The AudioManager consists of 4 central components.\n
+ *
+ * GOwnedComponent: AudioManager Daemon\n
+ *
+ * This component is owned and maintained by Genivi. It is the central audio framework component. There can be only one daemon in a system (singleton).
+ *
+ * \subsection controlinterface Control Interface Plugin
+ *
+ * This describes the interface towards the Controlling Instances of the AudioManagerDaemon. This is the HMI and interrupt sources that use this interface to start their interrupt and stop it again. The interface shall be asynchronous. Via this interface all user interactions are handled.
+ *
+ * \subsection routinginterface Routing Interface Plugin
+ *
+ * This interface is used by the AudioManager to control the RoutingAdapters and communicate with them. The communication is based on two interfaces, one is provided by the AudioManager for communication from the adapters towards the AudioManager and one for the opposite direction. The design of the AudioManager shall be done in such a way that several Interfaces are supported at the same time via a plug-in mechanism. The plug-ins are (either statically - due to performance reasons or dynamically) loaded at start-up. Due to this architecture, the number of buses and routing adapters that are supported are as low as possible for each system and as high as needed without the need of changing the AudioManager itself. The AudioManager expects a bus-like structure behind each plug-in, so that a plug-in can implement a bus interface and proxy the messages to the routing adapters - the AudioManager will be capable of addressing more than one adapter one each plug-in. The interface shall is asynchronous for all timely critical commands.
+ *
+ * \section interfaces Interfaces
+ * the calls to the interfaces of the AudioManagerDaemon are generally not threadsafe !
+ * Nevertheless if such calls from a different thread-context are needed, you may use the defered-call pattern that utilizes the mainloop (Sockethandler) to get self called in the next loop of the mainloop. For more infomation please check the audiomanger wiki page.
+ *
+ * \section deferred The deferred call pattern
+ * Create a unix pipe or socket and add the file descriptor to the Sockethandler. Whenever a call needs to be deferred you can store the necessary information protected by a mutex in a queue and write to the socket or pipe. This will lead to a callback in the next loop of the mainloop - when getting called by the callback that was registered at the Sockethandler execute your call with the information stored away.
+ *
+ *
+ * \section sources_sinks Sources & Sinks
+ * \subsection Visibility
+ * Sources and sinks can either be visible or not. If they are visible, the HMI is informed about their existence and can use them. \n
+ * Invisible Sources and Sinks either are system only relevant (e.g. an audio processing that has a source and a sink) or belong to a gateway.
+ *
+ * \subsection Availability
+ * It can be the case, that sources and sinks are present in the system but cannot be used at the moment. This is indicated via the availability. A sample use-case for this feature is CD drive that shall only be available if a CD is inserted.
+ *
+ * \section Interrupts
+ * \subsection llinterrupts Low level interrupts
+ * \todo write low level Interrupts description
+ *
+ * \subsection Interrupts
+ * \todo write Interrupts description
+ *
+ * \section Persistency
+ * It is the job of the AudioManagerController to handle the persistency. It is planned to expose an interface via the ControlInterface to accomplish this but the GENIVI persistance is not ready yet. \n
+ *
+ *
+ * \section speed Speed dependent volume
+ * The adjustments for the speed are done product specific in the controller. The speed information itself is retrieved by the AudioManagerDaemon, sampled and quantified and forwarded to the controller.\n
+ * Turning speed controlled volume on/off and possible settings are achieved via SinkSoundProperty settings.
+ *
+ * \section Lipsync
+ * It is the job of the AudioManager to retrieve all latency timing information from each connection, to aggregate this information and provide a latency information on a per MainConnection Basis. It is not the task of the AudioManager to actually delay or speed up video or audio signals to achieve a lipsync. The actual correction shall be done in the videoplayer with the information provided by the AudioManager.
+ * The time information is always reported by the routingadaptors for each connection. Delays that are introduced in a sink or a gateway are counting for the connection that connects to this sink or gateway.\n
+ * After the buildup of a connection the first timing information needs to be sent within 5 seconds, the timing information from the routing adaptors need to be sent via 4 seconds. If the latency for a connection is variable and changes over lifetime of the connection, the routing adaptors shall resend the value and the audiomanger will correct the over all latency.\n
+ * @author Christian Mueller
+ * @created 25-Feb-2012 3:54:06 PM
+ */
+
+#ifndef MAINPAGE_H_
+#define MAINPAGE_H_
+
+#endif /* MAINPAGE_H_ */