summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/include
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-01-24 17:04:42 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2012-01-24 17:04:42 +0100
commit4fe50302a695c625d5161b538da771b2c36bd33e (patch)
tree79d9fb949d626b19ac0d933a637b4881af31114e /AudioManagerDaemon/include
parent80213f17291e5b58c733de09f06439d71640d2e2 (diff)
downloadaudiomanager-4fe50302a695c625d5161b538da771b2c36bd33e.tar.gz
* formatting all the source code with eclipse source code style
* added used xml to the project
Diffstat (limited to 'AudioManagerDaemon/include')
-rw-r--r--AudioManagerDaemon/include/CommandReceiver.h106
-rw-r--r--AudioManagerDaemon/include/CommandSender.h100
-rw-r--r--AudioManagerDaemon/include/ControlReceiver.h195
-rw-r--r--AudioManagerDaemon/include/ControlSender.h145
-rw-r--r--AudioManagerDaemon/include/DatabaseHandler.h449
-rw-r--r--AudioManagerDaemon/include/DatabaseObserver.h106
-rw-r--r--AudioManagerDaemon/include/PluginTemplate.h142
-rw-r--r--AudioManagerDaemon/include/RoutingReceiver.h142
-rw-r--r--AudioManagerDaemon/include/RoutingSender.h307
-rw-r--r--AudioManagerDaemon/include/TelnetServer.h122
10 files changed, 915 insertions, 899 deletions
diff --git a/AudioManagerDaemon/include/CommandReceiver.h b/AudioManagerDaemon/include/CommandReceiver.h
index 114d075..1d00216 100644
--- a/AudioManagerDaemon/include/CommandReceiver.h
+++ b/AudioManagerDaemon/include/CommandReceiver.h
@@ -1,26 +1,26 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file CommandReveiver.h
-*
-* \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.
-*
-*/
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file CommandReveiver.h
+ *
+ * \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.
+ *
+ */
#ifndef COMMANDRECEIVER_H_
#define COMMANDRECEIVER_H_
@@ -28,7 +28,8 @@
#include <command/CommandReceiveInterface.h>
#include <config.h>
-namespace am {
+namespace am
+{
class DatabaseHandler;
class ControlSender;
@@ -38,38 +39,39 @@ class SocketHandler;
/**
* This class realizes the command Interface
*/
-class CommandReceiver: public CommandReceiveInterface {
+class CommandReceiver: public CommandReceiveInterface
+{
public:
- CommandReceiver(DatabaseHandler* iDatabaseHandler, ControlSender* iControlSender,DBusWrapper* iDBusWrapper);
- CommandReceiver(DatabaseHandler* iDatabaseHandler, ControlSender* iControlSender,SocketHandler* iSocketHandler);
- CommandReceiver(DatabaseHandler* iDatabaseHandler, ControlSender* iControlSender,SocketHandler* iSocketHandler,DBusWrapper* iDBusWrapper);
- virtual ~CommandReceiver();
- am_Error_e connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID) ;
- am_Error_e disconnect(const am_mainConnectionID_t mainConnectionID) ;
- am_Error_e setVolume(const am_sinkID_t sinkID, const am_mainVolume_t volume) ;
- am_Error_e volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep) ;
- am_Error_e setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState) ;
- am_Error_e setMainSinkSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID) ;
- am_Error_e setMainSourceSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID) ;
- am_Error_e setSystemProperty(const am_SystemProperty_s& property) ;
- am_Error_e getListMainConnections(std::vector<am_MainConnectionType_s>& listConnections) const ;
- am_Error_e getListMainSinks(std::vector<am_SinkType_s>& listMainSinks) const ;
- am_Error_e getListMainSources(std::vector<am_SourceType_s>& listMainSources) const ;
- am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties) const ;
- am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties) const ;
- am_Error_e getListSourceClasses(std::vector<am_SourceClass_s>& listSourceClasses) const ;
- am_Error_e getListSinkClasses(std::vector<am_SinkClass_s>& listSinkClasses) const ;
- am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const ;
- 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;
+ CommandReceiver(DatabaseHandler* iDatabaseHandler, ControlSender* iControlSender, DBusWrapper* iDBusWrapper);
+ CommandReceiver(DatabaseHandler* iDatabaseHandler, ControlSender* iControlSender, SocketHandler* iSocketHandler);
+ CommandReceiver(DatabaseHandler* iDatabaseHandler, ControlSender* iControlSender, SocketHandler* iSocketHandler, DBusWrapper* iDBusWrapper);
+ virtual ~CommandReceiver();
+ am_Error_e connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID);
+ am_Error_e disconnect(const am_mainConnectionID_t mainConnectionID);
+ am_Error_e setVolume(const am_sinkID_t sinkID, const am_mainVolume_t volume);
+ am_Error_e volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep);
+ am_Error_e setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState);
+ am_Error_e setMainSinkSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID);
+ am_Error_e setMainSourceSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID);
+ am_Error_e setSystemProperty(const am_SystemProperty_s& property);
+ am_Error_e getListMainConnections(std::vector<am_MainConnectionType_s>& listConnections) const;
+ am_Error_e getListMainSinks(std::vector<am_SinkType_s>& listMainSinks) const;
+ am_Error_e getListMainSources(std::vector<am_SourceType_s>& listMainSources) const;
+ am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties) const;
+ am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties) const;
+ am_Error_e getListSourceClasses(std::vector<am_SourceClass_s>& listSourceClasses) const;
+ am_Error_e getListSinkClasses(std::vector<am_SinkClass_s>& listSinkClasses) const;
+ am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const;
+ 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;
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
+ 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
};
}
diff --git a/AudioManagerDaemon/include/CommandSender.h b/AudioManagerDaemon/include/CommandSender.h
index 5a412f3..a3898dc 100644
--- a/AudioManagerDaemon/include/CommandSender.h
+++ b/AudioManagerDaemon/include/CommandSender.h
@@ -1,26 +1,26 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file CommandSender.h
-*
-* \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.
-*
-*/
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file CommandSender.h
+ *
+ * \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.
+ *
+ */
#ifndef COMMANDSENDER_H_
#define COMMANDSENDER_H_
@@ -31,42 +31,44 @@
#include "command/CommandSendInterface.h"
-namespace am {
+namespace am
+{
/**
* This class is used to send data to the CommandInterface.
* All loaded plugins will be called when a callback is invoked.
*/
-class CommandSender {
+class CommandSender
+{
public:
- CommandSender(const std::vector<std::string>& listOfPluginDirectories);
- virtual ~CommandSender();
- am_Error_e startupInterface(CommandReceiveInterface* commandreceiveinterface) ;
- am_Error_e stopInterface() ;
- void cbCommunicationReady() ;
- void 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 mainConnection, const am_timeSync_t time) ;
- uint16_t getInterfaceVersion() const;
+ CommandSender(const std::vector<std::string>& listOfPluginDirectories);
+ virtual ~CommandSender();
+ am_Error_e startupInterface(CommandReceiveInterface* commandreceiveinterface);
+ am_Error_e stopInterface();
+ void cbCommunicationReady();
+ void 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 mainConnection, const am_timeSync_t time);
+ uint16_t getInterfaceVersion() const;
#ifdef UNIT_TEST
- friend class CommandInterfaceBackdoor; //this is to get access to the loaded plugins and be able to exchange the interfaces
+ friend class CommandInterfaceBackdoor; //this is to get access to the loaded plugins and be able to exchange the interfaces
#endif
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.
+ 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.
};
}
diff --git a/AudioManagerDaemon/include/ControlReceiver.h b/AudioManagerDaemon/include/ControlReceiver.h
index a8afb79..ac2168c 100644
--- a/AudioManagerDaemon/include/ControlReceiver.h
+++ b/AudioManagerDaemon/include/ControlReceiver.h
@@ -1,26 +1,26 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file ControlReceiver.h
-*
-* \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.
-*
-*/
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file ControlReceiver.h
+ *
+ * \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.
+ *
+ */
#ifndef CONTRONLRECEIVER_H_
#define CONTRONLRECEIVER_H_
@@ -28,8 +28,8 @@
#include <control/ControlReceiveInterface.h>
#include <config.h>
-
-namespace am {
+namespace am
+{
class SocketHandler;
class DatabaseHandler;
@@ -39,82 +39,83 @@ class CommandSender;
/**
* This class is used to receive all commands from the control interface
*/
-class ControlReceiver: public ControlReceiveInterface {
+class ControlReceiver: public ControlReceiveInterface
+{
public:
- ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender, SocketHandler *iSocketHandler);
- ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender);
- virtual ~ControlReceiver();
- am_Error_e getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s>& returnList) ;
- 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 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 setSourceSoundProperties(am_Handle_s& handle, const am_sourceID_t sourceID, const std::vector<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 enterSystemPropertiesListDB(const std::vector<am_SystemProperty_s>& listSystemProperties) ;
- am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s& route) ;
- am_Error_e changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState) ;
- am_Error_e changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID) ;
- am_Error_e changeSinkAvailabilityDB(const am_Availability_s& availability, const am_sinkID_t sinkID) ;
- am_Error_e changDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID) ;
- am_Error_e changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID) ;
- am_Error_e changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID) ;
- 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) ;
- am_Error_e removeGatewayDB(const am_gatewayID_t gatewayID) ;
- am_Error_e removeCrossfaderDB(const am_crossfaderID_t crossfaderID) ;
- am_Error_e removeDomainDB(const am_domainID_t domainID) ;
- am_Error_e removeSinkClassDB(const am_sinkClass_t sinkClassID) ;
- am_Error_e removeSourceClassDB(const am_sourceClass_t sourceClassID) ;
- am_Error_e getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s& classInfo) const ;
- am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s& sinkClass) const ;
- am_Error_e getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s& gatewayData) const ;
- am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData) 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 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 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() ;
- am_Error_e getSocketHandler(SocketHandler*& socketHandler);
- uint16_t getInterfaceVersion() const;
+ ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender, SocketHandler *iSocketHandler);
+ ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender);
+ virtual ~ControlReceiver();
+ am_Error_e getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s>& returnList);
+ 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 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 setSourceSoundProperties(am_Handle_s& handle, const am_sourceID_t sourceID, const std::vector<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 enterSystemPropertiesListDB(const std::vector<am_SystemProperty_s>& listSystemProperties);
+ am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s& route);
+ am_Error_e changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState);
+ am_Error_e changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID);
+ am_Error_e changeSinkAvailabilityDB(const am_Availability_s& availability, const am_sinkID_t sinkID);
+ am_Error_e changDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID);
+ am_Error_e changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID);
+ am_Error_e changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID);
+ 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);
+ am_Error_e removeGatewayDB(const am_gatewayID_t gatewayID);
+ am_Error_e removeCrossfaderDB(const am_crossfaderID_t crossfaderID);
+ am_Error_e removeDomainDB(const am_domainID_t domainID);
+ am_Error_e removeSinkClassDB(const am_sinkClass_t sinkClassID);
+ am_Error_e removeSourceClassDB(const am_sourceClass_t sourceClassID);
+ am_Error_e getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s& classInfo) const;
+ am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s& sinkClass) const;
+ am_Error_e getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s& gatewayData) const;
+ am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData) 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 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 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();
+ am_Error_e getSocketHandler(SocketHandler*& socketHandler);
+ uint16_t getInterfaceVersion() const;
private:
- DatabaseHandler* mDatabaseHandler; //!< pointer tto the databasehandler
- RoutingSender* mRoutingSender; //!< pointer to the routing send interface.
- CommandSender* mCommandSender; //!< pointer to the command send interface
- SocketHandler* mSocketHandler; //!< pointer to the socketHandler
+ DatabaseHandler* mDatabaseHandler; //!< pointer tto the databasehandler
+ RoutingSender* mRoutingSender; //!< pointer to the routing send interface.
+ CommandSender* mCommandSender; //!< pointer to the command send interface
+ SocketHandler* mSocketHandler; //!< pointer to the socketHandler
};
}
diff --git a/AudioManagerDaemon/include/ControlSender.h b/AudioManagerDaemon/include/ControlSender.h
index 2134fa6..3021c3c 100644
--- a/AudioManagerDaemon/include/ControlSender.h
+++ b/AudioManagerDaemon/include/ControlSender.h
@@ -1,26 +1,26 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file ControlSender.h
-*
-* \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.
-*
-*/
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file ControlSender.h
+ *
+ * \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.
+ *
+ */
#ifndef CONTROLSENDER_H_
#define CONTROLSENDER_H_
@@ -31,64 +31,67 @@
#include "control/ControlSendInterface.h"
-namespace am {
+namespace am
+{
/**
* sends data to the commandInterface, takes the file of the library that needs to be loaded
*/
-class ControlSender {
+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) ;
- uint16_t getInterfaceVersion() const;
+ 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 std::vector<am_ConnectionFormat_e> listPossibleConnectionFormats, std::vector<am_ConnectionFormat_e>& listPrioConnectionFormats);
+ uint16_t getInterfaceVersion() const;
#ifdef UNIT_TEST
- friend class ControlInterfaceBackdoor;
+ friend class ControlInterfaceBackdoor;
#endif
private:
- void* mlibHandle; //!< pointer to the loaded control plugin interface
- ControlSendInterface* mController; //!< pointer to the ControlSend interface
+ void* mlibHandle; //!< pointer to the loaded control plugin interface
+ ControlSendInterface* mController; //!< pointer to the ControlSend interface
};
}
diff --git a/AudioManagerDaemon/include/DatabaseHandler.h b/AudioManagerDaemon/include/DatabaseHandler.h
index 65f4a64..5d1cac7 100644
--- a/AudioManagerDaemon/include/DatabaseHandler.h
+++ b/AudioManagerDaemon/include/DatabaseHandler.h
@@ -1,26 +1,26 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file Databasehandler.h
-*
-* \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.
-*
-*/
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file Databasehandler.h
+ *
+ * \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.
+ *
+ */
#ifndef DATABASEHANDLER_H_
#define DATABASEHANDLER_H_
@@ -29,14 +29,14 @@
#include <sqlite3.h>
#include <map>
-namespace am {
+namespace am
+{
class DatabaseObserver;
class RoutingTree;
class RoutingTreeItem;
#define DYNAMIC_ID_BOUNDARY 100 //!< the value below is reserved for staticIDs, the value above will be assigned to dynamically registered items
-
//todo: we do not have to create MainSoundProperty tables if visible = false.
//todo: check the enum values before entering & changing in the database.
//todo: change asserts for dynamic boundary checks into failure answers.#
@@ -50,223 +50,224 @@ class RoutingTreeItem;
/**
* This class handles and abstracts the database
*/
-class DatabaseHandler {
+class DatabaseHandler
+{
public:
- DatabaseHandler(std::string databasePath);
- virtual ~DatabaseHandler();
- 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 enterConnectionDB(const am_Connection_s& connection, am_connectionID_t& connectionID);
- 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 enterSystemProperties(const std::vector<am_SystemProperty_s>& listSystemProperties) ;
- am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s& route) ;
- am_Error_e changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState) ;
- am_Error_e changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID) ;
- am_Error_e changeSinkAvailabilityDB(const am_Availability_s& availability, const am_sinkID_t sinkID) ;
- am_Error_e changDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID) ;
- am_Error_e changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID) ;
- am_Error_e changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID) ;
- am_Error_e changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID) ;
- am_Error_e changeSourceSoundPropertyDB(const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID) ;
- am_Error_e changeSinkSoundPropertyDB(const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID) ;
- 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 changeDelayMainConnection(const am_timeSync_t & delay, const am_mainConnectionID_t & connectionID) ;
- am_Error_e changeSinkClassInfoDB(const am_SinkClass_s& sinkClass) ;
- am_Error_e changeSourceClassInfoDB(const am_SourceClass_s& sourceClass) ;
- am_Error_e changeConnectionTimingInformation(const am_connectionID_t connectionID, const am_timeSync_t delay) ;
- am_Error_e changeConnectionFinal(const am_connectionID_t connectionID) ;
- am_Error_e changeSourceState(const am_sourceID_t sourceID, const am_SourceState_e sourceState);
- am_Error_e changeSinkVolume(const am_sinkID_t sinkID, const am_volume_t volume);
- am_Error_e changeSourceVolume(const am_sourceID_t sourceID, const am_volume_t volume);
- am_Error_e changeCrossFaderHotSink(const am_crossfaderID_t crossfaderID,const am_HotSink_e hotsink);
- 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) ;
- am_Error_e removeGatewayDB(const am_gatewayID_t gatewayID) ;
- am_Error_e removeCrossfaderDB(const am_crossfaderID_t crossfaderID) ;
- am_Error_e removeDomainDB(const am_domainID_t domainID) ;
- am_Error_e removeSinkClassDB(const am_sinkClass_t sinkClassID) ;
- am_Error_e removeSourceClassDB(const am_sourceClass_t sourceClassID) ;
- am_Error_e removeConnection(const am_connectionID_t connectionID) ;
- am_Error_e getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s& classInfo) const ;
- am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s& sinkClass) const ;
- am_Error_e getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s& gatewayData) const ;
- am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData) const ;
- am_Error_e getSinkVolume(const am_sinkID_t sinkID, am_volume_t& volume) const;
- am_Error_e getSourceVolume(const am_sourceID_t sourceID, am_volume_t& volume) const;
- am_Error_e getSinkSoundPropertyValue(const am_sinkID_t sinkID, const am_SoundPropertyType_e propertyType, uint16_t& value) const ;
- am_Error_e getSourceSoundPropertyValue(const am_sourceID_t sourceID, const am_SoundPropertyType_e propertyType, uint16_t& value) 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 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 getListSourceClasses(std::vector<am_SourceClass_s>& listSourceClasses) 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 getListVisibleMainConnections(std::vector<am_MainConnectionType_s>& listConnections) const ;
- am_Error_e getListMainSinks(std::vector<am_SinkType_s>& listMainSinks) const ;
- am_Error_e getListMainSources(std::vector<am_SourceType_s>& listMainSources) const ;
- am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties) const ;
- am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties) const ;
- am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const ;
- am_Error_e getListSinkConnectionFormats(const am_sinkID_t sinkID, std::vector<am_ConnectionFormat_e> & listConnectionFormats) const ;
- am_Error_e getListSourceConnectionFormats(const am_sourceID_t sourceID, std::vector<am_ConnectionFormat_e> & listConnectionFormats) const ;
- am_Error_e getListGatewayConnectionFormats(const am_gatewayID_t gatewayID, std::vector<bool> & listConnectionFormat) const;
- am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const ;
- am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID) const;
- am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID) const;
- am_Error_e getSoureState(const am_sourceID_t sourceID, am_SourceState_e& sourceState) const;
- am_Error_e getDomainState(const am_domainID_t domainID, am_DomainState_e state) const;
- am_Error_e getRoutingTree(bool onlyfree, RoutingTree* tree, std::vector<RoutingTreeItem*>* flatTree);
- am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID);
- am_Error_e peekSink(const std::string& name, am_sinkID_t& sinkID);
- am_Error_e peekSource(const std::string& name, am_sourceID_t& sourceID);
- /**
- * checks for a certain mainConnection
- * @param mainConnectionID to be checked for
- * @return true if it exists
- */
- bool existMainConnection(const am_mainConnectionID_t mainConnectionID) const;
+ DatabaseHandler(std::string databasePath);
+ virtual ~DatabaseHandler();
+ 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 enterConnectionDB(const am_Connection_s& connection, am_connectionID_t& connectionID);
+ 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 enterSystemProperties(const std::vector<am_SystemProperty_s>& listSystemProperties);
+ am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s& route);
+ am_Error_e changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState);
+ am_Error_e changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID);
+ am_Error_e changeSinkAvailabilityDB(const am_Availability_s& availability, const am_sinkID_t sinkID);
+ am_Error_e changDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID);
+ am_Error_e changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID);
+ am_Error_e changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID);
+ am_Error_e changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID);
+ am_Error_e changeSourceSoundPropertyDB(const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID);
+ am_Error_e changeSinkSoundPropertyDB(const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID);
+ 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 changeDelayMainConnection(const am_timeSync_t & delay, const am_mainConnectionID_t & connectionID);
+ am_Error_e changeSinkClassInfoDB(const am_SinkClass_s& sinkClass);
+ am_Error_e changeSourceClassInfoDB(const am_SourceClass_s& sourceClass);
+ am_Error_e changeConnectionTimingInformation(const am_connectionID_t connectionID, const am_timeSync_t delay);
+ am_Error_e changeConnectionFinal(const am_connectionID_t connectionID);
+ am_Error_e changeSourceState(const am_sourceID_t sourceID, const am_SourceState_e sourceState);
+ am_Error_e changeSinkVolume(const am_sinkID_t sinkID, const am_volume_t volume);
+ am_Error_e changeSourceVolume(const am_sourceID_t sourceID, const am_volume_t volume);
+ am_Error_e changeCrossFaderHotSink(const am_crossfaderID_t crossfaderID, const am_HotSink_e hotsink);
+ 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);
+ am_Error_e removeGatewayDB(const am_gatewayID_t gatewayID);
+ am_Error_e removeCrossfaderDB(const am_crossfaderID_t crossfaderID);
+ am_Error_e removeDomainDB(const am_domainID_t domainID);
+ am_Error_e removeSinkClassDB(const am_sinkClass_t sinkClassID);
+ am_Error_e removeSourceClassDB(const am_sourceClass_t sourceClassID);
+ am_Error_e removeConnection(const am_connectionID_t connectionID);
+ am_Error_e getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s& classInfo) const;
+ am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s& sinkClass) const;
+ am_Error_e getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s& gatewayData) const;
+ am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData) const;
+ am_Error_e getSinkVolume(const am_sinkID_t sinkID, am_volume_t& volume) const;
+ am_Error_e getSourceVolume(const am_sourceID_t sourceID, am_volume_t& volume) const;
+ am_Error_e getSinkSoundPropertyValue(const am_sinkID_t sinkID, const am_SoundPropertyType_e propertyType, uint16_t& value) const;
+ am_Error_e getSourceSoundPropertyValue(const am_sourceID_t sourceID, const am_SoundPropertyType_e propertyType, uint16_t& value) 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 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 getListSourceClasses(std::vector<am_SourceClass_s>& listSourceClasses) 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 getListVisibleMainConnections(std::vector<am_MainConnectionType_s>& listConnections) const;
+ am_Error_e getListMainSinks(std::vector<am_SinkType_s>& listMainSinks) const;
+ am_Error_e getListMainSources(std::vector<am_SourceType_s>& listMainSources) const;
+ am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties) const;
+ am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties) const;
+ am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const;
+ am_Error_e getListSinkConnectionFormats(const am_sinkID_t sinkID, std::vector<am_ConnectionFormat_e> & listConnectionFormats) const;
+ am_Error_e getListSourceConnectionFormats(const am_sourceID_t sourceID, std::vector<am_ConnectionFormat_e> & listConnectionFormats) const;
+ am_Error_e getListGatewayConnectionFormats(const am_gatewayID_t gatewayID, std::vector<bool> & listConnectionFormat) const;
+ am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const;
+ am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID) const;
+ am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID) const;
+ am_Error_e getSoureState(const am_sourceID_t sourceID, am_SourceState_e& sourceState) const;
+ am_Error_e getDomainState(const am_domainID_t domainID, am_DomainState_e state) const;
+ am_Error_e getRoutingTree(bool onlyfree, RoutingTree* tree, std::vector<RoutingTreeItem*>* flatTree);
+ am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID);
+ am_Error_e peekSink(const std::string& name, am_sinkID_t& sinkID);
+ am_Error_e peekSource(const std::string& name, am_sourceID_t& sourceID);
+ /**
+ * checks for a certain mainConnection
+ * @param mainConnectionID to be checked for
+ * @return true if it exists
+ */
+ bool existMainConnection(const am_mainConnectionID_t mainConnectionID) const;
- /**
- * checks if a CrossFader exists
- * @param crossfaderID the ID of the crossfader to be checked
- * @return true if exists
- */
- bool existcrossFader(const am_crossfaderID_t crossfaderID) const;
+ /**
+ * checks if a CrossFader exists
+ * @param crossfaderID the ID of the crossfader to be checked
+ * @return true if exists
+ */
+ bool existcrossFader(const am_crossfaderID_t crossfaderID) const;
- /**
- * checks if a connection already exists.
- * Only takes sink, source and format information for search!
- * @param connection the connection to be checked
- * @return true if connections exists
- */
- bool existConnection(const am_Connection_s connection);
+ /**
+ * checks if a connection already exists.
+ * Only takes sink, source and format information for search!
+ * @param connection the connection to be checked
+ * @return true if connections exists
+ */
+ bool existConnection(const am_Connection_s connection);
- /**
- * checks if a connection with the given ID exists
- * @param connectionID
- * @return true if connection exits
- */
- bool existConnectionID(const am_connectionID_t connectionID);
- /**
- * checks for a certain Source
- * @param sourceID to be checked for
- * @return true if it exists
- */
- bool existSource(const am_sourceID_t sourceID) const;
+ /**
+ * checks if a connection with the given ID exists
+ * @param connectionID
+ * @return true if connection exits
+ */
+ bool existConnectionID(const am_connectionID_t connectionID);
+ /**
+ * checks for a certain Source
+ * @param sourceID to be checked for
+ * @return true if it exists
+ */
+ bool existSource(const am_sourceID_t sourceID) const;
- /**
- * checks if a source name or ID exists
- * @param sourceID the sourceID
- * @param name the name
- * @return true if it exits
- */
- bool existSourceNameOrID(const am_sourceID_t sourceID, const std::string& name) const;
+ /**
+ * checks if a source name or ID exists
+ * @param sourceID the sourceID
+ * @param name the name
+ * @return true if it exits
+ */
+ bool existSourceNameOrID(const am_sourceID_t sourceID, const std::string& name) const;
- /**
- * checks if a name exits
- * @param name the name
- * @return true if it exits
- */
- bool existSourceName(const std::string& name) const;
- /**
- * checks for a certain Sink
- * @param sinkID to be checked for
- * @return true if it exists
- */
- bool existSink(const am_sinkID_t sinkID) const;
+ /**
+ * checks if a name exits
+ * @param name the name
+ * @return true if it exits
+ */
+ bool existSourceName(const std::string& name) const;
+ /**
+ * checks for a certain Sink
+ * @param sinkID to be checked for
+ * @return true if it exists
+ */
+ bool existSink(const am_sinkID_t sinkID) const;
- /**
- * checks if a sink with the ID or the name exists
- * @param sinkID the ID
- * @param name the name
- * @return true if it exists.
- */
- bool existSinkNameOrID(const am_sinkID_t sinkID, const std::string& name) const;
+ /**
+ * checks if a sink with the ID or the name exists
+ * @param sinkID the ID
+ * @param name the name
+ * @return true if it exists.
+ */
+ bool existSinkNameOrID(const am_sinkID_t sinkID, const std::string& name) const;
- /**
- * checks if a sink with the name exists
- * @param name the name
- * @return true if it exists
- */
- bool existSinkName(const std::string& name) const;
+ /**
+ * checks if a sink with the name exists
+ * @param name the name
+ * @return true if it exists
+ */
+ bool existSinkName(const std::string& name) const;
- /**
- * checks for a certain domain
- * @param domainID to be checked for
- * @return true if it exists
- */
- bool existDomain(const am_domainID_t domainID) const;
+ /**
+ * checks for a certain domain
+ * @param domainID to be checked for
+ * @return true if it exists
+ */
+ bool existDomain(const am_domainID_t domainID) const;
- /**
- * checks for certain gateway
- * @param gatewayID to be checked for
- * @return true if it exists
- */
- bool existGateway(const am_gatewayID_t gatewayID) const;
+ /**
+ * checks for certain gateway
+ * @param gatewayID to be checked for
+ * @return true if it exists
+ */
+ bool existGateway(const am_gatewayID_t gatewayID) const;
- /**
- * checks for certain SinkClass
- * @param sinkClassID
- * @return true if it exists
- */
- bool existSinkClass(const am_sinkClass_t sinkClassID) const;
+ /**
+ * checks for certain SinkClass
+ * @param sinkClassID
+ * @return true if it exists
+ */
+ bool existSinkClass(const am_sinkClass_t sinkClassID) const;
- /**
- * checks for certain sourceClass
- * @param sourceClassID
- * @return true if it exists
- */
- bool existSourceClass(const am_sourceClass_t sourceClassID) const;
+ /**
+ * checks for certain sourceClass
+ * @param sourceClassID
+ * @return true if it exists
+ */
+ bool existSourceClass(const am_sourceClass_t sourceClassID) const;
- /**
- * registers the Observer at the Database
- * @param iObserver pointer to the observer
- */
- void registerObserver(DatabaseObserver *iObserver);
+ /**
+ * registers the Observer at the Database
+ * @param iObserver pointer to the observer
+ */
+ void registerObserver(DatabaseObserver *iObserver);
- /**
- * gives information about the visibility of a source
- * @param sourceID the sourceID
- * @return true if source is visible
- */
- bool sourceVisible(const am_sourceID_t sourceID) const;
+ /**
+ * gives information about the visibility of a source
+ * @param sourceID the sourceID
+ * @return true if source is visible
+ */
+ bool sourceVisible(const am_sourceID_t sourceID) const;
- /**
- * gives information about the visibility of a sink
- * @param sinkID the sinkID
- * @return true if source is visible
- */
- bool sinkVisible(const am_sinkID_t sinkID) const;
+ /**
+ * gives information about the visibility of a sink
+ * @param sinkID the sinkID
+ * @return true if source is visible
+ */
+ bool sinkVisible(const am_sinkID_t sinkID) const;
private:
- am_timeSync_t calculateMainConnectionDelay(const am_mainConnectionID_t mainConnectionID) const;
- bool sqQuery(const std::string& query);
- bool openDatabase(); //!< opens the database
- void createTables(); //!< creates all tables from the static table
- sqlite3 *mDatabase; //!< pointer to the database
- std::string mPath; //!< path to the database
- DatabaseObserver *mDatabaseObserver; //!< pointer to the Observer
- bool mFirstStaticSink;
- bool mFirstStaticSource;
- bool mFirstStaticGateway;
- bool mFirstStaticSinkClass;
- bool mFirstStaticSourceClass;
- typedef std::map<am_gatewayID_t,std::vector<bool> > ListConnectionFormat; //!< type for list of connection formats
- ListConnectionFormat mListConnectionFormat; //!< list of connection formats
+ am_timeSync_t calculateMainConnectionDelay(const am_mainConnectionID_t mainConnectionID) const;
+ bool sqQuery(const std::string& query);
+ bool openDatabase(); //!< opens the database
+ void createTables(); //!< creates all tables from the static table
+ sqlite3 *mDatabase; //!< pointer to the database
+ std::string mPath; //!< path to the database
+ DatabaseObserver *mDatabaseObserver; //!< pointer to the Observer
+ bool mFirstStaticSink;
+ bool mFirstStaticSource;
+ bool mFirstStaticGateway;
+ bool mFirstStaticSinkClass;
+ bool mFirstStaticSourceClass;
+ typedef std::map<am_gatewayID_t, std::vector<bool> > ListConnectionFormat; //!< type for list of connection formats
+ ListConnectionFormat mListConnectionFormat; //!< list of connection formats
};
}
diff --git a/AudioManagerDaemon/include/DatabaseObserver.h b/AudioManagerDaemon/include/DatabaseObserver.h
index f35defe..3ccdc0d 100644
--- a/AudioManagerDaemon/include/DatabaseObserver.h
+++ b/AudioManagerDaemon/include/DatabaseObserver.h
@@ -1,33 +1,34 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file DatabaseObserver.h
-*
-* \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.
-*
-*/
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file DatabaseObserver.h
+ *
+ * \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.
+ *
+ */
#ifndef DATABASEOBSERVER_H_
#define DATABASEOBSERVER_H_
#include <audiomanagertypes.h>
-namespace am {
+namespace am
+{
class TelnetServer;
class CommandSender;
@@ -35,37 +36,38 @@ class RoutingSender;
/**
* This class observes the Database and notifies other classes about important events, mainly the CommandSender.
*/
-class DatabaseObserver {
+class DatabaseObserver
+{
public:
- DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender);
- DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender,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 mainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState) ;
- 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) ;
- void volumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume) ;
- void sinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState) ;
- void systemPropertyChanged(const am_SystemProperty_s& SystemProperty) ;
- void timingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time) ;
+ DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender);
+ DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender, 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 mainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState);
+ 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);
+ void volumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume);
+ void sinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState);
+ void systemPropertyChanged(const am_SystemProperty_s& SystemProperty);
+ void timingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time);
private:
- CommandSender *mCommandSender; //!< pointer to the comandSender
- RoutingSender* mRoutingSender; //!< pointer to the routingSender
- TelnetServer* mTelnetServer; //!< pointer to the telnetserver
+ CommandSender *mCommandSender; //!< pointer to the comandSender
+ RoutingSender* mRoutingSender; //!< pointer to the routingSender
+ TelnetServer* mTelnetServer; //!< pointer to the telnetserver
};
}
diff --git a/AudioManagerDaemon/include/PluginTemplate.h b/AudioManagerDaemon/include/PluginTemplate.h
index cb5aa06..e677acf 100644
--- a/AudioManagerDaemon/include/PluginTemplate.h
+++ b/AudioManagerDaemon/include/PluginTemplate.h
@@ -1,26 +1,26 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file pluginTemplate.h
-*
-* \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.
-*
-*/
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file pluginTemplate.h
+ *
+ * \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.
+ *
+ */
#ifndef PLUGINTEMPLATE_H_
#define PLUGINTEMPLATE_H_
@@ -31,60 +31,62 @@
DLT_IMPORT_CONTEXT(AudioManager)
-namespace am {
+namespace am
+{
/**
* This template tries to load a library and cast ot to a class
* @param libname the full path to the library to be loaded
* @return returns the pointer to the class to be loaded
*/
-template<class T>T* getCreateFunction(const std::string& libname, void*& libraryHandle) {
-
- DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Trying to load libray with name: "),DLT_STRING(libname.c_str()));
-
- // cut off directories
- char* fileWithPath = const_cast<char*>(libname.c_str());
- std::string libFileName = basename(fileWithPath);
-
- // cut off "lib" in front and cut off .so end"
- std::string createFunctionName = libFileName.substr(3, libFileName.length() - 6) + "Factory";
-
- // open library
- dlerror(); // Clear any existing error
- libraryHandle = dlopen(libname.c_str(), RTLD_LAZY);
- const char* dlopen_error = dlerror();
- if (!libraryHandle || dlopen_error)
- {
- DLT_LOG(AudioManager,DLT_LOG_ERROR, DLT_STRING("dlopen failed"),DLT_STRING(dlopen_error));
- return 0;
- }
-
- // get entry point from shared lib
- dlerror(); // Clear any existing error
-
- union
- {
- void* voidPointer;
- T* typedPointer;
- } functionPointer;
-
- // Note: direct cast is not allowed by ISO C++. e.g.
- // T* createFunction = reinterpret_cast<T*>(dlsym(libraryHandle, createFunctionName.c_str()));
- // compiler warning: "forbids casting between pointer-to-function and pointer-to-object"
-
- functionPointer.voidPointer = dlsym(libraryHandle, createFunctionName.c_str());
- T* createFunction = functionPointer.typedPointer;
-
- const char* dlsym_error = dlerror();
- if (!createFunction || dlsym_error)
- {
- DLT_LOG(AudioManager,DLT_LOG_ERROR, DLT_STRING("Failed to load shared lib entry point"),DLT_STRING(dlsym_error));
- }
- else
- {
- DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("loaded successfully plugin"),DLT_STRING(createFunctionName.c_str()));
- }
- return createFunction;
+template<class T> T* getCreateFunction(const std::string& libname, void*& libraryHandle)
+{
+
+ DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("Trying to load libray with name: "), DLT_STRING(libname.c_str()));
+
+ // cut off directories
+ char* fileWithPath = const_cast<char*>(libname.c_str());
+ std::string libFileName = basename(fileWithPath);
+
+ // cut off "lib" in front and cut off .so end"
+ std::string createFunctionName = libFileName.substr(3, libFileName.length() - 6) + "Factory";
+
+ // open library
+ dlerror(); // Clear any existing error
+ libraryHandle = dlopen(libname.c_str(), RTLD_LAZY);
+ const char* dlopen_error = dlerror();
+ if (!libraryHandle || dlopen_error)
+ {
+ DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("dlopen failed"), DLT_STRING(dlopen_error));
+ return 0;
+ }
+
+ // get entry point from shared lib
+ dlerror(); // Clear any existing error
+
+ union
+ {
+ void* voidPointer;
+ T* typedPointer;
+ } functionPointer;
+
+ // Note: direct cast is not allowed by ISO C++. e.g.
+ // T* createFunction = reinterpret_cast<T*>(dlsym(libraryHandle, createFunctionName.c_str()));
+ // compiler warning: "forbids casting between pointer-to-function and pointer-to-object"
+
+ functionPointer.voidPointer = dlsym(libraryHandle, createFunctionName.c_str());
+ T* createFunction = functionPointer.typedPointer;
+
+ const char* dlsym_error = dlerror();
+ if (!createFunction || dlsym_error)
+ {
+ DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("Failed to load shared lib entry point"), DLT_STRING(dlsym_error));
+ }
+ else
+ {
+ DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("loaded successfully plugin"), DLT_STRING(createFunctionName.c_str()));
+ }
+ return createFunction;
}
}
diff --git a/AudioManagerDaemon/include/RoutingReceiver.h b/AudioManagerDaemon/include/RoutingReceiver.h
index a53a4ea..7c59978 100644
--- a/AudioManagerDaemon/include/RoutingReceiver.h
+++ b/AudioManagerDaemon/include/RoutingReceiver.h
@@ -1,26 +1,26 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file RoutingReceiver.h
-*
-* \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.
-*
-*/
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file RoutingReceiver.h
+ *
+ * \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.
+ *
+ */
#ifndef ROUTINGRECEIVER_H_
#define ROUTINGRECEIVER_H_
@@ -28,7 +28,8 @@
#include <routing/RoutingReceiveInterface.h>
#include <config.h>
-namespace am {
+namespace am
+{
class SocketHandler;
class DBusWrapper;
@@ -39,56 +40,57 @@ class ControlSender;
/**
* Implements the Receiving side of the RoutingPlugins.
*/
-class RoutingReceiver : public RoutingReceiveInterface {
+class RoutingReceiver: public RoutingReceiveInterface
+{
public:
- RoutingReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, ControlSender *iControlSender, SocketHandler *iSocketHandler);
- RoutingReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, ControlSender *iControlSender, DBusWrapper *iDBusWrapper);
- RoutingReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, ControlSender *iControlSender,SocketHandler *iSocketHandler,DBusWrapper *iDBusWrapper);
- virtual ~RoutingReceiver();
- void ackConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error) ;
- void ackDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error) ;
- 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 ackSetSourceSoundProperties(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) ;
- am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID) ;
- am_Error_e registerDomain(const am_Domain_s& domainData, am_domainID_t& domainID) ;
- am_Error_e deregisterDomain(const am_domainID_t domainID) ;
- am_Error_e registerGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID) ;
- am_Error_e deregisterGateway(const am_gatewayID_t gatewayID) ;
- am_Error_e peekSink(const std::string& name, am_sinkID_t& sinkID) ;
- am_Error_e registerSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID) ;
- am_Error_e deregisterSink(const am_sinkID_t sinkID) ;
- am_Error_e peekSource(const std::string& name, am_sourceID_t& sourceID) ;
- am_Error_e registerSource(const am_Source_s& sourceData, am_sourceID_t& sourceID) ;
- 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, const am_sinkClass_t& sinkClassID) ;
- am_Error_e peekSourceClassID(const std::string name, const am_sourceClass_t& sourceClassID) ;
- 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) ;
- void hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s& availability) ;
- void hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState) ;
- void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay) ;
- am_Error_e 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;
+ RoutingReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, ControlSender *iControlSender, SocketHandler *iSocketHandler);
+ RoutingReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, ControlSender *iControlSender, DBusWrapper *iDBusWrapper);
+ RoutingReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, ControlSender *iControlSender, SocketHandler *iSocketHandler, DBusWrapper *iDBusWrapper);
+ virtual ~RoutingReceiver();
+ void ackConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error);
+ void ackDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error);
+ 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 ackSetSourceSoundProperties(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);
+ am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID);
+ am_Error_e registerDomain(const am_Domain_s& domainData, am_domainID_t& domainID);
+ am_Error_e deregisterDomain(const am_domainID_t domainID);
+ am_Error_e registerGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID);
+ am_Error_e deregisterGateway(const am_gatewayID_t gatewayID);
+ am_Error_e peekSink(const std::string& name, am_sinkID_t& sinkID);
+ am_Error_e registerSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID);
+ am_Error_e deregisterSink(const am_sinkID_t sinkID);
+ am_Error_e peekSource(const std::string& name, am_sourceID_t& sourceID);
+ am_Error_e registerSource(const am_Source_s& sourceData, am_sourceID_t& sourceID);
+ 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, const am_sinkClass_t& sinkClassID);
+ am_Error_e peekSourceClassID(const std::string name, const am_sourceClass_t& sourceClassID);
+ 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);
+ void hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s& availability);
+ void hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState);
+ void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay);
+ am_Error_e 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;
private:
- DatabaseHandler *mDatabaseHandler; //!< pointer to the databaseHandler
- RoutingSender *mRoutingSender; //!< pointer to the routingSender
- ControlSender *mControlSender; //!< pointer to the controlSender
- SocketHandler *mSocketHandler; //!< pointer to sockethandler
- DBusWrapper *mDBusWrapper; //!< pointer to dbuswrapper
+ DatabaseHandler *mDatabaseHandler; //!< pointer to the databaseHandler
+ RoutingSender *mRoutingSender; //!< pointer to the routingSender
+ ControlSender *mControlSender; //!< pointer to the controlSender
+ SocketHandler *mSocketHandler; //!< pointer to sockethandler
+ DBusWrapper *mDBusWrapper; //!< pointer to dbuswrapper
};
diff --git a/AudioManagerDaemon/include/RoutingSender.h b/AudioManagerDaemon/include/RoutingSender.h
index 459fe84..0888b6a 100644
--- a/AudioManagerDaemon/include/RoutingSender.h
+++ b/AudioManagerDaemon/include/RoutingSender.h
@@ -1,26 +1,26 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file RoutingSender.h
-*
-* \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.
-*
-*/
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file RoutingSender.h
+ *
+ * \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.
+ *
+ */
#ifndef ROUTINGSENDER_H_
#define ROUTINGSENDER_H_
@@ -32,146 +32,147 @@
#include "../test/RoutingInterfaceBackdoor.h"
#endif
-namespace am {
+namespace am
+{
/**
* Implements the RoutingSendInterface. Loads all plugins and dispatches calls to the plugins
*/
-class RoutingSender {
+class RoutingSender
+{
public:
- RoutingSender(const std::vector<std::string>& listOfPluginDirectories);
- virtual ~RoutingSender();
-
- /**
- * removes a handle from the list
- * @param handle to be removed
- * @return E_OK in case of success
- */
- am_Error_e removeHandle(const am_Handle_s& handle);
-
- /**
- * @author Christian
- * this adds the domain to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
- * This must be done whenever a domain is registered.
- */
- am_Error_e addDomainLookup(const am_Domain_s& domainData);
- /**
- * @author Christian
- * this adds the Source to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
- * This must be done whenever a Source is registered.
- */
- am_Error_e addSourceLookup(const am_Source_s& sourceData);
- /**
- * @author Christian
- * this adds the Sink to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
- * This must be done whenever a Sink is registered.
- */
- am_Error_e addSinkLookup(const am_Sink_s& sinkData);
- /**
- * @author Christian
- * this adds the Crossfader to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
- * This must be done whenever a Crossfader is registered.
- */
- am_Error_e addCrossfaderLookup(const am_Crossfader_s& crossfaderData);
- /**
- * @author Christian
- * this removes the Domain to the lookup table of the Router. This must be done everytime a domain is deregistered.
- */
- am_Error_e removeDomainLookup(const am_domainID_t domainID);
- /**
- * @author Christian
- * this removes the Source to the lookup table of the Router. This must be done everytime a source is deregistered.
- */
- am_Error_e removeSourceLookup(const am_sourceID_t sourceID);
- /**
- * @author Christian
- * this removes the Sink to the lookup table of the Router. This must be done everytime a sink is deregistered.
- */
- am_Error_e removeSinkLookup(const am_sinkID_t sinkID);
- /**
- * @author Christian
- * 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 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) ;
- am_Error_e asyncSetSinkVolume(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(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(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SourceState_e state) ;
- am_Error_e asyncSetSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) ;
- am_Error_e asyncSetSourceSoundProperties(am_Handle_s& handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID) ;
- am_Error_e asyncSetSinkSoundProperties(am_Handle_s& handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID) ;
- am_Error_e asyncSetSourceSoundProperty(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) ;
- am_Error_e asyncCrossFade(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 getListHandles(std::vector<am_Handle_s> & listHandles) const ;
- am_Error_e getListPlugins(std::vector<std::string>& interfaces) const;
- uint16_t getInterfaceVersion() const;
-
- //!< is used to pair interfaces with busnames
- struct InterfaceNamePairs
- {
- RoutingSendInterface* routingInterface;
- std::string busName;
- };
-
- //!< is used to store data related to handles
- class am_handleData_c
- {
- public:
- union
- {
- am_sinkID_t sinkID;
- am_sourceID_t sourceID;
- am_crossfaderID_t crossfaderID;
- am_connectionID_t connectionID;
- };
- union
- {
- am_SoundProperty_s soundPropery;
- am_SourceState_e sourceState;
- am_volume_t volume;
- am_HotSink_e hotSink;
- std::vector<am_SoundProperty_s>* soundProperties;
- };
-
- };
-
+ RoutingSender(const std::vector<std::string>& listOfPluginDirectories);
+ virtual ~RoutingSender();
+
+ /**
+ * removes a handle from the list
+ * @param handle to be removed
+ * @return E_OK in case of success
+ */
+ am_Error_e removeHandle(const am_Handle_s& handle);
+
+ /**
+ * @author Christian
+ * this adds the domain to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
+ * This must be done whenever a domain is registered.
+ */
+ am_Error_e addDomainLookup(const am_Domain_s& domainData);
+ /**
+ * @author Christian
+ * this adds the Source to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
+ * This must be done whenever a Source is registered.
+ */
+ am_Error_e addSourceLookup(const am_Source_s& sourceData);
+ /**
+ * @author Christian
+ * this adds the Sink to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
+ * This must be done whenever a Sink is registered.
+ */
+ am_Error_e addSinkLookup(const am_Sink_s& sinkData);
+ /**
+ * @author Christian
+ * this adds the Crossfader to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
+ * This must be done whenever a Crossfader is registered.
+ */
+ am_Error_e addCrossfaderLookup(const am_Crossfader_s& crossfaderData);
+ /**
+ * @author Christian
+ * this removes the Domain to the lookup table of the Router. This must be done everytime a domain is deregistered.
+ */
+ am_Error_e removeDomainLookup(const am_domainID_t domainID);
+ /**
+ * @author Christian
+ * this removes the Source to the lookup table of the Router. This must be done everytime a source is deregistered.
+ */
+ am_Error_e removeSourceLookup(const am_sourceID_t sourceID);
+ /**
+ * @author Christian
+ * this removes the Sink to the lookup table of the Router. This must be done everytime a sink is deregistered.
+ */
+ am_Error_e removeSinkLookup(const am_sinkID_t sinkID);
+ /**
+ * @author Christian
+ * 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 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);
+ am_Error_e asyncSetSinkVolume(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(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(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SourceState_e state);
+ am_Error_e asyncSetSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty);
+ am_Error_e asyncSetSourceSoundProperties(am_Handle_s& handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID);
+ am_Error_e asyncSetSinkSoundProperties(am_Handle_s& handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID);
+ am_Error_e asyncSetSourceSoundProperty(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty);
+ am_Error_e asyncCrossFade(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 getListHandles(std::vector<am_Handle_s> & listHandles) const;
+ am_Error_e getListPlugins(std::vector<std::string>& interfaces) const;
+ uint16_t getInterfaceVersion() const;
+
+ //!< is used to pair interfaces with busnames
+ struct InterfaceNamePairs
+ {
+ RoutingSendInterface* routingInterface;
+ std::string busName;
+ };
+
+ //!< is used to store data related to handles
+ class am_handleData_c
+ {
+ public:
+ union
+ {
+ am_sinkID_t sinkID;
+ am_sourceID_t sourceID;
+ am_crossfaderID_t crossfaderID;
+ am_connectionID_t connectionID;
+ };
+ union
+ {
+ am_SoundProperty_s soundPropery;
+ am_SourceState_e sourceState;
+ am_volume_t volume;
+ am_HotSink_e hotSink;
+ std::vector<am_SoundProperty_s>* soundProperties;
+ };
+
+ };
#ifdef UNIT_TEST //this is needed to test RoutingSender
- friend class RoutingInterfaceBackdoor;
+ friend class RoutingInterfaceBackdoor;
#endif
- /**
- * returns the data that belong to handles
- * @param handle the handle
- * @return a class holding the handle data
- */
- am_handleData_c returnHandleData(const am_Handle_s handle) const;
+ /**
+ * returns the data that belong to handles
+ * @param handle the handle
+ * @return a class holding the handle data
+ */
+ am_handleData_c returnHandleData(const am_Handle_s handle) const;
private:
- //!< is needed to sort the handles in the map
- struct comparator
- {
- bool operator()(const am_Handle_s& a, const am_Handle_s& b) const
- {
- return (a.handle < b.handle);
- }
- };
-
- /**
- * creates a handle and adds it to the list of handles
- * @param handleData the data that should be saves together with the handle
- * @param type the type of handle to be created
- * @return the handle
- */
- am_Handle_s createHandle(const am_handleData_c& handleData, const am_Handle_e type);
- void unloadLibraries(void); //!< unloads all loaded plugins
+ //!< is needed to sort the handles in the map
+ struct comparator
+ {
+ bool operator()(const am_Handle_s& a, const am_Handle_s& b) const
+ {
+ return (a.handle < b.handle);
+ }
+ };
+
+ /**
+ * creates a handle and adds it to the list of handles
+ * @param handleData the data that should be saves together with the handle
+ * @param type the type of handle to be created
+ * @return the handle
+ */
+ am_Handle_s createHandle(const am_handleData_c& handleData, const am_Handle_e type);
+ void unloadLibraries(void); //!< unloads all loaded plugins
typedef std::map<am_domainID_t, RoutingSendInterface*> DomainInterfaceMap; //!< maps domains to interfaces
typedef std::map<am_sinkID_t, RoutingSendInterface*> SinkInterfaceMap; //!< maps sinks to interfaces
@@ -179,12 +180,12 @@ private:
typedef std::map<am_crossfaderID_t, RoutingSendInterface*> CrossfaderInterfaceMap; //!< maps crossfaders to interfaces
typedef std::map<am_connectionID_t, RoutingSendInterface*> ConnectionInterfaceMap; //!< maps connections to interfaces
typedef std::map<uint16_t, RoutingSendInterface*> HandleInterfaceMap; //!< maps handles to interfaces
- typedef std::map<am_Handle_s,am_handleData_c,comparator> HandlesMap; //!< maps handleData to handles
+ typedef std::map<am_Handle_s, am_handleData_c, comparator> HandlesMap; //!< maps handleData to handles
int16_t mHandleCount; //!< is used to create handles
HandlesMap mlistActiveHandles; //!< list of all currently "running" handles.
- std::vector<void*> mListLibraryHandles; //!< list of all loaded pluginInterfaces
- std::vector<InterfaceNamePairs> mListInterfaces; //!< list of busname/interface relation
+ std::vector<void*> mListLibraryHandles; //!< list of all loaded pluginInterfaces
+ std::vector<InterfaceNamePairs> mListInterfaces; //!< list of busname/interface relation
ConnectionInterfaceMap mMapConnectionInterface; //!< map of connection to interfaces
CrossfaderInterfaceMap mMapCrossfaderInterface; //!< map of crossfaders to interface
DomainInterfaceMap mMapDomainInterface; //!< map of domains to interfaces
diff --git a/AudioManagerDaemon/include/TelnetServer.h b/AudioManagerDaemon/include/TelnetServer.h
index 9b7d097..b4ea078 100644
--- a/AudioManagerDaemon/include/TelnetServer.h
+++ b/AudioManagerDaemon/include/TelnetServer.h
@@ -1,27 +1,26 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file TelnetServer.h
-*
-* \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.
-*
-*/
-
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file TelnetServer.h
+ *
+ * \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.
+ *
+ */
#ifndef TELNETSERVER_H_
#define TELNETSERVER_H_
@@ -30,7 +29,8 @@
#include <queue>
#include <map>
-namespace am {
+namespace am
+{
class DatabaseHandler;
class CommandSender;
@@ -43,45 +43,45 @@ class ControlReceiver;
class TelnetServer
{
public:
- TelnetServer(SocketHandler *iSocketHandler,CommandSender *iCommandSender,CommandReceiver *iCommandReceiver, RoutingSender *iRoutingSender,RoutingReceiver *iRoutingReceiver,ControlSender *iControlSender, ControlReceiver *iControlReceiver,DatabaseHandler *iDatabasehandler,unsigned int servPort, unsigned int maxConnections);
- virtual ~TelnetServer();
- void connectSocket(const pollfd pfd,const sh_pollHandle_t handle, void* userData);
- void receiveData(const pollfd pfd,const sh_pollHandle_t handle, void* userData);
- bool dispatchData(const sh_pollHandle_t handle, void* userData);
- bool check(const sh_pollHandle_t handle, void* userData);
- shPollFired_T<TelnetServer> telnetConnectFiredCB;
- shPollFired_T<TelnetServer> telnetReceiveFiredCB;
- shPollDispatch_T<TelnetServer> telnetDispatchCB;
- shPollCheck_T<TelnetServer> telnetCheckCB;
+ TelnetServer(SocketHandler *iSocketHandler, CommandSender *iCommandSender, CommandReceiver *iCommandReceiver, RoutingSender *iRoutingSender, RoutingReceiver *iRoutingReceiver, ControlSender *iControlSender, ControlReceiver *iControlReceiver, DatabaseHandler *iDatabasehandler, unsigned int servPort, unsigned int maxConnections);
+ virtual ~TelnetServer();
+ void connectSocket(const pollfd pfd, const sh_pollHandle_t handle, void* userData);
+ void receiveData(const pollfd pfd, const sh_pollHandle_t handle, void* userData);
+ bool dispatchData(const sh_pollHandle_t handle, void* userData);
+ bool check(const sh_pollHandle_t handle, void* userData);
+ shPollFired_T<TelnetServer> telnetConnectFiredCB;
+ shPollFired_T<TelnetServer> telnetReceiveFiredCB;
+ shPollDispatch_T<TelnetServer> telnetDispatchCB;
+ shPollCheck_T<TelnetServer> telnetCheckCB;
private:
- typedef void (*CommandPrototype)(std::vector<std::string>& msg,int filedescriptor);
- typedef std::map<std::string,CommandPrototype> mMapCommand_t;
- static void listCommand(std::vector<std::string>& msg,int filedescriptor);
- void listCommandShadow(std::vector<std::string>& msg,int filedescriptor);
- void sliceCommand(const std::string& string,std::string& command,std::vector<std::string>& msg);
- mMapCommand_t createCommandMap();
- struct connection_s
- {
- int filedescriptor;
- sh_pollHandle_t handle;
- };
+ typedef void (*CommandPrototype)(std::vector<std::string>& msg, int filedescriptor);
+ typedef std::map<std::string, CommandPrototype> mMapCommand_t;
+ static void listCommand(std::vector<std::string>& msg, int filedescriptor);
+ void listCommandShadow(std::vector<std::string>& msg, int filedescriptor);
+ void sliceCommand(const std::string& string, std::string& command, std::vector<std::string>& msg);
+ mMapCommand_t createCommandMap();
+ struct connection_s
+ {
+ int filedescriptor;
+ sh_pollHandle_t handle;
+ };
- static TelnetServer* instance;
- SocketHandler *mSocketHandler;
- CommandSender *mCommandSender;
- CommandReceiver *mCommandReceiver;
- RoutingSender *mRoutingSender;
- RoutingReceiver *mRoutingReceiver;
- ControlSender *mControlSender;
- ControlReceiver *mControlReceiver;
- DatabaseHandler *mDatabasehandler;
- sh_pollHandle_t mConnecthandle;
- std::queue<std::string> msgList;
- std::vector<connection_s> mListConnections;
- int mConnectFD;
- unsigned int mServerPort;
- unsigned int mMaxConnections;
- mMapCommand_t mMapCommands;
+ static TelnetServer* instance;
+ SocketHandler *mSocketHandler;
+ CommandSender *mCommandSender;
+ CommandReceiver *mCommandReceiver;
+ RoutingSender *mRoutingSender;
+ RoutingReceiver *mRoutingReceiver;
+ ControlSender *mControlSender;
+ ControlReceiver *mControlReceiver;
+ DatabaseHandler *mDatabasehandler;
+ sh_pollHandle_t mConnecthandle;
+ std::queue<std::string> msgList;
+ std::vector<connection_s> mListConnections;
+ int mConnectFD;
+ unsigned int mServerPort;
+ unsigned int mMaxConnections;
+ mMapCommand_t mMapCommands;
};