summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/include
diff options
context:
space:
mode:
authorChristian Mueller <christian@lmuc329619u.(none)>2011-12-14 11:36:44 +0100
committerChristian Mueller <christian@lmuc329619u.(none)>2011-12-14 11:36:44 +0100
commit68678bed2dc3d4a5849d283bec84a01e2836603f (patch)
tree57b58aa549d7e0547468c8f13475b3e5ac1326e8 /AudioManagerDaemon/include
parent92c8b837306ff1dcd889f9c075435aec50e9aea3 (diff)
downloadaudiomanager-68678bed2dc3d4a5849d283bec84a01e2836603f.tar.gz
update in headers, small things
Diffstat (limited to 'AudioManagerDaemon/include')
-rw-r--r--AudioManagerDaemon/include/CommandReceiver.h26
-rw-r--r--AudioManagerDaemon/include/CommandSender.h49
-rw-r--r--AudioManagerDaemon/include/ControlReceiver.h40
-rw-r--r--AudioManagerDaemon/include/ControlSender.h44
-rw-r--r--AudioManagerDaemon/include/DatabaseHandler.h60
-rw-r--r--AudioManagerDaemon/include/DatabaseObserver.h65
-rw-r--r--AudioManagerDaemon/include/Observer.h45
-rw-r--r--AudioManagerDaemon/include/PluginTemplate.h (renamed from AudioManagerDaemon/include/pluginTemplate.h)8
-rw-r--r--AudioManagerDaemon/include/RoutingReceiver.h42
-rw-r--r--AudioManagerDaemon/include/RoutingSender.h95
10 files changed, 306 insertions, 168 deletions
diff --git a/AudioManagerDaemon/include/CommandReceiver.h b/AudioManagerDaemon/include/CommandReceiver.h
index a49c03d..2e49c9a 100644
--- a/AudioManagerDaemon/include/CommandReceiver.h
+++ b/AudioManagerDaemon/include/CommandReceiver.h
@@ -1,19 +1,9 @@
-/*
- * CommandReceiver.h
- *
- * Created on: Oct 24, 2011
- * Author: christian
- */
-
-#ifndef COMMANDRECEIVER_H_
-#define COMMANDRECEIVER_H_
-
/**
* Copyright (C) 2011, BMW AG
*
* GeniviAudioMananger AudioManagerDaemon
*
-* \file DBusWrapper.cpp
+* \file CommandReveiver.h
*
* \date 20-Oct-2011 3:42:04 PM
* \author Christian Mueller (christian.ei.mueller@bmw.de)
@@ -30,8 +20,11 @@
* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
+
+#ifndef COMMANDRECEIVER_H_
+#define COMMANDRECEIVER_H_
+
#include <command/CommandReceiveInterface.h>
#include "DatabaseHandler.h"
#include "DBusWrapper.h"
@@ -39,6 +32,9 @@
using namespace am;
+/**
+ * This class realizes the command Interface
+ */
class CommandReceiver: public CommandReceiveInterface {
public:
CommandReceiver(DatabaseHandler* iDatabaseHandler, DBusWrapper* iDBusWrapper, ControlSender* iControlSender);
@@ -63,9 +59,9 @@ public:
am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const ;
private:
- DatabaseHandler* mDatabaseHandler;
- DBusWrapper* mDBusWrapper;
- ControlSender* mControlSender;
+ DatabaseHandler* mDatabaseHandler; //!< pointer to the databasehandler
+ DBusWrapper* mDBusWrapper; //!< pointer to the dbuswrapper
+ ControlSender* mControlSender; //!< pointer to the control sender
};
#endif /* COMMANDRECEIVER_H_ */
diff --git a/AudioManagerDaemon/include/CommandSender.h b/AudioManagerDaemon/include/CommandSender.h
index 2cd5025..a871a77 100644
--- a/AudioManagerDaemon/include/CommandSender.h
+++ b/AudioManagerDaemon/include/CommandSender.h
@@ -1,24 +1,45 @@
-/*
- * CommandSender.h
- *
- * Created on: Oct 26, 2011
- * Author: christian
- */
+/**
+* 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_
-#include "command/CommandSendInterface.h"
-
#ifdef UNIT_TEST
-#include "../test/CommandInterfaceBackdoor.h"
+#include "../test/CommandInterfaceBackdoor.h" //we need this for the unit test
#endif
+#include "command/CommandSendInterface.h"
+
using 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 {
public:
- CommandSender();
+ CommandSender(const std::vector<std::string>& listOfPluginDirectories);
virtual ~CommandSender();
am_Error_e startupInterface(CommandReceiveInterface* commandreceiveinterface) ;
am_Error_e stopInterface() ;
@@ -39,12 +60,12 @@ public:
void cbSystemPropertyChanged(const am_SystemProperty_s& SystemProperty) ;
void cbTimingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time) ;
#ifdef UNIT_TEST
- friend class CommandInterfaceBackdoor;
+ friend class CommandInterfaceBackdoor; //this is to get access to the loaded plugins and be able to exchange the interfaces
#endif
private:
- void unloadLibraries(void);
- std::vector<CommandSendInterface*> mListInterfaces;
- std::vector<void*> mListLibraryHandles;
+ 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.
};
#endif /* COMMANDSENDER_H_ */
diff --git a/AudioManagerDaemon/include/ControlReceiver.h b/AudioManagerDaemon/include/ControlReceiver.h
index 1b5c072..5564fd0 100644
--- a/AudioManagerDaemon/include/ControlReceiver.h
+++ b/AudioManagerDaemon/include/ControlReceiver.h
@@ -1,9 +1,26 @@
-/*
- * ContronlReceiver.h
- *
- * Created on: Oct 24, 2011
- * Author: christian
- */
+/**
+* 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_
@@ -11,12 +28,16 @@
#include <control/ControlReceiveInterface.h>
#include "DatabaseHandler.h"
#include "RoutingSender.h"
+#include "CommandSender.h"
using namespace am;
+/**
+ * This class is used to receive all commands from the control interface
+ */
class ControlReceiver: public ControlReceiveInterface {
public:
- ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender);
+ 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) ;
@@ -81,8 +102,9 @@ public:
void setCommandReady() ;
private:
- DatabaseHandler* mDatabaseHandler;
- RoutingSender* mRoutingSender;
+ DatabaseHandler* mDatabaseHandler; //!< pointer tto the databasehandler
+ RoutingSender* mRoutingSender; //!< pointer to the routing send interface.
+ CommandSender* mCommandSender; //!< pointer to the command send interface
};
#endif /* CONTRONLRECEIVER_H_ */
diff --git a/AudioManagerDaemon/include/ControlSender.h b/AudioManagerDaemon/include/ControlSender.h
index ac917be..133b7cd 100644
--- a/AudioManagerDaemon/include/ControlSender.h
+++ b/AudioManagerDaemon/include/ControlSender.h
@@ -1,28 +1,47 @@
-/*
- * ControlSender.h
- *
- * Created on: Dec 9, 2011
- * Author: christian
- */
+/**
+* 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_
-#include "control/ControlSendInterface.h"
-
#ifdef UNIT_TEST
#include "../test/ControlInterfaceBackdoor.h"
#endif
+#include "control/ControlSendInterface.h"
+
using namespace am;
+/**
+ * sends data to the commandInterface, takes the file of the library that needs to be loaded
+ */
class ControlSender {
public:
- ControlSender();
+ ControlSender(std::string controlPluginFile);
virtual ~ControlSender();
am_Error_e startupController(ControlReceiveInterface* controlreceiveinterface) ;
am_Error_e stopController() ;
- void hookAllPluginsLoaded() ;
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) ;
@@ -41,6 +60,7 @@ public:
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) ;
@@ -64,8 +84,8 @@ public:
friend class ControlInterfaceBackdoor;
#endif
private:
- ControlSendInterface* mController;
- void* mlibHandle;
+ ControlSendInterface* mController; //!< pointer to the ControlSend interface
+ void* mlibHandle; //!< pointer to the loaded control plugin interface
};
#endif /* CONTROLSENDER_H_ */
diff --git a/AudioManagerDaemon/include/DatabaseHandler.h b/AudioManagerDaemon/include/DatabaseHandler.h
index 057b7a8..798cd27 100644
--- a/AudioManagerDaemon/include/DatabaseHandler.h
+++ b/AudioManagerDaemon/include/DatabaseHandler.h
@@ -1,26 +1,37 @@
-/*
- * DatabaseHandler.h
- *
- * Created on: Oct 24, 2011
- * Author: christian
- */
+/**
+* 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_
-#include "Observer.h"
#include "audiomanagertypes.h"
-#include <map>
-#include <string>
-#include <stdint.h>
-#include <fstream>
-#include <sstream>
-#include <vector>
+#include "DatabaseObserver.h"
#include <sqlite3.h>
using namespace am;
-#define DYNAMIC_ID_BOUNDARY 100
+#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.
@@ -31,9 +42,12 @@ using namespace am;
//todo: create test to ensure uniqueness of names throughout the database
//todo: enforce the uniqueness of names
+/**
+ * This class handles and abstracts the database
+ */
class DatabaseHandler {
public:
- DatabaseHandler();
+ 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) ;
@@ -212,7 +226,7 @@ public:
* registers the Observer at the Database
* @param iObserver pointer to the observer
*/
- void registerObserver(Observer *iObserver);
+ void registerObserver(DatabaseObserver *iObserver);
/**
* gives information about the visibility of a source
@@ -232,18 +246,18 @@ private:
am_timeSync_t calculateMainConnectionDelay(const am_mainConnectionID_t mainConnectionID) const;
bool connectionPartofMainConnection(const am_connectionID_t connectionID,const am_mainConnectionID_t mainConnectionID) const;
bool sqQuery(const std::string& query);
- bool openDatabase();
- void createTables();
- sqlite3 *mDatabase;
- std::string mPath;
- Observer *mObserver;
+ 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;
- ListConnectionFormat mListConnectionFormat;
+ typedef std::map<am_gatewayID_t,std::vector<bool> > ListConnectionFormat; //!< type for list of connection formats
+ ListConnectionFormat mListConnectionFormat; //!< list of connection formats
};
#endif /* DATABASEHANDLER_H_ */
diff --git a/AudioManagerDaemon/include/DatabaseObserver.h b/AudioManagerDaemon/include/DatabaseObserver.h
new file mode 100644
index 0000000..42b38c2
--- /dev/null
+++ b/AudioManagerDaemon/include/DatabaseObserver.h
@@ -0,0 +1,65 @@
+/**
+* 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 "CommandSender.h"
+#include "RoutingSender.h"
+
+/**
+ * This class observes the Database and notifies other classes about important events, mainly the CommandSender.
+ */
+class DatabaseObserver {
+public:
+ DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender);
+ 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
+};
+
+#endif /* DATABASEOBSERVER_H_ */
diff --git a/AudioManagerDaemon/include/Observer.h b/AudioManagerDaemon/include/Observer.h
deleted file mode 100644
index f616722..0000000
--- a/AudioManagerDaemon/include/Observer.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Observer.h
- *
- * Created on: Dec 10, 2011
- * Author: christian
- */
-
-#ifndef OBSERVER_H_
-#define OBSERVER_H_
-
-#include "CommandSender.h"
-#include "RoutingSender.h"
-
-class Observer {
-public:
- Observer(CommandSender *iCommandSender, RoutingSender *iRoutingSender);
- virtual ~Observer();
- 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;
- RoutingSender* mRoutingSender;
-};
-
-#endif /* OBSERVER_H_ */
diff --git a/AudioManagerDaemon/include/pluginTemplate.h b/AudioManagerDaemon/include/PluginTemplate.h
index 0054d92..f995f0c 100644
--- a/AudioManagerDaemon/include/pluginTemplate.h
+++ b/AudioManagerDaemon/include/PluginTemplate.h
@@ -20,20 +20,14 @@
* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#ifndef PLUGINTEMPLATE_H_
#define PLUGINTEMPLATE_H_
-#include <iostream>
-#include <stdio.h>
-#include <dirent.h>
+#include <dlt/dlt.h>
#include <dlfcn.h>
#include <libgen.h>
-#include <unistd.h>
-#include <string>
-#include <dlt/dlt.h>
DLT_IMPORT_CONTEXT(AudioManager)
diff --git a/AudioManagerDaemon/include/RoutingReceiver.h b/AudioManagerDaemon/include/RoutingReceiver.h
index f2dc405..2c1cf0e 100644
--- a/AudioManagerDaemon/include/RoutingReceiver.h
+++ b/AudioManagerDaemon/include/RoutingReceiver.h
@@ -1,20 +1,40 @@
-/*
- * RoutingReceiver.h
- *
- * Created on: Oct 24, 2011
- * Author: christian
- */
+/**
+* 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_
#include "routing/RoutingReceiveInterface.h"
-#include "ControlSender.h"
-#include "RoutingSender.h"
#include "DatabaseHandler.h"
+#include "RoutingSender.h"
+#include "ControlSender.h"
using namespace am;
+/**
+ * Implements the Receiving side of the RoutingPlugins.
+ */
class RoutingReceiver : public RoutingReceiveInterface {
public:
RoutingReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, ControlSender *iControlSender);
@@ -53,9 +73,9 @@ public:
am_Error_e sendChangedData(const std::vector<am_EarlyData_s>& earlyData) ;
am_Error_e getDBusConnectionWrapper(DBusWrapper* dbusConnectionWrapper) const ;
private:
- DatabaseHandler *mDatabaseHandler;
- RoutingSender *mRoutingSender;
- ControlSender *mControlSender;
+ DatabaseHandler *mDatabaseHandler; //!< pointer to the databaseHandler
+ RoutingSender *mRoutingSender; //!< pointer to the routingSender
+ ControlSender *mControlSender; //!< pointer to the controlSender
};
diff --git a/AudioManagerDaemon/include/RoutingSender.h b/AudioManagerDaemon/include/RoutingSender.h
index a931940..0a7a1eb 100644
--- a/AudioManagerDaemon/include/RoutingSender.h
+++ b/AudioManagerDaemon/include/RoutingSender.h
@@ -1,27 +1,45 @@
-/*
- * RoutingSender.h
- *
- * Created on: Oct 26, 2011
- * Author: christian
- */
+/**
+* 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_
#include "routing/RoutingSendInterface.h"
+#include <map>
#ifdef UNIT_TEST //this is needed to test RoutingSender
#include "../test/RoutingInterfaceBackdoor.h"
#endif
-#include <map>
-#include <set>
-
using namespace am;
+/**
+ * Implements the RoutingSendInterface. Loads all plugins and dispatches calls to the plugins
+ */
class RoutingSender {
public:
- RoutingSender();
+ RoutingSender(const std::vector<std::string>& listOfPluginDirectories);
virtual ~RoutingSender();
/**
@@ -90,13 +108,14 @@ public:
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) ;
am_Error_e getListHandles(std::vector<am_Handle_s> & listHandles) const ;
+ //!< is used to pair interfaces with busnames
struct InterfaceNamePairs
{
RoutingSendInterface* routingInterface;
std::string busName;
};
- //todo: maybe this would be valuable information for the controller...
+ //!< is used to store data related to handles
class am_handleData_c
{
public:
@@ -122,10 +141,16 @@ public:
friend class RoutingInterfaceBackdoor;
#endif
-am_handleData_c returnHandleData(am_Handle_s handle);
+ /**
+ * returns the data that belong to handles
+ * @param handle the handle
+ * @return a class holding the handle data
+ */
+ am_handleData_c returnHandleData(am_Handle_s handle);
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
@@ -134,27 +159,33 @@ private:
}
};
+ /**
+ * 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);
-
- typedef std::map<am_domainID_t, RoutingSendInterface*> DomainInterfaceMap;
- typedef std::map<am_sinkID_t, RoutingSendInterface*> SinkInterfaceMap;
- typedef std::map<am_sourceID_t, RoutingSendInterface*> SourceInterfaceMap;
- typedef std::map<am_crossfaderID_t, RoutingSendInterface*> CrossfaderInterfaceMap;
- typedef std::map<am_connectionID_t, RoutingSendInterface*> ConnectionInterfaceMap;
- typedef std::map<uint16_t, RoutingSendInterface*> HandleInterfaceMap;
- typedef std::map<am_Handle_s,am_handleData_c,comparator> HandlesMap;
-
- int16_t mHandleCount;
- std::vector<InterfaceNamePairs> mListInterfaces;
- std::vector<void*> mListLibraryHandles;
- ConnectionInterfaceMap mMapConnectionInterface;
- CrossfaderInterfaceMap mMapCrossfaderInterface;
- DomainInterfaceMap mMapDomainInterface;
- SinkInterfaceMap mMapSinkInterface;
- SourceInterfaceMap mMapSourceInterface;
- HandleInterfaceMap mMapHandleInterface;
- HandlesMap mlistActiveHandles;
+ 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
+ typedef std::map<am_sourceID_t, RoutingSendInterface*> SourceInterfaceMap; //!< maps sources to interfaces
+ 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
+
+ int16_t mHandleCount; //!< is used to create handles
+ std::vector<InterfaceNamePairs> mListInterfaces; //!< list of busname/interface relation
+ std::vector<void*> mListLibraryHandles; //!< list of all loaded pluginInterfaces
+ ConnectionInterfaceMap mMapConnectionInterface; //!< map of connection to interfaces
+ CrossfaderInterfaceMap mMapCrossfaderInterface; //!< map of crossfaders to interface
+ DomainInterfaceMap mMapDomainInterface; //!< map of domains to interfaces
+ SinkInterfaceMap mMapSinkInterface; //!< map of sinks to interfaces
+ SourceInterfaceMap mMapSourceInterface; //!< map of sources to interfaces
+ HandleInterfaceMap mMapHandleInterface; //!< map of handles to interfaces
+ HandlesMap mlistActiveHandles; //!< list of all currently "running" handles.
};
#endif /* ROUTINGSENDER_H_ */