summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon
diff options
context:
space:
mode:
authorChristian Mueller <christian@lmuc329619u.(none)>2011-07-26 21:02:37 +0200
committerChristian Mueller <christian@lmuc329619u.(none)>2011-07-26 21:02:37 +0200
commitdf88fefdd7df890aaf2a3206483678851cffc5c5 (patch)
treeb79613020a91ab167ae196469849eb3518fe2de0 /AudioManagerDaemon
parent2feaef3bb5f91af43573155106c73143597bdf3e (diff)
downloadaudiomanager-df88fefdd7df890aaf2a3206483678851cffc5c5.tar.gz
- first time synchronisation with EA
- remodelled some interfaces - new plugin structure for CommandInterfaces
Diffstat (limited to 'AudioManagerDaemon')
-rw-r--r--AudioManagerDaemon/AudioManagerCore.cpp4
-rw-r--r--AudioManagerDaemon/AudioManagerCore.h8
-rw-r--r--AudioManagerDaemon/CMakeLists.txt3
-rw-r--r--AudioManagerDaemon/CommandReceive.cpp101
-rw-r--r--AudioManagerDaemon/CommandReceive.h30
-rw-r--r--AudioManagerDaemon/DBusCommandInterface.cpp55
-rw-r--r--AudioManagerDaemon/Router.cpp23
-rw-r--r--AudioManagerDaemon/RoutingReceive.h4
-rw-r--r--AudioManagerDaemon/commandInterface.h (renamed from AudioManagerDaemon/DBusCommandInterface.h)147
-rw-r--r--AudioManagerDaemon/routinginterface.cpp12
-rw-r--r--AudioManagerDaemon/routinginterface.h335
11 files changed, 404 insertions, 318 deletions
diff --git a/AudioManagerDaemon/AudioManagerCore.cpp b/AudioManagerDaemon/AudioManagerCore.cpp
index 8d1f867..db4b665 100644
--- a/AudioManagerDaemon/AudioManagerCore.cpp
+++ b/AudioManagerDaemon/AudioManagerCore.cpp
@@ -454,7 +454,7 @@ RoutingReceiver* AudioManagerCore::returnReceiver() {
return m_receiver;
}
-DBusCommandInterface* AudioManagerCore::returnCommandInterface() {
+CommandInterface* AudioManagerCore::returnCommandInterface() {
return m_command;
}
@@ -478,7 +478,7 @@ void AudioManagerCore::registerReceiver(RoutingReceiver* receiver) {
m_receiver = receiver;
}
-void AudioManagerCore::registerCommandInterface(DBusCommandInterface* command) {
+void AudioManagerCore::registerCommandInterface(CommandInterface* command) {
m_command = command;
}
diff --git a/AudioManagerDaemon/AudioManagerCore.h b/AudioManagerDaemon/AudioManagerCore.h
index 5647a44..addb52f 100644
--- a/AudioManagerDaemon/AudioManagerCore.h
+++ b/AudioManagerDaemon/AudioManagerCore.h
@@ -39,7 +39,7 @@ class AudioManagerCore;
class Queue;
class Router;
class Bushandler;
-class DBusCommandInterface;
+class CommandInterface;
/**
* \class Task
@@ -594,14 +594,14 @@ public:
Router* returnRouter();
DataBaseHandler* returnDatabaseHandler();
RoutingReceiver* returnReceiver();
- DBusCommandInterface* returnCommandInterface();
+ CommandInterface* returnCommandInterface();
void registerDatabasehandler(DataBaseHandler * handler);
void registerRouter(Router* router);
void registerBushandler(Bushandler* handler);
void registerHookEngine(HookHandler* handler);
void registerReceiver(RoutingReceiver* receiver);
- void registerCommandInterface(DBusCommandInterface* command);
+ void registerCommandInterface(CommandInterface* command);
void addQueue(Queue* queue);
genError_t removeQueue(Queue* queue);
@@ -619,7 +619,7 @@ private:
Bushandler* m_busHandler; //!< pointer to the Bushandler Class
HookHandler* m_hookHandler; //!< pointer to the HookHandler CLass
RoutingReceiver* m_receiver; //!< pointer to the Routing receiver Class
- DBusCommandInterface* m_command; //!< pointer to the command Interface Class
+ CommandInterface* m_command; //!< pointer to the command Interface Class
std::list<Queue*> m_queueList; //!< List of pointers to all running queues
};
diff --git a/AudioManagerDaemon/CMakeLists.txt b/AudioManagerDaemon/CMakeLists.txt
index a0ba7c7..bb3ced5 100644
--- a/AudioManagerDaemon/CMakeLists.txt
+++ b/AudioManagerDaemon/CMakeLists.txt
@@ -35,12 +35,11 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${STD_INCLUDE_DIRS})
SET(AUDIOMAN_SRCS_CXX
AudioManagerCore.cpp
RoutingReceive.cpp
+ CommandReceive.cpp
Router.cpp
DataBaseHandler.cpp
main.cpp
- DBusCommandInterface.cpp
HookEngine.cpp
- routinginterface.cpp
)
INCLUDE_DIRECTORIES(
diff --git a/AudioManagerDaemon/CommandReceive.cpp b/AudioManagerDaemon/CommandReceive.cpp
new file mode 100644
index 0000000..afc87b2
--- /dev/null
+++ b/AudioManagerDaemon/CommandReceive.cpp
@@ -0,0 +1,101 @@
+/*
+ * CommandReceive.cpp
+ *
+ * Created on: Jul 26, 2011
+ * Author: christian
+ */
+
+#include "CommandReceive.h"
+
+CommandReceive::CommandReceive(AudioManagerCore* core) : m_core(core) {
+
+}
+
+CommandReceive::~CommandReceive() {
+
+}
+
+connection_t CommandReceive::connect(source_t source, sink_t sink) {
+ DLT_LOG(AudioManager,DLT_LOG_ERROR, DLT_STRING("Connect"));
+ if (m_core->UserConnect(source, sink) == GEN_OK) {
+ return 1;
+ }
+ return -1;
+
+ /**
+ * \todo returns a connection_t but this is always one. Somethings not right....
+ */
+}
+
+
+
+connection_t CommandReceive::disconnect(source_t source, source_t sink){
+
+ genRoute_t ReturnRoute;
+ if (int value=m_core->returnDatabaseHandler()->returnMainconnectionIDforSinkSourceID(sink,source)>0) {
+ return m_core->UserDisconnect(value);
+ } else {
+ return -1;
+ }
+
+ /**
+ * \todo not sure if the test of existance of thatconnection should be done here...
+ */
+}
+
+
+
+std::list<ConnectionType> CommandReceive::getListConnections(){
+ return m_core->getListConnections();
+}
+
+
+
+std::list<SinkType> CommandReceive::getListSinks(){
+ return m_core->getListSinks();
+}
+
+
+
+std::list<SourceType> CommandReceive::getListSources() {
+ return m_core->getListSources();
+}
+
+
+
+genInt_t CommandReceive::interruptRequest(const std::string & SourceName, const std::string & SinkName) {
+ source_t sourceID = m_core->returnSourceIDfromName(SourceName);
+ sink_t sinkID = m_core->returnSinkIDfromName(SinkName);
+ genInt_t intID = -1;
+ if (m_core->interruptRequest(sourceID, sinkID, &intID)==GEN_OK) {
+ return intID;
+ }
+
+ return -1;
+
+ /**
+ * \todo need to change something?
+ */
+}
+
+
+
+interrupt_t CommandReceive::interruptResume(interrupt_t interrupt){
+ /**
+ * \todo here a callback mechanism needs to be installed....
+ */
+
+ return 1;
+}
+
+
+
+volume_t CommandReceive::setVolume(sink_t sink, volume_t volume) {
+ if (m_core->UserSetVolume(sink, volume) == GEN_OK) {
+ return 1;
+ }
+ return -1;
+}
+
+
+
diff --git a/AudioManagerDaemon/CommandReceive.h b/AudioManagerDaemon/CommandReceive.h
new file mode 100644
index 0000000..18af2ca
--- /dev/null
+++ b/AudioManagerDaemon/CommandReceive.h
@@ -0,0 +1,30 @@
+/*
+ * CommandReceive.h
+ *
+ * Created on: Jul 26, 2011
+ * Author: christian
+ */
+
+#ifndef COMMANDRECEIVE_H_
+#define COMMANDRECEIVE_H_
+
+#include "commandInterface.h"
+#include "audioManagerIncludes.h"
+
+class CommandReceive : CommandReceiveInterface {
+public:
+ CommandReceive(AudioManagerCore* core);
+ virtual ~CommandReceive();
+ connection_t connect(source_t source, sink_t sink);
+ connection_t disconnect(source_t source, source_t sink);
+ std::list<ConnectionType> getListConnections();
+ std::list<SinkType> getListSinks();
+ std::list<SourceType> getListSources();
+ genInt_t interruptRequest(const std::string &SourceName, const std::string &SinkName);
+ interrupt_t interruptResume(interrupt_t interrupt);
+ volume_t setVolume(sink_t sink, volume_t volume);
+private:
+ AudioManagerCore* m_core;
+};
+
+#endif /* COMMANDRECEIVE_H_ */
diff --git a/AudioManagerDaemon/DBusCommandInterface.cpp b/AudioManagerDaemon/DBusCommandInterface.cpp
index 3773536..607acf6 100644
--- a/AudioManagerDaemon/DBusCommandInterface.cpp
+++ b/AudioManagerDaemon/DBusCommandInterface.cpp
@@ -25,10 +25,10 @@
#include "DBusCommandInterface.h"
-DBusCommandInterface::DBusCommandInterface() {
+CommandInterface::CommandInterface() {
}
-void DBusCommandInterface::startupInterface() {
+void CommandInterface::startupInterface() {
DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Startup of DBUS Command interface"));
// new DBusCommand(this);
@@ -48,38 +48,24 @@ void DBusCommandInterface::startupInterface() {
//
}
-int DBusCommandInterface::connect(int Source_ID, int Sink_ID) {
- if (m_core->UserConnect(Source_ID, Sink_ID) == GEN_OK) {
- return 1;
- }
- return -1;
+int CommandInterface::connect(int Source_ID, int Sink_ID) {
+
}
-int DBusCommandInterface::disconnect(int Source_ID, int Sink_ID) {
- DLT_LOG(AudioManager,DLT_LOG_ERROR, DLT_STRING("Disconnect"));
- genRoute_t ReturnRoute;
- if (int value=m_core->returnDatabaseHandler()->returnMainconnectionIDforSinkSourceID(Sink_ID,Source_ID)>0) {
- return m_core->UserDisconnect(value);
- } else {
- return -1;
- }
+int CommandInterface::disconnect(int Source_ID, int Sink_ID) {
+
}
-int DBusCommandInterface::interruptRequest(const std::string &SourceName,
- const std::string &SinkName) {
- source_t sourceID = m_core->returnSourceIDfromName(SourceName);
- sink_t sinkID = m_core->returnSinkIDfromName(SinkName);
- genInt_t intID = -1;
- m_core->interruptRequest(sourceID, sinkID, &intID);
- return intID;
+int CommandInterface::interruptRequest(const std::string &SourceName,
+
}
-int DBusCommandInterface::interruptResume(int InterruptID) {
+int CommandInterface::interruptResume(int InterruptID) {
// emit signal_interruptResume(InterruptID);
return 1;
}
-void DBusCommandInterface::registerAudioManagerCore(AudioManagerCore* core) {
+void CommandInterface::registerAudioManagerCore(AudioManagerCore* core) {
m_core = core;
// QObject::connect((const QObject*) m_core,
// SIGNAL(signal_connectionChanged()), (const QObject*) this,
@@ -92,31 +78,28 @@ void DBusCommandInterface::registerAudioManagerCore(AudioManagerCore* core) {
// SLOT(slot_numberOfSourcesChanged()));
}
-void DBusCommandInterface::slot_connectionChanged() {
+void CommandInterface::slot_connectionChanged() {
// emit signal_connectionChanged();
}
-void DBusCommandInterface::slot_numberOfSinksChanged() {
+void CommandInterface::slot_numberOfSinksChanged() {
// emit signal_numberOfSinksChanged();
}
-void DBusCommandInterface::slot_numberOfSourcesChanged() {
+void CommandInterface::slot_numberOfSourcesChanged() {
// emit signal_numberOfSourcesChanged();
}
-int DBusCommandInterface::setVolume(int SinkID, int Volume) {
- if (m_core->UserSetVolume(SinkID, Volume) == GEN_OK) {
- return 1;
- }
- return -1;
+int CommandInterface::setVolume(int SinkID, int Volume) {
+
}
-std::list<SourceType> DBusCommandInterface::getListSources() {
- return m_core->getListSources();
+std::list<SourceType> CommandInterface::getListSources() {
+
}
-std::list<SinkType> DBusCommandInterface::getListSinks() {
+std::list<SinkType> CommandInterface::getListSinks() {
return m_core->getListSinks();
}
-std::list<ConnectionType> DBusCommandInterface::getListConnections() {
+std::list<ConnectionType> CommandInterface::getListConnections() {
return m_core->getListConnections();
}
diff --git a/AudioManagerDaemon/Router.cpp b/AudioManagerDaemon/Router.cpp
index b71ccad..1cca6ff 100644
--- a/AudioManagerDaemon/Router.cpp
+++ b/AudioManagerDaemon/Router.cpp
@@ -263,7 +263,6 @@ void Bushandler::load_Bus_plugins() {
continue;
}
- DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Hello"));
RoutingSendInterface* RoutingPlugin = createFunc();
@@ -303,12 +302,20 @@ void Bushandler::registerCore (AudioManagerCore* core) {
}
RoutingSendInterface* Bushandler::getInterfaceforBus(std::string bus) {
-// foreach (Bus b, Busses)
-// {
-// if (b.Name.compare(bus) == 0) {
-// return b.sendInterface;
-// }
-// }
-// return NULL;
+ /**
+ * \todo this could be done more nicer and faster with a hash lookup or so.. worht it??
+ */
+ std::list<Bus>::iterator busIter;
+ std::list<Bus>::iterator busStart=Busses.begin();
+ std::list<Bus>::iterator busEnd=Busses.end();
+
+ for (busIter=busStart;busIter!=busEnd;busIter++) {
+ {
+ if (busIter->Name.compare(bus) == 0) {
+ return busIter->sendInterface;
+ }
+ }
+ }
+ return NULL;
}
diff --git a/AudioManagerDaemon/RoutingReceive.h b/AudioManagerDaemon/RoutingReceive.h
index fdb6edc..aa375fc 100644
--- a/AudioManagerDaemon/RoutingReceive.h
+++ b/AudioManagerDaemon/RoutingReceive.h
@@ -36,11 +36,11 @@ class DataBaseHandler;
class RoutingReceiver: public RoutingReceiveInterface {
public:
+ virtual ~RoutingReceiver() {}
void register_Databasehandler(DataBaseHandler* handler_); //is used to register the Database handler
int registerDomain(char* name, char* busname, char* node, bool earlymode);
- int registerGateway(char* name, char* sink, char* source,
- char *domainSource, char* domainSink, char* controlDomain);
+ int registerGateway(char* name, char* sink, char* source, char *domainSource, char* domainSink, char* controlDomain);
int registerSink(char* name, char* sinkclass, char* domain);
int registerSource(char* name, char* audioclass, char* domain);
int peekDomain(char* name);
diff --git a/AudioManagerDaemon/DBusCommandInterface.h b/AudioManagerDaemon/commandInterface.h
index 0534e18..e6d2953 100644
--- a/AudioManagerDaemon/DBusCommandInterface.h
+++ b/AudioManagerDaemon/commandInterface.h
@@ -1,73 +1,74 @@
-/**
- * Copyright (C) 2011, BMW AG
- *
- * AudioManangerDeamon
- *
- * \file DBusCommandInterface.h
- *
- * \date 20.05.2011
- * \author Christian Müller (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 Müller 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 DBUSCOMMANDINTERFACE_H_
-#define DBUSCOMMANDINTERFACE_H_
-
-#include "audioManagerIncludes.h"
-
-
-#define SERVICEINTERFACE "org.Genivi.ControllerInterface"
-
-class AudioManagerCore;
-
-/**The interface towards the HMI
- * This class is copied from DBusCommand.h which is generated out of DBusAudioManager.xml. It handles the communication towards the HMI.
- * It also implements some Application logic that needs to be triggered to execute the actions demanded by the HMI.
- * TODO: make a clear seperation between HMI Interface and Application Logic
- */
-class DBusCommandInterface {
-
-public:
- DBusCommandInterface();
- void registerAudioManagerCore(AudioManagerCore* core);
- void startupInterface();
-
- void slot_connectionChanged();
- void slot_numberOfSinksChanged();
- void slot_numberOfSourcesChanged();
-
- // METHODS
- int connect(int Source_ID, int Sink_ID);
- int disconnect(int Source_ID, int Sink_ID);
- std::list<ConnectionType> getListConnections();
- std::list<SinkType> getListSinks();
- std::list<SourceType> getListSources();
- int interruptRequest(const std::string &SourceName, const std::string &SinkName);
- int interruptResume(int InterruptID);
- int setVolume(int SinkID, int Volume);
-
- void signal_connectionChanged();
- void signal_numberOfSinksChanged();
- void signal_numberOfSourcesChanged();
-
- void signal_interruptResume(genInt_t interruptID);
-
-private:
- std::list<int> getSourceIDsForSinkID(int SinkID);
- AudioManagerCore* m_core;
-};
-
-#endif /* DBUSCOMMANDINTERFACE_H_ */
+/**
+ * Copyright (C) 2011, BMW AG
+ *
+ * AudioManangerDeamon
+ *
+ * \file DBusCommandInterface.h
+ *
+ * \date 20.05.2011
+ * \author Christian Müller (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 Müller 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 COMMANDINTERFACE_H
+#define COMMANDINTERFACE_H
+
+#include "audioManagerIncludes.h"
+
+
+#define SERVICEINTERFACE "org.Genivi.ControllerInterface"
+
+class CommandSendInterface;
+
+/**
+ * The interface towards the Controlling Instace (e.g HMI).
+ * It handles the communication towards the HMI. It also implements some
+ * Application logic that needs to be triggered to execute the actions demanded by
+ * the Controller.
+ * \todo: make a clear seperation between hmi Interface and Application Logic
+ */
+class CommandReceiveInterface {
+
+public:
+ virtual void startupInterface()=0;
+ virtual connection_t connect(source_t source, sink_t sink)=0;
+ virtual connection_t disconnect(source_t source, source_t sink)=0;
+ virtual std::list<ConnectionType> getListConnections()=0;
+ virtual std::list<SinkType> getListSinks()=0;
+ virtual std::list<SourceType> getListSources()=0;
+ virtual genInt_t interruptRequest(const std::string &SourceName, const std::string &SinkName)=0;
+ virtual interrupt_t interruptResume(interrupt_t interrupt)=0;
+ virtual volume_t setVolume(sink_t sink, volume_t volume)=0;
+};
+
+class CommandSendInterface {
+public:
+
+ /**
+ * Callback that is called when the number of connections change
+ */
+ virtual void cbConnectionChanged()=0;
+ /**
+ * Callback that is called when the number of sinks change
+ */
+ virtual void cbNumberOfSinksChanged()=0;
+ /**
+ * Callback that is called when the number of sources change
+ */
+ virtual void cbNumberOfSourcesChanged()=0;
+};
+
+#endif /* COMMANDINTERFACE_H */
diff --git a/AudioManagerDaemon/routinginterface.cpp b/AudioManagerDaemon/routinginterface.cpp
deleted file mode 100644
index cd9645b..0000000
--- a/AudioManagerDaemon/routinginterface.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * routinginterface.cpp
- *
- * Created on: Jul 21, 2011
- * Author: christian
- */
-
-
-#include "routinginterface.h"
-
-RoutingSendInterface::RoutingSendInterface() {}
-RoutingSendInterface::~RoutingSendInterface() {}
diff --git a/AudioManagerDaemon/routinginterface.h b/AudioManagerDaemon/routinginterface.h
index 5460acf..935357e 100644
--- a/AudioManagerDaemon/routinginterface.h
+++ b/AudioManagerDaemon/routinginterface.h
@@ -1,179 +1,156 @@
-/**
- * Copyright (C) 2011, BMW AG
- *
- * AudioManangerDeamon
- *
- * \file routinginterface.h
- *
- * \date 20.05.2011
- * \author Christian Müller (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 Müller 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 ROUTINGINTERFACE_H_
-#define ROUTINGINTERFACE_H_
-
-#include "dataTypes.h"
-
-class RoutingSendInterface;
-
-/** Routing Receive sendInterface description.
- * This class implements everything from RoutingAdapter -> Audiomanager
- */
-class RoutingReceiveInterface {
-public:
- /** destructor*/
- virtual ~RoutingReceiveInterface() {
- }
-
- /** Registers a Domain at the Audiomanager.
- * \return a unique ID of the domain */
- virtual domain_t registerDomain(char* name, /**< the name of the domain. Must be unique in the system*/
- char* busname, /**< the name of the bus that is used laster to talk to the domain*/
- char* node, /**< the nonde of the bus*/
- bool earlymode /**< true if the domain is in earlymode*/
- )=0;
-
- /** Registers a Gateway at the Audiomanager
- * \return a unique ID of the gateway */
- virtual gateway_t registerGateway(char* name, /**< the name of the gateway. Should be unique in the system*/
- char* sink, /**< the name of the sink (on the emitting side)*/
- char* source, /**< the name of the source (on the receiving side)*/
- char *domainSource, /**< the domain of the source*/
- char* domainSink, /**< the domain of the sink*/
- char* controlDomain /**< the controlling domain*/
- )=0;
-
- /** registers a Sink at the Audiomanager
- * \return a unique ID of the sink.*/
- virtual sink_t registerSink(char* name, /**< the name of the sink to be registered. Sink names must be unique within a Domain*/
- char* sinkclass, /**< the name of the class. Must be valid otherwise registration fails*/
- char* domain /**< the domain name of the sink*/
- )=0;
-
- /** registers a Source at the Audiomanager *
- * \return unique ID of the source */
- virtual source_t registerSource(char* name, /**< the name of the source to be registered. Source names must be unique wihin the Domain*/
- char* audioclass, /**< the name of the class. If not existend, default will be used.*/
- char* domain /**< the domain of the sink*/
- )=0;
-
- /** just get the ID of a domain without registering it. This is used to register Gateways.
- * During the time of registration it is unclear if the other Domain already exists. This function will either
- * return the already existing ID or reserve an ID with is then used later when the domain is registered. *
- * \return the unique Id of the domain. */
- virtual domain_t peekDomain(char* name /**< the name of the domain*/
- )=0;
-
- /**Acknowledgement of a connect. This function shall be called when a connect event is finished
- *
- * @param handle the the handle for the connection
- * @param error reads GEN_OK on success, other errors in case of problems
- */
- virtual void ackConnect(genHandle_t handle, genError_t error)=0;
-
-};
-
-/** Routing Send sendInterface
- * This class implements everything from Audiomanager -> RoutingAdapter
- */
-class RoutingSendInterface {
-public:
-
- RoutingSendInterface();
-
- /** destructor*/
- virtual ~RoutingSendInterface();
-
- /** starts up the interface. In the implementations, here is the best place for
- * init routines.
- */
- virtual void startup_interface(RoutingReceiveInterface * action /**< hands over the handle to the receive object. */
- )=0;
-
- /** connect a source to a sink
- * \return the unique ID of the connection.
- */
- virtual connection_t connect(source_t source, /**< the ID of the source*/
- sink_t sink, /**< the ID of the sink*/
- connection_t con_ID /**< the ID of the connection*/
- )=0;
-
- /** disconnect a connection
- * \return true on success
- */
- virtual bool disconnect(connection_t connection_ID /**< the ID of the connection*/
- )=0;
-
- /** this method is used to retrieve the busname during startup of the plugin.
- * Needs to be implemented
- */
- virtual void return_BusName(char* BusName /**< pointer to the Busname that needs to be returned*/
- )=0;
-
- /** this method is used to set the volume of a sink
- * \return returns the new value or -1 on error or impossible.
- * It is not mandatory that a Plugin implements this feature.
- */
- virtual volume_t setSinkVolume(volume_t volume, /**< new volume */
- sink_t sinkID /**< sinkID to change */
- )=0;
-
- /** this method is used to set the volume of a source
- * \return returns the new value or -1 on error or impossible.
- * It is not mandatory that a Plugin implements this feature.
- */
- virtual volume_t setSourceVolume(volume_t volume, /**< new volume */
- source_t sourceID /**< sourceID to change */
- )=0;
-
- /** this method is used to mute a source
- *
- * \return true if succeeded
- * \todo add error codes to answers
- */
- virtual bool muteSource(source_t sourceID /**< SourceID to be muted */
- )=0;
-
- /** this method is used to mute a sink
- *
- * \return true if succeeded
- * \todo add error codes to answers
- */
- virtual bool muteSink(sink_t sinkID /**< SinkID to be muted */
- )=0;
-
- /** this method is used to unmute a source
- *
- * \return true if succeeded
- * \todo add error codes to answers
- */
- virtual bool unmuteSource(source_t sourceID /**< SourceID to be unmuted */
- )=0;
-
- /** this method is used to unmute a sink
- *
- * \return true if succeeded
- * \todo add error codes to answers
- */
- virtual bool unmuteSink(sink_t sinkID /**< SinkID to be unmuted */
- )=0;
-
- /** signal that tells the plugin that the system is ready. Is used to trigger a registration of Domains, etc..*/
- virtual void system_ready()=0;
-};
-
-#endif /* ROUTINGINTERFACE_H_ */
+/**
+ * Copyright (C) 2011, BMW AG
+ *
+ * AudioManangerDeamon
+ *
+ * \file routinginterface.h
+ *
+ * \date 20.05.2011
+ * \author Christian Müller (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 Müller 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 ROUTINGINTERFACE_H_
+#define ROUTINGINTERFACE_H_
+
+#include "dataTypes.h"
+
+class RoutingSendInterface;
+
+/** Routing Receive sendInterface description.
+ * This class implements everything from RoutingAdapter -> Audiomanager
+ */
+class RoutingReceiveInterface {
+public:
+ /**
+ * What happens now?
+ */
+ virtual domain_t registerDomain(char* name, char* busname, char* node, bool earlymode) =0;
+
+ /** Registers a Gateway at the Audiomanager
+ * \return a unique ID of the gateway */
+ virtual gateway_t registerGateway(char* name, char* sink, char* source, char* domainSource, char* domainSink, char* controlDomain) =0;
+
+ /** registers a Sink at the Audiomanager
+ * \return a unique ID of the sink.*/
+ virtual sink_t registerSink(char* name, char* sinkclass, char* domain) =0;
+
+ /** registers a Source at the Audiomanager *
+ * \return unique ID of the source */
+ virtual source_t registerSource(char* name, char* audioclass, char* domain) =0;
+
+ /** just get the ID of a domain without registering it. This is used to register Gateways.
+ * During the time of registration it is unclear if the other Domain already exists. This function will either
+ * return the already existing ID or reserve an ID with is then used later when the domain is registered. *
+ * \return the unique Id of the domain. */
+ virtual domain_t peekDomain(char* name) =0;
+
+ /**Acknowledgement of a connect. This function shall be called when a connect event is finished
+ *
+ * @param handle the the handle for the connection
+ * @param error reads GEN_OK on success, other errors in case of problems
+ */
+ virtual void ackConnect(genHandle_t handle, genError_t error)=0;
+ /**
+ * Just check me out I am the comment
+ */
+ virtual void ackDisconnect(genHandle_t handle, genError_t error);
+
+};
+
+/** Routing Send sendInterface
+ * This class implements everything from Audiomanager -> RoutingAdapter
+ */
+class RoutingSendInterface {
+public:
+
+ /** destructor*/
+ virtual ~RoutingSendInterface();
+
+ /** starts up the interface. In the implementations, here is the best place for
+ * init routines.
+ */
+ virtual void startup_interface(RoutingReceiveInterface * action /**< hands over the handle to the receive object. */
+ )=0;
+
+ /** connect a source to a sink
+ * \return the unique ID of the connection.
+ */
+ virtual genError_t connect(source_t source, sink_t sink, connection_t con_ID) =0;
+
+ /** disconnect a connection
+ * \return true on success
+ */
+ virtual genError_t disconnect(connection_t connection_ID) =0;
+
+ /** this method is used to retrieve the busname during startup of the plugin.
+ * Needs to be implemented
+ */
+ virtual void return_BusName(char* BusName) =0;
+
+ /** this method is used to set the volume of a sink
+ * \return returns the new value or -1 on error or impossible.
+ * It is not mandatory that a Plugin implements this feature.
+ */
+ virtual genError_t setSinkVolume(volume_t volume, sink_t sinkID) =0;
+
+ /** this method is used to set the volume of a source
+ * \return returns the new value or -1 on error or impossible.
+ * It is not mandatory that a Plugin implements this feature.
+ */
+ virtual genError_t setSourceVolume(volume_t volume, source_t sourceID) =0;
+
+ /** this method is used to mute a source
+ *
+ * \return true if succeeded
+ * \todo add error codes to answers
+ */
+ virtual genError_t muteSource(source_t sourceID) =0;
+
+ /** this method is used to mute a sink
+ *
+ * \return true if succeeded
+ * \todo add error codes to answers
+ */
+ virtual genError_t muteSink(sink_t sinkID) =0;
+
+ /** this method is used to unmute a source
+ *
+ * \return true if succeeded
+ * \todo add error codes to answers
+ */
+ virtual genError_t unmuteSource(source_t sourceID) =0;
+
+ /** this method is used to unmute a sink
+ *
+ * \return true if succeeded
+ * \todo add error codes to answers
+ */
+ virtual genError_t unmuteSink(sink_t sinkID) =0;
+
+ /** signal that tells the plugin that the system is ready. Is used to trigger a registration of Domains, etc..*/
+ virtual void system_ready()=0;
+ /**
+ * connect a source to a sink \return the unique ID of the connection.
+ */
+ virtual genError_t asyncConnect(source_t source, sink_t sink, connection_t con_ID) =0;
+ /**
+ * disconnect a connection \return true on success
+ */
+ virtual genError_t asyncDisconnect(connection_t connection_ID) =0;
+};
+
+#endif /* ROUTINGINTERFACE_H_ */