summaryrefslogtreecommitdiff
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
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
-rw-r--r--.gitignore1
-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
-rw-r--r--AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp16
-rw-r--r--AudioManagerDaemon/src/CommandReceiver.cpp56
-rw-r--r--AudioManagerDaemon/src/CommandSender.cpp135
-rw-r--r--AudioManagerDaemon/src/ControlReceiver.cpp28
-rw-r--r--AudioManagerDaemon/src/ControlSender.cpp62
-rw-r--r--AudioManagerDaemon/src/DBusWrapper.cpp2
-rw-r--r--AudioManagerDaemon/src/DatabaseHandler.cpp20
-rw-r--r--AudioManagerDaemon/src/DatabaseObserver.cpp272
-rw-r--r--AudioManagerDaemon/src/RoutingReceiver.cpp49
-rw-r--r--AudioManagerDaemon/src/RoutingSender.cpp78
-rw-r--r--AudioManagerDaemon/src/main.cpp8
-rw-r--r--CMakeLists.txt2
-rw-r--r--PluginCommandInterfaceDbus/CMakeLists.txt2
-rw-r--r--PluginCommandInterfaceDbus/include/DBusCommandSender.h40
-rw-r--r--PluginCommandInterfaceDbus/src/DBusCommandSender.cpp134
-rw-r--r--PluginControlInterface/CMakeLists.txt2
-rw-r--r--PluginControlInterface/include/ControlSender.h14
-rw-r--r--PluginControlInterface/src/ControlSender.cpp35
-rw-r--r--PluginRoutingInterfaceAsync/CMakeLists.txt2
-rw-r--r--PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h34
-rw-r--r--PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp32
-rw-r--r--PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp11
-rw-r--r--PluginRoutingInterfaceDbus/include/RoutingSender.h34
-rw-r--r--PluginRoutingInterfaceDbus/src/RoutingSender.cpp35
-rw-r--r--cmake/DoxyFile.in2
-rw-r--r--cmake/genivilogo.pngbin0 -> 9537 bytes
-rw-r--r--includes/CAmSerializer.h350
-rw-r--r--includes/audiomanagertypes.h248
-rw-r--r--includes/command/CommandReceiveInterface.h78
-rw-r--r--includes/command/CommandSendInterface.h119
-rw-r--r--includes/control/ControlReceiveInterface.h82
-rw-r--r--includes/control/ControlSendInterface.h90
-rw-r--r--includes/projecttypes.h63
-rw-r--r--includes/routing/RoutingReceiveInterface.h78
-rw-r--r--includes/routing/RoutingSendInterface.h80
44 files changed, 1587 insertions, 1142 deletions
diff --git a/.gitignore b/.gitignore
index 93de88d..fed9435 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,3 @@ build/
doc/
packages/
.*
-
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_ */
diff --git a/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp b/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
index 2066487..9e052cc 100644
--- a/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
+++ b/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
@@ -741,7 +741,13 @@ void CAmTelnetMenuHelper::getSenderversionCommandExec(std::queue<std::string> &
(void) CmdQueue;
std::stringstream output;
- output << "\tSender versions:" << std::endl << "\tCtrl: " << mpControlSender->getInterfaceVersion() << " | " << "Cmd: " << mpCommandSender->getInterfaceVersion() << " | " << "Routing: " << mpRoutingSender->getInterfaceVersion() << std::endl;
+ std::string versionCommand;
+ std::string versionRouting;
+ std::string versionControl;
+ mpControlSender->getInterfaceVersion(versionControl);
+ mpRoutingSender->getInterfaceVersion(versionRouting);
+ mpCommandSender->getInterfaceVersion(versionCommand);
+ output << "\tSender versions:" << std::endl << "\tCtrl: " << versionControl << " | " << "Cmd: " << versionCommand << " | " << "Routing: " << versionRouting << std::endl;
sendTelnetLine(filedescriptor, output);
}
@@ -760,7 +766,13 @@ void CAmTelnetMenuHelper::getReceiverversionCommandExec(std::queue<std::string>
(void) CmdQueue;
std::stringstream output;
- output << "\tReceiver versions:" << std::endl << "\tCtrl: " << mpControlReceiver->getInterfaceVersion() << " | " << "Cmd: " << mpCommandReceiver->getInterfaceVersion() << " | " << "Routing: " << mpRoutingReceiver->getInterfaceVersion() << std::endl;
+ std::string versionCommand;
+ std::string versionRouting;
+ std::string versionControl;
+ mpControlReceiver->getInterfaceVersion(versionControl);
+ mpRoutingReceiver->getInterfaceVersion(versionRouting);
+ mpCommandReceiver->getInterfaceVersion(versionCommand);
+ output << "\tReceiver versions:" << std::endl << "\tCtrl: " << versionControl << " | " << "Cmd: " << versionCommand << " | " << "Routing: " << versionRouting << std::endl;
sendTelnetLine(filedescriptor, output);
diff --git a/AudioManagerDaemon/src/CommandReceiver.cpp b/AudioManagerDaemon/src/CommandReceiver.cpp
index ff092dd..74b819b 100644
--- a/AudioManagerDaemon/src/CommandReceiver.cpp
+++ b/AudioManagerDaemon/src/CommandReceiver.cpp
@@ -29,13 +29,19 @@
#include <SocketHandler.h>
#include <config.h>
#include <cassert>
+#include <algorithm>
using namespace am;
CommandReceiver::CommandReceiver(DatabaseHandler *iDatabaseHandler, ControlSender *iControlSender, SocketHandler *iSocketHandler) :
mDatabaseHandler(iDatabaseHandler), //
mControlSender(iControlSender), //
- mSocketHandler(iSocketHandler)
+ mSocketHandler(iSocketHandler), //
+ mListStartupHandles(), //
+ mListRundownHandles(), //
+ mWaitStartup(false), //
+ mWaitRundown(false)
+
{
assert(mDatabaseHandler!=NULL);
assert(mSocketHandler!=NULL);
@@ -46,7 +52,11 @@ CommandReceiver::CommandReceiver(DatabaseHandler *iDatabaseHandler, ControlSende
mDatabaseHandler(iDatabaseHandler), //
mControlSender(iControlSender), //
mDBusWrapper(iDBusWrapper), //
- mSocketHandler(iSocketHandler)
+ mSocketHandler(iSocketHandler), //
+ mListStartupHandles(), //
+ mListRundownHandles(), //
+ mWaitStartup(false), //
+ mWaitRundown(false)
{
assert(mDatabaseHandler!=NULL);
assert(mSocketHandler!=NULL);
@@ -168,8 +178,46 @@ am_Error_e CommandReceiver::getSocketHandler(SocketHandler *& socketHandler) con
return E_OK;
}
-uint16_t CommandReceiver::getInterfaceVersion() const
+void CommandReceiver::getInterfaceVersion(std::string & version) const
+{
+ version = CommandReceiveVersion;
+}
+
+void CommandReceiver::confirmCommandReady(const uint16_t handle)
+{
+ mListStartupHandles.erase(std::remove(mListStartupHandles.begin(), mListStartupHandles.end(), handle), mListStartupHandles.end());
+ if (mWaitStartup && mListStartupHandles.empty())
+ mControlSender->confirmCommandReady();
+}
+
+void CommandReceiver::confirmCommandRundown(const uint16_t handle)
+{
+ mListRundownHandles.erase(std::remove(mListRundownHandles.begin(), mListRundownHandles.end(), handle), mListRundownHandles.end());
+ if (mWaitRundown && mListRundownHandles.empty())
+ mControlSender->confirmCommandRundown();
+}
+
+uint16_t CommandReceiver::getStartupHandle()
+{
+ uint16_t handle = ++handleCount; //todo: handle overflow
+ mListStartupHandles.push_back(handle);
+ return handle;
+}
+
+uint16_t CommandReceiver::getRundownHandle()
+{
+ uint16_t handle = ++handleCount; //todo: handle overflow
+ mListRundownHandles.push_back(handle);
+ return handle;
+}
+
+void am::CommandReceiver::waitOnStartup(bool startup)
+{
+ mWaitStartup = startup;
+}
+
+void am::CommandReceiver::waitOnRundown(bool rundown)
{
- return CommandReceiveVersion;
+ mWaitRundown = rundown;
}
diff --git a/AudioManagerDaemon/src/CommandSender.cpp b/AudioManagerDaemon/src/CommandSender.cpp
index c70509f..c613a4e 100644
--- a/AudioManagerDaemon/src/CommandSender.cpp
+++ b/AudioManagerDaemon/src/CommandSender.cpp
@@ -23,14 +23,17 @@
*/
#include "CommandSender.h"
-#include "command/CommandReceiveInterface.h"
#include <dirent.h>
+#include <sstream>
+#include <string>
+#include "CommandReceiver.h"
#include "PluginTemplate.h"
#include "DLTWrapper.h"
using namespace am;
-#define REQUIRED_INTERFACE_VERSION 1
+#define REQUIRED_INTERFACE_VERSION_MAJOR 1
+#define REQUIRED_INTERFACE_VERSION_MINOR 0
//!< macro to call all interfaces
#define CALL_ALL_INTERFACES(...) \
@@ -43,8 +46,9 @@ using namespace am;
CommandSender::CommandSender(const std::vector<std::string>& listOfPluginDirectories) :
mListInterfaces(), //
- mListLibraryHandles(),
- mListLibraryNames()
+ mListLibraryHandles(), //
+ mListLibraryNames(), //
+ mCommandReceiver()
{
std::vector<std::string> sharedLibraryNameList;
std::vector<std::string>::const_iterator dirIter = listOfPluginDirectories.begin();
@@ -54,12 +58,12 @@ CommandSender::CommandSender(const std::vector<std::string>& listOfPluginDirecto
for (; dirIter < dirIterEnd; ++dirIter)
{
const char* directoryName = dirIter->c_str();
- logInfo("Searching for CommandPlugins in" , *dirIter);
+ logInfo("Searching for CommandPlugins in", *dirIter);
DIR *directory = opendir(directoryName);
if (!directory)
{
- logError("Error opening directory ",*dirIter);
+ logError("Error opening directory ", *dirIter);
continue;
}
@@ -108,9 +112,15 @@ CommandSender::CommandSender(const std::vector<std::string>& listOfPluginDirecto
}
//check libversion
- if (commander->getInterfaceVersion() < REQUIRED_INTERFACE_VERSION)
+ std::string version;
+ commander->getInterfaceVersion(version);
+ uint16_t minorVersion, majorVersion;
+ std::istringstream(version.substr(0, 1)) >> majorVersion;
+ std::istringstream(version.substr(2, 1)) >> minorVersion;
+
+ if (majorVersion < REQUIRED_INTERFACE_VERSION_MAJOR || ((majorVersion == REQUIRED_INTERFACE_VERSION_MAJOR) && (minorVersion > REQUIRED_INTERFACE_VERSION_MINOR)))
{
- logInfo("RoutingPlugin initialization failed. Version of Interface to old");
+ logInfo("CommandInterface initialization failed. Version of Interface to old");
continue;
}
@@ -125,32 +135,16 @@ CommandSender::~CommandSender()
unloadLibraries();
}
-am_Error_e CommandSender::stopInterface()
-{
- am_Error_e returnError = E_OK;
-
- std::vector<CommandSendInterface*>::iterator iter = mListInterfaces.begin();
- std::vector<CommandSendInterface*>::iterator iterEnd = mListInterfaces.end();
- for (; iter < iterEnd; ++iter)
- {
- am_Error_e error = (*iter)->stopInterface();
- if (error != E_OK)
- {
- returnError = error;
- }
- }
- return returnError;
-}
-
-am_Error_e CommandSender::startupInterface(CommandReceiveInterface *commandreceiveinterface)
+am_Error_e CommandSender::startupInterfaces(CommandReceiver *iCommandReceiver)
{
+ mCommandReceiver = iCommandReceiver;
am_Error_e returnError = E_OK;
std::vector<CommandSendInterface*>::iterator iter = mListInterfaces.begin();
std::vector<CommandSendInterface*>::iterator iterEnd = mListInterfaces.end();
for (; iter < iterEnd; ++iter)
{
- am_Error_e error = (*iter)->startupInterface(commandreceiveinterface);
+ am_Error_e error = (*iter)->startupInterface(iCommandReceiver);
if (error != E_OK)
{
returnError = error;
@@ -159,31 +153,6 @@ am_Error_e CommandSender::startupInterface(CommandReceiveInterface *commandrecei
return returnError;
}
-void CommandSender::cbCommunicationReady()
-{
- CALL_ALL_INTERFACES(cbCommunicationReady())
-}
-
-void CommandSender::cbCommunicationRundown()
-{
- CALL_ALL_INTERFACES(cbCommunicationRundown())
-}
-
-void CommandSender::cbNumberOfMainConnectionsChanged()
-{
- CALL_ALL_INTERFACES(cbNumberOfMainConnectionsChanged())
-}
-
-void CommandSender::cbNumberOfSinksChanged()
-{
- CALL_ALL_INTERFACES(cbNumberOfSinksChanged())
-}
-
-void CommandSender::cbNumberOfSourcesChanged()
-{
- CALL_ALL_INTERFACES(cbNumberOfSourcesChanged())
-}
-
void CommandSender::cbNumberOfSinkClassesChanged()
{
CALL_ALL_INTERFACES(cbNumberOfSinkClassesChanged())
@@ -199,12 +168,12 @@ void CommandSender::cbMainConnectionStateChanged(const am_mainConnectionID_t con
CALL_ALL_INTERFACES(cbMainConnectionStateChanged(connectionID,connectionState))
}
-void CommandSender::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s SoundProperty)
+void CommandSender::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& SoundProperty)
{
CALL_ALL_INTERFACES(cbMainSinkSoundPropertyChanged(sinkID,SoundProperty))
}
-void CommandSender::cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s & SoundProperty)
+void CommandSender::cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& SoundProperty)
{
CALL_ALL_INTERFACES(cbMainSourceSoundPropertyChanged(sourceID,SoundProperty))
}
@@ -239,34 +208,69 @@ void CommandSender::cbTimingInformationChanged(const am_mainConnectionID_t mainC
CALL_ALL_INTERFACES(cbTimingInformationChanged(mainConnection,time))
}
-am_Error_e am::CommandSender::getListPlugins(std::vector<std::string> & interfaces) const
+void CommandSender::cbNewMainConnection(const am_MainConnectionType_s mainConnection)
{
- interfaces = mListLibraryNames;
- return E_OK;
+ CALL_ALL_INTERFACES(cbNewMainConnection(mainConnection))
}
-void am::CommandSender::cbNewMainConnection(const am_MainConnectionType_s mainConnection)
+void CommandSender::cbRemovedMainConnection(const am_mainConnectionID_t mainConnection)
{
+ CALL_ALL_INTERFACES(cbRemovedMainConnection(mainConnection))
}
-void am::CommandSender::cbRemovedMainConnection(const am_MainConnectionType_s mainConnection)
+void CommandSender::cbNewSink(const am_SinkType_s sink)
{
+ CALL_ALL_INTERFACES(cbNewSink(sink))
}
-void am::CommandSender::cbNewSink(const am_SinkType_s sink)
+void CommandSender::cbRemovedSink(const am_sinkID_t sink)
{
+ CALL_ALL_INTERFACES(cbRemovedSink(sink))
}
-void am::CommandSender::cbRemovedSink(const am_SinkType_s sink)
+void CommandSender::cbNewSource(const am_SourceType_s source)
{
+ CALL_ALL_INTERFACES(cbNewSource(source))
}
-void am::CommandSender::cbNewSource(const am_SourceType_s source)
+void CommandSender::cbRemovedSource(const am_sourceID_t source)
{
+ CALL_ALL_INTERFACES(cbRemovedSource(source))
}
-void am::CommandSender::cbRemovedSource(const am_SourceType_s source)
+void CommandSender::setCommandReady()
{
+ mCommandReceiver->waitOnStartup(false);
+ std::vector<CommandSendInterface*>::iterator iter = mListInterfaces.begin();
+ std::vector<CommandSendInterface*>::iterator iterEnd = mListInterfaces.end();
+ for (; iter < iterEnd; ++iter)
+ {
+ (*iter)->setCommandReady(mCommandReceiver->getStartupHandle());
+ }
+ mCommandReceiver->waitOnStartup(true);
+}
+
+void CommandSender::setCommandRundown()
+{
+ mCommandReceiver->waitOnRundown(false);
+ std::vector<CommandSendInterface*>::iterator iter = mListInterfaces.begin();
+ std::vector<CommandSendInterface*>::iterator iterEnd = mListInterfaces.end();
+ for (; iter < iterEnd; ++iter)
+ {
+ (*iter)->setCommandRundown(mCommandReceiver->getRundownHandle());
+ }
+ mCommandReceiver->waitOnRundown(true);
+}
+
+void CommandSender::getInterfaceVersion(std::string & version) const
+{
+ version = CommandSendVersion;
+}
+
+am_Error_e am::CommandSender::getListPlugins(std::vector<std::string> & interfaces) const
+{
+ interfaces = mListLibraryNames;
+ return E_OK;
}
void CommandSender::unloadLibraries(void)
@@ -279,8 +283,3 @@ void CommandSender::unloadLibraries(void)
mListLibraryHandles.clear();
}
-uint16_t CommandSender::getInterfaceVersion() const
-{
- return CommandSendVersion;
-}
-
diff --git a/AudioManagerDaemon/src/ControlReceiver.cpp b/AudioManagerDaemon/src/ControlReceiver.cpp
index 2b2e8b0..8ef8d23 100644
--- a/AudioManagerDaemon/src/ControlReceiver.cpp
+++ b/AudioManagerDaemon/src/ControlReceiver.cpp
@@ -468,13 +468,23 @@ am_Error_e ControlReceiver::removeSourceClassDB(const am_sourceClass_t sourceCla
void ControlReceiver::setCommandReady()
{
logInfo("ControlReceiver::setCommandReady got called");
- mCommandSender->cbCommunicationReady();
+ mCommandSender->setCommandReady();
}
void ControlReceiver::setRoutingReady()
{
logInfo("ControlReceiver::setRoutingReady got called");
- mRoutingSender->routingInterfacesReady();
+ mRoutingSender->setRoutingReady();
+}
+
+void ControlReceiver::confirmControllerReady()
+{
+ //todo: one time implement here system interaction with NSM
+}
+
+void ControlReceiver::confirmControllerRundown()
+{
+ //todo: one time implement here system interaction with NSM
}
am_Error_e ControlReceiver::getSocketHandler(SocketHandler *& socketHandler)
@@ -483,20 +493,22 @@ am_Error_e ControlReceiver::getSocketHandler(SocketHandler *& socketHandler)
return E_OK;
}
-void am::ControlReceiver::setCommandRundown()
+void ControlReceiver::setCommandRundown()
{
logInfo("ControlReceiver::setCommandRundown got called");
- mCommandSender->cbCommunicationRundown();
+ mCommandSender->setCommandRundown();
}
-void am::ControlReceiver::setRoutingRundown()
+void ControlReceiver::setRoutingRundown()
{
logInfo("ControlReceiver::setRoutingRundown got called");
- mRoutingSender->routingInterfacesRundown();
+ mRoutingSender->setRoutingRundown();
}
-uint16_t ControlReceiver::getInterfaceVersion() const
+void ControlReceiver::getInterfaceVersion(std::string & version) const
{
- return ControlReceiveVersion;
+ version = ControlReceiveVersion;
}
+
+
diff --git a/AudioManagerDaemon/src/ControlSender.cpp b/AudioManagerDaemon/src/ControlSender.cpp
index a334475..492244e 100644
--- a/AudioManagerDaemon/src/ControlSender.cpp
+++ b/AudioManagerDaemon/src/ControlSender.cpp
@@ -27,10 +27,14 @@
#include "DLTWrapper.h"
#include <cassert>
#include <fstream>
+#include <iostream>
+#include <sstream>
+#include <stdexcept>
using namespace am;
-#define REQUIRED_MIN_INTERFACE_VERSION 1
+#define REQUIRED_INTERFACE_VERSION_MAJOR 1
+#define REQUIRED_INTERFACE_VERSION_MINOR 0
ControlSender::ControlSender(std::string controlPluginFile) :
mlibHandle(NULL), //
@@ -49,7 +53,17 @@ ControlSender::ControlSender(std::string controlPluginFile) :
mController = createFunc();
//check libversion
- assert(REQUIRED_MIN_INTERFACE_VERSION<=mController->getInterfaceVersion());
+ std::string version;
+ mController->getInterfaceVersion(version);
+ uint16_t minorVersion, majorVersion;
+ std::istringstream(version.substr(0, 1)) >> majorVersion;
+ std::istringstream(version.substr(2, 1)) >> minorVersion;
+
+ if (majorVersion < REQUIRED_INTERFACE_VERSION_MAJOR || ((majorVersion == REQUIRED_INTERFACE_VERSION_MAJOR) && (minorVersion > REQUIRED_INTERFACE_VERSION_MINOR)))
+ {
+ logError("ControlSender::ControlSender: Interface Version of Controller too old, exiting now");
+ throw std::runtime_error("Interface Version of Controller too old");
+ }
}
else
{
@@ -63,11 +77,6 @@ ControlSender::~ControlSender()
dlclose(mlibHandle);
}
-void ControlSender::hookAllPluginsLoaded()
-{
- mController->hookAllPluginsLoaded();
-}
-
am_Error_e ControlSender::hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
{
return mController->hookUserConnectionRequest(sourceID, sinkID, mainConnectionID);
@@ -248,11 +257,6 @@ am_Error_e ControlSender::startupController(ControlReceiveInterface *controlrece
return mController->startupController(controlreceiveinterface);
}
-am_Error_e ControlSender::stopController()
-{
- return mController->stopController();
-}
-
void ControlSender::cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
{
mController->cbAckSetSinkSoundProperty(handle, error);
@@ -268,13 +272,43 @@ void ControlSender::cbAckSetSourceSoundProperties(const am_Handle_s handle, cons
mController->cbAckSetSourceSoundProperties(handle, error);
}
+void ControlSender::setControllerReady()
+{
+ mController->setControllerReady();
+}
+
+void ControlSender::setControllerRundown()
+{
+ mController->setControllerRundown();
+}
+
am_Error_e am::ControlSender::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)
{
return mController->getConnectionFormatChoice(sourceID, sinkID, listRoute, listPossibleConnectionFormats, listPrioConnectionFormats);
}
-uint16_t ControlSender::getInterfaceVersion() const
+void ControlSender::getInterfaceVersion(std::string & version) const
+{
+ version = ControlSendVersion;
+}
+
+void ControlSender::confirmCommandReady()
+{
+ mController->confirmCommandReady();
+}
+
+void ControlSender::confirmRoutingReady()
+{
+ mController->confirmRoutingReady();
+}
+
+void ControlSender::confirmCommandRundown()
+{
+ mController->confirmCommandRundown();
+}
+
+void ControlSender::confirmRoutingRundown()
{
- return ControlSendVersion;
+ mController->confirmRoutingRundown();
}
diff --git a/AudioManagerDaemon/src/DBusWrapper.cpp b/AudioManagerDaemon/src/DBusWrapper.cpp
index bfe6706..71352ef 100644
--- a/AudioManagerDaemon/src/DBusWrapper.cpp
+++ b/AudioManagerDaemon/src/DBusWrapper.cpp
@@ -103,7 +103,7 @@ DBusWrapper::DBusWrapper(SocketHandler* socketHandler) :
}
if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret)
{
- logError("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner",ret);
+ logError("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner ! Another instance already running?",ret);
exit(1);
}
}
diff --git a/AudioManagerDaemon/src/DatabaseHandler.cpp b/AudioManagerDaemon/src/DatabaseHandler.cpp
index a80e241..54e0129 100644
--- a/AudioManagerDaemon/src/DatabaseHandler.cpp
+++ b/AudioManagerDaemon/src/DatabaseHandler.cpp
@@ -262,7 +262,13 @@ am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & ma
if (mDatabaseObserver)
{
- mDatabaseObserver->numberOfMainConnectionsChanged();
+ am_MainConnectionType_s mainConnection;
+ mainConnection.mainConnectionID=connectionID;
+ mainConnection.connectionState=mainConnectionData.connectionState;
+ mainConnection.delay=delay;
+ mainConnection.sinkID=mainConnectionData.sinkID;
+ mainConnection.sourceID=mainConnectionData.sourceID;
+ mDatabaseObserver->newMainConnection(mainConnection);
mDatabaseObserver->mainConnectionStateChanged(connectionID, mainConnectionData.connectionState);
}
@@ -1227,7 +1233,7 @@ am_Error_e DatabaseHandler::removeMainConnectionDB(const am_mainConnectionID_t m
if (mDatabaseObserver)
{
mDatabaseObserver->mainConnectionStateChanged(mainConnectionID, CS_DISCONNECTED);
- mDatabaseObserver->numberOfMainConnectionsChanged();
+ mDatabaseObserver->removedMainConnection(mainConnectionID);
}
return E_OK;
}
@@ -1240,6 +1246,9 @@ am_Error_e DatabaseHandler::removeSinkDB(const am_sinkID_t sinkID)
{
return E_NON_EXISTENT;
}
+
+ bool visible=sinkVisible(sinkID);
+
std::string command = "DELETE from " + std::string(SINK_TABLE) + " WHERE sinkID=" + i2s(sinkID);
std::string command1 = "DROP table SinkConnectionFormat" + i2s(sinkID);
std::string command2 = "DROP table SinkMainSoundProperty" + i2s(sinkID);
@@ -1255,7 +1264,7 @@ am_Error_e DatabaseHandler::removeSinkDB(const am_sinkID_t sinkID)
logInfo("DatabaseHandler::removeSinkDB removed:", sinkID);
if (mDatabaseObserver != NULL)
- mDatabaseObserver->removedSink(sinkID);
+ mDatabaseObserver->removedSink(sinkID,visible);
return E_OK;
}
@@ -1268,6 +1277,9 @@ am_Error_e DatabaseHandler::removeSourceDB(const am_sourceID_t sourceID)
{
return E_NON_EXISTENT;
}
+
+ bool visible=sourceVisible(sourceID);
+
std::string command = "DELETE from " + std::string(SOURCE_TABLE) + " WHERE sourceID=" + i2s(sourceID);
std::string command1 = "DROP table SourceConnectionFormat" + i2s(sourceID);
std::string command2 = "DROP table SourceMainSoundProperty" + i2s(sourceID);
@@ -1282,7 +1294,7 @@ am_Error_e DatabaseHandler::removeSourceDB(const am_sourceID_t sourceID)
return E_DATABASE_ERROR;
logInfo("DatabaseHandler::removeSourceDB removed:", sourceID);
if (mDatabaseObserver)
- mDatabaseObserver->removedSource(sourceID);
+ mDatabaseObserver->removedSource(sourceID,visible);
return E_OK;
}
diff --git a/AudioManagerDaemon/src/DatabaseObserver.cpp b/AudioManagerDaemon/src/DatabaseObserver.cpp
index a1bc123..93031ef 100644
--- a/AudioManagerDaemon/src/DatabaseObserver.cpp
+++ b/AudioManagerDaemon/src/DatabaseObserver.cpp
@@ -16,7 +16,7 @@
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
- * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+ * Linking AudioManager statiasyncCally or dynamiasyncCally with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
*
@@ -32,317 +32,175 @@
#include "RoutingSender.h"
#include "TelnetServer.h"
#include "DLTWrapper.h"
+//#include "CAmSerializer.h"
using namespace am;
DatabaseObserver::DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender, SocketHandler *iSocketHandler) :
- receiverCallbackT(this, &DatabaseObserver::receiverCallback), //
- dispatcherCallbackT(this, &DatabaseObserver::dispatcherCallback), //
- checkerCallbackT(this, &DatabaseObserver::checkerCallback), //
mCommandSender(iCommandSender), //
mRoutingSender(iRoutingSender), //
- mSocketHandler(iSocketHandler), //
- mPipe(), //
- mHandle(), //
- mQueue()
+ mSerializer(iSocketHandler) //
{
- commonConstructor();
+ assert(mCommandSender!=0);
+ assert(mRoutingSender!=0);
+ assert(iSocketHandler!=0);
}
DatabaseObserver::DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender, SocketHandler *iSocketHandler, TelnetServer *iTelnetServer) :
- receiverCallbackT(this, &DatabaseObserver::receiverCallback), //
- dispatcherCallbackT(this, &DatabaseObserver::dispatcherCallback), //
- checkerCallbackT(this, &DatabaseObserver::checkerCallback), //
mCommandSender(iCommandSender), //
mRoutingSender(iRoutingSender), //
mTelnetServer(iTelnetServer), //
- mSocketHandler(iSocketHandler), //
- mPipe(), //
- mHandle(), //
- mQueue()
+ mSerializer(iSocketHandler) //
{
assert(mTelnetServer!=0);
- commonConstructor();
+ assert(mCommandSender!=0);
+ assert(mRoutingSender!=0);
+ assert(iSocketHandler!=0);
}
-void DatabaseObserver::pipeCommand(const do_msg_s & message)
+DatabaseObserver::~DatabaseObserver()
{
- mQueue.push(message);
-
- if (write(mPipe[1], &message.msgID, sizeof(do_msg_s)) == -1)
- {
- logError("DatabaseObserver::msgID pipe write failed, error code:", strerror(errno));
- }
}
-void DatabaseObserver::commonConstructor()
+void DatabaseObserver::newMainConnection(const am_MainConnectionType_s& mainConnection)
{
- assert(mCommandSender!=0);
- assert(mRoutingSender!=0);
- assert(mSocketHandler!=0);
- if (pipe(mPipe) == -1)
- {
- logError("RoutingReceiverAsyncShadow::setRoutingInterface could not create pipe!:");
- throw "could not create pipe";
- }
-
- short event = 0;
- event |= POLLIN;
- mSocketHandler->addFDPoll(mPipe[0], event, NULL, &receiverCallbackT, &checkerCallbackT, &dispatcherCallbackT, NULL, mHandle);
+ mSerializer.asyncCall<CommandSender, const am_MainConnectionType_s>(mCommandSender, &CommandSender::cbNewMainConnection, mainConnection);
}
-DatabaseObserver::~DatabaseObserver()
+void DatabaseObserver::removedMainConnection(const am_mainConnectionID_t mainConnection)
{
+ mSerializer.asyncCall<CommandSender, const am_mainConnectionID_t>(mCommandSender, &CommandSender::cbRemovedMainConnection, mainConnection);
}
-void DatabaseObserver::newSink(am_Sink_s sink)
+void DatabaseObserver::newSink(const am_Sink_s& sink)
{
mRoutingSender->addSinkLookup(sink);
- do_msg_s msg;
- msg.msgID = MDO_cbNumberOfSinksChanged;
- pipeCommand(msg);
-
+ if (sink.visible)
+ {
+ am_SinkType_s s;
+ s.availability = sink.available;
+ s.muteState = sink.muteState;
+ s.name = sink.name;
+ s.sinkClassID = sink.sinkClassID;
+ s.sinkID = sink.sinkID;
+ s.volume = sink.mainVolume;
+ mSerializer.asyncCall<CommandSender, const am_SinkType_s>(mCommandSender, &CommandSender::cbNewSink, s);
+ }
}
-void DatabaseObserver::newSource(am_Source_s source)
+void DatabaseObserver::newSource(const am_Source_s& source)
{
mRoutingSender->addSourceLookup(source);
- do_msg_s msg;
- msg.msgID = MDO_cbNumberOfSourcesChanged;
- pipeCommand(msg);
+ if (source.visible)
+ {
+ am_SourceType_s s;
+ s.availability = source.available;
+ s.name = source.name;
+ s.sourceClassID = source.sourceClassID;
+ s.sourceID = source.sourceID;
+ mSerializer.asyncCall<CommandSender, const am_SourceType_s>(mCommandSender, &CommandSender::cbNewSource, s);
+ }
}
-void DatabaseObserver::newDomain(am_Domain_s domain)
+void DatabaseObserver::newDomain(const am_Domain_s& domain)
{
mRoutingSender->addDomainLookup(domain);
}
-void DatabaseObserver::newGateway(am_Gateway_s gateway)
+void DatabaseObserver::newGateway(const am_Gateway_s& gateway)
{
(void) gateway;
//todo: implement something
}
-void DatabaseObserver::newCrossfader(am_Crossfader_s crossfader)
+void DatabaseObserver::newCrossfader(const am_Crossfader_s& crossfader)
{
mRoutingSender->addCrossfaderLookup(crossfader);
}
-void DatabaseObserver::removedSink(am_sinkID_t sinkID)
+void DatabaseObserver::removedSink(const am_sinkID_t sinkID, const bool visible)
{
mRoutingSender->removeSinkLookup(sinkID);
- do_msg_s msg;
- msg.msgID = MDO_cbNumberOfSinksChanged;
- pipeCommand(msg);
+
+ if (visible)
+ mSerializer.asyncCall<CommandSender, const am_sinkID_t>(mCommandSender, &CommandSender::cbRemovedSink, sinkID);
}
-void DatabaseObserver::removedSource(am_sourceID_t sourceID)
+void DatabaseObserver::removedSource(const am_sourceID_t sourceID, const bool visible)
{
mRoutingSender->removeSourceLookup(sourceID);
- do_msg_s msg;
- msg.msgID = MDO_cbNumberOfSourcesChanged;
- pipeCommand(msg);
+
+ if (visible)
+ mSerializer.asyncCall<CommandSender, const am_sourceID_t>(mCommandSender, &CommandSender::cbRemovedSource, sourceID);
}
-void DatabaseObserver::removeDomain(am_domainID_t domainID)
+void DatabaseObserver::removeDomain(const am_domainID_t domainID)
{
mRoutingSender->removeDomainLookup(domainID);
}
-void DatabaseObserver::removeGateway(am_gatewayID_t gatewayID)
+void DatabaseObserver::removeGateway(const am_gatewayID_t gatewayID)
{
(void) gatewayID;
- //todo: implement something
+ //todo: implement something?
}
-void DatabaseObserver::removeCrossfader(am_crossfaderID_t crossfaderID)
+void DatabaseObserver::removeCrossfader(const am_crossfaderID_t crossfaderID)
{
mRoutingSender->removeCrossfaderLookup(crossfaderID);
}
-void DatabaseObserver::numberOfMainConnectionsChanged()
-{
- do_msg_s msg;
- msg.msgID = MDO_cbNumberOfMainConnectionsChanged;
- pipeCommand(msg);
-}
-
void DatabaseObserver::numberOfSinkClassesChanged()
{
- do_msg_s msg;
- msg.msgID = MDO_cbNumberOfSinkClassesChanged;
- pipeCommand(msg);
+ mSerializer.asyncCall<CommandSender>(mCommandSender, &CommandSender::cbNumberOfSinkClassesChanged);
}
void DatabaseObserver::numberOfSourceClassesChanged()
{
- do_msg_s msg;
- msg.msgID = MDO_cbNumberOfSourceClassesChanged;
- pipeCommand(msg);
+ mSerializer.asyncCall<CommandSender>(mCommandSender, &CommandSender::cbNumberOfSourceClassesChanged);
}
void DatabaseObserver::mainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState)
{
- do_msg_s msg;
- msg.msgID = MDO_cbMainConnectionStateChanged;
- msg.parameters.connectionStateChanged.connectionID = connectionID;
- msg.parameters.connectionStateChanged.connectionState = connectionState;
- pipeCommand(msg);
+ mSerializer.asyncCall<CommandSender, const am_connectionID_t, const am_ConnectionState_e>(mCommandSender, &CommandSender::cbMainConnectionStateChanged, connectionID, connectionState);
}
-void DatabaseObserver::mainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s SoundProperty)
+void DatabaseObserver::mainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& SoundProperty)
{
- do_msg_s msg;
- msg.msgID = MDO_cbMainSinkSoundPropertyChanged;
- msg.parameters.mainSinkSoundPropertyChanged.sinkID = sinkID;
- msg.parameters.mainSinkSoundPropertyChanged.SoundProperty = SoundProperty;
- pipeCommand(msg);
+ mSerializer.asyncCall<CommandSender, const am_sinkID_t, const am_MainSoundProperty_s&>(mCommandSender, &CommandSender::cbMainSinkSoundPropertyChanged, sinkID, SoundProperty);
}
void DatabaseObserver::mainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s & SoundProperty)
{
- do_msg_s msg;
- msg.msgID = MDO_cbMainSourceSoundPropertyChanged;
- msg.parameters.mainSourceSoundPropertyChanged.sourceID = sourceID;
- msg.parameters.mainSourceSoundPropertyChanged.SoundProperty = SoundProperty;
- pipeCommand(msg);
+ mSerializer.asyncCall<CommandSender, const am_sourceID_t, const am_MainSoundProperty_s&>(mCommandSender, &CommandSender::cbMainSourceSoundPropertyChanged, sourceID, SoundProperty);
}
void DatabaseObserver::sinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s & availability)
{
- do_msg_s msg;
- msg.msgID = MDO_cbSinkAvailabilityChanged;
- msg.parameters.sinkAvailabilityChanged.sinkID = sinkID;
- msg.parameters.sinkAvailabilityChanged.availability = availability;
- pipeCommand(msg);
+ mSerializer.asyncCall<CommandSender, const am_sinkID_t, const am_Availability_s&>(mCommandSender, &CommandSender::cbSinkAvailabilityChanged, sinkID, availability);
}
void DatabaseObserver::sourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s & availability)
{
- do_msg_s msg;
- msg.msgID = MDO_cbSourceAvailabilityChanged;
- msg.parameters.sourceAvailabilityChanged.sourceID = sourceID;
- msg.parameters.sourceAvailabilityChanged.availability = availability;
- pipeCommand(msg);
+ mSerializer.asyncCall<CommandSender, const am_sourceID_t, const am_Availability_s&>(mCommandSender, &CommandSender::cbSourceAvailabilityChanged, sourceID, availability);
}
void DatabaseObserver::volumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume)
{
- do_msg_s msg;
- msg.msgID = MDO_cbVolumeChanged;
- msg.parameters.volumeChanged.sinkID = sinkID;
- msg.parameters.volumeChanged.volume = volume;
- pipeCommand(msg);
+ mSerializer.asyncCall<CommandSender, const am_sinkID_t, const am_mainVolume_t>(mCommandSender, &CommandSender::cbVolumeChanged, sinkID, volume);
}
void DatabaseObserver::sinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState)
{
- do_msg_s msg;
- msg.msgID = MDO_cbSinkMuteStateChanged;
- msg.parameters.sinkMuteStateChanged.sinkID = sinkID;
- msg.parameters.sinkMuteStateChanged.muteState = muteState;
- pipeCommand(msg);
+ mSerializer.asyncCall<CommandSender, const am_sinkID_t, const am_MuteState_e>(mCommandSender, &CommandSender::cbSinkMuteStateChanged, sinkID, muteState);
}
-void DatabaseObserver::systemPropertyChanged(const am_SystemProperty_s & SystemProperty)
+void DatabaseObserver::systemPropertyChanged(const am_SystemProperty_s& SystemProperty)
{
- do_msg_s msg;
- msg.msgID = MDO_cbSystemPropertyChanged;
- msg.parameters.systemProperty = SystemProperty;
- pipeCommand(msg);
+ mSerializer.asyncCall<CommandSender, const am_SystemProperty_s&>(mCommandSender, &CommandSender::cbSystemPropertyChanged, SystemProperty);
}
void DatabaseObserver::timingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time)
{
- do_msg_s msg;
- msg.msgID = MDO_cbTimingInformationChanged;
- msg.parameters.timingInformationChanged.mainConnection = mainConnection;
- msg.parameters.timingInformationChanged.time = time;
- pipeCommand(msg);
- //todo:inform the controller via controlsender
+ mSerializer.asyncCall<CommandSender, const am_mainConnectionID_t, const am_timeSync_t>(mCommandSender, &CommandSender::cbTimingInformationChanged, mainConnection, time);
}
-
-void DatabaseObserver::receiverCallback(const pollfd pollfd, const sh_pollHandle_t handle, void *userData)
-{
- (void) handle;
- (void) userData;
- //it is no really important what to read here, we will read the queue later...
- char buffer[10];
- if (read(pollfd.fd, buffer, 10) == -1)
- {
- logError("DatabaseObserver::receiverCallback could not read pipe!");
- }
-}
-
-bool DatabaseObserver::dispatcherCallback(const sh_pollHandle_t handle, void *userData)
-{
- (void) handle;
- (void) userData;
- do_msg_s msg;
-
- msg = mQueue.front();
- mQueue.pop();
-
- switch (msg.msgID)
- {
- case MDO_cbNumberOfSinksChanged:
- mCommandSender->cbNumberOfSinksChanged();
- break;
- case MDO_cbNumberOfSourcesChanged:
- mCommandSender->cbNumberOfSourcesChanged();
- break;
- case MDO_cbNumberOfMainConnectionsChanged:
- mCommandSender->cbNumberOfMainConnectionsChanged();
- break;
- case MDO_cbNumberOfSinkClassesChanged:
- mCommandSender->cbNumberOfSinkClassesChanged();
- break;
- case MDO_cbNumberOfSourceClassesChanged:
- mCommandSender->cbNumberOfSourceClassesChanged();
- break;
- case MDO_cbMainConnectionStateChanged:
- mCommandSender->cbMainConnectionStateChanged(msg.parameters.connectionStateChanged.connectionID, msg.parameters.connectionStateChanged.connectionState);
- break;
- case MDO_cbMainSinkSoundPropertyChanged:
- mCommandSender->cbMainSinkSoundPropertyChanged(msg.parameters.mainSinkSoundPropertyChanged.sinkID, msg.parameters.mainSinkSoundPropertyChanged.SoundProperty);
- break;
- case MDO_cbMainSourceSoundPropertyChanged:
- mCommandSender->cbMainSourceSoundPropertyChanged(msg.parameters.mainSourceSoundPropertyChanged.sourceID, msg.parameters.mainSourceSoundPropertyChanged.SoundProperty);
- break;
- case MDO_cbSinkAvailabilityChanged:
- mCommandSender->cbSinkAvailabilityChanged(msg.parameters.sinkAvailabilityChanged.sinkID, msg.parameters.sinkAvailabilityChanged.availability);
- break;
- case MDO_cbSourceAvailabilityChanged:
- mCommandSender->cbSourceAvailabilityChanged(msg.parameters.sourceAvailabilityChanged.sourceID, msg.parameters.sourceAvailabilityChanged.availability);
- break;
- case MDO_cbVolumeChanged:
- mCommandSender->cbVolumeChanged(msg.parameters.volumeChanged.sinkID, msg.parameters.volumeChanged.volume);
- break;
- case MDO_cbSinkMuteStateChanged:
- mCommandSender->cbSinkMuteStateChanged(msg.parameters.sinkMuteStateChanged.sinkID, msg.parameters.sinkMuteStateChanged.muteState);
- break;
- case MDO_cbSystemPropertyChanged:
- mCommandSender->cbSystemPropertyChanged(msg.parameters.systemProperty);
- break;
- case MDO_cbTimingInformationChanged:
- mCommandSender->cbTimingInformationChanged(msg.parameters.timingInformationChanged.mainConnection, msg.parameters.timingInformationChanged.time);
- break;
- default:
- logError("Something went totally wrong in DatabaseObserver::dispatcherCallback");
- break;
- }
-
- if (mQueue.size() > 0)
- return (true);
- return (false);
-}
-
-bool DatabaseObserver::checkerCallback(const sh_pollHandle_t handle, void *userData)
-{
- (void) handle;
- (void) userData;
- if (mQueue.size() > 0)
- return (true);
- return (false);
-}
-
diff --git a/AudioManagerDaemon/src/RoutingReceiver.cpp b/AudioManagerDaemon/src/RoutingReceiver.cpp
index 49ee3f9..fb160b0 100644
--- a/AudioManagerDaemon/src/RoutingReceiver.cpp
+++ b/AudioManagerDaemon/src/RoutingReceiver.cpp
@@ -39,7 +39,11 @@ RoutingReceiver::RoutingReceiver(DatabaseHandler *iDatabaseHandler, RoutingSende
mDatabaseHandler(iDatabaseHandler), //
mRoutingSender(iRoutingSender), //
mControlSender(iControlSender), //
- mSocketHandler(iSocketHandler) //
+ mSocketHandler(iSocketHandler), //
+ mListStartupHandles(), //
+ mListRundownHandles(), //
+ mWaitStartup(false), //
+ mWaitRundown(false)
{
assert(mDatabaseHandler!=NULL);
assert(mRoutingSender!=NULL);
@@ -52,7 +56,11 @@ RoutingReceiver::RoutingReceiver(DatabaseHandler *iDatabaseHandler, RoutingSende
mRoutingSender(iRoutingSender), //
mControlSender(iControlSender), //
mSocketHandler(iSocketHandler), //
- mDBusWrapper(iDBusWrapper) //
+ mDBusWrapper(iDBusWrapper), //
+ mListStartupHandles(), //
+ mListRundownHandles(), //
+ mWaitStartup(false), //
+ mWaitRundown(false)
{
assert(mDatabaseHandler!=NULL);
assert(mRoutingSender!=NULL);
@@ -329,8 +337,41 @@ am_Error_e RoutingReceiver::getSocketHandler(SocketHandler *& socketHandler) con
return E_OK;
}
-uint16_t RoutingReceiver::getInterfaceVersion() const
+void RoutingReceiver::getInterfaceVersion(std::string & version) const
+{
+ version = RoutingReceiveVersion;
+}
+
+void RoutingReceiver::confirmRoutingReady(const uint16_t handle) const
+{
+
+}
+
+void RoutingReceiver::confirmRoutingRundown(const uint16_t handle) const
+{
+}
+
+uint16_t am::RoutingReceiver::getStartupHandle()
+{
+ uint16_t handle = ++handleCount; //todo: handle overflow
+ mListStartupHandles.push_back(handle);
+ return handle;
+}
+
+uint16_t am::RoutingReceiver::getRundownHandle()
+{
+ uint16_t handle = ++handleCount; //todo: handle overflow
+ mListRundownHandles.push_back(handle);
+ return handle;
+}
+
+void am::RoutingReceiver::waitOnStartup(bool startup)
+{
+ mWaitStartup = startup;
+}
+
+void am::RoutingReceiver::waitOnRundown(bool rundown)
{
- return RoutingReceiveVersion;
+ mWaitRundown = rundown;
}
diff --git a/AudioManagerDaemon/src/RoutingSender.cpp b/AudioManagerDaemon/src/RoutingSender.cpp
index 16d04b0..76c671d 100644
--- a/AudioManagerDaemon/src/RoutingSender.cpp
+++ b/AudioManagerDaemon/src/RoutingSender.cpp
@@ -27,12 +27,17 @@
#include <dirent.h>
#include <dlfcn.h>
#include <cassert>
+#include <iostream>
+#include <sstream>
+
+#include "RoutingReceiver.h"
#include "PluginTemplate.h"
#include "DLTWrapper.h"
using namespace am;
-#define REQUIRED_INTERFACE_VERSION 1
+#define REQUIRED_INTERFACE_VERSION_MAJOR 1
+#define REQUIRED_INTERFACE_VERSION_MINOR 0
#define CALL_ALL_INTERFACES(...) \
std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin(); \
@@ -51,7 +56,8 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
mMapDomainInterface(), //
mMapSinkInterface(), //
mMapSourceInterface(), //
- mMapHandleInterface() //
+ mMapHandleInterface(), //
+ mRoutingReceiver()
{
std::vector<std::string> sharedLibraryNameList;
std::vector<std::string>::const_iterator dirIter = listOfPluginDirectories.begin();
@@ -61,7 +67,7 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
for (; dirIter < dirIterEnd; ++dirIter)
{
const char* directoryName = dirIter->c_str();
- logInfo("Searching for HookPlugins in",directoryName);
+ logInfo("Searching for HookPlugins in", directoryName);
DIR *directory = opendir(directoryName);
if (!directory)
@@ -101,7 +107,7 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
for (; iter != iterEnd; ++iter)
{
- logInfo("RoutingSender::RoutingSender try loading: " , *iter);
+ logInfo("RoutingSender::RoutingSender try loading: ", *iter);
RoutingSendInterface* (*createFunc)();
void* tempLibHandle = NULL;
@@ -125,9 +131,14 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
routerInterface.routingInterface = router;
//check libversion
- if (router->getInterfaceVersion() < REQUIRED_INTERFACE_VERSION)
+ std::string version;
+ router->getInterfaceVersion(version);
+ uint16_t minorVersion, majorVersion;
+ std::istringstream(version.substr(0, 1)) >> majorVersion;
+ std::istringstream(version.substr(2, 1)) >> minorVersion;
+ if (majorVersion < REQUIRED_INTERFACE_VERSION_MAJOR || ((majorVersion == REQUIRED_INTERFACE_VERSION_MAJOR) && (minorVersion > REQUIRED_INTERFACE_VERSION_MINOR)))
{
- logError("RoutingSender::RoutingSender RoutingPlugin initialization failed. Version of Interface to old");
+ logInfo("RoutingPlugin initialization failed. Version of Interface to old");
continue;
}
@@ -154,19 +165,22 @@ RoutingSender::~RoutingSender()
}
}
-void RoutingSender::routingInterfacesReady()
-{
- CALL_ALL_INTERFACES(routingInterfacesReady())
-}
-
-void RoutingSender::routingInterfacesRundown()
+am_Error_e RoutingSender::startupInterfaces(RoutingReceiver *iRoutingReceiver)
{
- CALL_ALL_INTERFACES(routingInterfacesRundown())
-}
+ mRoutingReceiver = iRoutingReceiver;
+ am_Error_e returnError = E_OK;
-void RoutingSender::startupRoutingInterface(RoutingReceiveInterface *routingreceiveinterface)
-{
- CALL_ALL_INTERFACES(startupRoutingInterface(routingreceiveinterface))
+ std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
+ std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end();
+ for (; iter < iterEnd; ++iter)
+ {
+ am_Error_e error = (*iter).routingInterface->startupInterface(iRoutingReceiver);
+ if (error != E_OK)
+ {
+ returnError = error;
+ }
+ }
+ return returnError;
}
am_Error_e RoutingSender::asyncAbort(const am_Handle_s& handle)
@@ -479,6 +493,30 @@ RoutingSender::am_handleData_c RoutingSender::returnHandleData(const am_Handle_s
return (it->second);
}
+void am::RoutingSender::setRoutingReady()
+{
+ mRoutingReceiver->waitOnStartup(false);
+ std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
+ std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end();
+ for (; iter < iterEnd; ++iter)
+ {
+ (*iter).routingInterface->setRoutingReady(mRoutingReceiver->getStartupHandle());
+ }
+ mRoutingReceiver->waitOnStartup(true);
+}
+
+void am::RoutingSender::setRoutingRundown()
+{
+ mRoutingReceiver->waitOnRundown(false);
+ std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
+ std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end();
+ for (; iter < iterEnd; ++iter)
+ {
+ (*iter).routingInterface->setRoutingRundown(mRoutingReceiver->getStartupHandle());
+ }
+ mRoutingReceiver->waitOnRundown(true);
+}
+
void RoutingSender::unloadLibraries(void)
{
std::vector<void*>::iterator iterator = mListLibraryHandles.begin();
@@ -489,7 +527,7 @@ void RoutingSender::unloadLibraries(void)
mListLibraryHandles.clear();
}
-am_Error_e am::RoutingSender::getListPlugins(std::vector<std::string>& interfaces) const
+am_Error_e RoutingSender::getListPlugins(std::vector<std::string>& interfaces) const
{
std::vector<InterfaceNamePairs>::const_iterator it = mListInterfaces.begin();
for (; it != mListInterfaces.end(); ++it)
@@ -499,8 +537,8 @@ am_Error_e am::RoutingSender::getListPlugins(std::vector<std::string>& interface
return E_OK;
}
-uint16_t RoutingSender::getInterfaceVersion() const
+void RoutingSender::getInterfaceVersion(std::string & version) const
{
- return (RoutingSendVersion);
+ version = RoutingSendVersion;
}
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index b4f0e99..dee5edb 100644
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -277,7 +277,7 @@ int main(int argc, char *argv[])
TelnetServer iTelnetServer(&iSocketHandler, &iCommandSender, &iCommandReceiver, &iRoutingSender, &iRoutingReceiver, &iControlSender, &iControlReceiver, &iDatabaseHandler, &iRouter, telnetport, maxConnections);
DatabaseObserver iObserver(&iCommandSender, &iRoutingSender, &iSocketHandler, &iTelnetServer);
#else /*WITH_TELNET*/
- DatabaseObserver iObserver(&iCommandSender, &iSocketHandler, &iRoutingSender);
+ DatabaseObserver iObserver(&iCommandSender,&iRoutingSender, &iSocketHandler);
#endif
#else /*WITH_DBUS_WRAPPER*/
CommandReceiver iCommandReceiver(&iDatabaseHandler,&iControlSender,&iSocketHandler);
@@ -295,11 +295,11 @@ int main(int argc, char *argv[])
//startup all the Plugins and Interfaces
iControlSender.startupController(&iControlReceiver);
- iCommandSender.startupInterface(&iCommandReceiver);
- iRoutingSender.startupRoutingInterface(&iRoutingReceiver);
+ iCommandSender.startupInterfaces(&iCommandReceiver);
+ iRoutingSender.startupInterfaces(&iRoutingReceiver);
//when the routingInterface is done, all plugins are loaded:
- iControlSender.hookAllPluginsLoaded();
+ iControlSender.setControllerReady();
//start the mainloop here....
iSocketHandler.start_listenting();
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b386ca..ad3c219 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -194,6 +194,7 @@ ENDFOREACH(dep)
STRING(REGEX REPLACE ".$" "" bin_DEPENDENCIES ${bin_DEPENDENCIES})
endif(WITH_MAIN)
+if(WITH_PLUGIN_COMMAND OR WITH_PLUGIN_CONTROL OR WITH_PLUGIN_ROUTING)
get_property(ADD_DEPEND GLOBAL PROPERTY sampleplugins_prop)
list(REMOVE_DUPLICATES ADD_DEPEND)
list(APPEND ALL_DEPEND ${ADD_DEPEND})
@@ -201,6 +202,7 @@ FOREACH (dep ${ADD_DEPEND})
SET(sampleplugins_DEPENDENCIES "${dep} ,${sampleplugins_DEPENDENCIES}")
ENDFOREACH(dep)
STRING(REGEX REPLACE ".$" "" sampleplugins_DEPENDENCIES ${sampleplugins_DEPENDENCIES})
+endif(WITH_PLUGIN_COMMAND OR WITH_PLUGIN_CONTROL OR WITH_PLUGIN_ROUTING)
if(WITH_TESTS)
get_property(ADD_DEPEND GLOBAL PROPERTY tests_prop)
diff --git a/PluginCommandInterfaceDbus/CMakeLists.txt b/PluginCommandInterfaceDbus/CMakeLists.txt
index 0c26e12..10d696c 100644
--- a/PluginCommandInterfaceDbus/CMakeLists.txt
+++ b/PluginCommandInterfaceDbus/CMakeLists.txt
@@ -8,7 +8,7 @@ set(INCLUDES_FOLDER "include")
FILE(READ "${AUDIO_INCLUDES_FOLDER}/command/CommandSendInterface.h" VERSION_BUFFER LIMIT 6000)
STRING(REGEX MATCH "CommandSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
-STRING(REGEX REPLACE "CommandSendVersion*." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
+STRING(REGEX REPLACE "CommandSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
MESSAGE(STATUS "Building against command interface version ${LIB_INTERFACE_VERSION}")
FIND_PACKAGE(DBUS REQUIRED)
diff --git a/PluginCommandInterfaceDbus/include/DBusCommandSender.h b/PluginCommandInterfaceDbus/include/DBusCommandSender.h
index dbf6b04..e64e6f6 100644
--- a/PluginCommandInterfaceDbus/include/DBusCommandSender.h
+++ b/PluginCommandInterfaceDbus/include/DBusCommandSender.h
@@ -50,25 +50,27 @@ class DbusCommandSender: public CommandSendInterface
public:
DbusCommandSender();
virtual ~DbusCommandSender();
- am_Error_e startupInterface(CommandReceiveInterface* commandreceiveinterface);
- am_Error_e stopInterface();
- am_Error_e cbCommunicationReady();
- am_Error_e cbCommunicationRundown();
- void cbNumberOfMainConnectionsChanged();
- void cbNumberOfSinksChanged();
- void cbNumberOfSourcesChanged();
- 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 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);
- void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume);
- 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;
+ am_Error_e startupInterface(CommandReceiveInterface* commandreceiveinterface) ;
+ void setCommandReady(const uint16_t handle) ;
+ void setCommandRundown(const uint16_t handle) ;
+ void cbNewMainConnection(const am_MainConnectionType_s mainConnection) ;
+ void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection) ;
+ void cbNewSink(const am_SinkType_s& sink) ;
+ void cbRemovedSink(const am_sinkID_t sinkID) ;
+ void cbNewSource(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 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) ;
+ void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume) ;
+ 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) ;
+ void getInterfaceVersion(std::string& version) const ;
#ifdef UNIT_TEST
friend class DbusCommandInterfaceBackdoor;
diff --git a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
index 3bebdde..de577c9 100644
--- a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
+++ b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
@@ -86,38 +86,26 @@ am_Error_e DbusCommandSender::startupInterface(CommandReceiveInterface* commandr
return (E_OK);
}
-am_Error_e DbusCommandSender::stopInterface()
-{
- log(&commandDbus, DLT_LOG_INFO, "stopInterface called");
- mReady = false;
- /**
- * todo: finish DbusCommandSender::stopInterface(), what needs to be done?
- */
- return (E_OK);
-}
-
-am_Error_e DbusCommandSender::cbCommunicationReady()
+void DbusCommandSender::setCommandReady(const uint16_t handle)
{
+ //todo:implement handle handling
log(&commandDbus, DLT_LOG_INFO, "cbCommunicationReady called");
mReady = true;
- /**
- * todo: implement DbusCommandSender::cbCommunicationReady()
- */
- return E_NOT_USED;
}
-am_Error_e DbusCommandSender::cbCommunicationRundown()
+void DbusCommandSender::setCommandRundown(const uint16_t handle)
{
log(&commandDbus, DLT_LOG_INFO, "cbCommunicationRundown called");
mReady = false;
/**
* todo: implement DbusCommandSender::cbCommunicationRundown()
*/
- return E_NOT_USED;
}
-void DbusCommandSender::cbNumberOfMainConnectionsChanged()
+void DbusCommandSender::cbNewMainConnection(const am_MainConnectionType_s mainConnection)
{
+ (void)mainConnection;
+ //todo: change xml and interface to differetiate between new connection and removed one
log(&commandDbus, DLT_LOG_INFO, "cbNumberOfMainConnectionsChanged called");
if (mReady)
@@ -127,76 +115,72 @@ void DbusCommandSender::cbNumberOfMainConnectionsChanged()
}
}
-void DbusCommandSender::cbNumberOfSinksChanged()
+void DbusCommandSender::cbRemovedMainConnection(const am_mainConnectionID_t mainConnection)
{
- log(&commandDbus, DLT_LOG_INFO, "cbNumberOfSinksChanged called");
+//todo: change xml and interface to differetiate between new connection and removed one
+ log(&commandDbus, DLT_LOG_INFO, "cbNumberOfMainConnectionsChanged called");
- std::vector<am_SinkType_s> newListSinks;
- std::vector<am_SinkType_s> diffList;
- mCommandReceiveInterface->getListMainSinks(newListSinks);
- std::sort(newListSinks.begin(), newListSinks.end(), sortBySinkID());
- std::set_symmetric_difference(newListSinks.begin(), newListSinks.end(), mlistSinks.begin(), mlistSinks.end(), std::back_inserter(diffList), sortBySinkID());
if (mReady)
{
- if (newListSinks.size() > mlistSinks.size())
- {
- std::vector<am_SinkType_s>::iterator iter(diffList.begin());
- for (;iter!=diffList.end();++iter)
- {
- mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SinkAdded");
- mDBUSMessageHandler.append(*iter);
-
- log(&commandDbus, DLT_LOG_INFO, "send signal SinkAdded");
- mDBUSMessageHandler.sendMessage();
- }
- }
- else
- {
- std::vector<am_SinkType_s>::iterator iter(diffList.begin());
- for (;iter!=diffList.end();++iter)
- {
- mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SinkAdded");
- mDBUSMessageHandler.append(*iter);
-
- log(&commandDbus, DLT_LOG_INFO, "send signal SinkAdded");
- mDBUSMessageHandler.sendMessage();
- }
- }
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfMainConnectionsChanged"));
+ mDBUSMessageHandler.sendMessage();
}
- mlistSinks = newListSinks;
+}
+
+void DbusCommandSender::cbNewSink(const am_SinkType_s& sink)
+{
+ log(&commandDbus, DLT_LOG_INFO, "cbNewSink called");
+ if (mReady)
+ {
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SinkAdded");
+ mDBUSMessageHandler.append(sink);
+
+ log(&commandDbus, DLT_LOG_INFO, "send signal SinkAdded");
+ mDBUSMessageHandler.sendMessage();
+ }
+}
+
+void DbusCommandSender::cbRemovedSink(const am_sinkID_t sinkID)
+{
+ //todo: check if this really works!
+ log(&commandDbus, DLT_LOG_INFO, "cbRemovedSink called");
+
+ if (mReady)
+ {
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SinkRemoved");
+ mDBUSMessageHandler.append(sinkID);
+
+ log(&commandDbus, DLT_LOG_INFO, "send signal SinkAdded");
+ mDBUSMessageHandler.sendMessage();
+ }
}
-void DbusCommandSender::cbNumberOfSourcesChanged()
+void DbusCommandSender::cbNewSource(const am_SourceType_s& source)
{
log(&commandDbus, DLT_LOG_INFO, "cbNumberOfSourcesChanged called");
- std::vector<am_SourceType_s> newlistSources;
- std::vector<am_SourceType_s> diffList;
- mCommandReceiveInterface->getListMainSources(newlistSources);
- std::sort(newlistSources.begin(), newlistSources.end(), sortBySourceID());
- std::set_symmetric_difference(newlistSources.begin(), newlistSources.end(), mlistSources.begin(), mlistSources.end(), std::back_inserter(diffList), sortBySourceID());
- assert(diffList.size()==1);
if (mReady)
{
- if (newlistSources.size() > mlistSources.size())
- {
- mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SourceAdded");
- mDBUSMessageHandler.append(diffList[0]);
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SourceAdded");
+ mDBUSMessageHandler.append(source);
- log(&commandDbus, DLT_LOG_INFO, "send signal SourceAdded");
- }
- else
- {
- mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SourceRemoved");
- mDBUSMessageHandler.append((dbus_uint16_t) diffList.begin()->sourceID);
+ log(&commandDbus, DLT_LOG_INFO, "send signal SourceAdded");
+ mDBUSMessageHandler.sendMessage();
+ }
+}
- log(&commandDbus, DLT_LOG_INFO, "send signal SourceRemoved");
- }
+void am::DbusCommandSender::cbRemovedSource(const am_sourceID_t source)
+{
+ if (mReady)
+ {
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SourceRemoved");
+ mDBUSMessageHandler.append(source);
+
+ log(&commandDbus, DLT_LOG_INFO, "send signal SourceRemoved");
mDBUSMessageHandler.sendMessage();
}
- mlistSources = newlistSources;
}
void DbusCommandSender::cbNumberOfSinkClassesChanged()
@@ -234,15 +218,15 @@ void DbusCommandSender::cbMainConnectionStateChanged(const am_mainConnectionID_t
}
}
-void DbusCommandSender::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s SoundProperty)
+void DbusCommandSender::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s & soundProperty)
{
- log(&commandDbus, DLT_LOG_INFO, "cbMainSinkSoundPropertyChanged called, sinkID", sinkID, "SoundProperty.type", SoundProperty.type, "SoundProperty.value", SoundProperty.value);
+ log(&commandDbus, DLT_LOG_INFO, "cbMainSinkSoundPropertyChanged called, sinkID", sinkID, "SoundProperty.type", soundProperty.type, "SoundProperty.value", soundProperty.value);
if (mReady)
{
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("MainSinkSoundPropertyChanged"));
mDBUSMessageHandler.append((dbus_uint16_t) sinkID);
- mDBUSMessageHandler.append(SoundProperty);
+ mDBUSMessageHandler.append(soundProperty);
mDBUSMessageHandler.sendMessage();
}
}
@@ -337,8 +321,8 @@ void am::DbusCommandSender::cbTimingInformationChanged(const am_mainConnectionID
}
}
-uint16_t DbusCommandSender::getInterfaceVersion() const
+void DbusCommandSender::getInterfaceVersion(std::string & version) const
{
- return (CommandSendVersion);
+ version = CommandSendVersion;
}
diff --git a/PluginControlInterface/CMakeLists.txt b/PluginControlInterface/CMakeLists.txt
index 7bd3bb1..5946df7 100644
--- a/PluginControlInterface/CMakeLists.txt
+++ b/PluginControlInterface/CMakeLists.txt
@@ -8,7 +8,7 @@ set(INCLUDES_FOLDER "include")
FILE(READ "${AUDIO_INCLUDES_FOLDER}/control/ControlSendInterface.h" VERSION_BUFFER LIMIT 6000)
STRING(REGEX MATCH "ControlSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
-STRING(REGEX REPLACE "ControlSendVersion*." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
+STRING(REGEX REPLACE "ControlSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
MESSAGE(STATUS "Building against control interface version ${LIB_INTERFACE_VERSION}")
INCLUDE_DIRECTORIES(
diff --git a/PluginControlInterface/include/ControlSender.h b/PluginControlInterface/include/ControlSender.h
index 0e98768..e96f445 100644
--- a/PluginControlInterface/include/ControlSender.h
+++ b/PluginControlInterface/include/ControlSender.h
@@ -37,8 +37,8 @@ public:
ControlSenderPlugin();
virtual ~ControlSenderPlugin();
am_Error_e startupController(ControlReceiveInterface* controlreceiveinterface);
- am_Error_e stopController();
- void hookAllPluginsLoaded();
+ 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);
@@ -73,12 +73,16 @@ public:
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 cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error);
void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error);
- void cbAckSetSinkSoundProperty(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);
- uint16_t getInterfaceVersion() const;
+ void getInterfaceVersion(std::string& version) const;
+ void confirmCommandReady();
+ void confirmRoutingReady();
+ void confirmCommandRundown();
+ void confirmRoutingRundown();
private:
ControlReceiveInterface * mControlReceiveInterface;
diff --git a/PluginControlInterface/src/ControlSender.cpp b/PluginControlInterface/src/ControlSender.cpp
index 60ae417..052d1ff 100644
--- a/PluginControlInterface/src/ControlSender.cpp
+++ b/PluginControlInterface/src/ControlSender.cpp
@@ -61,12 +61,7 @@ am_Error_e ControlSenderPlugin::startupController(ControlReceiveInterface *contr
return E_NOT_USED;
}
-am_Error_e ControlSenderPlugin::stopController()
-{
- return E_NOT_USED;
-}
-
-void ControlSenderPlugin::hookAllPluginsLoaded()
+void ControlSenderPlugin::setControllerReady()
{
//here is a good place to insert Source and SinkClasses into the database...
mControlReceiveInterface->setRoutingReady();
@@ -440,6 +435,10 @@ void ControlSenderPlugin::cbAckSetSinkSoundProperties(const am_Handle_s handle,
(void) handle;
}
+void ControlSenderPlugin::setControllerRundown()
+{
+}
+
am_Error_e ControlSenderPlugin::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) sourceID;
@@ -450,8 +449,28 @@ am_Error_e ControlSenderPlugin::getConnectionFormatChoice(const am_sourceID_t so
return (E_OK);
}
-uint16_t ControlSenderPlugin::getInterfaceVersion() const
+void ControlSenderPlugin::getInterfaceVersion(std::string & version) const
+{
+ version = ControlSendVersion;
+}
+
+void ControlSenderPlugin::confirmCommandReady()
+{
+ //todo:implement
+}
+
+void ControlSenderPlugin::confirmRoutingReady()
+{
+ //todo:implement
+}
+
+void ControlSenderPlugin::confirmCommandRundown()
+{
+ //todo:implement
+}
+
+void ControlSenderPlugin::confirmRoutingRundown()
{
- return (ControlSendVersion);
+ //todo:implement
}
diff --git a/PluginRoutingInterfaceAsync/CMakeLists.txt b/PluginRoutingInterfaceAsync/CMakeLists.txt
index 2ccb6da..598b4fe 100644
--- a/PluginRoutingInterfaceAsync/CMakeLists.txt
+++ b/PluginRoutingInterfaceAsync/CMakeLists.txt
@@ -30,7 +30,7 @@ set(INCLUDES_FOLDER "include")
FILE(READ "${AUDIO_INCLUDES_FOLDER}/routing/RoutingSendInterface.h" VERSION_BUFFER LIMIT 6000)
STRING(REGEX MATCH "RoutingSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
-STRING(REGEX REPLACE "RoutingSendVersion*." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
+STRING(REGEX REPLACE "RoutingSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
MESSAGE(STATUS "Building against routing interface version ${LIB_INTERFACE_VERSION}")
find_package( Threads )
diff --git a/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h b/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h
index 4dcf29c..dd88be1 100644
--- a/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h
+++ b/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h
@@ -129,23 +129,23 @@ class AsyncRoutingSender: public RoutingSendInterface
public:
AsyncRoutingSender();
virtual ~AsyncRoutingSender();
- void startupRoutingInterface(RoutingReceiveInterface* routingreceiveinterface);
- void routingInterfacesReady();
- void routingInterfacesRundown();
- am_Error_e asyncAbort(const am_Handle_s handle);
- am_Error_e asyncConnect(const 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(const am_Handle_s handle, const am_connectionID_t connectionID);
- am_Error_e asyncSetSinkVolume(const 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 asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time);
- am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state);
- am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty);
- am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties);
- am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty);
- am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties);
- am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time);
- am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState);
- am_Error_e returnBusName(std::string& BusName) const;
- uint16_t getInterfaceVersion() const;
+ am_Error_e startupInterface(RoutingReceiveInterface* routingreceiveinterface) ;
+ void setRoutingReady(const uint16_t handle) ;
+ void setRoutingRundown(const uint16_t handle) ;
+ am_Error_e asyncAbort(const am_Handle_s handle) ;
+ am_Error_e asyncConnect(const 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(const am_Handle_s handle, const am_connectionID_t connectionID) ;
+ am_Error_e asyncSetSinkVolume(const 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 asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) ;
+ am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state) ;
+ am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties) ;
+ am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) ;
+ am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties) ;
+ am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) ;
+ am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time) ;
+ am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) ;
+ am_Error_e returnBusName(std::string& BusName) const ;
+ void getInterfaceVersion(std::string& version) const ;
/**
* threadafe insert of route and connectionID
diff --git a/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp b/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp
index 17e5a93..c11201e 100644
--- a/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp
+++ b/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp
@@ -74,7 +74,7 @@ void RoutingReceiverAsyncShadow::ackConnect(const am_Handle_s handle, const am_c
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::ackConnect write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::ackConnect write failed, error code:", strerror(errno));
}
}
@@ -98,7 +98,7 @@ void RoutingReceiverAsyncShadow::ackDisconnect(const am_Handle_s handle, const a
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::ackDisconnect write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::ackDisconnect write failed, error code:", strerror(errno));
}
}
@@ -122,7 +122,7 @@ void RoutingReceiverAsyncShadow::ackSetSinkVolumeChange(const am_Handle_s handle
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::ackSetSinkVolumeChange write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::ackSetSinkVolumeChange write failed, error code:", strerror(errno));
}
}
@@ -146,7 +146,7 @@ void RoutingReceiverAsyncShadow::ackSetSourceVolumeChange(const am_Handle_s hand
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::ackSetSourceVolumeChange write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::ackSetSourceVolumeChange write failed, error code:", strerror(errno));
}
}
@@ -169,7 +169,7 @@ void RoutingReceiverAsyncShadow::ackSetSourceState(const am_Handle_s handle, con
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::ackSetSourceState write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::ackSetSourceState write failed, error code:", strerror(errno));
}
}
@@ -192,7 +192,7 @@ void RoutingReceiverAsyncShadow::ackSetSinkSoundProperty(const am_Handle_s handl
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::ackSetSinkSoundProperty write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::ackSetSinkSoundProperty write failed, error code:", strerror(errno));
}
}
@@ -215,7 +215,7 @@ void RoutingReceiverAsyncShadow::ackSetSourceSoundProperty(const am_Handle_s han
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::ackSetSourceSoundProperty write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::ackSetSourceSoundProperty write failed, error code:", strerror(errno));
}
}
@@ -239,7 +239,7 @@ void RoutingReceiverAsyncShadow::ackCrossFading(const am_Handle_s handle, const
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::ackCrossFading write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::ackCrossFading write failed, error code:", strerror(errno));
}
}
@@ -263,7 +263,7 @@ void RoutingReceiverAsyncShadow::ackSourceVolumeTick(const am_Handle_s handle, c
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::ackSourceVolumeTick write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::ackSourceVolumeTick write failed, error code:", strerror(errno));
}
}
@@ -287,7 +287,7 @@ void RoutingReceiverAsyncShadow::ackSinkVolumeTick(const am_Handle_s handle, con
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::ackSinkVolumeTick write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::ackSinkVolumeTick write failed, error code:", strerror(errno));
}
}
@@ -311,7 +311,7 @@ void RoutingReceiverAsyncShadow::hookInterruptStatusChange(const am_sourceID_t s
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::hookInterruptStatusChange write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::hookInterruptStatusChange write failed, error code:", strerror(errno));
}
}
@@ -335,7 +335,7 @@ void RoutingReceiverAsyncShadow::hookSinkAvailablityStatusChange(const am_sinkID
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::hookSinkAvailablityStatusChange write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::hookSinkAvailablityStatusChange write failed, error code:", strerror(errno));
}
}
@@ -359,7 +359,7 @@ void RoutingReceiverAsyncShadow::hookSourceAvailablityStatusChange(const am_sour
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::hookSourceAvailablityStatusChange write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::hookSourceAvailablityStatusChange write failed, error code:", strerror(errno));
}
}
@@ -383,7 +383,7 @@ void RoutingReceiverAsyncShadow::hookDomainStateChange(const am_domainID_t domai
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::hookDomainStateChange write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::hookDomainStateChange write failed, error code:", strerror(errno));
}
}
@@ -407,7 +407,7 @@ void RoutingReceiverAsyncShadow::hookTimingInformationChanged(const am_connectio
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- logError("RoutingReceiverAsyncShadow::hookTimingInformationChanged write failed, error code:",strerror(errno));
+ logError("RoutingReceiverAsyncShadow::hookTimingInformationChanged write failed, error code:", strerror(errno));
}
}
@@ -484,7 +484,7 @@ bool RoutingReceiverAsyncShadow::asyncDispatcher(const sh_pollHandle_t handle, v
mRoutingReceiveInterface->hookTimingInformationChanged(msg.parameters.timingInfoChange.connectionID, msg.parameters.timingInfoChange.delay);
break;
default:
- logError("RoutingReceiverAsyncShadow::asyncDispatcher unknown message was received:",msg.msgID);
+ logError("RoutingReceiverAsyncShadow::asyncDispatcher unknown message was received:", msg.msgID);
break;
}
diff --git a/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp b/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
index 4993f76..1a1ee70 100644
--- a/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
+++ b/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
@@ -278,7 +278,7 @@ AsyncRoutingSender::~AsyncRoutingSender()
{
}
-void AsyncRoutingSender::startupRoutingInterface(RoutingReceiveInterface *routingreceiveinterface)
+am_Error_e AsyncRoutingSender::startupInterface(RoutingReceiveInterface *routingreceiveinterface)
{
//first, create the Shadow:
assert(routingreceiveinterface!=0);
@@ -286,8 +286,9 @@ void AsyncRoutingSender::startupRoutingInterface(RoutingReceiveInterface *routin
mShadow.setRoutingInterface(routingreceiveinterface);
}
-void AsyncRoutingSender::routingInterfacesReady()
+void AsyncRoutingSender::setRoutingReady(const uint16_t handle)
{
+ //todo: implement handle !
assert(mReceiveInterface!=0);
am_Error_e eCode;
//first register the domains
@@ -348,7 +349,7 @@ void AsyncRoutingSender::routingInterfacesReady()
//pthread_create(&mInterruptThread,NULL,&AsyncRoutingSender::InterruptEvents,&mShadow);
}
-void AsyncRoutingSender::routingInterfacesRundown()
+void AsyncRoutingSender::setRoutingRundown(const uint16_t handle)
{
assert(mReceiveInterface!=0);
}
@@ -952,9 +953,9 @@ void am::AsyncRoutingSender::updateDomainstateSafe(am_domainID_t domainID, am_Do
pthread_mutex_unlock(&mDomainsMutex);
}
-uint16_t AsyncRoutingSender::getInterfaceVersion() const
+void AsyncRoutingSender::getInterfaceVersion(std::string & version) const
{
- return (RoutingSendVersion);
+ version = RoutingSendVersion;
}
am_Error_e AsyncRoutingSender::asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
diff --git a/PluginRoutingInterfaceDbus/include/RoutingSender.h b/PluginRoutingInterfaceDbus/include/RoutingSender.h
index 700a1f5..276bd1e 100644
--- a/PluginRoutingInterfaceDbus/include/RoutingSender.h
+++ b/PluginRoutingInterfaceDbus/include/RoutingSender.h
@@ -35,23 +35,23 @@ class DbusRoutingSender: public RoutingSendInterface
public:
DbusRoutingSender();
virtual ~DbusRoutingSender();
- void startupRoutingInterface(RoutingReceiveInterface* routingreceiveinterface);
- void routingInterfacesReady();
- void routingInterfacesRundown();
- am_Error_e asyncAbort(const am_Handle_s handle);
- am_Error_e asyncConnect(const 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(const am_Handle_s handle, const am_connectionID_t connectionID);
- am_Error_e asyncSetSinkVolume(const 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 asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time);
- am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state);
- am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty);
- am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties);
- am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty);
- am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties);
- am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time);
- am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState);
- am_Error_e returnBusName(std::string& BusName) const;
- uint16_t getInterfaceVersion() const;
+ am_Error_e startupInterface(RoutingReceiveInterface* routingreceiveinterface) ;
+ void setRoutingReady(const uint16_t handle) ;
+ void setRoutingRundown(const uint16_t handle) ;
+ am_Error_e asyncAbort(const am_Handle_s handle) ;
+ am_Error_e asyncConnect(const 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(const am_Handle_s handle, const am_connectionID_t connectionID) ;
+ am_Error_e asyncSetSinkVolume(const 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 asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) ;
+ am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state) ;
+ am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties) ;
+ am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) ;
+ am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties) ;
+ am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) ;
+ am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time) ;
+ am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) ;
+ am_Error_e returnBusName(std::string& BusName) const ;
+ void getInterfaceVersion(std::string& version) const ;
};
#endif /* ROUTINGSENDER_H_ */
diff --git a/PluginRoutingInterfaceDbus/src/RoutingSender.cpp b/PluginRoutingInterfaceDbus/src/RoutingSender.cpp
index 0feb441..3606c66 100644
--- a/PluginRoutingInterfaceDbus/src/RoutingSender.cpp
+++ b/PluginRoutingInterfaceDbus/src/RoutingSender.cpp
@@ -43,19 +43,6 @@ DbusRoutingSender::~DbusRoutingSender()
{
}
-void DbusRoutingSender::startupRoutingInterface(RoutingReceiveInterface *routingreceiveinterface)
-{
- (void)routingreceiveinterface;
-}
-
-void DbusRoutingSender::routingInterfacesReady()
-{
-}
-
-void DbusRoutingSender::routingInterfacesRundown()
-{
-}
-
am_Error_e DbusRoutingSender::asyncAbort(const am_Handle_s handle)
{
(void) handle;
@@ -124,6 +111,22 @@ am_Error_e DbusRoutingSender::setDomainState(const am_domainID_t domainID, const
return (E_NOT_USED);
}
+am_Error_e DbusRoutingSender::startupInterface(RoutingReceiveInterface *routingreceiveinterface)
+{
+ (void)routingreceiveinterface;
+ return (E_NOT_USED);
+}
+
+void DbusRoutingSender::setRoutingReady(const uint16_t handle)
+{
+ (void) handle;
+}
+
+void DbusRoutingSender::setRoutingRundown(const uint16_t handle)
+{
+ (void) handle;
+}
+
am_Error_e DbusRoutingSender::returnBusName(std::string & BusName) const
{
BusName = "DbusPlugin";
@@ -162,8 +165,10 @@ am_Error_e DbusRoutingSender::asyncSetSourceSoundProperties(const am_Handle_s ha
return (E_NOT_USED);
}
-uint16_t DbusRoutingSender::getInterfaceVersion() const
+void DbusRoutingSender::getInterfaceVersion(std::string & version) const
{
- return (RoutingSendVersion);
+ version=RoutingSendVersion;
}
+
+
diff --git a/cmake/DoxyFile.in b/cmake/DoxyFile.in
index 25cabe1..c53895e 100644
--- a/cmake/DoxyFile.in
+++ b/cmake/DoxyFile.in
@@ -697,7 +697,7 @@ EXAMPLE_RECURSIVE = NO
# directories that contain image that are included in the documentation (see
# the \image command).
-IMAGE_PATH = ../../AudioManGUI
+IMAGE_PATH = ../cmake
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
diff --git a/cmake/genivilogo.png b/cmake/genivilogo.png
new file mode 100644
index 0000000..d016ec8
--- /dev/null
+++ b/cmake/genivilogo.png
Binary files differ
diff --git a/includes/CAmSerializer.h b/includes/CAmSerializer.h
new file mode 100644
index 0000000..e4924e9
--- /dev/null
+++ b/includes/CAmSerializer.h
@@ -0,0 +1,350 @@
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef CAMSERIALIZER_H_
+#define CAMSERIALIZER_H_
+
+#include <pthread.h>
+#include <deque>
+#include <cassert>
+#include <memory>
+#include <stdexcept>
+#include "DLTWrapper.h"
+#include "SocketHandler.h"
+
+#include "iostream" //todo remove
+
+namespace am
+{
+/**
+ * magic class that does the serialization of functions calls
+ * The constructor must be called within the main threadcontext, after that using the
+ * overloaded template function call will serialize all calls and call them within the
+ * main thread context.\n
+ * If you want to use synchronous calls make sure that you use one instance of this class
+ * per thread otherwise you could be lost in never returning calls.
+ */
+class CAmSerializer
+{
+private:
+
+ /**
+ * Prototype for a delegate
+ */
+ class CAmDelegate
+ {
+ public:
+ virtual ~CAmDelegate(){};
+ virtual void call()=0;
+
+ };
+
+ typedef CAmDelegate* CAmDelegagePtr; //!< pointer to a delegate
+
+ /**
+ * delegate template for no argument
+ */
+ template<class TClass> class CAmNoArgDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)();
+
+ public:
+ CAmNoArgDelegate(TClass* instance, void(TClass::*function)()) :
+ mInstance(instance), //
+ mFunction(function){};
+
+ void call()
+ {
+ (*mInstance.*mFunction)();
+ };
+ };
+
+ /**
+ * delegate template for one argument
+ */
+ template<class TClass, typename Targ> class CAmOneArgDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(Targ);
+ Targ mArgument;
+
+ public:
+ CAmOneArgDelegate(TClass* instance, void(TClass::*function)(Targ), Targ argument) :
+ mInstance(instance), //
+ mFunction(function), //
+ mArgument(argument) { };
+
+ void call()
+ {
+ (*mInstance.*mFunction)(mArgument);
+ };
+ };
+
+ /**
+ * delegate template for two arguments
+ */
+ template<class TClass, typename Targ, typename Targ1> class CAmTwoArgDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(Targ argument,Targ1 argument1);
+ Targ mArgument;
+ Targ1 mArgument1;
+
+ public:
+ CAmTwoArgDelegate(TClass* instance, void(TClass::*function)(Targ argument,Targ1 argument1), Targ argument, Targ1 argument1) :
+ mInstance(instance), //
+ mFunction(function), //
+ mArgument(argument), //
+ mArgument1(argument1){};
+
+ void call()
+ {
+ (*mInstance.*mFunction)(mArgument,mArgument1);
+ };
+ };
+
+ /**
+ * delegate template for three arguments
+ */
+ template<class TClass, typename Targ, typename Targ1, typename Targ2> class CAmThreeArgDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(Targ argument,Targ1 argument1,Targ2 argument2);
+ Targ mArgument;
+ Targ1 mArgument1;
+ Targ2 mArgument2;
+
+ public:
+ CAmThreeArgDelegate(TClass* instance, void(TClass::*function)(Targ argument,Targ1 argument1,Targ2 argument2), Targ argument, Targ1 argument1, Targ2 argument2) :
+ mInstance(instance), //
+ mFunction(function), //
+ mArgument(argument), //
+ mArgument1(argument1), //
+ mArgument2(argument2){};
+
+ void call()
+ {
+ (*mInstance.*mFunction)(mArgument,mArgument1,mArgument2);
+ };
+ };
+
+ /**
+ * delegate template for four arguments
+ */
+ template<class TClass, typename Targ, typename Targ1, typename Targ2, typename Targ3> class CAmFourArgDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(Targ argument, Targ1 argument1, Targ2 argument2, Targ3 argument3);
+ Targ mArgument;
+ Targ1 mArgument1;
+ Targ2 mArgument2;
+ Targ3 mArgument3;
+
+ public:
+ CAmFourArgDelegate(TClass* instance, void(TClass::*function)(Targ argument,Targ1 argument1,Targ2 argument2, Targ3 argument3), Targ argument, Targ1 argument1, Targ2 argument2, Targ3 argument3) :
+ mInstance(instance), //
+ mFunction(function), //
+ mArgument(argument), //
+ mArgument1(argument1), //
+ mArgument2(argument2), //
+ mArgument3(argument3){};
+
+ void call()
+ {
+ (*mInstance.*mFunction)(mArgument,mArgument1,mArgument2,mArgument3);
+ };
+ };
+
+ /**
+ * rings the line of the pipe and adds the delegate pointer to the queue
+ * @param p delegate pointer
+ */
+ inline void send(CAmDelegagePtr p)
+ {
+ if (write(mPipe[1], &p, sizeof(p)) == -1)
+ {
+ throw std::runtime_error("could not write to pipe !");
+ }
+ }
+ int mPipe[2]; //!< the pipe
+ std::deque<CAmDelegagePtr> mListDelegatePoiters; //!< intermediate queue to store the pipe results
+
+public:
+
+ /**
+ * calls a function with no arguments threadsafe
+ * @param instance the instance of the class that shall be called
+ * @param function the function that shall be called as memberfunction pointer.
+ * Here is an example:
+ * @code
+ * class myClass
+ * {
+ * public:
+ * void myfunction();
+ * }
+ * CAmSerializer serial(&Sockethandler);
+ * myClass instanceMyClass;
+ * serial<CommandSender>(&instanceMyClass,&myClass::myfunction);
+ * @endcode
+ */
+ template<class TClass>
+ void asyncCall(TClass* instance, void(TClass::*function)())
+ {
+ CAmDelegagePtr p(new CAmNoArgDelegate<TClass>(instance, function));
+ send(p);
+ }
+
+ /**
+ * calls a function with one arguments asynchronously threadsafe
+ * @param instance the instance of the class that shall be called
+ * @param function the function that shall be called as memberfunction pointer.
+ * Here is an example:
+ * @code
+ * class myClass
+ * {
+ * public:
+ * void myfunction(int k);
+ * }
+ * CAmSerializer serial(&Sockethandler);
+ * myClass instanceMyClass;
+ * serial<CommandSender,int>(&instanceMyClass,&myClass::myfunction,k);
+ * @endcode
+ */
+ template<class TClass1, class Targ>
+ void asyncCall(TClass1* instance, void(TClass1::*function)(Targ), Targ argument)
+ {
+ CAmDelegagePtr p(new CAmOneArgDelegate<TClass1, Targ>(instance, function, argument));
+ send(p);
+ }
+
+ /**
+ * calls a function with two arguments asynchronously threadsafe. for more see asyncCall with one argument
+ * @param instance
+ * @param function
+ * @param argument
+ * @param argument1
+ */
+ template<class TClass1, class Targ, class Targ1>
+ void asyncCall(TClass1* instance, void(TClass1::*function)(Targ argument,Targ1 argument1), Targ argument, Targ1 argument1)
+ {
+ CAmDelegagePtr p(new CAmTwoArgDelegate<TClass1, Targ, Targ1>(instance, function, argument,argument1));
+ send(p);
+ }
+
+ /**
+ * calls a function with three arguments asynchronously threadsafe. for more see asyncCall with one argument
+ * @param instance
+ * @param function
+ * @param argument
+ * @param argument1
+ * @param argument2
+ */
+ template<class TClass1, class Targ, class Targ1, class Targ2>
+ void asyncCall(TClass1* instance, void(TClass1::*function)(Targ argument,Targ1 argument1, Targ2 argument2), Targ argument, Targ1 argument1, Targ2 argument2)
+ {
+ CAmDelegagePtr p(new CAmThreeArgDelegate<TClass1, Targ, Targ1, Targ2>(instance, function, argument,argument1, argument2));
+ send(p);
+ }
+
+ /**
+ * calls a function with four arguments asynchronously threadsafe. for more see asyncCall with one argument
+ * @param instance
+ * @param function
+ * @param argument
+ * @param argument1
+ * @param argument2
+ * @param argument3
+ */
+ template<class TClass1, class Targ, class Targ1, class Targ2, class Targ3>
+ void asyncCall(TClass1* instance, void(TClass1::*function)(Targ argument,Targ1 argument1, Targ2 argument2, Targ3 argument3), Targ argument, Targ1 argument1, Targ2 argument2, Targ3 argument3)
+ {
+ CAmDelegagePtr p(new CAmFourArgDelegate<TClass1, Targ, Targ1, Targ2, Targ3>(instance, function, argument,argument1, argument2, argument3));
+ send(p);
+ }
+
+ void receiverCallback(const pollfd pollfd, const sh_pollHandle_t handle, void* userData)
+ {
+ (void) handle;
+ (void) userData;
+ int numReads;
+ CAmDelegagePtr listPointers[3];
+ if ((numReads=read(pollfd.fd,&listPointers, sizeof(listPointers))) == -1)
+ {
+ logError("CAmSerializer::receiverCallback could not read pipe!");
+ throw std::runtime_error("CAmSerializer Could not read pipe!");
+ }
+ mListDelegatePoiters.assign(listPointers, listPointers+(numReads/sizeof(CAmDelegagePtr)));
+ }
+
+ bool checkerCallback(const sh_pollHandle_t handle, void* userData)
+ {
+ (void) handle;
+ (void) userData;
+ if (mListDelegatePoiters.empty())
+ return false;
+ return true;
+ }
+
+ bool dispatcherCallback(const sh_pollHandle_t handle, void* userData)
+ {
+ (void) handle;
+ (void) userData;
+ CAmDelegagePtr delegatePoiter = mListDelegatePoiters.front();
+ mListDelegatePoiters.pop_front();
+ delegatePoiter->call();
+ delete delegatePoiter;
+ if (mListDelegatePoiters.empty())
+ return false;
+ return true;
+ }
+
+ shPollFired_T<CAmSerializer> receiverCallbackT;
+ shPollDispatch_T<CAmSerializer> dispatcherCallbackT;
+ shPollCheck_T<CAmSerializer> checkerCallbackT;
+
+ /**
+ * The constructor must be called in the mainthread context !
+ * @param iSocketHandler pointer to the sockethandler
+ */
+ CAmSerializer(SocketHandler *iSocketHandler) :
+ mPipe(), //
+ mListDelegatePoiters(), //
+ receiverCallbackT(this, &CAmSerializer::receiverCallback), //
+ dispatcherCallbackT(this, &CAmSerializer::dispatcherCallback), //
+ checkerCallbackT(this, &CAmSerializer::checkerCallback)
+ {
+ if (pipe(mPipe) == -1)
+ {
+ logError("CAmSerializer could not create pipe!");
+ throw std::runtime_error("CAmSerializer Could not open pipe!");
+ }
+
+ short event = 0;
+ sh_pollHandle_t handle;
+ event |= POLLIN;
+ iSocketHandler->addFDPoll(mPipe[0], event, NULL, &receiverCallbackT, NULL, &dispatcherCallbackT, NULL, handle);
+ }
+
+ virtual ~CAmSerializer(){}
+};
+} /* namespace am */
+#endif /* CAMSERIALIZER_H_ */
diff --git a/includes/audiomanagertypes.h b/includes/audiomanagertypes.h
index f1bd542..2d9b883 100644
--- a/includes/audiomanagertypes.h
+++ b/includes/audiomanagertypes.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \date 20-Oct-2011 3:42:04 PM
-* \author Christian Mueller (christian.ei.mueller@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
-*
-* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
-* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
-* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
-* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
-* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
-* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
-#if !defined(EA_6D2D8AED_B7CC_424e_8C3F_EB10C5EBDC21__INCLUDED_)
-#define EA_6D2D8AED_B7CC_424e_8C3F_EB10C5EBDC21__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_5B7FFAAE_6D10_4b76_8E0F_E8060678C777__INCLUDED_)
+#define EA_5B7FFAAE_6D10_4b76_8E0F_E8060678C777__INCLUDED_
#include <stdint.h>
#include "projecttypes.h"
@@ -34,152 +29,65 @@
namespace am {
/**
- * This is the domain type. Each domain has a unique identifier.
- *
- * \mainpage
- * Copyright Copyright (C) 2011,2012 BMW AG
- *
- * \date 21.2.2012
- *
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
- *
- * \par About AudioManagerInterfaces
- * 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.
- *
- * \par More information
- * can be found at https://collab.genivi.org/wiki/display/genivi/GENIVI+Home \n \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 21-Feb-2012 4:58:31 PM
+ * a domain ID
+ * @author Christian Mueller
+ * @created 27-Feb-2012 6:57:27 PM
*/
typedef uint16_t am_domainID_t;
/**
+ * a source ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:27 PM
*/
typedef uint16_t am_sourceID_t;
/**
+ * a sink ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:27 PM
*/
typedef uint16_t am_sinkID_t;
/**
+ * a gateway ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:27 PM
*/
typedef uint16_t am_gatewayID_t;
/**
+ * a crossfader ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_crossfaderID_t;
/**
+ * a connection ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_connectionID_t;
/**
+ * a mainConnection ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_mainConnectionID_t;
/**
+ * speed
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_speed_t;
/**
* The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE). The minimum and maximum can be limited by actual project.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef int16_t am_volume_t;
@@ -187,40 +95,40 @@ namespace am {
* 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.
* The range of this type is customer specific.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef int16_t am_mainVolume_t;
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_sourceClass_t;
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_sinkClass_t;
/**
* time in ms!
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_time_t;
/**
* offset time that is introduced in milli seconds.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef int16_t am_timeSync_t;
/**
* with the help of this enum, sinks and sources can report their availability state
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_Availablility_e
{
@@ -242,7 +150,7 @@ namespace am {
/**
* represents the connection state
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_ConnectionState_e
{
@@ -272,7 +180,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_DomainState_e
{
@@ -298,7 +206,7 @@ namespace am {
/**
* This enum characterizes the data of the EarlyData_t
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_EarlyDataType_e
{
@@ -328,7 +236,7 @@ namespace am {
/**
* the errors of the audiomanager. All possible errors are in here. This enum is used widely as return parameter.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_Error_e
{
@@ -381,7 +289,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_MuteState_e
{
@@ -403,7 +311,7 @@ namespace am {
/**
* The source state reflects the state of the source
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_SourceState_e
{
@@ -426,7 +334,7 @@ namespace am {
/**
* This enumeration is used to define the type of the action that is correlated to a handle.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_Handle_e
{
@@ -446,7 +354,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_InterruptState_e
{
@@ -468,7 +376,7 @@ namespace am {
/**
* describes the active sink of a crossfader.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_HotSink_e
{
@@ -494,7 +402,7 @@ namespace am {
/**
* this describes the availability of a sink or a source together with the latest change
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
struct am_Availability_s
{
@@ -513,7 +421,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
struct am_ClassProperty_s
{
@@ -526,7 +434,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
struct am_Crossfader_s
{
@@ -543,7 +451,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
struct am_Gateway_s
{
@@ -583,7 +491,7 @@ namespace am {
/**
* This represents one "hopp" in a route
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
struct am_RoutingElement_s
{
@@ -598,7 +506,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_Route_s
{
@@ -612,7 +520,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SoundProperty_s
{
@@ -625,7 +533,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SystemProperty_s
{
@@ -644,7 +552,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SinkClass_s
{
@@ -658,7 +566,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SourceClass_s
{
@@ -676,7 +584,7 @@ namespace am {
/**
* this type holds all information of sources relevant to the HMI
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SourceType_s
{
@@ -692,7 +600,7 @@ namespace am {
/**
* this type holds all information of sinks relevant to the HMI
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SinkType_s
{
@@ -709,7 +617,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_Handle_s
{
@@ -722,7 +630,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_MainSoundProperty_s
{
@@ -736,7 +644,7 @@ namespace am {
/**
* this type holds all information of connections relevant to the HMI
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_MainConnectionType_s
{
@@ -752,7 +660,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_MainConnection_s
{
@@ -775,7 +683,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_Sink_s
{
@@ -798,7 +706,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_Source_s
{
@@ -830,7 +738,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_Domain_s
{
@@ -848,7 +756,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
struct am_Connection_s
{
@@ -867,7 +775,7 @@ namespace am {
* volume_t in case of ED_SOURCE_VOLUME, ED_SINK_VOLUME
* soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
union am_EarlyData_u
{
@@ -883,7 +791,7 @@ namespace am {
* sourceID in case of ED_SOURCE_VOLUME, ED_SOURCE_PROPERTY
* sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
union am_DataType_u
{
@@ -896,7 +804,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
struct am_EarlyData_s
{
@@ -908,4 +816,4 @@ namespace am {
};
}
-#endif // !defined(EA_6D2D8AED_B7CC_424e_8C3F_EB10C5EBDC21__INCLUDED_)
+#endif // !defined(EA_5B7FFAAE_6D10_4b76_8E0F_E8060678C777__INCLUDED_)
diff --git a/includes/command/CommandReceiveInterface.h b/includes/command/CommandReceiveInterface.h
index b07ef2e..2e79f44 100644
--- a/includes/command/CommandReceiveInterface.h
+++ b/includes/command/CommandReceiveInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \date 20-Oct-2011 3:42:04 PM
-* \author Christian Mueller (christian.ei.mueller@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
-*
-* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
-* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
-* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
-* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
-* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
-* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
-#if !defined(EA_241FAB0A_6108_4f68_8AAD_F2218B1C41D9__INCLUDED_)
-#define EA_241FAB0A_6108_4f68_8AAD_F2218B1C41D9__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_7F5A2204_92A2_4006_80F8_099931A426CE__INCLUDED_)
+#define EA_7F5A2204_92A2_4006_80F8_099931A426CE__INCLUDED_
#include <vector>
#include <string>
@@ -34,16 +29,17 @@ class SocketHandler;
}
-#define CommandReceiveVersion 1.0
+#define CommandReceiveVersion "1.0"
namespace am {
/**
* The interface towards the Controlling Instance (e.g HMI). It handles the communication towards the HMI and other system components who need to interact with the audiomanagement.
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
class CommandReceiveInterface
{
@@ -202,9 +198,23 @@ namespace am {
virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) const =0;
/**
* This function returns the version of the interface.
+ *
+ * @param version
+ */
+ virtual void getInterfaceVersion(std::string& version) const =0;
+ /**
+ * asynchronous confirmation of setCommandReady.
+ *
+ * @param handle the handle that was handed over by setCommandReady
+ */
+ virtual void confirmCommandReady(const uint16_t handle) =0;
+ /**
+ * asynchronous confirmation of setCommandRundown
+ *
+ * @param handle the handle that was given via setCommandRundown
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void confirmCommandRundown(const uint16_t handle) =0;
};
}
-#endif // !defined(EA_241FAB0A_6108_4f68_8AAD_F2218B1C41D9__INCLUDED_)
+#endif // !defined(EA_7F5A2204_92A2_4006_80F8_099931A426CE__INCLUDED_)
diff --git a/includes/command/CommandSendInterface.h b/includes/command/CommandSendInterface.h
index f8c47be..e5135df 100644
--- a/includes/command/CommandSendInterface.h
+++ b/includes/command/CommandSendInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \date 20-Oct-2011 3:42:04 PM
-* \author Christian Mueller (christian.ei.mueller@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
-*
-* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
-* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
-* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
-* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
-* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
-* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
-#if !defined(EA_A230EB7E_1719_4470_BCC6_12B0606A80E6__INCLUDED_)
-#define EA_A230EB7E_1719_4470_BCC6_12B0606A80E6__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_78C60EC5_4114_41a8_BE01_4911668CE1C1__INCLUDED_)
+#define EA_78C60EC5_4114_41a8_BE01_4911668CE1C1__INCLUDED_
#include <vector>
#include <string>
@@ -35,16 +30,17 @@ class CommandReceiveInterface;
#include "CommandReceiveInterface.h"
-#define CommandSendVersion 1.0
+#define CommandSendVersion "1.0"
namespace am {
/**
* This interface handles all communication from the AudioManagerDaemon towards the system. It is designed in such a way that only callbacks with no return types are implemented. So when the CommandInterfacePlugins are designed in such a way that they broadcast signals to any node who is interested in the particular information (like signals on Dbus for example), more information can be retrieved via the CommandReceiveInterface.
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:36 PM
+ * @created 27-Feb-2012 6:57:32 PM
*/
class CommandSendInterface
{
@@ -60,36 +56,62 @@ namespace am {
/**
* This command starts the interface, the plugin itself. This is not meant to start communication with the HMI itself. It is a good idea to implement here everything that sets up the basic communication like DbusCommunication etc...
+ * Be aware of side effects with systemd and socketbased communication!
* @return E_OK on success, E_UNKNOWN on error
*
* @param commandreceiveinterface pointer to the receive interface. Is used to call the audiomanagerdaemon
*/
virtual am_Error_e startupInterface(CommandReceiveInterface* commandreceiveinterface) =0;
/**
- * This command stops the interface before the plugin is unloaded.
- * @return E_OK on success, E_UNKNOWN on error
+ * This function will indirectly be called by the Controller and is used to start the Communication. Before this command, all communication will be ignored by the AudioManager.
+ * After the Plugin is ready, it will asynchronously answer with condfirmCommandReady, the handle that is handed over must be returned.
+ *
+ * @param handle the handle uniquely idenfies the request
*/
- virtual am_Error_e stopInterface() =0;
+ virtual void setCommandReady(const uint16_t handle) =0;
/**
- * This callback is fired when the Interface is ready to be used. Before this command, all communication will be ignored by the Audiomanager
+ * This function will indirectly be called by the Controller and is used to stop the Communication. After this command, all communication will be ignored by the AudioManager. The plugin has to be prepared that either the power will be switched off or the Interface is started again with setCommandReady
+ * After the Plugin is ready to rundown, it will asynchronously answer with condfirmCommandRundown, the handle that is handed over must be returned.
+ *
+ * @param handle This handle uniquly idenfies the request
*/
- virtual am_Error_e cbCommunicationReady() =0;
+ virtual void setCommandRundown(const uint16_t handle) =0;
/**
- * This callback is fired when the AudioManager is about to rundown. After this command no more action will be carried out by the AudioManager.
+ * Callback that is called when the number of connections change
+ *
+ * @param mainConnection
*/
- virtual am_Error_e cbCommunicationRundown() =0;
+ virtual void cbNewMainConnection(const am_MainConnectionType_s mainConnection) =0;
/**
* Callback that is called when the number of connections change
+ *
+ * @param mainConnection
+ */
+ virtual void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection) =0;
+ /**
+ * Callback that is called when the number of sinks change
+ *
+ * @param sink
*/
- virtual void cbNumberOfMainConnectionsChanged() =0;
+ virtual void cbNewSink(const am_SinkType_s& sink) =0;
/**
* Callback that is called when the number of sinks change
+ *
+ * @param sinkID
*/
- virtual void cbNumberOfSinksChanged() =0;
+ virtual void cbRemovedSink(const am_sinkID_t sinkID) =0;
/**
* Callback that is called when the number of sources change
+ *
+ * @param source
*/
- virtual void cbNumberOfSourcesChanged() =0;
+ virtual void cbNewSource(const am_SourceType_s& source) =0;
+ /**
+ * Callback that is called when the number of sources change
+ *
+ * @param source
+ */
+ virtual void cbRemovedSource(const am_sourceID_t source) =0;
/**
* this callback is fired if the number of sink classes changed
*/
@@ -111,7 +133,7 @@ namespace am {
* @param sinkID
* @param soundProperty
*/
- virtual void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s soundProperty) =0;
+ virtual void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty) =0;
/**
* this callback indicates that a sourceSoundProperty has changed.
*
@@ -154,18 +176,19 @@ namespace am {
*/
virtual void cbSystemPropertyChanged(const am_SystemProperty_s& systemProperty) =0;
/**
- * CommandReceiveVer_0.0.9.
+ * This callback is fired if the timinginformation for a mainConnectionID changed
*
* @param mainConnectionID
* @param time
*/
virtual void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time) =0;
/**
- * This function returns the version of the interface
- * returns E_OK, E_UNKOWN if version is unknown.
+ * returns the interface version as string.
+ *
+ * @param version
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void getInterfaceVersion(std::string& version) const =0;
};
}
-#endif // !defined(EA_A230EB7E_1719_4470_BCC6_12B0606A80E6__INCLUDED_)
+#endif // !defined(EA_78C60EC5_4114_41a8_BE01_4911668CE1C1__INCLUDED_)
diff --git a/includes/control/ControlReceiveInterface.h b/includes/control/ControlReceiveInterface.h
index a3ec949..35bf977 100644
--- a/includes/control/ControlReceiveInterface.h
+++ b/includes/control/ControlReceiveInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \date 20-Oct-2011 3:42:04 PM
-* \author Christian Mueller (christian.ei.mueller@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
-*
-* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
-* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
-* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
-* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
-* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
-* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
-#if !defined(EA_E6BEDBFE_083F_4174_8B46_FDDAEE627EB3__INCLUDED_)
-#define EA_E6BEDBFE_083F_4174_8B46_FDDAEE627EB3__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_4782C934_9728_44b7_8F9A_D8FB838CF1A7__INCLUDED_)
+#define EA_4782C934_9728_44b7_8F9A_D8FB838CF1A7__INCLUDED_
#include <vector>
#include <string>
@@ -33,16 +28,17 @@ class SocketHandler;
}
-#define ControlReceiveVersion 1.0
+#define ControlReceiveVersion "1.0"
namespace am {
/**
* This interface gives access to all important functions of the audiomanager that are used by the AudioManagerController to control the system.
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:36 PM
+ * @created 27-Feb-2012 6:57:32 PM
*/
class ControlReceiveInterface
{
@@ -576,22 +572,30 @@ namespace am {
*/
virtual am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const =0;
/**
- * sets the command interface to ready
+ * sets the command interface to ready. Will send setCommandReady to each of the plugins. The corresponding answer is confirmCommandReady.
*/
virtual void setCommandReady() =0;
/**
- * sets the command interface into the rundown state
+ * sets the command interface into the rundown state. Will send setCommandRundown to each of the plugins. The corresponding answer is confirmCommandRundown.
*/
virtual void setCommandRundown() =0;
/**
- * sets the routinginterface to ready.
+ * sets the routinginterface to ready. Will send the command setRoutingReady to each of the plugins. The related answer is confirmRoutingReady.
*/
virtual void setRoutingReady() =0;
/**
- * sets the routinginterface to the rundown state
+ * sets the routinginterface to the rundown state. Will send the command setRoutingRundown to each of the plugins. The related answer is confirmRoutingRundown.
*/
virtual void setRoutingRundown() =0;
/**
+ * acknowledges the setControllerReady call.
+ */
+ virtual void confirmControllerReady() =0;
+ /**
+ * acknowledges the setControllerRundown call.
+ */
+ virtual void confirmControllerRundown() =0;
+ /**
* This function returns the pointer to the socketHandler. This can be used to integrate socket-based activites like communication with the mainloop of the AudioManager.
* returns E_OK if pointer is valid, E_UNKNOWN in case AudioManager was compiled without socketHandler support,
*
@@ -600,9 +604,11 @@ namespace am {
virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) =0;
/**
* This function returns the version of the interface
+ *
+ * @param version
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void getInterfaceVersion(std::string& version) const =0;
};
}
-#endif // !defined(EA_E6BEDBFE_083F_4174_8B46_FDDAEE627EB3__INCLUDED_)
+#endif // !defined(EA_4782C934_9728_44b7_8F9A_D8FB838CF1A7__INCLUDED_)
diff --git a/includes/control/ControlSendInterface.h b/includes/control/ControlSendInterface.h
index 79aeb71..4857dd0 100644
--- a/includes/control/ControlSendInterface.h
+++ b/includes/control/ControlSendInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \date 20-Oct-2011 3:42:04 PM
-* \author Christian Mueller (christian.ei.mueller@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
-*
-* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
-* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
-* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
-* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
-* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
-* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
-#if !defined(EA_71CB967F_6C92_467f_99BE_B9F5210165C2__INCLUDED_)
-#define EA_71CB967F_6C92_467f_99BE_B9F5210165C2__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_453737DF_D0F3_4dda_8960_2B6C2FE2297F__INCLUDED_)
+#define EA_453737DF_D0F3_4dda_8960_2B6C2FE2297F__INCLUDED_
#include <vector>
#include <string>
@@ -33,17 +28,18 @@ namespace am {
class ControlReceiveInterface;
}
-#define ControlSendVersion 1.0
+#define ControlSendVersion "1.0"
namespace am {
/**
* This interface is presented by the AudioManager controller.
* All the hooks represent system events that need to be handled. The callback functions are used to handle for example answers to function calls on the AudioManagerCoreInterface.
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:37 PM
+ * @created 27-Feb-2012 6:57:33 PM
*/
class ControlSendInterface
{
@@ -64,13 +60,13 @@ namespace am {
*/
virtual am_Error_e startupController(ControlReceiveInterface* controlreceiveinterface) =0;
/**
- * stops the controller
+ * this message is used tell the controller that it should get ready. This message must be acknowledged via confirmControllerReady.
*/
- virtual am_Error_e stopController() =0;
+ virtual void setControllerReady() =0;
/**
- * This hook is fired when all plugins have been loaded.
+ * this message tells the controller that he should prepare everything for the power to be switched off. This message must be acknowledged via confirmControllerRundown.
*/
- virtual void hookAllPluginsLoaded() =0;
+ virtual void setControllerRundown() =0;
/**
* is called when a connection request comes in via the command interface
* @return E_OK on success, E_NOT_POSSIBLE on error, E_ALREADY_EXISTENT if already exists
@@ -366,9 +362,27 @@ namespace am {
/**
* This function returns the version of the interface
* returns E_OK, E_UNKOWN if version is unknown.
+ *
+ * @param version
+ */
+ virtual void getInterfaceVersion(std::string& version) const =0;
+ /**
+ * confirms the setCommandReady call
+ */
+ virtual void confirmCommandReady() =0;
+ /**
+ * confirms the setRoutingReady call
+ */
+ virtual void confirmRoutingReady() =0;
+ /**
+ * confirms the setCommandRundown call
+ */
+ virtual void confirmCommandRundown() =0;
+ /**
+ * confirms the setRoutingRundown command
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void confirmRoutingRundown() =0;
};
}
-#endif // !defined(EA_71CB967F_6C92_467f_99BE_B9F5210165C2__INCLUDED_)
+#endif // !defined(EA_453737DF_D0F3_4dda_8960_2B6C2FE2297F__INCLUDED_)
diff --git a/includes/projecttypes.h b/includes/projecttypes.h
index dd55451..b480070 100644
--- a/includes/projecttypes.h
+++ b/includes/projecttypes.h
@@ -1,35 +1,30 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \date 20-Oct-2011 3:42:04 PM
-* \author Christian Mueller (christian.ei.mueller@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
-*
-* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
-* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
-* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
-* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
-* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
-* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
-#if !defined(EA_8A329625_1F6F_478f_A704_D5359425FB4E__INCLUDED_)
-#define EA_8A329625_1F6F_478f_A704_D5359425FB4E__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_2597AEAA_55EC_440a_8189_04DF7389A1AD__INCLUDED_)
+#define EA_2597AEAA_55EC_440a_8189_04DF7389A1AD__INCLUDED_
namespace am {
/**
* This enum classifies the format in which data is exchanged within a connection. The enum itself is project specific although there are some Genivi standard formats defined.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_ConnectionFormat_e
{
@@ -59,7 +54,7 @@ namespace am {
/**
* This enum gives the information about reason for reason for Source/Sink change
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_AvailabilityReason_e
{
@@ -97,7 +92,7 @@ namespace am {
/**
* product specific identifier of property
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_ClassProperty_e
{
@@ -120,7 +115,7 @@ namespace am {
* The given ramp types here are just a possiblity. for products, different ramp types can be defined here.
* It is in the responsibility of the product to make sure that the routing plugins are aware of the ramp types used.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_RampType_e
{
@@ -142,7 +137,7 @@ namespace am {
/**
* sound properties. Within genivi only the standard properties are defined, for products these need to be extended.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_SoundPropertyType_e
{
@@ -168,7 +163,7 @@ namespace am {
/**
* Here are all SoundProperties that can be set via the CommandInterface. Product specific
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_MainSoundPropertyType_e
{
@@ -194,7 +189,7 @@ namespace am {
/**
* describes the different system properties. Project specific
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_SystemPropertyType_e
{
@@ -205,4 +200,4 @@ namespace am {
SYP_MAX
};
}
-#endif // !defined(EA_8A329625_1F6F_478f_A704_D5359425FB4E__INCLUDED_)
+#endif // !defined(EA_2597AEAA_55EC_440a_8189_04DF7389A1AD__INCLUDED_)
diff --git a/includes/routing/RoutingReceiveInterface.h b/includes/routing/RoutingReceiveInterface.h
index f9df264..b9d6f34 100644
--- a/includes/routing/RoutingReceiveInterface.h
+++ b/includes/routing/RoutingReceiveInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \date 20-Oct-2011 3:42:04 PM
-* \author Christian Mueller (christian.ei.mueller@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
-*
-* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
-* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
-* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
-* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
-* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
-* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
-#if !defined(EA_3F1137F5_C65B_42b9_A805_A65B61A04AA1__INCLUDED_)
-#define EA_3F1137F5_C65B_42b9_A805_A65B61A04AA1__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_1872FCAA_4ACA_4547_ABD0_F0CC01DE516C__INCLUDED_)
+#define EA_1872FCAA_4ACA_4547_ABD0_F0CC01DE516C__INCLUDED_
#include <vector>
#include <string>
@@ -35,16 +30,17 @@ class SocketHandler;
}
-#define RoutingReceiveVersion 1.0
+#define RoutingReceiveVersion "1.0"
namespace am {
/**
* Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:37 PM
+ * @created 27-Feb-2012 6:57:33 PM
*/
class RoutingReceiveInterface
{
@@ -330,9 +326,23 @@ namespace am {
virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) const =0;
/**
* This function returns the version of the interface
+ *
+ * @param version retrieves the verison of the interface
+ */
+ virtual void getInterfaceVersion(std::string& version) const =0;
+ /**
+ * confirms the setRoutingReady Command
+ *
+ * @param handle the handle that was given via setRoutingReady
+ */
+ virtual void confirmRoutingReady(const uint16_t handle) const =0;
+ /**
+ * confirms the setRoutingRundown Command
+ *
+ * @param handle handle that was given via setRoutingRundown
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void confirmRoutingRundown(const uint16_t handle) const =0;
};
}
-#endif // !defined(EA_3F1137F5_C65B_42b9_A805_A65B61A04AA1__INCLUDED_)
+#endif // !defined(EA_1872FCAA_4ACA_4547_ABD0_F0CC01DE516C__INCLUDED_)
diff --git a/includes/routing/RoutingSendInterface.h b/includes/routing/RoutingSendInterface.h
index b126c56..0f07022 100644
--- a/includes/routing/RoutingSendInterface.h
+++ b/includes/routing/RoutingSendInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \date 20-Oct-2011 3:42:04 PM
-* \author Christian Mueller (christian.ei.mueller@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
-*
-* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
-* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
-* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
-* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
-* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
-* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
-#if !defined(EA_E6EBF9D0_B241_44f2_AABB_8DAE02D74E88__INCLUDED_)
-#define EA_E6EBF9D0_B241_44f2_AABB_8DAE02D74E88__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_C3949186_203B_474d_AD8F_42D39FB00FFA__INCLUDED_)
+#define EA_C3949186_203B_474d_AD8F_42D39FB00FFA__INCLUDED_
#include <vector>
#include <string>
@@ -35,16 +30,17 @@ class RoutingReceiveInterface;
#include "RoutingReceiveInterface.h"
-#define RoutingSendVersion 1.0
+#define RoutingSendVersion "1.0"
namespace am {
/**
* This class implements everything from Audiomanager -> RoutingAdapter
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:37 PM
+ * @created 27-Feb-2012 6:57:33 PM
*/
class RoutingSendInterface
{
@@ -63,15 +59,19 @@ namespace am {
*
* @param routingreceiveinterface pointer to the receive interface
*/
- virtual void startupRoutingInterface(RoutingReceiveInterface* routingreceiveinterface) =0;
+ virtual am_Error_e startupInterface(RoutingReceiveInterface* routingreceiveinterface) =0;
/**
- * indicates that the interface is now ready to be used. Should be used as trigger to register all sinks, sources, etc...
+ * indicates that the routing now ready to be used. Should be used as trigger to register all sinks, sources, etc...
+ *
+ * @param handle handle that uniquely identifies the request
*/
- virtual void routingInterfacesReady() =0;
+ virtual void setRoutingReady(const uint16_t handle) =0;
/**
- * is used to indicate the rundown of the system
+ * indicates that the routing plugins need to be prepared to switch the power off or be ready again.
+ *
+ * @param handle the handle that uniquely identifies the request
*/
- virtual void routingInterfacesRundown() =0;
+ virtual void setRoutingRundown(const uint16_t handle) =0;
/**
* aborts an asynchronous action.
* @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if handle was not found
@@ -194,9 +194,11 @@ namespace am {
virtual am_Error_e returnBusName(std::string& BusName) const =0;
/**
* This function returns the version of the interface
+ *
+ * @param version
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void getInterfaceVersion(std::string& version) const =0;
};
}
-#endif // !defined(EA_E6EBF9D0_B241_44f2_AABB_8DAE02D74E88__INCLUDED_)
+#endif // !defined(EA_C3949186_203B_474d_AD8F_42D39FB00FFA__INCLUDED_)