summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Brandner <simon.brandner@partner.bmw.de>2011-07-01 15:06:11 +0200
committerSimon Brandner <simon.brandner@partner.bmw.de>2011-07-01 15:06:11 +0200
commit9d723d9b3918d8c9227b806aa9f016699e234a15 (patch)
tree9ec0170ee232818761a8e6046652bff2be9686b5
parentd61f9cbeeb25c02d73fc99170b1bdf0cc802002f (diff)
parente6ad5d883663688d0e36e9d506aa9a1f1190c47f (diff)
downloadaudiomanager-9d723d9b3918d8c9227b806aa9f016699e234a15.tar.gz
Merge branch 'master' of 10.250.89.137:audiomangenivi
-rw-r--r--AudioManGUI/Doxyfile.in2
-rw-r--r--AudioManagerDaemon/AudioManagerCore.cpp (renamed from AudioManagerDeamon/AudioManagerCore.cpp)0
-rw-r--r--AudioManagerDaemon/AudioManagerCore.h (renamed from AudioManagerDeamon/AudioManagerCore.h)0
-rw-r--r--AudioManagerDaemon/CMakeLists.txt (renamed from AudioManagerDeamon/CMakeLists.txt)0
-rw-r--r--AudioManagerDaemon/DBusCommandInterface.cpp (renamed from AudioManagerDeamon/DBusCommandInterface.cpp)0
-rw-r--r--AudioManagerDaemon/DBusCommandInterface.h (renamed from AudioManagerDeamon/DBusCommandInterface.h)0
-rw-r--r--AudioManagerDaemon/DataBaseHandler.cpp (renamed from AudioManagerDeamon/DataBaseHandler.cpp)0
-rw-r--r--AudioManagerDaemon/DataBaseHandler.h (renamed from AudioManagerDeamon/DataBaseHandler.h)0
-rw-r--r--AudioManagerDaemon/Doxyfile.in (renamed from AudioManagerDeamon/Doxyfile.in)4
-rw-r--r--AudioManagerDaemon/HookEngine.cpp (renamed from AudioManagerDeamon/HookEngine.cpp)0
-rw-r--r--AudioManagerDaemon/HookEngine.h (renamed from AudioManagerDeamon/HookEngine.h)0
-rw-r--r--AudioManagerDaemon/Router.cpp (renamed from AudioManagerDeamon/Router.cpp)0
-rw-r--r--AudioManagerDaemon/Router.h (renamed from AudioManagerDeamon/Router.h)0
-rw-r--r--AudioManagerDaemon/RoutingReceive.cpp (renamed from AudioManagerDeamon/RoutingReceive.cpp)0
-rw-r--r--AudioManagerDaemon/RoutingReceive.h (renamed from AudioManagerDeamon/RoutingReceive.h)0
-rw-r--r--AudioManagerDaemon/audioManagerIncludes.h (renamed from AudioManagerDeamon/audioManagerIncludes.h)0
-rw-r--r--AudioManagerDaemon/dataTypes.h (renamed from AudioManagerDeamon/dataTypes.h)0
-rw-r--r--AudioManagerDaemon/main.cpp (renamed from AudioManagerDeamon/main.cpp)0
-rw-r--r--AudioManagerDaemon/mainpage.h (renamed from AudioManagerDeamon/mainpage.h)0
-rw-r--r--AudioManagerDaemon/routinginterface.h (renamed from AudioManagerDeamon/routinginterface.h)0
-rw-r--r--PlayerGUI/Doxyfile.in2
-rw-r--r--PluginRoutingInterfaceDbus/CMakeLists.txt2
-rw-r--r--PluginRoutingInterfaceDbus/Doxyfile.in2
-rw-r--r--PluginRoutingInterfaceJack/CMakeLists.txt2
-rw-r--r--PluginRoutingInterfaceJack/Doxyfile.in4
-rw-r--r--PluginStructuralTest/CMakeLists.txt2
-rw-r--r--PluginStructuralTest/Doxyfile.in2
-rw-r--r--README2
-rw-r--r--pluginRoutingInterfaceTCP/CMakeLists.txt70
-rw-r--r--pluginRoutingInterfaceTCP/RoutingSend.cpp46
-rw-r--r--pluginRoutingInterfaceTCP/RoutingSend.h44
-rw-r--r--pluginRoutingInterfaceTCP/TcpServer.cpp68
-rw-r--r--pluginRoutingInterfaceTCP/TcpServer.h34
-rw-r--r--pluginRoutingInterfaceTCP/tcpClient.cpp62
-rw-r--r--pluginRoutingInterfaceTCP/tcpClient.h36
35 files changed, 372 insertions, 12 deletions
diff --git a/AudioManGUI/Doxyfile.in b/AudioManGUI/Doxyfile.in
index cbd42ac..2d9095f 100644
--- a/AudioManGUI/Doxyfile.in
+++ b/AudioManGUI/Doxyfile.in
@@ -590,7 +590,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = /home/blacky/workspace/AudioManGUI
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
diff --git a/AudioManagerDeamon/AudioManagerCore.cpp b/AudioManagerDaemon/AudioManagerCore.cpp
index 9133006..9133006 100644
--- a/AudioManagerDeamon/AudioManagerCore.cpp
+++ b/AudioManagerDaemon/AudioManagerCore.cpp
diff --git a/AudioManagerDeamon/AudioManagerCore.h b/AudioManagerDaemon/AudioManagerCore.h
index 36d86b5..36d86b5 100644
--- a/AudioManagerDeamon/AudioManagerCore.h
+++ b/AudioManagerDaemon/AudioManagerCore.h
diff --git a/AudioManagerDeamon/CMakeLists.txt b/AudioManagerDaemon/CMakeLists.txt
index 67da2e0..67da2e0 100644
--- a/AudioManagerDeamon/CMakeLists.txt
+++ b/AudioManagerDaemon/CMakeLists.txt
diff --git a/AudioManagerDeamon/DBusCommandInterface.cpp b/AudioManagerDaemon/DBusCommandInterface.cpp
index 775d5d6..775d5d6 100644
--- a/AudioManagerDeamon/DBusCommandInterface.cpp
+++ b/AudioManagerDaemon/DBusCommandInterface.cpp
diff --git a/AudioManagerDeamon/DBusCommandInterface.h b/AudioManagerDaemon/DBusCommandInterface.h
index 8eaa51f..8eaa51f 100644
--- a/AudioManagerDeamon/DBusCommandInterface.h
+++ b/AudioManagerDaemon/DBusCommandInterface.h
diff --git a/AudioManagerDeamon/DataBaseHandler.cpp b/AudioManagerDaemon/DataBaseHandler.cpp
index 788e835..788e835 100644
--- a/AudioManagerDeamon/DataBaseHandler.cpp
+++ b/AudioManagerDaemon/DataBaseHandler.cpp
diff --git a/AudioManagerDeamon/DataBaseHandler.h b/AudioManagerDaemon/DataBaseHandler.h
index 03704af..03704af 100644
--- a/AudioManagerDeamon/DataBaseHandler.h
+++ b/AudioManagerDaemon/DataBaseHandler.h
diff --git a/AudioManagerDeamon/Doxyfile.in b/AudioManagerDaemon/Doxyfile.in
index fbb3169..bb1ef58 100644
--- a/AudioManagerDeamon/Doxyfile.in
+++ b/AudioManagerDaemon/Doxyfile.in
@@ -590,7 +590,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = /home/blacky/workspace/AudioManagerDeamon
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -801,7 +801,7 @@ COLS_IN_ALPHA_INDEX = 5
# should be ignored while generating the index headers.
IGNORE_PREFIX =
-dbus
+
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
diff --git a/AudioManagerDeamon/HookEngine.cpp b/AudioManagerDaemon/HookEngine.cpp
index c03eadc..c03eadc 100644
--- a/AudioManagerDeamon/HookEngine.cpp
+++ b/AudioManagerDaemon/HookEngine.cpp
diff --git a/AudioManagerDeamon/HookEngine.h b/AudioManagerDaemon/HookEngine.h
index 4586bf5..4586bf5 100644
--- a/AudioManagerDeamon/HookEngine.h
+++ b/AudioManagerDaemon/HookEngine.h
diff --git a/AudioManagerDeamon/Router.cpp b/AudioManagerDaemon/Router.cpp
index 6952433..6952433 100644
--- a/AudioManagerDeamon/Router.cpp
+++ b/AudioManagerDaemon/Router.cpp
diff --git a/AudioManagerDeamon/Router.h b/AudioManagerDaemon/Router.h
index 683b75e..683b75e 100644
--- a/AudioManagerDeamon/Router.h
+++ b/AudioManagerDaemon/Router.h
diff --git a/AudioManagerDeamon/RoutingReceive.cpp b/AudioManagerDaemon/RoutingReceive.cpp
index 6108495..6108495 100644
--- a/AudioManagerDeamon/RoutingReceive.cpp
+++ b/AudioManagerDaemon/RoutingReceive.cpp
diff --git a/AudioManagerDeamon/RoutingReceive.h b/AudioManagerDaemon/RoutingReceive.h
index 81e9213..81e9213 100644
--- a/AudioManagerDeamon/RoutingReceive.h
+++ b/AudioManagerDaemon/RoutingReceive.h
diff --git a/AudioManagerDeamon/audioManagerIncludes.h b/AudioManagerDaemon/audioManagerIncludes.h
index f5aeeef..f5aeeef 100644
--- a/AudioManagerDeamon/audioManagerIncludes.h
+++ b/AudioManagerDaemon/audioManagerIncludes.h
diff --git a/AudioManagerDeamon/dataTypes.h b/AudioManagerDaemon/dataTypes.h
index 604e7aa..604e7aa 100644
--- a/AudioManagerDeamon/dataTypes.h
+++ b/AudioManagerDaemon/dataTypes.h
diff --git a/AudioManagerDeamon/main.cpp b/AudioManagerDaemon/main.cpp
index a31c2db..a31c2db 100644
--- a/AudioManagerDeamon/main.cpp
+++ b/AudioManagerDaemon/main.cpp
diff --git a/AudioManagerDeamon/mainpage.h b/AudioManagerDaemon/mainpage.h
index 8a94c2c..8a94c2c 100644
--- a/AudioManagerDeamon/mainpage.h
+++ b/AudioManagerDaemon/mainpage.h
diff --git a/AudioManagerDeamon/routinginterface.h b/AudioManagerDaemon/routinginterface.h
index d8a063e..d8a063e 100644
--- a/AudioManagerDeamon/routinginterface.h
+++ b/AudioManagerDaemon/routinginterface.h
diff --git a/PlayerGUI/Doxyfile.in b/PlayerGUI/Doxyfile.in
index e07f616..29ddfc4 100644
--- a/PlayerGUI/Doxyfile.in
+++ b/PlayerGUI/Doxyfile.in
@@ -590,7 +590,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = /home/blacky/workspace/PlayerGUI
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
diff --git a/PluginRoutingInterfaceDbus/CMakeLists.txt b/PluginRoutingInterfaceDbus/CMakeLists.txt
index c5fa002..ed15031 100644
--- a/PluginRoutingInterfaceDbus/CMakeLists.txt
+++ b/PluginRoutingInterfaceDbus/CMakeLists.txt
@@ -21,7 +21,7 @@ INCLUDE_DIRECTORIES(
${STD_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
${DBUS_FOLDER}
- ../AudioManagerDeamon
+ ../AudioManagerDaemon
)
# add Qt modules here, the include will setup QT_LIBRARIES
diff --git a/PluginRoutingInterfaceDbus/Doxyfile.in b/PluginRoutingInterfaceDbus/Doxyfile.in
index 8cd2e46..9a193ed 100644
--- a/PluginRoutingInterfaceDbus/Doxyfile.in
+++ b/PluginRoutingInterfaceDbus/Doxyfile.in
@@ -590,7 +590,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = /home/blacky/workspace/PluginRoutingInterfaceDbus
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
diff --git a/PluginRoutingInterfaceJack/CMakeLists.txt b/PluginRoutingInterfaceJack/CMakeLists.txt
index 5c52bdb..cbd3f38 100644
--- a/PluginRoutingInterfaceJack/CMakeLists.txt
+++ b/PluginRoutingInterfaceJack/CMakeLists.txt
@@ -24,7 +24,7 @@ INCLUDE_DIRECTORIES(
${STD_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${JACK_INCLUDE_DIRS}
- ../AudioManagerDeamon
+ ../AudioManagerDaemon
)
LINK_DIRECTORIES(
diff --git a/PluginRoutingInterfaceJack/Doxyfile.in b/PluginRoutingInterfaceJack/Doxyfile.in
index 8cdca51..a19e1c1 100644
--- a/PluginRoutingInterfaceJack/Doxyfile.in
+++ b/PluginRoutingInterfaceJack/Doxyfile.in
@@ -115,7 +115,7 @@ INLINE_INHERITED_MEMB = NO
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
-FULL_PATH_NAMES = YES
+FULL_PATH_NAMES = NO
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user-defined part of the path. Stripping is
@@ -590,7 +590,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = /home/blacky/workspace/PluginRoutingInterfaceJack
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
diff --git a/PluginStructuralTest/CMakeLists.txt b/PluginStructuralTest/CMakeLists.txt
index 8e62162..aae04c4 100644
--- a/PluginStructuralTest/CMakeLists.txt
+++ b/PluginStructuralTest/CMakeLists.txt
@@ -27,7 +27,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${QT_INCLUDE_DIR}
${DBUS_FOLDER}
- ../AudioManagerDeamon
+ ../AudioManagerDaemon
)
# defines for QL Plugins
diff --git a/PluginStructuralTest/Doxyfile.in b/PluginStructuralTest/Doxyfile.in
index 41bb583..aa7eed3 100644
--- a/PluginStructuralTest/Doxyfile.in
+++ b/PluginStructuralTest/Doxyfile.in
@@ -590,7 +590,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = /home/blacky/workspace/PluginStructuralTest
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
diff --git a/README b/README
index a34434a..cccd2dd 100644
--- a/README
+++ b/README
@@ -175,7 +175,7 @@ If you want to have the same as the demo in Dublin, start now the jack equalizer
Now it's time to start pulseaudio, since we need to start it with a special configuration, get into the pulseaudio directory and run
- src/pulseaudio -n -F src/default.pa -p $(pwd)/src/.libs/ -vvvv
+ src/pulseaudio -n -F src/test.pa -p $(pwd)/src/.libs/ -vvvv
The next step is to start the DLT server
diff --git a/pluginRoutingInterfaceTCP/CMakeLists.txt b/pluginRoutingInterfaceTCP/CMakeLists.txt
new file mode 100644
index 0000000..48e5290
--- /dev/null
+++ b/pluginRoutingInterfaceTCP/CMakeLists.txt
@@ -0,0 +1,70 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(PluginRoutingInterfaceTCP)
+
+set(CMAKE_CXX_FLAGS "-g -pipe -fPIC -Wall -W -D_REENTRANT")
+
+set(STD_INCLUDE_DIRS "/usr/include")
+set(EXECUTABLE_OUTPUT_PATH ../../bin/)
+set(LIBRARY_OUTPUT_PATH ../plugins)
+set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../dbusInterfaces)
+
+cmake_policy(SET CMP0015 NEW)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+FIND_PACKAGE(PkgConfig)
+pkg_check_modules(GLIB REQUIRED glib-2.0)
+
+INCLUDE_DIRECTORIES(
+ include
+ ${CMAKE_SOURCE_DIR}
+ ${STD_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
+ ${DBUS_FOLDER}
+ ../AudioManagerDaemon
+)
+
+LINK_DIRECTORIES(
+ ${LINK_DIRECTORIES}
+ ${GLIB_LIBRARY_DIRS}
+)
+
+# add Qt modules here, the include will setup QT_LIBRARIES
+SET(QT_USE_QTNETWORK TRUE)
+
+# defines for QL Plugins
+ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(-DQT_STATICPLUGIN)
+ADD_DEFINITIONS(-DQT_PLUGIN)
+ADD_DEFINITIONS(-DQT_SHARED)
+
+
+
+INCLUDE(${QT_USE_FILE})
+
+# all source files go here
+SET(PLUGINJACK_SRCS_CXX
+ RoutingSend.cpp
+ tcpClient.cpp
+ TcpServer.cpp
+)
+
+# every header that contains QT stuff like Q_OBJECT .... and must be mocced
+SET(PLUGINJACK_MOC_SRCS
+ RoutingSend.h
+ tcpClient.h
+ TcpServer.h
+)
+
+#now take the headers, moc them and append the resulting moc files to the sources
+QT4_WRAP_CPP(PLUGINJACK_SRCS_CXX ${PLUGINJACK_MOC_SRCS})
+
+add_library(RoutingTcpPlugin ${PLUGINJACK_SRCS_CXX})
+
+TARGET_LINK_LIBRARIES(RoutingTcpPlugin
+ ${QT_LIBRARIES}
+)
+
+
+
+
diff --git a/pluginRoutingInterfaceTCP/RoutingSend.cpp b/pluginRoutingInterfaceTCP/RoutingSend.cpp
new file mode 100644
index 0000000..71829ac
--- /dev/null
+++ b/pluginRoutingInterfaceTCP/RoutingSend.cpp
@@ -0,0 +1,46 @@
+/*
+ * Bus_Interface.cpp
+ *
+ * Created on: Jan 19, 2011
+ * Author: demo
+ */
+#include <iostream>
+
+
+#include "RoutingSend.h"
+#include "routinginterface.h"
+#include "tcpMessages.h"
+
+
+using namespace std;
+
+
+void RoutingSendTcp::startup_interface(RoutingReceiveInterface* audioman){
+ audiomanager=audioman;
+ m_server=new TcpServer(AUDIOMAN_PORT);
+ m_client=new tcpClient(BEAGLE_IP,BEAGLE_PORT);
+ m_server->registerAudioManager(audiomanager);
+ cout<<"server started"<<endl;
+}
+
+void RoutingSendTcp::return_BusName(char* BusName) {
+ strcpy(BusName,BUS_NAME);
+}
+
+int RoutingSendTcp::Connect(int source, int sink){
+ return m_client->connect(source,sink);
+}
+
+void RoutingSendTcp::system_ready() {
+
+ m_client->system_ready();
+ cout<<"Tcp ready"<<endl;
+
+}
+
+
+RoutingSendInterface* SampleRoutingInterfaceTcpFactory::returnInstance(){
+ return new RoutingSendTcp();
+}
+
+Q_EXPORT_PLUGIN2(RoutingTcpPlugin, SampleRoutingInterfaceTcpFactory);
diff --git a/pluginRoutingInterfaceTCP/RoutingSend.h b/pluginRoutingInterfaceTCP/RoutingSend.h
new file mode 100644
index 0000000..30518a6
--- /dev/null
+++ b/pluginRoutingInterfaceTCP/RoutingSend.h
@@ -0,0 +1,44 @@
+/*
+ * Bus_Interface.h
+ *
+ * Created on: Feb 24, 2011
+ * Author: demo
+ */
+
+#ifndef BUS_INTERFACE_H_
+#define BUS_INTERFACE_H_
+
+#include <qplugin.h>
+#include "routinginterface.h"
+#include "TcpServer.h"
+#include "tcpClient.h"
+
+#define BUS_NAME "TCP"
+
+class RoutingSendTcp: public RoutingSendInterface
+{
+Q_OBJECT
+public:
+ void startup_interface(RoutingReceiveInterface * audioman);
+ void return_BusName(char * BusName);
+ int Connect(int source, int sink);
+public slots:
+ void system_ready();
+
+private:
+ RoutingReceiveInterface *audiomanager;
+ TcpServer* m_server;
+ tcpClient* m_client;
+};
+
+//That is the actual implementation of the Factory Class returning the real Interface
+
+class SampleRoutingInterfaceTcpFactory: public QObject, public RoutingInterfaceFactory
+{
+Q_OBJECT
+Q_INTERFACES(RoutingInterfaceFactory)
+public:
+ RoutingSendInterface* returnInstance();
+};
+
+#endif /* BUS_INTERFACE_H_ */
diff --git a/pluginRoutingInterfaceTCP/TcpServer.cpp b/pluginRoutingInterfaceTCP/TcpServer.cpp
new file mode 100644
index 0000000..1e63f8b
--- /dev/null
+++ b/pluginRoutingInterfaceTCP/TcpServer.cpp
@@ -0,0 +1,68 @@
+/*
+ * TcpServer.cpp
+ *
+ * Created on: Apr 6, 2011
+ * Author: blacky
+ */
+
+#include "TcpServer.h"
+
+#include <iostream>
+#include <QList>
+#include <QByteArray>
+
+using namespace std;
+
+TcpServer::TcpServer(int ListenPort) {
+ connect(this, SIGNAL(newConnection()), this, SLOT(receivedCommand()));
+ if (! this->listen(QHostAddress::Any,ListenPort)) {
+ cout<<" Problem: "<<this->errorString().toStdString()<<endl;
+ }
+}
+
+TcpServer::~TcpServer() {
+ // TODO Auto-generated destructor stub
+}
+
+void TcpServer::registerAudioManager(RoutingReceiveInterface *audiomanager_) {
+ audiomanager=audiomanager_;
+}
+
+void TcpServer::receivedCommand() {
+ socket=this->nextPendingConnection ();
+ connect(socket, SIGNAL(readyRead()), this, SLOT(startRead()));
+ cout<<"got new command"<<endl;
+}
+
+void TcpServer::startRead() {
+ QByteArray buffer;
+ int answer;
+ bool earlyMode=false;
+ buffer=socket->readAll();
+ QList<QByteArray> bList=buffer.split('#');
+ switch (bList.at(0).toInt()) {
+ case MSG_registerDomain:
+ if (QString(bList.at(4))=="true") {
+ earlyMode=true;
+ }
+ answer=audiomanager->registerDomain((char*)bList.at(1).data(),(char*)bList.at(2).data(),(char*)bList.at(3).data(),earlyMode);
+ socket->write(QByteArray::number(answer));
+ break;
+ case MSG_registerGateway:
+ answer=audiomanager->registerGateway((char*)bList.at(1).data(),(char*)bList.at(2).data(),(char*)bList.at(3).data(),(char*)bList.at(4).data(),(char*)bList.at(5).data(),(char*)bList.at(6).data());
+ socket->write(QByteArray::number(answer));
+ break;
+ case MSG_registerSink:
+ answer=audiomanager->registerSink((char*)bList.at(1).data(),(char*)bList.at(2).data(),(char*)bList.at(3).data());
+ socket->write(QByteArray::number(answer));
+ break;
+ case MSG_registerSource:
+ answer=audiomanager->registerSource((char*)bList.at(1).data(),(char*)bList.at(2).data(),(char*)bList.at(3).data());
+ socket->write(QByteArray::number(answer));
+ break;
+ case MSG_peekDomain:
+ answer=audiomanager->peekDomain((char*)bList.at(1).data());
+ socket->write(QByteArray::number(answer));
+ break;
+ }
+}
diff --git a/pluginRoutingInterfaceTCP/TcpServer.h b/pluginRoutingInterfaceTCP/TcpServer.h
new file mode 100644
index 0000000..32f9745
--- /dev/null
+++ b/pluginRoutingInterfaceTCP/TcpServer.h
@@ -0,0 +1,34 @@
+/*
+ * TcpServer.h
+ *
+ * Created on: Apr 6, 2011
+ * Author: blacky
+ */
+
+#ifndef I2CSERVER_H_
+#define I2CSERVER_H_
+
+#include <QtNetwork>
+#include <QObject>
+
+#include "routinginterface.h"
+#include "tcpMessages.h"
+
+class TcpServer : public QTcpServer{
+Q_OBJECT
+public:
+ TcpServer(int ListenPort);
+ virtual ~TcpServer();
+
+ void registerAudioManager(RoutingReceiveInterface *audiomanager_);
+
+public slots:
+ void receivedCommand();
+ void startRead();
+
+private:
+ QTcpSocket* socket;
+ RoutingReceiveInterface *audiomanager;
+};
+
+#endif /* I2CSERVER_H_ */
diff --git a/pluginRoutingInterfaceTCP/tcpClient.cpp b/pluginRoutingInterfaceTCP/tcpClient.cpp
new file mode 100644
index 0000000..b2aefe3
--- /dev/null
+++ b/pluginRoutingInterfaceTCP/tcpClient.cpp
@@ -0,0 +1,62 @@
+/*
+ * udpClient.cpp
+ *
+ * Created on: Apr 6, 2011
+ * Author: blacky
+ */
+
+#include "tcpClient.h"
+#include <iostream>
+
+using namespace std;
+
+tcpClient::tcpClient(QString serverIP_, int serverPort_) {
+ serverIP=serverIP_;
+ serverPort=serverPort_;
+ QObject::connect(this, SIGNAL(connected()), this, SLOT(sendOut()));
+}
+
+tcpClient::~tcpClient() {
+ // TODO Auto-generated destructor stub
+}
+
+int tcpClient::connect(int source, int sink) {
+
+ sendBuffer.clear();
+ sendBuffer.append(QByteArray::number(MSG_CONNECT));
+ sendBuffer.append('#');
+ sendBuffer.append(QByteArray::number(source));
+ sendBuffer.append('#');
+ sendBuffer.append(QByteArray::number(sink));
+ if (send()) {
+ this->waitForReadyRead(CONNECT_TIMEOUT);
+ return this->readAll().toInt();
+ } else {
+ return -1;
+ }
+
+}
+
+void tcpClient::system_ready() {
+
+ sendBuffer.clear();
+ sendBuffer.append(QByteArray::number(SIG_system_ready));
+ send();
+}
+
+bool tcpClient::send() {
+ QHostAddress adr;
+ adr.setAddress(serverIP);
+ this->connectToHost(adr,serverPort);
+ if (!this->waitForConnected(CONNECT_TIMEOUT)) {
+ cout<<"No connection"<<endl;
+ return false;
+ } else {
+ cout<<"got connection"<<endl;
+ return true;
+ }
+}
+
+void tcpClient::sendOut() {
+ this->write(sendBuffer);
+}
diff --git a/pluginRoutingInterfaceTCP/tcpClient.h b/pluginRoutingInterfaceTCP/tcpClient.h
new file mode 100644
index 0000000..1d93246
--- /dev/null
+++ b/pluginRoutingInterfaceTCP/tcpClient.h
@@ -0,0 +1,36 @@
+/*
+ * udpClient.h
+ *
+ * Created on: Apr 6, 2011
+ * Author: blacky
+ */
+#ifndef UDPCLIENT_H_
+#define UDPCLIENT_H_
+
+#include <QtNetwork>
+#include "tcpMessages.h"
+
+class tcpClient : public QTcpSocket
+{
+Q_OBJECT
+public:
+ tcpClient(QString serverIP, int serverPort);
+ virtual ~tcpClient();
+
+ int connect(int source, int sink);
+ void system_ready();
+
+ bool send();
+
+public slots:
+ void sendOut();
+
+
+private:
+ QString serverIP;
+ int serverPort;
+ QByteArray sendBuffer;
+
+};
+
+#endif /* UDPCLIENT_H_ */