summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-03-05 22:49:12 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2012-03-05 22:49:12 +0100
commit8ced1dced5ae1fbc7356ec65c03e6e8201216155 (patch)
treeb4b19aac085948040d775e284455a0041b17e022 /AudioManagerDaemon
parent1b85f2410d1d644ff00284e78b1eeff6cfad2fc4 (diff)
downloadaudiomanager-8ced1dced5ae1fbc7356ec65c03e6e8201216155.tar.gz
* updated license headers
* updated documentation
Diffstat (limited to 'AudioManagerDaemon')
-rw-r--r--AudioManagerDaemon/CMakeLists.txt33
-rw-r--r--AudioManagerDaemon/include/CAmCommandReceiver.h31
-rw-r--r--AudioManagerDaemon/include/CAmCommandSender.h28
-rw-r--r--AudioManagerDaemon/include/CAmControlReceiver.h31
-rw-r--r--AudioManagerDaemon/include/CAmControlSender.h28
-rw-r--r--AudioManagerDaemon/include/CAmDatabaseHandler.h155
-rw-r--r--AudioManagerDaemon/include/CAmDatabaseObserver.h33
-rw-r--r--AudioManagerDaemon/include/CAmRouter.h61
-rw-r--r--AudioManagerDaemon/include/CAmRoutingReceiver.h41
-rw-r--r--AudioManagerDaemon/include/CAmRoutingSender.h105
-rw-r--r--AudioManagerDaemon/include/CAmTelnetMenuHelper.h35
-rw-r--r--AudioManagerDaemon/include/CAmTelnetServer.h104
-rw-r--r--AudioManagerDaemon/include/DAmDoxygenMainPage.h436
-rw-r--r--AudioManagerDaemon/include/TAmPluginTemplate.h35
-rw-r--r--AudioManagerDaemon/src/CAmCommandReceiver.cpp78
-rw-r--r--AudioManagerDaemon/src/CAmCommandSender.cpp44
-rw-r--r--AudioManagerDaemon/src/CAmControlReceiver.cpp190
-rw-r--r--AudioManagerDaemon/src/CAmControlSender.cpp81
-rw-r--r--AudioManagerDaemon/src/CAmDatabaseHandler.cpp1302
-rw-r--r--AudioManagerDaemon/src/CAmDatabaseObserver.cpp28
-rw-r--r--AudioManagerDaemon/src/CAmDbusWrapper.cpp90
-rw-r--r--AudioManagerDaemon/src/CAmDltWrapper.cpp32
-rw-r--r--AudioManagerDaemon/src/CAmRouter.cpp76
-rw-r--r--AudioManagerDaemon/src/CAmRoutingReceiver.cpp207
-rw-r--r--AudioManagerDaemon/src/CAmRoutingSender.cpp189
-rw-r--r--AudioManagerDaemon/src/CAmSocketHandler.cpp99
-rw-r--r--AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp27
-rw-r--r--AudioManagerDaemon/src/CAmTelnetServer.cpp288
-rw-r--r--AudioManagerDaemon/src/main.cpp87
-rw-r--r--AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp28
-rw-r--r--AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.h27
-rw-r--r--AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt33
-rw-r--r--AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp28
-rw-r--r--AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.h28
-rw-r--r--AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt33
-rw-r--r--AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.cpp28
-rw-r--r--AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.h28
-rw-r--r--AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt33
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp28
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h28
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt33
-rw-r--r--AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp40
-rw-r--r--AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.h28
-rw-r--r--AudioManagerDaemon/test/AmSocketHandlerTest/CMakeLists.txt33
-rw-r--r--AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp31
-rw-r--r--AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h23
-rw-r--r--AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt33
-rw-r--r--AudioManagerDaemon/test/CAmCommonFunctions.cpp28
-rw-r--r--AudioManagerDaemon/test/CAmCommonFunctions.h28
-rw-r--r--AudioManagerDaemon/test/CMakeLists.txt33
-rw-r--r--AudioManagerDaemon/test/IAmCommandBackdoor.h28
-rw-r--r--AudioManagerDaemon/test/IAmControlBackdoor.h28
-rw-r--r--AudioManagerDaemon/test/IAmRoutingBackdoor.h28
-rw-r--r--AudioManagerDaemon/test/MockIAmCommandSend.h42
-rw-r--r--AudioManagerDaemon/test/MockIAmControlSend.h42
-rw-r--r--AudioManagerDaemon/test/MockIAmRoutingSend.h42
56 files changed, 2493 insertions, 2323 deletions
diff --git a/AudioManagerDaemon/CMakeLists.txt b/AudioManagerDaemon/CMakeLists.txt
index c0a31b0..e90afee 100644
--- a/AudioManagerDaemon/CMakeLists.txt
+++ b/AudioManagerDaemon/CMakeLists.txt
@@ -1,24 +1,19 @@
-#GENIVI AUDIOMANAGER
+# Copyright (C) 2012, GENIVI Alliance, Inc.
+# Copyright (C) 2012, BMW AG
#
-#Copyright (C) 2011, BMW AG
+# This file is part of GENIVI Project AudioManager.
+#
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+#
+# copyright
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
#
-#Datum 20.2.2012
-#author Christian Mueller (christian.ei.mueller@bmw.de)
-#
-#***********************************************************************************************************
-#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.
+# For further information see http://www.genivi.org/.
#
cmake_minimum_required(VERSION 2.6)
diff --git a/AudioManagerDaemon/include/CAmCommandReceiver.h b/AudioManagerDaemon/include/CAmCommandReceiver.h
index 72f72f2..ee1134f 100644
--- a/AudioManagerDaemon/include/CAmCommandReceiver.h
+++ b/AudioManagerDaemon/include/CAmCommandReceiver.h
@@ -1,32 +1,29 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CommandReveiver.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * \file CAmCommandReceiver.h
+ * For further information see http://www.genivi.org/.
*
*/
#ifndef COMMANDRECEIVER_H_
#define COMMANDRECEIVER_H_
-#include <command/IAmCommandReceive.h>
-#include <config.h>
+#include "command/IAmCommandReceive.h"
namespace am
{
diff --git a/AudioManagerDaemon/include/CAmCommandSender.h b/AudioManagerDaemon/include/CAmCommandSender.h
index d902e96..6c4e013 100644
--- a/AudioManagerDaemon/include/CAmCommandSender.h
+++ b/AudioManagerDaemon/include/CAmCommandSender.h
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CommandSender.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * \file CAmCommandSender.h
+ * For further information see http://www.genivi.org/.
*
*/
diff --git a/AudioManagerDaemon/include/CAmControlReceiver.h b/AudioManagerDaemon/include/CAmControlReceiver.h
index af5a0e4..bcc642e 100644
--- a/AudioManagerDaemon/include/CAmControlReceiver.h
+++ b/AudioManagerDaemon/include/CAmControlReceiver.h
@@ -1,32 +1,29 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmControlReceiver.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmControlReceiver.h
+ * For further information see http://www.genivi.org/.
*
*/
#ifndef CONTRONLRECEIVER_H_
#define CONTRONLRECEIVER_H_
-#include <control/IAmControlReceive.h>
-#include <config.h>
+#include "control/IAmControlReceive.h"
namespace am
{
diff --git a/AudioManagerDaemon/include/CAmControlSender.h b/AudioManagerDaemon/include/CAmControlSender.h
index ddc8cf3..5d7a169 100644
--- a/AudioManagerDaemon/include/CAmControlSender.h
+++ b/AudioManagerDaemon/include/CAmControlSender.h
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmControlSender.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmControlSender.h
+ * For further information see http://www.genivi.org/.
*
*/
diff --git a/AudioManagerDaemon/include/CAmDatabaseHandler.h b/AudioManagerDaemon/include/CAmDatabaseHandler.h
index ceaff88..7b1e48e 100644
--- a/AudioManagerDaemon/include/CAmDatabaseHandler.h
+++ b/AudioManagerDaemon/include/CAmDatabaseHandler.h
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmDatabaseHandler.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmDatabaseHandler.h
+ * For further information see http://www.genivi.org/.
*
*/
@@ -26,9 +24,10 @@
#define DATABASEHANDLER_H_
#include "audiomanagertypes.h"
-#include <sqlite3.h>
#include <map>
-#include <list>
+#include <vector>
+#include <string>
+#include <sqlite3.h>
namespace am
{
@@ -138,139 +137,39 @@ public:
am_Error_e peekSource(const std::string& name, am_sourceID_t& sourceID);
am_Error_e peekSinkClassID(const std::string& name, am_sinkClass_t& sinkClassID);
am_Error_e peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID);
- /**
- * checks for a certain mainConnection
- * @param mainConnectionID to be checked for
- * @return true if it exists
- */
- bool existMainConnection(const am_mainConnectionID_t mainConnectionID) const;
- /**
- * checks if a CrossFader exists
- * @param crossfaderID the ID of the crossfader to be checked
- * @return true if exists
- */
+ bool existMainConnection(const am_mainConnectionID_t mainConnectionID) const;
bool existcrossFader(const am_crossfaderID_t crossfaderID) const;
-
- /**
- * checks if a connection already exists.
- * Only takes sink, source and format information for search!
- * @param connection the connection to be checked
- * @return true if connections exists
- */
bool existConnection(const am_Connection_s connection);
-
- /**
- * checks if a connection with the given ID exists
- * @param connectionID
- * @return true if connection exits
- */
bool existConnectionID(const am_connectionID_t connectionID);
- /**
- * checks for a certain Source
- * @param sourceID to be checked for
- * @return true if it exists
- */
bool existSource(const am_sourceID_t sourceID) const;
-
- /**
- * checks if a source name or ID exists
- * @param sourceID the sourceID
- * @param name the name
- * @return true if it exits
- */
bool existSourceNameOrID(const am_sourceID_t sourceID, const std::string& name) const;
-
- /**
- * checks if a name exits
- * @param name the name
- * @return true if it exits
- */
bool existSourceName(const std::string& name) const;
- /**
- * checks for a certain Sink
- * @param sinkID to be checked for
- * @return true if it exists
- */
bool existSink(const am_sinkID_t sinkID) const;
-
- /**
- * checks if a sink with the ID or the name exists
- * @param sinkID the ID
- * @param name the name
- * @return true if it exists.
- */
bool existSinkNameOrID(const am_sinkID_t sinkID, const std::string& name) const;
-
- /**
- * checks if a sink with the name exists
- * @param name the name
- * @return true if it exists
- */
bool existSinkName(const std::string& name) const;
-
- /**
- * checks for a certain domain
- * @param domainID to be checked for
- * @return true if it exists
- */
bool existDomain(const am_domainID_t domainID) const;
-
- /**
- * checks for certain gateway
- * @param gatewayID to be checked for
- * @return true if it exists
- */
bool existGateway(const am_gatewayID_t gatewayID) const;
-
- /**
- * checks for certain SinkClass
- * @param sinkClassID
- * @return true if it exists
- */
bool existSinkClass(const am_sinkClass_t sinkClassID) const;
-
- /**
- * checks for certain sourceClass
- * @param sourceClassID
- * @return true if it exists
- */
bool existSourceClass(const am_sourceClass_t sourceClassID) const;
-
- /**
- * registers the Observer at the Database
- * @param iObserver pointer to the observer
- */
void registerObserver(CAmDatabaseObserver *iObserver);
-
- /**
- * gives information about the visibility of a source
- * @param sourceID the sourceID
- * @return true if source is visible
- */
bool sourceVisible(const am_sourceID_t sourceID) const;
-
- /**
- * gives information about the visibility of a sink
- * @param sinkID the sinkID
- * @return true if source is visible
- */
bool sinkVisible(const am_sinkID_t sinkID) const;
private:
- am_timeSync_t calculateMainConnectionDelay(const am_mainConnectionID_t mainConnectionID) const;
- bool sqQuery(const std::string& query);
+ am_timeSync_t calculateMainConnectionDelay(const am_mainConnectionID_t mainConnectionID) const; //!< calculates a new main connection delay
+ bool sqQuery(const std::string& query); //!< queries the database
bool openDatabase(); //!< opens the database
void createTables(); //!< creates all tables from the static table
- sqlite3 *mDatabase; //!< pointer to the database
+ sqlite3 *mpDatabase; //!< pointer to the database
std::string mPath; //!< path to the database
- CAmDatabaseObserver *mDatabaseObserver; //!< pointer to the Observer
- bool mFirstStaticSink;
- bool mFirstStaticSource;
- bool mFirstStaticGateway;
- bool mFirstStaticSinkClass;
- bool mFirstStaticSourceClass;
- bool mFirstStaticCrossfader;
+ CAmDatabaseObserver *mpDatabaseObserver; //!< pointer to the Observer
+ bool mFirstStaticSink; //!< bool for dynamic range handling
+ bool mFirstStaticSource; //!< bool for dynamic range handling
+ bool mFirstStaticGateway; //!< bool for dynamic range handling
+ bool mFirstStaticSinkClass; //!< bool for dynamic range handling
+ bool mFirstStaticSourceClass; //!< bool for dynamic range handling
+ bool mFirstStaticCrossfader; //!< bool for dynamic range handling
typedef std::map<am_gatewayID_t, std::vector<bool> > ListConnectionFormat; //!< type for list of connection formats
ListConnectionFormat mListConnectionFormat; //!< list of connection formats
};
diff --git a/AudioManagerDaemon/include/CAmDatabaseObserver.h b/AudioManagerDaemon/include/CAmDatabaseObserver.h
index 430f061..78c60a6 100644
--- a/AudioManagerDaemon/include/CAmDatabaseObserver.h
+++ b/AudioManagerDaemon/include/CAmDatabaseObserver.h
@@ -1,31 +1,29 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmDatabaseObserver.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmDatabaseObserver.h
+ * For further information see http://www.genivi.org/.
*
*/
#ifndef DATABASEOBSERVER_H_
#define DATABASEOBSERVER_H_
-#include <audiomanagertypes.h>
+#include "audiomanagertypes.h"
#include <queue>
#include "shared/CAmSerializer.h"
@@ -40,7 +38,6 @@ class CAmSocketHandler;
/**
* This class observes the Database and notifies other classes about important events, mainly the CommandSender.
*/
-
class CAmDatabaseObserver
{
public:
@@ -75,7 +72,7 @@ private:
CAmCommandSender *mCommandSender; //!< pointer to the comandSender
CAmRoutingSender* mRoutingSender; //!< pointer to the routingSender
CAmTelnetServer* mTelnetServer; //!< pointer to the telnetserver
- CAmSerializer mSerializer;
+ CAmSerializer mSerializer; //!< serializer to handle the CommandInterface via the mainloop
};
}
diff --git a/AudioManagerDaemon/include/CAmRouter.h b/AudioManagerDaemon/include/CAmRouter.h
index ba13bf1..9b2b4d2 100644
--- a/AudioManagerDaemon/include/CAmRouter.h
+++ b/AudioManagerDaemon/include/CAmRouter.h
@@ -1,31 +1,29 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmRouter.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmRouter.h
+ * For further information see http://www.genivi.org/.
*
*/
#ifndef ROUTER_H_
#define ROUTER_H_
-#include <audiomanagertypes.h>
+#include "audiomanagertypes.h"
namespace am
{
@@ -33,47 +31,56 @@ namespace am
class CAmDatabaseHandler;
class CAmControlSender;
+/**
+ * Implements an autorouting algorithm for connecting sinks and sources via different audio domains.
+ */
class CAmRouter
{
public:
CAmRouter(CAmDatabaseHandler* iDatabaseHandler, CAmControlSender* iSender);
- am_Error_e getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s>& returnList);
~CAmRouter();
+ am_Error_e getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s>& returnList);
private:
am_Error_e findBestWay(am_sinkID_t sinkID, am_sourceID_t sourceID, std::vector<am_RoutingElement_s>& listRoute, std::vector<am_RoutingElement_s>::iterator routeIterator, std::vector<am_gatewayID_t>::iterator gatewayIterator);
void listPossibleConnectionFormats(const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_ConnectionFormat_e>& listFormats) const;
void listRestrictedOutputFormatsGateways(const am_gatewayID_t gatewayID, const am_ConnectionFormat_e sinkConnectionFormat, std::vector<am_ConnectionFormat_e>& listFormats) const;
- CAmDatabaseHandler* mDatabaseHandler;
- CAmControlSender* mControlSender;
+ CAmDatabaseHandler* mpDatabaseHandler; //!< pointer to database handler
+ CAmControlSender* mpControlSender; //!< pointer the controlsender - is used to retrieve information for the optimal route
};
+/**
+ * an item in the routing tree
+ */
class CAmRoutingTreeItem
{
public:
CAmRoutingTreeItem(const am_domainID_t domainID, const am_gatewayID_t gatewayID = 0, CAmRoutingTreeItem *parent = 0);
- void appendChild(CAmRoutingTreeItem *newChild);
- void returnChildItems(std::vector<CAmRoutingTreeItem*> listChildItems);
- am_domainID_t returnDomainID() const;
- am_gatewayID_t returnGatewayID() const;
- virtual ~CAmRoutingTreeItem();
- CAmRoutingTreeItem* returnParent() const;
+ ~CAmRoutingTreeItem();
+ void appendChild(CAmRoutingTreeItem *newChild); //!< appends a new child
+ void returnChildItems(std::vector<CAmRoutingTreeItem*> listChildItems); //!< returns the list of childs
+ am_domainID_t returnDomainID() const; //!< returns the domainID of the tree
+ am_gatewayID_t returnGatewayID() const; //!< returns the gatewayID of the tree
+ CAmRoutingTreeItem* returnParent() const; //!< returns the parent item of the tree
private:
std::vector<CAmRoutingTreeItem*> mListChildItems; //!< List of all child items
am_domainID_t mDomainID; //!< the domain ID of the item
am_gatewayID_t mGatewayID; //!< the gateway Id
- CAmRoutingTreeItem *mParentItem; //!< pointer to the parent item
+ CAmRoutingTreeItem *mpParentItem; //!< pointer to the parent item
};
+/**
+ * a routing tree
+ */
class CAmRoutingTree
{
public:
CAmRoutingTree(const am_domainID_t rootDomainID);
+ ~CAmRoutingTree();
CAmRoutingTreeItem* insertItem(const am_domainID_t domainID, const am_gatewayID_t gatewayID, CAmRoutingTreeItem *parent);
void getRoute(CAmRoutingTreeItem* targetItem, std::vector<am_gatewayID_t>& listGateways);
am_domainID_t returnRootDomainID() const;
CAmRoutingTreeItem* returnRootItem();
- virtual ~CAmRoutingTree();
private:
CAmRoutingTreeItem mRootItem; //!< pointer to root item
std::vector<CAmRoutingTreeItem*> mListChild; //!< list of all childs
diff --git a/AudioManagerDaemon/include/CAmRoutingReceiver.h b/AudioManagerDaemon/include/CAmRoutingReceiver.h
index dfacc3b..73bad28 100644
--- a/AudioManagerDaemon/include/CAmRoutingReceiver.h
+++ b/AudioManagerDaemon/include/CAmRoutingReceiver.h
@@ -1,32 +1,29 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmRoutingReceiver.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmRoutingReceiver.h
+ * For further information see http://www.genivi.org/.
*
*/
#ifndef ROUTINGRECEIVER_H_
#define ROUTINGRECEIVER_H_
-#include <routing/IAmRoutingReceive.h>
-#include <config.h>
+#include "routing/IAmRoutingReceive.h"
namespace am
{
@@ -93,11 +90,11 @@ public:
void waitOnRundown(bool rundown); //!< tells the RoutingReceiver to start waiting for all handles to be confirmed
private:
- CAmDatabaseHandler *mDatabaseHandler; //!< pointer to the databaseHandler
- CAmRoutingSender *mRoutingSender; //!< pointer to the routingSender
- CAmControlSender *mControlSender; //!< pointer to the controlSender
- CAmSocketHandler *mSocketHandler; //!< pointer to sockethandler
- CAmDbusWrapper *mDBusWrapper; //!< pointer to dbuswrapper
+ CAmDatabaseHandler *mpDatabaseHandler; //!< pointer to the databaseHandler
+ CAmRoutingSender *mpRoutingSender; //!< pointer to the routingSender
+ CAmControlSender *mpControlSender; //!< pointer to the controlSender
+ CAmSocketHandler *mpSocketHandler; //!< pointer to sockethandler
+ CAmDbusWrapper *mpDBusWrapper; //!< pointer to dbuswrapper
uint16_t handleCount; //!< counts all handles
std::vector<uint16_t> mListStartupHandles; //!< list of handles that wait for a confirm
diff --git a/AudioManagerDaemon/include/CAmRoutingSender.h b/AudioManagerDaemon/include/CAmRoutingSender.h
index c6a7677..41d48de 100644
--- a/AudioManagerDaemon/include/CAmRoutingSender.h
+++ b/AudioManagerDaemon/include/CAmRoutingSender.h
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmRoutingSender.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmRoutingSender.h
+ * For further information see http://www.genivi.org/.
*
*/
@@ -46,57 +44,16 @@ public:
CAmRoutingSender(const std::vector<std::string>& listOfPluginDirectories);
~CAmRoutingSender();
- /**
- * removes a handle from the list
- * @param handle to be removed
- * @return E_OK in case of success
- */
am_Error_e removeHandle(const am_Handle_s& handle);
-
- /**
- * @author Christian
- * this adds the domain to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
- * This must be done whenever a domain is registered.
- */
am_Error_e addDomainLookup(const am_Domain_s& domainData);
- /**
- * @author Christian
- * this adds the Source to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
- * This must be done whenever a Source is registered.
- */
am_Error_e addSourceLookup(const am_Source_s& sourceData);
- /**
- * @author Christian
- * this adds the Sink to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
- * This must be done whenever a Sink is registered.
- */
am_Error_e addSinkLookup(const am_Sink_s& sinkData);
- /**
- * @author Christian
- * this adds the Crossfader to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
- * This must be done whenever a Crossfader is registered.
- */
am_Error_e addCrossfaderLookup(const am_Crossfader_s& crossfaderData);
- /**
- * @author Christian
- * this removes the Domain to the lookup table of the Router. This must be done everytime a domain is deregistered.
- */
am_Error_e removeDomainLookup(const am_domainID_t domainID);
- /**
- * @author Christian
- * this removes the Source to the lookup table of the Router. This must be done everytime a source is deregistered.
- */
am_Error_e removeSourceLookup(const am_sourceID_t sourceID);
- /**
- * @author Christian
- * this removes the Sink to the lookup table of the Router. This must be done everytime a sink is deregistered.
- */
am_Error_e removeSinkLookup(const am_sinkID_t sinkID);
- /**
- * @author Christian
- * this removes the Crossfader to the lookup table of the Router. This must be done everytime a crossfader is deregistered.
- */
am_Error_e removeCrossfaderLookup(const am_crossfaderID_t crossfaderID);
+
am_Error_e startupInterfaces(CAmRoutingReceiver* iRoutingReceiver);
void setRoutingReady();
void setRoutingRundown();
@@ -116,15 +73,13 @@ public:
am_Error_e getListPlugins(std::vector<std::string>& interfaces) const;
void getInterfaceVersion(std::string& version) const;
- //!< is used to pair interfaces with busnames
- struct InterfaceNamePairs
+ struct InterfaceNamePairs //!< is used to pair interfaces with busnames
{
- IAmRoutingSend* routingInterface;
- std::string busName;
+ IAmRoutingSend* routingInterface; //!< pointer to the routingInterface
+ std::string busName; //!< the busname
};
- //!< is used to store data related to handles
- class am_handleData_c
+ class am_handleData_c //!< is used to store data related to handles
{
public:
union
@@ -134,6 +89,7 @@ public:
am_crossfaderID_t crossfaderID;
am_connectionID_t connectionID;
};
+
union
{
am_SoundProperty_s soundPropery;
@@ -145,21 +101,14 @@ public:
};
+ am_handleData_c returnHandleData(const am_Handle_s handle) const; //!< returns the handle data associated with a handle
+
#ifdef UNIT_TEST //this is needed to test RoutingSender
friend class IAmRoutingBackdoor;
#endif
- /**
- * returns the data that belong to handles
- * @param handle the handle
- * @return a class holding the handle data
- */
- am_handleData_c returnHandleData(const am_Handle_s handle) const;
-
private:
-
- //!< is needed to sort the handles in the map
- struct comparator
+ struct comparator //!< is needed to sort the handles in the map
{
bool operator()(const am_Handle_s& a, const am_Handle_s& b) const
{
@@ -167,13 +116,7 @@ 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);
+ am_Handle_s createHandle(const am_handleData_c& handleData, const am_Handle_e type); //!< creates a handle
void unloadLibraries(void); //!< unloads all loaded plugins
typedef std::map<am_domainID_t, IAmRoutingSend*> DomainInterfaceMap; //!< maps domains to interfaces
@@ -194,7 +137,7 @@ private:
SinkInterfaceMap mMapSinkInterface; //!< map of sinks to interfaces
SourceInterfaceMap mMapSourceInterface; //!< map of sources to interfaces
HandleInterfaceMap mMapHandleInterface; //!< map of handles to interfaces
- CAmRoutingReceiver *mRoutingReceiver;
+ CAmRoutingReceiver *mpRoutingReceiver; //!< pointer to routing receiver
};
}
diff --git a/AudioManagerDaemon/include/CAmTelnetMenuHelper.h b/AudioManagerDaemon/include/CAmTelnetMenuHelper.h
index 54a0ee5..8607edf 100644
--- a/AudioManagerDaemon/include/CAmTelnetMenuHelper.h
+++ b/AudioManagerDaemon/include/CAmTelnetMenuHelper.h
@@ -1,24 +1,23 @@
/**
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
* Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmTelnetMenuHelper.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \date 23-Jan-2012
- * \author Frank Herchet (frank.fh.herchet@bmw.de)
*
- * \section License
- * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
- * Copyright (C) 2012, BMW AG Frank Herchet frank.fh.herchet@bmw.de
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
- * 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.
+ * \file CAmTelnetMenuHelper.h
+ * For further information see http://www.genivi.org/.
*
*/
@@ -33,10 +32,8 @@
#include <string>
#include <sstream>
#include <vector>
-
-// for sockets
#include <sys/socket.h>
-#include <audiomanagertypes.h>
+#include "audiomanagertypes.h"
namespace am
{
@@ -166,9 +163,7 @@ private:
};
typedef std::map<std::string, sCommandPrototypeInfo> tCommandMap;
-
- // int filedescriptor of socket connection; EMainState state of current telnet session
- std::map<int, EMainState> mCurrentMainStateMap;
+ std::map<int, EMainState> mCurrentMainStateMap; //!< int filedescriptor of socket connection; EMainState state of current telnet session
static CAmTelnetMenuHelper* instance;
CAmTelnetServer *mpTelenetServer;
diff --git a/AudioManagerDaemon/include/CAmTelnetServer.h b/AudioManagerDaemon/include/CAmTelnetServer.h
index f7bf274..32701a2 100644
--- a/AudioManagerDaemon/include/CAmTelnetServer.h
+++ b/AudioManagerDaemon/include/CAmTelnetServer.h
@@ -1,34 +1,33 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmTelnetServer.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
- * 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.
+ * \file CAmTelnetServer.h
+ * For further information see http://www.genivi.org/.
*
*/
#ifndef TELNETSERVER_H_
#define TELNETSERVER_H_
-#include "shared/CAmSocketHandler.h"
-#include "CAmTelnetMenuHelper.h"
#include <queue>
#include <map>
+#include "shared/CAmSocketHandler.h"
+#include "CAmTelnetMenuHelper.h"
namespace am
{
@@ -43,21 +42,16 @@ class CAmControlReceiver;
class CAmRouter;
class CAmTelnetMenuHelper;
+/**
+ * Implements a telnetserver that can be used to connect to the audiomanager, retrieve some information and use it. For debugginp purposes.
+ * For example, launch a telnet session on port 6060:
+ * \code telnet localhost 6060 \endcode
+ * more details can be found at the README
+ */
class CAmTelnetServer
{
public:
- CAmTelnetServer(CAmSocketHandler *iSocketHandler,
- CAmCommandSender *iCommandSender,
- CAmCommandReceiver *iCommandReceiver,
- CAmRoutingSender *iRoutingSender,
- CAmRoutingReceiver *iRoutingReceiver,
- CAmControlSender *iControlSender,
- CAmControlReceiver *iControlReceiver,
- CAmDatabaseHandler *iDatabasehandler,
- CAmRouter *iRouter,
- unsigned int servPort,
- unsigned int maxConnections);
-
+ CAmTelnetServer(CAmSocketHandler *iSocketHandler, CAmCommandSender *iCommandSender, CAmCommandReceiver *iCommandReceiver, CAmRoutingSender *iRoutingSender, CAmRoutingReceiver *iRoutingReceiver, CAmControlSender *iControlSender, CAmControlReceiver *iControlReceiver, CAmDatabaseHandler *iDatabasehandler, CAmRouter *iRouter, unsigned int servPort, unsigned int maxConnections);
~CAmTelnetServer();
void connectSocket(const pollfd pfd, const sh_pollHandle_t handle, void* userData);
void disconnectClient(int filedescriptor);
@@ -70,34 +64,34 @@ public:
TAmShPollCheck<CAmTelnetServer> telnetCheckCB;
private:
- typedef void (*CommandPrototype)(std::vector<std::string>& msg,int filedescriptor);
- typedef std::map<std::string,CommandPrototype> mMapCommand_t;
+ typedef void (*CommandPrototype)(std::vector<std::string>& msg, int filedescriptor);
+ typedef std::map<std::string, CommandPrototype> mMapCommand_t;
- void sliceCommand(const std::string& string,std::string& command,std::queue<std::string>& msg);
- mMapCommand_t createCommandMap();
- struct connection_s
- {
- int filedescriptor;
- sh_pollHandle_t handle;
- };
+ void sliceCommand(const std::string& string, std::string& command, std::queue<std::string>& msg);
+ mMapCommand_t createCommandMap();
+ struct connection_s
+ {
+ int filedescriptor;
+ sh_pollHandle_t handle;
+ };
- static CAmTelnetServer* instance;
- CAmSocketHandler *mSocketHandler;
- CAmCommandSender *mCommandSender;
- CAmCommandReceiver *mCommandReceiver;
- CAmRoutingSender *mRoutingSender;
- CAmRoutingReceiver *mRoutingReceiver;
- CAmControlSender *mControlSender;
- CAmControlReceiver *mControlReceiver;
- CAmDatabaseHandler *mDatabasehandler;
- CAmRouter *mRouter;
- sh_pollHandle_t mConnecthandle;
- std::queue<std::string> mMsgList;
- std::vector<connection_s> mListConnections;
- int mConnectFD;
- unsigned int mServerPort;
- unsigned int mMaxConnections;
- CAmTelnetMenuHelper mTelnetMenuHelper;
+ static CAmTelnetServer* mpInstance;
+ CAmSocketHandler *mpSocketHandler;
+ CAmCommandSender *mpCommandSender;
+ CAmCommandReceiver *mpCommandReceiver;
+ CAmRoutingSender *mpRoutingSender;
+ CAmRoutingReceiver *mpRoutingReceiver;
+ CAmControlSender *mpControlSender;
+ CAmControlReceiver *mpControlReceiver;
+ CAmDatabaseHandler *mpDatabasehandler;
+ CAmRouter *mpRouter;
+ sh_pollHandle_t mConnecthandle;
+ std::queue<std::string> mListMessages;
+ std::vector<connection_s> mListConnections;
+ int mConnectFD;
+ unsigned int mServerPort;
+ unsigned int mMaxConnections;
+ CAmTelnetMenuHelper mTelnetMenuHelper;
};
diff --git a/AudioManagerDaemon/include/DAmDoxygenMainPage.h b/AudioManagerDaemon/include/DAmDoxygenMainPage.h
index e27b233..662182d 100644
--- a/AudioManagerDaemon/include/DAmDoxygenMainPage.h
+++ b/AudioManagerDaemon/include/DAmDoxygenMainPage.h
@@ -1,21 +1,22 @@
/**
* \mainpage
*
- *
* \image html genivilogo.png
*
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
+ *
+ * This file is part of GENIVI Project AudioManager.
+ *
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \par Copyright
- * Copyright Copyright (C) 2011,2012 GENIVI Alliance\n
- * Copyright Copyright (C) 2011,2012 BMW AG
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \par License
- * Contributions are licensed to the GENIVI Alliance under one or more Contribution License Agreements.
- * This file is licensed under the terms of the Mozilla Public License 2.0.\n
- * A copy of the license text has been included in the “LICENSE” file in the root directory of the source distribution.
- * You can also obtain a copy of the license text at\n
- * http://mozilla.org/MPL/2.0/.
+ * \author Christian Mueller (christian.ei.mueller@bmw.de)
*
* \par More information
* can be found at https://collab.genivi.org/wiki/display/genivi/GENIVI+Home \n
@@ -23,90 +24,377 @@
* \par About AudioManager
* The AudioManager is a Deamon that manages all Audio Connections in a GENIVI headunit.
* It is a managing instance that uses so called RoutingAdaptors to control AudioDomains that then do the "real" connections.
- * \n\n\n
- *
*
- * \section architecture Architecture Overview
+ */
+
+/**
+ * \page lic License
+ * \section contr Code Contribution License
+ * The contribution is done under GENIVI CLA, please see here:
+ * https://collab.genivi.org/wiki/display/genivi/Code+Contribution+Team
+ * \section split License Split
+ * The licenses of this project are split into two parts:\n
+ * 1. the AudioManagerDaemon, licensed under MPL 2.0\n
+ * 2. all other parts that serve as example code that can be taken to build up an own project with it these parts are licensed
+ * \section mpl Mozilla Public License, v. 2.0
+ * http://mozilla.org/MPL/2.0/
+ * \section mit MIT license
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \page architecturepage Architecture Overview
*
- * The architecture concept bases on the partition of management (logic) and routing (action). Sinks and sources are clustered into independent parts which are capable of exchanging audio with each other (AudioDomains). Between these AudioDomains, Audio can be interchanged via Gateways. \n
- * Since the routing and the management shall be independent from the actual used system, it is realized as an OwnedComponent, the AudioManager. Each AudioDomain has a Routing Adapter which implements some necessary logic and is the interface between the AudioManager and the AudioDomains.
+ * The architecture concept bases on the partition of management (logic) and routing (action). Sinks and sources are clustered
+ * into independent parts which are capable of exchanging audio with each other (AudioDomains). Between these AudioDomains,
+ * Audio can be interchanged via Gateways. \n
+ * Since the routing and the management shall be independent from the actual used system, it is realized as an OwnedComponent,
+ * the AudioManager. Each AudioDomain has a Routing Adapter which implements some necessary logic and is the interface between
+ * the AudioManager and the AudioDomains.
*
* \section domains Audio Domains
*
- * An Audio Domain consists of sinks and sources that can exchange audio with each other. To make the most out of the concept, AudioDomains shall be chosen in such a way that they are implemented by already existing audio routing engines.
+ * \image html AudioDomains.gif
+ * An Audio Domain consists of sinks and sources that can exchange audio with each other. To make the most out of the concept,
+ * AudioDomains shall be chosen in such a way that they are implemented by already existing audio routing engines.
*
- * The AudioManager assumes that there are no restrictions in interconnection of sinks and sources. One or more sources can be connected to one sink and one or more sinks can be connected to one source. Since real hardware or software might end up in having restrictions, the knowledge of this must exist in the AudioManager and handled by him accordingly. This shall be accomplished via a plug-in mechanism. An AudioDomain is not tied to a hardware or software implementation. It can be software or hardware or even a combination of both. \n
+ * The AudioManager assumes that there are no restrictions in interconnection of sinks and sources. One or more sources can be
+ * connected to one sink and one or more sinks can be connected to one source. Since real hardware or software might end up in
+ * having restrictions, the knowledge of this must exist in the AudioManager and handled by him accordingly. This shall be
+ * accomplished via a plug-in mechanism. An AudioDomain is not tied to a hardware or software implementation. It can be software
+ * or hardware or even a combination of both. \n
*
* Examples for possible audio domains:\n
* PulseAudio, Alsa, Jack, DSP, FPGA, MOST, In-chip switching matrix\n
*
- * The clustering and usage of the AudioDomains will vary from each product. Care must be taken while choosing the right AudioDomains in regards to system load (due to resampling), latency and of course flexibility.\n
- * In special implementations of the AudioDomain, it is capable of operation a certain time without interaction to the AudioManager. This is needed to fulfill the requirements for Early & Late Audio, more information can be found below.
+ * The clustering and usage of the AudioDomains will vary from each product. Care must be taken while choosing the right AudioDomains
+ * in regards to system load (due to resampling), latency and of course flexibility.\n
+ * In special implementations of the AudioDomain, it is capable of operation a certain time without interaction to the AudioManager.
+ * This is needed to fulfill the requirements for Early & Late Audio, more information can be found below.
+ * am::am_Domain_s describe the attribiutes of a domain.
*
* \section routing_adaptor Routing Adapter
*
- * Via this adapter, the interconnection from the AudioManager to the AudioDomains is accomplished. An AudioDomain shall have exactly one RoutingAdapter. In the terms of GENIVI, a RoutingAdapter is an AbstractComponent, this means that we define an API and a certain behavior in UML models but do not maintain components itself. Existing implementations from Proof of Concepts are shipped as example Adapters "as is" but cannot be seen as maintained components.\n
- * The implementation of a routing adapter can and will vary from each project to another since the combination of sinks and sources, the used hardware etc has influence on the adapters. Besides interchanging and abstracting information between the AudioManager and the sinks and sources, the Adapters also need to implement some business logic in order to interact with the AudioManager. This include for example the registering of components, managing the current state, error handling etc.\n
- * In the special case of an EarlyDomain, the routing adapter also has to manage start-up and rundown including persistence for his domain while the AudioManager is not started or already stopped. During this periods of time, these special adapters have to be able to fulfill basic tasks like changing volumes, for example (this implies that the Adapter is implemented on a different piece of hardware, e.g. vehicle processor).
- *
- * \section Gateway
- *
- * Gateways are used to let audio flow between two domains. They always have a direction and can only transport one stream at a time. Several gateways connecting the same domains together can exist in parallel so that more than one source can be connected to more than one sink from the same domains at the same time.\n
- * The representation of a Gateway in the domain which originates the audio is a sink. In the receiving domain, the gateway appears as a source. The AudioManager knows about the Gateways, in terms of connection, it handles it as simple sources and sinks.
- *
- * \section AudioManagerDaemon
- *
- * The AudioManager is the central managing instance of the Audio architecture. It is designed as an OwnedComponent, this means that the software is maintained within GENIVI as open source component. The AudioManager consists of 4 central components.\n
- *
- * GOwnedComponent: AudioManager Daemon\n
- *
- * This component is owned and maintained by Genivi. It is the central audio framework component. There can be only one daemon in a system (singleton).
- *
- * \subsection controlinterface Control Interface Plugin
- *
- * This describes the interface towards the Controlling Instances of the AudioManagerDaemon. This is the HMI and interrupt sources that use this interface to start their interrupt and stop it again. The interface shall be asynchronous. Via this interface all user interactions are handled.
- *
- * \subsection routinginterface Routing Interface Plugin
- *
- * This interface is used by the AudioManager to control the RoutingAdapters and communicate with them. The communication is based on two interfaces, one is provided by the AudioManager for communication from the adapters towards the AudioManager and one for the opposite direction. The design of the AudioManager shall be done in such a way that several Interfaces are supported at the same time via a plug-in mechanism. The plug-ins are (either statically - due to performance reasons or dynamically) loaded at start-up. Due to this architecture, the number of buses and routing adapters that are supported are as low as possible for each system and as high as needed without the need of changing the AudioManager itself. The AudioManager expects a bus-like structure behind each plug-in, so that a plug-in can implement a bus interface and proxy the messages to the routing adapters - the AudioManager will be capable of addressing more than one adapter one each plug-in. The interface shall is asynchronous for all timely critical commands.
- *
- * \section interfaces Interfaces
- * the calls to the interfaces of the AudioManagerDaemon are generally not threadsafe !
- * Nevertheless if such calls from a different thread-context are needed, you may use the defered-call pattern that utilizes the mainloop (Sockethandler) to get self called in the next loop of the mainloop. For more infomation please check the audiomanger wiki page.
- *
- * \section deferred The deferred call pattern
- * Create a unix pipe or socket and add the file descriptor to the Sockethandler. Whenever a call needs to be deferred you can store the necessary information protected by a mutex in a queue and write to the socket or pipe. This will lead to a callback in the next loop of the mainloop - when getting called by the callback that was registered at the Sockethandler execute your call with the information stored away.
- *
- *
- * \section sources_sinks Sources & Sinks
- * \subsection Visibility
- * Sources and sinks can either be visible or not. If they are visible, the HMI is informed about their existence and can use them. \n
- * Invisible Sources and Sinks either are system only relevant (e.g. an audio processing that has a source and a sink) or belong to a gateway.
+ * Via this adapter, the interconnection from the AudioManager to the AudioDomains is accomplished. An AudioDomain shall have exactly
+ * one RoutingAdapter. In the terms of GENIVI, a RoutingAdapter is an AbstractComponent, this means that we define an API and a certain
+ * behavior in UML models but do not maintain components itself. Existing implementations from Proof of Concepts are shipped as example
+ * Adapters "as is" but cannot be seen as maintained components.\n
+ * The implementation of a routing adapter can and will vary from each project to another since the combination of sinks and sources,
+ * the used hardware etc has influence on the adapters. Besides interchanging and abstracting information between the AudioManager and
+ * the sinks and sources, the Adapters also need to implement some business logic in order to interact with the AudioManager.
+ * This include for example the registering of components, managing the current state, error handling etc.\n
+ * In the special case of an EarlyDomain, the routing adapter also has to manage start-up and rundown including persistence for his
+ * domain while the AudioManager is not started or already stopped. During this periods of time, these special adapters have to be able
+ * to fulfill basic tasks like changing volumes, for example (this implies that the Adapter is implemented on a different piece of
+ * hardware, e.g. vehicle processor).
+ *
+ * \section gateway Gateway
+ *
+ * \image html Gateway.gif
+ *
+ * Gateways are used to let audio flow between two domains. They always have a direction and can only transport one stream at a time.
+ * Several gateways connecting the same domains together can exist in parallel so that more than one source can be connected to more
+ * than one sink from the same domains at the same time.\n
+ * In principle, gateways have the ability to convert the connectionFormat of an audiostream, for example the sink could receive audio
+ * in a digital form and output it as analog (sound card). In order to express the conversion capabilities of a gateway, a matrix of
+ * all source/sink connectionFormats is given (details below). The sources and sinks of a gateway are registered like ordinary sources
+ * and sinks where the domains have the responsibility to register "their" sinks and sources.\n
+ * For every gateway, a controlDomain is defined, this is the domain that registered the gateway. At the time of registering, the ID of
+ * the "other end" of the gateway might be unknown. To handle this situation, a domain can "peek" Domains, Sources and Sinks. When
+ * something is peeked, it means that an ID is reserved for a unique name without registering it.\n
+ * If a gateway is deregistered, the source or sink of the controlling domain is deregistered as well - not the one in the "other" domain.
+ */
+
+/**
+ * \page audiomanagercomponentspage AudioManager Components
+ * \image html AudioManagement.png
+ *
+ * The AudioManager is the central managing instance of the Audio architecture. It is designed as an OwnedComponent, this means that the
+ * software is maintained within GENIVI as open source component. The AudioManager consists of 4 central components.\n
+ *
+ *
+ * \section audiomanagercomponents AudioManagerDaemon
+ *
+ * This component is owned and maintained by Genivi. It is the central audio framework component. There can be only one daemon in a system (singleton).\n
+ * The AudioManagerDaemon is subject to this documentation
+ *
+ * \section commander AudioManagerCommandPlugin
+ *
+ * This describes the interface towards the Commanding Instances of the AudioManagerDaemon. This is the HMI and interrupt sources that use this
+ * interface to start their interrupt and stop it again. The interface shall be asynchronous. Via this interface all user interactions are handled.
+ * This component is designed to be a dynamic linked library that will be loaded on the startup of the AudioManager. There can be more than one
+ * CommandPlugin at a time.
+ * Since the implementation of this component is project specific, only examples are included.\n
+ * An example Dbus Implementation can be found in the folder PluginCommandInterfaceDbus.
+ * \n
+ * All commands that must be fulfilled by an AudioManagerCommandPlugin are described in am::IAmCommandSend.\n
+ * All commands that are presented to AudioManagerCommandPlugin by the AudioManagerDaemon are described in am::IAmCommandReceive.\n
+ *
+ * \section controller AudioManagerController
+ * The controller is the intelligent "heart" of the AudioManager and it is project specific. In principle, the controller gets commands from the command
+ * interface or events from outside and reacts to them. For this purpose, some basic commands are in the "toolbox" of the Controller that he can use
+ * to interact with the rest of the system.\n
+ * Among this there are commands to read/write the database and to perform actions on the Audiodomains like connect or disconnect. There must be only one
+ * Controller in the system at a time, like the AudioManagerCommandPlugins, the Controller is loaded at startup by the daemon\n
+ * A simple example Implementation can be found in the folder PluginControlInterface.
+ * \n
+ * All commands that must be fulfilled by an AudioManagerController are described in am::IAmControlSend.\n
+ * All commands that are presented to AudioManagerController by the AudioManagerDaemon are described in am::IAmControlReceive.\n
+ *
+ * \section router Routing AudioManagerRoutingPlugin
+ *
+ * The AudioManagerRoutingPlugins are used to abstract the actual Hard- and Software that does the routing. There can be more than one plugins at a
+ * time, they are loaded at startup time like the commandplugins. \n
+ * The AudioManager expects a bus-like structure behind each plug-in, so that a plug-in can implement a bus interface and proxy the messages to the
+ * routing adapters - the AudioManager is capable of addressing more than one adapter one each plug-in. The AudioManagerController does not have to
+ * know anything about the real system plugins - he sends his commands to sources and sinks. The daemon does the dispatching of these commands.
+ * The interface is mainly asynchronous.\
+ * Sample plugins can be found in the directory, for example PluginRoutingInterfaceAsync.\n
+ * \n
+ * All commands that must be fulfilled by an AudioManagerRoutingPlugin are described in am::IAmRoutingSend.\n
+ * All commands that are presented to AudioManagerRoutingPlugins by the AudioManagerDaemon are described in am::IAmRoutingReceive.\n
+ *
+ * \page elementspage Elements of the AudioManagement
+ *
+ * The audiomanagement in principle consists of the following elements:
+ *
+ * \section source Sources
+ * This is where audio comes from, for examples tuner, mediaplayer. But sources can also be part of a building block that processes audio, examples
+ * are here crossfaders or gateways. Several Sinks can be connected to one source.\n
+ * \subsection sourceattributes Attributes
+ * - am::am_SourceType_s describes the attributes that are accessible from the AudioManagerCommandPlugins.\n
+ * - am::am_Source_s describes the general attributes.\n
+ *
+ * \section sinks Sinks
+ * This is where audio flows to, for examples amplifier, headphones. But sources can also be part of a building block that processes audio,
+ * examples are here crossfaders or gateways. Several Sources can be connected to one sink.\n
+ * \subsection sinkattributes Attributes
+ * - am::am_SinkType_s describes the attribiutes that are accessible form the AudioManagerCommandPlugins.\n
+ * - am::am_Sink_s describes the general attributes.\n
+ *
+ * \section gw Gateways
+ * Gateways are described here: \ref gateway
+ * A specialitry of a gateways is the convertionmatrix. It indicates which sinksoundformats can be transferred in which sourcesoundformats. A convertion
+ * matrix looks like this:
+ * \image html GatewayMatrix.png
+ * \subsection gwattributes Attributes
+ * - am::am_Gateway_s describe the attribiutes of a gateway\n
+ *
+ * \section crossfaders Crossfaders
+ * Cross-faders are special elements that can perform cross-fading between two sources connected to the sinks of the crossfader. The audio of either source
+ * or both (mixed, during the fade) is put out at the source of the fader. Cross-fading within a source (for example from one song to another) is out of
+ * scope audio management and must be performed in the source.\n
+ * A crossfader has two sinks and one source, where one sink is the "hot" one. It is in the duty of the AudioManagerController to connect the correct
+ * sources to the sinks in order to perform a cross-fade. When fading is started, the hotSink changes from either HS_SINKA or HS_SINKB to HS_INTERMEDIATE,
+ * when the fading is finished, it changes to HS_SINKA or HS_SINKB (the sink that was "cold" before).Fading itself is done in the RoutingAdapters, the
+ * implementation has to ensure the smooth and synchronous change of volumes. With different rampTypes, different kinds of cross-fade ramps can be supported.
+ * The actual status of the "hot" sink is reported by the routingAdapter. Care has to be taken that the correct "hot" end of the crossfader is given
+ * at registration time.\n
+ * \subsection cfattributes Attributes
+ * - am::am_Crossfader_s describes the attribiutes of a Crossfader
*
- * \subsection Availability
- * It can be the case, that sources and sinks are present in the system but cannot be used at the moment. This is indicated via the availability. A sample use-case for this feature is CD drive that shall only be available if a CD is inserted.
+ */
+
+/**
+ * \page uniquepage About unique IDs : Static vs Dynamic IDs
+ *
+ * \section why Why having two different kinds of ids?\n
+ * The complexity of up-to-date IVI-systems demand to support sources and sinks dynamically added and removed in order to support the variety of CE products,
+ * but parts of the system are never going to change - to start a dynamic registration here is a waste of system capacity.\n
+ * \section setup The setup
+ * The AudioManagement is capable of handling static, dynamic or mixed setups. In case of a dynamic setup, all elements of the system like domains, sinks,
+ * sources, gateways etc are registered at system start-up. In a static setup, the IDs of the elements are known and fixed - no further registration is needed.
+ * The start-up for static elements works as follows:\n
+ * when a domain known as static (this is knowledge of the AudioManagerController, recognized by the unique name of the domain) registers, the
+ * AudioManagerController enters all elements of this domain in the database. Still, this domain can register additional elements during runtime.
+ * In case of static setups, the RoutingAdapter needs to ensure that all static elements are ready to be used when the domain registers.\n
+ * In order to ensure the uniqueness of IDs, there exist two separate ID areas (for each of sources, sinks, gateways and crossfaders):\n\n
+ * Fixed area (from 1..100)\n
+ * Variable area (starting from 101)\n\n
+ * In case of dynamic added elements, the audiomanagerdaemon ensures the uniqueness of the ID's, in case of the static setup, the project has to ensure the
+ * uniqueness by assigning the IDs wisely. The knowledge of the static IDs need to be in the AudioManagerController, the RoutingAdapters and in the HMI
+ * (optional because IDs will be reported anyway).\n
+ * Domains cannot be static because registering them is the trigger for the AudioManagerController to enter the static values into the database.
*
- * \section Interrupts
- * \subsection llinterrupts Low level interrupts
- * \todo write low level Interrupts description
+ */
+
+/**
+ * \page classficationpage Classification of Sinks and Sources
+ * \section classification Classification
+ * The AudioManagement offers classification for sources and sinks. It can be used to group sources and sinks together and link certain behaviors to these groups.
+ * An example for such a use is to group all interrupt sources in a class together and let the AudioManagerController react different for this class.\n
+ * Elements can only have one class at a time. The AudioManagerDaemon will take care of registration of sourceClasses, sinkClasses and will assign unique IDs,
+ * but the parameters of the Classes itself are product specific and have to be interpreted by the AudioManagerController. This concept allows for very individual
+ * implementations of system behaviors.\n
+ * Since Classes are held in the database, Classes can be registered and deregistered during runtime, it is recommended that the AudioManagerController enters
+ * all source & sink classes at start-up into the database.A ClassProperty exists out of an enumeration (am_ClassProperty_e, project specific) and a corresponding
+ * value (integer) that is interpreted by the AudioManagerController according to am_ClassProperty_e.\n
+ * There is no restriction to the number of properties a class can have and how many classes can exist in a system.\n
+ * \section attributes Attributes
+ * - am::am_SourceClass_s describes the attributes of a source class\n
+ * - am::am_SinkClass_s describes the attributes of a sink class\n
*
- * \subsection Interrupts
- * \todo write Interrupts description
+ */
+
+/**
+ * \page interrupts Interrups & Low Level Interrupts
+ * \section diff Differences
+ * The only difference between a "normal" interrupt and a source for the audioManagement may lie in it's classification, so playing a "normal" interrupt is not
+ * different to changing a source. An exception here are the so called "low level interrupts".\n
+ * \section crit Criterias
+ * These are special sources that fulfill the following criteria:
+ * - direct connection to a sink that is "always on", so no extra actions and communications need to be done in order to play audio
+ * - no dependencies to the current system state need to be checked before playing. This means that the source knows if it is allowed to play at the moment it
+ * wants to play
+ * - all information for the source that is needed to judge if it is allowed to play or not is either directly retrieved by the source or set static via a property.
+ *
+ * This becomes very handy for implementing such things like park distance control. When the source is informed that it needs to output signals
+ * (due to an emerging wall for example) it outputs the beeps directly to the amplifier that then overlays the sound to the current active source.\n
+ * Settings that influence the behavior of low level interrupts like for example volume offset for park distance control or sound on/off for it need to be done via
+ * sourceProperties on the source level, so that the judgment and the adoptions that need to be taken can be taken by the source without system interaction.
+ * In order to give the AudioManagerController the chance to react on a low level interrupt (by lowering the main volume for example), a feedback path is provided
+ * and the AudioManagerController is informed about the current state of the low level interrupt (via hooklInterruptStatusChange).\n
*
- * \section Persistency
- * It is the job of the AudioManagerController to handle the persistency. It is planned to expose an interface via the ControlInterface to accomplish this but the GENIVI persistance is not ready yet. \n
+ */
+
+/**
+ * \page connpage Connections & MainConnections
+ * \section con Connections
+ * A connection connects a source to a sink to let audio data flow. The direction of the flow is always source to sink. For each connection the connectionFormat
+ * must be defined when the connection is demanded, if source or sink is not capable of supporting this format, the connection cannot be established.
+ * ConnectionFormats are product specific, also are some standard formats defined within GENIVI that can be enhanced in the product area. Examples of formats:
+ * analog, autodefined, stereo 48khz 16bit PCM, ....
+ *
+ * \section maincon Mainconnections
+ * is visible to the HMI and consists out of one or more connections. A MainConnection shall always connect a Source and a Sink visible to the HMI.
+ * In contradiction to connections, the MainConnection does not know about connectionFormat. MainConnections are demanded by the commandInterface.
+ * This picture demonstrates the relation between MainConnections and connections:
+ * \image html Levels.png
+ *
+ * \section att Attributes
+ * - am::am_Connection_s describes the attributes of a conenction
+ * - am::am_MainConnection_s describes the attributes of a MainConnection
+ */
+
+ /** \page lip Lipsync
+ * \section t The Task of the Audiomanager
+ * It is the job of the AudioManager to retrieve all latency timing information from each connection, to aggregate this information and provide a latency #
+ * information on a per MainConnection Basis. It is not the task of the AudioManager to actually delay or speed up video or audio signals to achieve a lipsync.
+ * The actual correction shall be done in the with the information provided by the AudioManager.
+ * The time information is always reported by the routingadapters for each connection. Delays that are introduced in a sink or a gateway are counting for the
+ * connection that connects to this sink or gateway.
+ * \section ex Example
+ * \image html delay.jpg
+ *
+ * This graph shows how the delay is calculated:
+ * - Connection 1 has a delay 2ms + 60ms that is added due to the gateway
+ * - Connection 2 has a delay 0ms + 10ms due to sink
+ * So the routing adapters report 62ms and 10ms, the audiomanager will add this to 72ms and report this value for the main connection from sink to source.
+ * The videoplayer getting this information can now delay his video against the audio for 72ms and be in perfect lipsync.\n
+ * After the buildup of a connection the first timing information needs to be sent within 5 seconds, the timing information from the routing adapters need to
+ * be sent via 4 seconds. If the latency for a connection is variable and changes over lifetime of the connection, the routing adapters shall resend the value
+ * and the audiomanager will correct the over all latency.
+ */
+
+/**
+ * \page early Early Audio
+ * \section req The Requirement
+ * The requirement reviews showed that one very important aspect of managing audio within GENIVI is the early/late phase where the Linux part of the system is
+ * not available. This feature is addressed via special domains: EarlyDomains. These domains are acting "unmanaged" - meaning without the interaction with the
+ * AudioManager - providing a simpler set of features until the AudioManager is up and running. When the Linux system is then fully operable a handover is done
+ * from the EarlyDomains towards the AudioManager. In order to be able to operate without the Linux up and running, the EarlyDomains must be implemented on a
+ * second fast-boot or always-on controller, e.g. the so called vehicle processor.\n
+ * \section earlys Early Startup
+ * This picture shows the principle of the early startup:
+ * \image html early.png
+ * \section late Late Rundown
+ * This picture shows the principle of the late rundown:
+ * \image html late.png
*
+ */
+
+/**
+ * \page views The two views of the AudioManager
+ * In general, there are two views of the system:\n
+ * \section command The CommandInterface View View
+ * This is an abstracted view that the HMI and other controlling Instances have of the system. Every Information (with some little exceptions) here is maintained
+ * by the AudioManagerController, so that he can "fake" situations for the HMI.
+ * So why is that? Depending on the actual project it might be - for example - that not the volume at the sink must be changed, but instead of the source.
+ * The HMI does not know about sourceVolumes (and does not need to!) so the HMI would change the sink volume and the AudioManagerController can translate it to a
+ * sourceVolumeChange. The metrics of the volumes are different as well.
+ * It is the duty of the AudioManagementController to keep the commandInterface information consistent with the "real" situation.
+ * \section route RoutingInterface View
+ * Here are the "real" system states. All changes that are done on this interface are maintained by the AudioMangerDaemon and here is the actual situation always
+ * consistent with the reality. All actions on this interface are either triggered by the AudioManagerController or by the domains itself, like registration for
+ * example.
+ * \section over Overview
+ * \image html views.png
+ */
+
+/**
+ * \page vol Volumes & MainVolumes
+ * \section mainVol MainVolumes
+ * This is the volume at the CommanInterface level. The exact definition is project specific and can be adopted for each project since the AudioManagerController
+ * and the HMI are the only ones who need to interfere with this volume. The actual value is an integer.
+ * - am::am_mainVolume_t defines the mainvolume
+ *
+ * \section volv Volumes
+ * These are the actual volumes that are set for sources and sinks. The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE). The minimum and maximum can be
+ * limited by actual project.
+ * - am::am_volume_t describes the volume
+ */
+
+/**
+ * \page prop Properties
+ * \section soundprop SoundProperties & MainSoundProperties
+ * SoundProperties are properties that are related to either a source or a sink. They are product specific and are used to set source or sink specific properties.
+ * This could be for example: equalizer settings, relative volume offsets but also bool information "surround sound on/off".
+ * A soundProperty is defined by its type (am_SoundProperty_e, a product specific enum) and a value (integer) that is interpreted according to the type.
+ * There are not limits how many properties a sink or a source can have. SoundProperties in contradiction to MainSoundProperties are not visible to the
+ * CommandInterface.\n
+ * - am::am_SoundProperty_s describe the of the SoundProperties
+ * - am::am_MainSoundProperty_s describe the attributes of MainSoundProperties
+ *
+ * \section sys SystemProperties
+ * are properties that apply to the whole system or parts of it but cannot be tight to a specific sink or source. They are product specific and could be used
+ * for example to set general behavior like all interrupts on/off for example. The information is only exchanged between the commandInterface and the
+ * AudioManagerController. The AudioManagerController has to interpret the value and react accordingly.
+ * - am::am_SystemProperty_s describes the attributes of Systemproperties
+ */
+
+/**
+ * \page misc Miscellaneous
+ *
+ * \section connfor Connection Formats
+ * Every flow of audio is using a format to exchange data. The format that the source and the sink uses must match together in order to have an undisturbed
+ * experience. It is common that sources and sinks are capable of supporting more than one audioformat.\n
+ * So all sources and sinks register with a list of connectionFormats that they support and for each connection a format must be chosen that is then used
+ * to transport the audio data. Gateways (and Soundconverters) have the information which connectionFormat can be transformed into another one.
+ * - am::am_ConnectionFormat_e has all formats listed.
+ *
+ * \section pers Persistence & Lifecycle
+ * Details of persistence can be done when the si-team have defined the components and interfaces in the Enterprise Architect model.
+ * So much is clear: the persistence will be based on POSIX interfaces that can be used to read and write data.\n
+ * Persistence is a very system specific topic: what needs to be remembered over lifecycles, what will be reset to default? So this needs to be done via the
+ * AudioMangerController. The Controller will then enter the values read from the persistence and write them to the daemon.
+ * The lifecycle itself will be handles by the daemon which will then fire hooks in the controller to make sure appropriate actions are taken.
*
* \section speed Speed dependent volume
- * The adjustments for the speed are done product specific in the controller. The speed information itself is retrieved by the AudioManagerDaemon, sampled and quantified and forwarded to the controller.\n
+ * The adjustments for the speed are done product specific in the controller. The speed information itself is retrieved by the AudioManagerDaemon, sampled and
+ * quantified and forwarded to the controller. The interface in not yet defined !\n
* Turning speed controlled volume on/off and possible settings are achieved via SinkSoundProperty settings.
- *
- * \section Lipsync
- * It is the job of the AudioManager to retrieve all latency timing information from each connection, to aggregate this information and provide a latency information on a per MainConnection Basis. It is not the task of the AudioManager to actually delay or speed up video or audio signals to achieve a lipsync. The actual correction shall be done in the videoplayer with the information provided by the AudioManager.
- * The time information is always reported by the routingadaptors for each connection. Delays that are introduced in a sink or a gateway are counting for the connection that connects to this sink or gateway.\n
- * After the buildup of a connection the first timing information needs to be sent within 5 seconds, the timing information from the routing adaptors need to be sent via 4 seconds. If the latency for a connection is variable and changes over lifetime of the connection, the routing adaptors shall resend the value and the audiomanger will correct the over all latency.\n
- * @author Christian Mueller
- * @created 25-Feb-2012 3:54:06 PM
+ */
+
+/**
+ * \page comp Compiling & Co
+ * \todo add README
+ * \include ../README
*/
#ifndef MAINPAGE_H_
diff --git a/AudioManagerDaemon/include/TAmPluginTemplate.h b/AudioManagerDaemon/include/TAmPluginTemplate.h
index e525ce3..68fe786 100644
--- a/AudioManagerDaemon/include/TAmPluginTemplate.h
+++ b/AudioManagerDaemon/include/TAmPluginTemplate.h
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file TAmPluginTemplate.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file TAmPluginTemplate.h
+ * For further information see http://www.genivi.org/.
*
*/
@@ -33,8 +31,9 @@ namespace am
{
/**
- * This template tries to load a library and cast ot to a class
+ * * This template tries to load a library and cast to a class
* @param libname the full path to the library to be loaded
+ * @param libraryHandle the handle to the library that gets returned
* @return returns the pointer to the class to be loaded
*/
template<class T> T* getCreateFunction(const std::string& libname, void*& libraryHandle)
@@ -56,7 +55,7 @@ template<class T> T* getCreateFunction(const std::string& libname, void*& librar
if (!libraryHandle || dlopen_error)
{
logError("getCreateFunction : dlopen failed",dlopen_error);
- return 0;
+ return (0);
}
// get entry point from shared lib
@@ -84,7 +83,7 @@ template<class T> T* getCreateFunction(const std::string& libname, void*& librar
{
logInfo("getCreateFunction : loaded successfully plugin", createFunctionName);
}
- return createFunction;
+ return (createFunction);
}
}
diff --git a/AudioManagerDaemon/src/CAmCommandReceiver.cpp b/AudioManagerDaemon/src/CAmCommandReceiver.cpp
index c6f760c..95554bd 100644
--- a/AudioManagerDaemon/src/CAmCommandReceiver.cpp
+++ b/AudioManagerDaemon/src/CAmCommandReceiver.cpp
@@ -1,34 +1,32 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CommandReveiver.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * \file CAmCommandReceiver.cpp
+ * For further information see http://www.genivi.org/.
*
*/
#include "CAmCommandReceiver.h"
+#include <cassert>
+#include <algorithm>
#include "CAmDatabaseHandler.h"
#include "CAmControlSender.h"
#include "shared/CAmDltWrapper.h"
-#include <shared/CAmSocketHandler.h>
-#include <cassert>
-#include <algorithm>
+#include "shared/CAmSocketHandler.h"
namespace am
{
@@ -71,111 +69,111 @@ CAmCommandReceiver::~CAmCommandReceiver()
am_Error_e CAmCommandReceiver::connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
{
logInfo("CommandReceiver::connect got called, sourceID=", sourceID, "sinkID=", sinkID);
- return mControlSender->hookUserConnectionRequest(sourceID, sinkID, mainConnectionID);
+ return (mControlSender->hookUserConnectionRequest(sourceID, sinkID, mainConnectionID));
}
am_Error_e CAmCommandReceiver::disconnect(const am_mainConnectionID_t mainConnectionID)
{
logInfo("CommandReceiver::disconnect got called, mainConnectionID=", mainConnectionID);
- return mControlSender->hookUserDisconnectionRequest(mainConnectionID);
+ return (mControlSender->hookUserDisconnectionRequest(mainConnectionID));
}
am_Error_e CAmCommandReceiver::setVolume(const am_sinkID_t sinkID, const am_mainVolume_t volume)
{
logInfo("CommandReceiver::setVolume got called, sinkID=", sinkID, "volume=", volume);
- return mControlSender->hookUserVolumeChange(sinkID, volume);
+ return (mControlSender->hookUserVolumeChange(sinkID, volume));
}
am_Error_e CAmCommandReceiver::volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep)
{
logInfo("CommandReceiver::volumeStep got called, sinkID=", sinkID, "volumeStep=", volumeStep);
- return mControlSender->hookUserVolumeStep(sinkID, volumeStep);
+ return (mControlSender->hookUserVolumeStep(sinkID, volumeStep));
}
am_Error_e CAmCommandReceiver::setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
{
logInfo("CommandReceiver::setSinkMuteState got called, sinkID=", sinkID, "muteState=", muteState);
- return mControlSender->hookUserSetSinkMuteState(sinkID, muteState);
+ return (mControlSender->hookUserSetSinkMuteState(sinkID, muteState));
}
am_Error_e CAmCommandReceiver::setMainSinkSoundProperty(const am_MainSoundProperty_s & soundProperty, const am_sinkID_t sinkID)
{
logInfo("CommandReceiver::setMainSinkSoundProperty got called, sinkID=", sinkID, "soundPropertyType=", soundProperty.type, "soundPropertyValue=", soundProperty.value);
- return mControlSender->hookUserSetMainSinkSoundProperty(sinkID, soundProperty);
+ return (mControlSender->hookUserSetMainSinkSoundProperty(sinkID, soundProperty));
}
am_Error_e CAmCommandReceiver::setMainSourceSoundProperty(const am_MainSoundProperty_s & soundProperty, const am_sourceID_t sourceID)
{
logInfo("CommandReceiver::setMainSourceSoundProperty got called, sourceID=", sourceID, "soundPropertyType=", soundProperty.type, "soundPropertyValue=", soundProperty.value);
- return mControlSender->hookUserSetMainSourceSoundProperty(sourceID, soundProperty);
+ return (mControlSender->hookUserSetMainSourceSoundProperty(sourceID, soundProperty));
}
am_Error_e CAmCommandReceiver::setSystemProperty(const am_SystemProperty_s & property)
{
logInfo("CommandReceiver::setSystemProperty got called", "type=", property.type, "soundPropertyValue=", property.value);
- return mControlSender->hookUserSetSystemProperty(property);
+ return (mControlSender->hookUserSetSystemProperty(property));
}
am_Error_e CAmCommandReceiver::getListMainConnections(std::vector<am_MainConnectionType_s> & listConnections) const
{
- return mDatabaseHandler->getListVisibleMainConnections(listConnections);
+ return (mDatabaseHandler->getListVisibleMainConnections(listConnections));
}
am_Error_e CAmCommandReceiver::getListMainSinks(std::vector<am_SinkType_s>& listMainSinks) const
{
- return mDatabaseHandler->getListMainSinks(listMainSinks);
+ return (mDatabaseHandler->getListMainSinks(listMainSinks));
}
am_Error_e CAmCommandReceiver::getListMainSources(std::vector<am_SourceType_s>& listMainSources) const
{
- return mDatabaseHandler->getListMainSources(listMainSources);
+ return (mDatabaseHandler->getListMainSources(listMainSources));
}
am_Error_e CAmCommandReceiver::getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s> & listSoundProperties) const
{
- return mDatabaseHandler->getListMainSinkSoundProperties(sinkID, listSoundProperties);
+ return (mDatabaseHandler->getListMainSinkSoundProperties(sinkID, listSoundProperties));
}
am_Error_e CAmCommandReceiver::getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s> & listSourceProperties) const
{
- return mDatabaseHandler->getListMainSourceSoundProperties(sourceID, listSourceProperties);
+ return (mDatabaseHandler->getListMainSourceSoundProperties(sourceID, listSourceProperties));
}
am_Error_e CAmCommandReceiver::getListSourceClasses(std::vector<am_SourceClass_s> & listSourceClasses) const
{
- return mDatabaseHandler->getListSourceClasses(listSourceClasses);
+ return (mDatabaseHandler->getListSourceClasses(listSourceClasses));
}
am_Error_e CAmCommandReceiver::getListSinkClasses(std::vector<am_SinkClass_s> & listSinkClasses) const
{
- return mDatabaseHandler->getListSinkClasses(listSinkClasses);
+ return (mDatabaseHandler->getListSinkClasses(listSinkClasses));
}
am_Error_e CAmCommandReceiver::getListSystemProperties(std::vector<am_SystemProperty_s> & listSystemProperties) const
{
- return mDatabaseHandler->getListSystemProperties(listSystemProperties);
+ return (mDatabaseHandler->getListSystemProperties(listSystemProperties));
}
am_Error_e CAmCommandReceiver::getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t & delay) const
{
- return mDatabaseHandler->getTimingInformation(mainConnectionID, delay);
+ return (mDatabaseHandler->getTimingInformation(mainConnectionID, delay));
}
am_Error_e CAmCommandReceiver::getDBusConnectionWrapper(CAmDbusWrapper*& dbusConnectionWrapper) const
{
#ifdef WITH_DBUS_WRAPPER
dbusConnectionWrapper = mDBusWrapper;
- return E_OK;
+ return (E_OK);
#else
- return E_UNKNOWN;
+ return (E_UNKNOWN);
#endif /*WITH_DBUS_WRAPPER*/
}
am_Error_e CAmCommandReceiver::getSocketHandler(CAmSocketHandler *& socketHandler) const
{
socketHandler = mSocketHandler;
- return E_OK;
+ return (E_OK);
}
void CAmCommandReceiver::getInterfaceVersion(std::string & version) const
@@ -201,14 +199,14 @@ uint16_t CAmCommandReceiver::getStartupHandle()
{
uint16_t handle = ++handleCount; //todo: handle overflow
mListStartupHandles.push_back(handle);
- return handle;
+ return (handle);
}
uint16_t CAmCommandReceiver::getRundownHandle()
{
uint16_t handle = ++handleCount; //todo: handle overflow
mListRundownHandles.push_back(handle);
- return handle;
+ return (handle);
}
void CAmCommandReceiver::waitOnStartup(bool startup)
diff --git a/AudioManagerDaemon/src/CAmCommandSender.cpp b/AudioManagerDaemon/src/CAmCommandSender.cpp
index 0ada15c..d16485f 100644
--- a/AudioManagerDaemon/src/CAmCommandSender.cpp
+++ b/AudioManagerDaemon/src/CAmCommandSender.cpp
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmCommandSender.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmCommandSender.cpp
+ * For further information see http://www.genivi.org/.
*
*/
@@ -33,13 +31,15 @@
namespace am
{
-#define REQUIRED_INTERFACE_VERSION_MAJOR 1
-#define REQUIRED_INTERFACE_VERSION_MINOR 0
+#define REQUIRED_INTERFACE_VERSION_MAJOR 1 //!< major interface version. All versions smaller than this will be rejected
+#define REQUIRED_INTERFACE_VERSION_MINOR 0 //!< minor interface version. All versions smaller than this will be rejected
-//!< macro to call all interfaces
+/**
+ * macro to call all interfaces
+ */
#define CALL_ALL_INTERFACES(...) \
- std::vector<IAmCommandSend*>::iterator iter = mListInterfaces.begin(); \
- std::vector<IAmCommandSend*>::iterator iterEnd = mListInterfaces.end(); \
+ std::vector<IAmCommandSend*>::iterator iter = mListInterfaces.begin(); \
+ std::vector<IAmCommandSend*>::iterator iterEnd = mListInterfaces.end(); \
for (; iter<iterEnd;++iter) \
{ \
(*iter)->__VA_ARGS__; \
@@ -151,7 +151,7 @@ am_Error_e CAmCommandSender::startupInterfaces(CAmCommandReceiver *iCommandRecei
returnError = error;
}
}
- return returnError;
+ return (returnError);
}
void CAmCommandSender::cbNumberOfSinkClassesChanged()
@@ -271,7 +271,7 @@ void CAmCommandSender::getInterfaceVersion(std::string & version) const
am_Error_e am::CAmCommandSender::getListPlugins(std::vector<std::string> & interfaces) const
{
interfaces = mListLibraryNames;
- return E_OK;
+ return (E_OK);
}
void CAmCommandSender::unloadLibraries(void)
diff --git a/AudioManagerDaemon/src/CAmControlReceiver.cpp b/AudioManagerDaemon/src/CAmControlReceiver.cpp
index 6d68089..3d64226 100644
--- a/AudioManagerDaemon/src/CAmControlReceiver.cpp
+++ b/AudioManagerDaemon/src/CAmControlReceiver.cpp
@@ -1,36 +1,34 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmControlReceiver.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmControlReceiver.cpp
+ * For further information see http://www.genivi.org/.
*
*/
-#include <config.h>
-#include <shared/CAmSocketHandler.h>
#include "CAmControlReceiver.h"
+#include <cassert>
+#include "config.h"
#include "CAmDatabaseHandler.h"
#include "CAmRoutingSender.h"
#include "CAmCommandSender.h"
#include "CAmRouter.h"
#include "shared/CAmDltWrapper.h"
-#include <cassert>
+#include "shared/CAmSocketHandler.h"
namespace am {
@@ -54,7 +52,7 @@ CAmControlReceiver::~CAmControlReceiver()
am_Error_e CAmControlReceiver::getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s> & returnList)
{
- return mRouter->getRoute(onlyfree, sourceID, sinkID, returnList);
+ return (mRouter->getRoute(onlyfree, sourceID, sinkID, returnList));
}
am_Error_e CAmControlReceiver::connect(am_Handle_s & handle, am_connectionID_t & connectionID, const am_ConnectionFormat_e format, const am_sourceID_t sourceID, const am_sinkID_t sinkID)
@@ -69,10 +67,10 @@ am_Error_e CAmControlReceiver::connect(am_Handle_s & handle, am_connectionID_t &
//todo: enter function to find out what happends if the same connection is in the course of being build up.
if (mDatabaseHandler->existConnection(tempConnection))
- return E_ALREADY_EXISTS; //todo:enter the correct connectionID here?
+ return (E_ALREADY_EXISTS); //todo:enter the correct connectionID here?
mDatabaseHandler->enterConnectionDB(tempConnection, connectionID);
- return mRoutingSender->asyncConnect(handle, connectionID, sourceID, sinkID, format);
+ return (mRoutingSender->asyncConnect(handle, connectionID, sourceID, sinkID, format));
}
am_Error_e CAmControlReceiver::disconnect(am_Handle_s & handle, const am_connectionID_t connectionID)
@@ -80,8 +78,8 @@ am_Error_e CAmControlReceiver::disconnect(am_Handle_s & handle, const am_connect
logInfo("CAmControlReceiver::disconnect got called, connectionID=", connectionID);
if (!mDatabaseHandler->existConnectionID(connectionID))
- return E_NON_EXISTENT; //todo: check with EA model and correct
- return mRoutingSender->asyncDisconnect(handle, connectionID);
+ return (E_NON_EXISTENT); //todo: check with EA model and correct
+ return (mRoutingSender->asyncDisconnect(handle, connectionID));
}
am_Error_e CAmControlReceiver::crossfade(am_Handle_s & handle, const am_HotSink_e hotSource, const am_crossfaderID_t crossfaderID, const am_RampType_e rampType, const am_time_t rampTime)
@@ -89,8 +87,8 @@ am_Error_e CAmControlReceiver::crossfade(am_Handle_s & handle, const am_HotSink_
logInfo("CAmControlReceiver::crossfade got called, hotSource=", hotSource, "crossfaderID=", crossfaderID, "rampType=", rampType, "rampTime=", rampTime);
if (!mDatabaseHandler->existcrossFader(crossfaderID))
- return E_NON_EXISTENT;
- return mRoutingSender->asyncCrossFade(handle, crossfaderID, hotSource, rampType, rampTime);
+ return (E_NON_EXISTENT);
+ return (mRoutingSender->asyncCrossFade(handle, crossfaderID, hotSource, rampType, rampTime));
}
am_Error_e CAmControlReceiver::setSourceState(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SourceState_e state)
@@ -99,10 +97,10 @@ am_Error_e CAmControlReceiver::setSourceState(am_Handle_s & handle, const am_sou
am_SourceState_e sourceState;
if (mDatabaseHandler->getSoureState(sourceID, sourceState) != E_OK)
- return E_UNKNOWN;
+ return (E_UNKNOWN);
if (sourceState == state)
- return E_NO_CHANGE;
- return mRoutingSender->asyncSetSourceState(handle, sourceID, state);
+ return (E_NO_CHANGE);
+ return (mRoutingSender->asyncSetSourceState(handle, sourceID, state));
}
am_Error_e CAmControlReceiver::setSinkVolume(am_Handle_s & handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time)
@@ -111,10 +109,10 @@ am_Error_e CAmControlReceiver::setSinkVolume(am_Handle_s & handle, const am_sink
am_volume_t tempVolume;
if (mDatabaseHandler->getSinkVolume(sinkID, tempVolume) != E_OK)
- return E_UNKNOWN;
+ return (E_UNKNOWN);
if (tempVolume == volume)
- return E_NO_CHANGE;
- return mRoutingSender->asyncSetSinkVolume(handle, sinkID, volume, ramp, time);
+ return (E_NO_CHANGE);
+ return (mRoutingSender->asyncSetSinkVolume(handle, sinkID, volume, ramp, time));
}
am_Error_e CAmControlReceiver::setSourceVolume(am_Handle_s & handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e rampType, const am_time_t time)
@@ -123,10 +121,10 @@ am_Error_e CAmControlReceiver::setSourceVolume(am_Handle_s & handle, const am_so
am_volume_t tempVolume;
if (mDatabaseHandler->getSourceVolume(sourceID, tempVolume) != E_OK)
- return E_UNKNOWN;
+ return (E_UNKNOWN);
if (tempVolume == volume)
- return E_NO_CHANGE;
- return mRoutingSender->asyncSetSourceVolume(handle, sourceID, volume, rampType, time);
+ return (E_NO_CHANGE);
+ return (mRoutingSender->asyncSetSourceVolume(handle, sourceID, volume, rampType, time));
}
am_Error_e CAmControlReceiver::setSinkSoundProperty(am_Handle_s & handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
@@ -135,10 +133,10 @@ am_Error_e CAmControlReceiver::setSinkSoundProperty(am_Handle_s & handle, const
uint16_t value;
if (mDatabaseHandler->getSinkSoundPropertyValue(sinkID, soundProperty.type, value) != E_OK)
- return E_UNKNOWN;
+ return (E_UNKNOWN);
if (value == soundProperty.value)
- return E_NO_CHANGE;
- return mRoutingSender->asyncSetSinkSoundProperty(handle, sinkID, soundProperty);
+ return (E_NO_CHANGE);
+ return (mRoutingSender->asyncSetSinkSoundProperty(handle, sinkID, soundProperty));
}
am_Error_e CAmControlReceiver::setSinkSoundProperties(am_Handle_s & handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s> & listSoundProperties)
@@ -166,10 +164,10 @@ am_Error_e CAmControlReceiver::setSourceSoundProperty(am_Handle_s & handle, cons
uint16_t value;
if (mDatabaseHandler->getSourceSoundPropertyValue(sourceID, soundProperty.type, value) != E_OK)
- return E_UNKNOWN;
+ return (E_UNKNOWN);
if (value == soundProperty.value)
- return E_NO_CHANGE;
- return mRoutingSender->asyncSetSourceSoundProperty(handle, sourceID, soundProperty);
+ return (E_NO_CHANGE);
+ return (mRoutingSender->asyncSetSourceSoundProperty(handle, sourceID, soundProperty));
}
am_Error_e CAmControlReceiver::setSourceSoundProperties(am_Handle_s & handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
@@ -197,272 +195,272 @@ am_Error_e CAmControlReceiver::setDomainState(const am_domainID_t domainID, cons
am_DomainState_e tempState = DS_UNKNOWN;
if (mDatabaseHandler->getDomainState(domainID, tempState) != E_OK)
- return E_UNKNOWN;
+ return (E_UNKNOWN);
if (tempState == domainState)
- return E_NO_CHANGE;
- return mRoutingSender->setDomainState(domainID, domainState);
+ return (E_NO_CHANGE);
+ return (mRoutingSender->setDomainState(domainID, domainState));
}
am_Error_e CAmControlReceiver::abortAction(const am_Handle_s handle)
{
logInfo("CAmControlReceiver::abortAction got called, handle.type=", handle.handle, "handle.handleType=", handle.handleType);
- return mRoutingSender->asyncAbort(handle);
+ return (mRoutingSender->asyncAbort(handle));
}
am_Error_e CAmControlReceiver::enterDomainDB(const am_Domain_s & domainData, am_domainID_t & domainID)
{
- return mDatabaseHandler->enterDomainDB(domainData, domainID);
+ return (mDatabaseHandler->enterDomainDB(domainData, domainID));
}
am_Error_e CAmControlReceiver::enterMainConnectionDB(const am_MainConnection_s & mainConnectionData, am_mainConnectionID_t & connectionID)
{
- return mDatabaseHandler->enterMainConnectionDB(mainConnectionData, connectionID);
+ return (mDatabaseHandler->enterMainConnectionDB(mainConnectionData, connectionID));
}
am_Error_e CAmControlReceiver::enterSinkDB(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
{
- return mDatabaseHandler->enterSinkDB(sinkData, sinkID);
+ return (mDatabaseHandler->enterSinkDB(sinkData, sinkID));
}
am_Error_e CAmControlReceiver::enterCrossfaderDB(const am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
{
- return mDatabaseHandler->enterCrossfaderDB(crossfaderData, crossfaderID);
+ return (mDatabaseHandler->enterCrossfaderDB(crossfaderData, crossfaderID));
}
am_Error_e CAmControlReceiver::enterGatewayDB(const am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
{
- return mDatabaseHandler->enterGatewayDB(gatewayData, gatewayID);
+ return (mDatabaseHandler->enterGatewayDB(gatewayData, gatewayID));
}
am_Error_e CAmControlReceiver::enterSourceDB(const am_Source_s & sourceData, am_sourceID_t & sourceID)
{
- return mDatabaseHandler->enterSourceDB(sourceData, sourceID);
+ return (mDatabaseHandler->enterSourceDB(sourceData, sourceID));
}
am_Error_e CAmControlReceiver::enterSinkClassDB(const am_SinkClass_s & sinkClass, am_sinkClass_t & sinkClassID)
{
- return mDatabaseHandler->enterSinkClassDB(sinkClass, sinkClassID);
+ return (mDatabaseHandler->enterSinkClassDB(sinkClass, sinkClassID));
}
am_Error_e CAmControlReceiver::enterSourceClassDB(am_sourceClass_t & sourceClassID, const am_SourceClass_s & sourceClass)
{
- return mDatabaseHandler->enterSourceClassDB(sourceClassID, sourceClass);
+ return (mDatabaseHandler->enterSourceClassDB(sourceClassID, sourceClass));
}
am_Error_e CAmControlReceiver::enterSystemPropertiesListDB(const std::vector<am_SystemProperty_s> & listSystemProperties)
{
- return mDatabaseHandler->enterSystemProperties(listSystemProperties);
+ return (mDatabaseHandler->enterSystemProperties(listSystemProperties));
}
am_Error_e CAmControlReceiver::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID)
{
- return mDatabaseHandler->changeMainConnectionRouteDB(mainconnectionID, listConnectionID);
+ return (mDatabaseHandler->changeMainConnectionRouteDB(mainconnectionID, listConnectionID));
}
am_Error_e CAmControlReceiver::changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState)
{
- return mDatabaseHandler->changeMainConnectionStateDB(mainconnectionID, connectionState);
+ return (mDatabaseHandler->changeMainConnectionStateDB(mainconnectionID, connectionState));
}
am_Error_e CAmControlReceiver::changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID)
{
- return mDatabaseHandler->changeSinkMainVolumeDB(mainVolume, sinkID);
+ return (mDatabaseHandler->changeSinkMainVolumeDB(mainVolume, sinkID));
}
am_Error_e CAmControlReceiver::changeSinkAvailabilityDB(const am_Availability_s & availability, const am_sinkID_t sinkID)
{
- return mDatabaseHandler->changeSinkAvailabilityDB(availability, sinkID);
+ return (mDatabaseHandler->changeSinkAvailabilityDB(availability, sinkID));
}
am_Error_e CAmControlReceiver::changDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID)
{
- return mDatabaseHandler->changDomainStateDB(domainState, domainID);
+ return (mDatabaseHandler->changDomainStateDB(domainState, domainID));
}
am_Error_e CAmControlReceiver::changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID)
{
- return mDatabaseHandler->changeSinkMuteStateDB(muteState, sinkID);
+ return (mDatabaseHandler->changeSinkMuteStateDB(muteState, sinkID));
}
am_Error_e CAmControlReceiver::changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s & soundProperty, const am_sinkID_t sinkID)
{
- return mDatabaseHandler->changeMainSinkSoundPropertyDB(soundProperty, sinkID);
+ return (mDatabaseHandler->changeMainSinkSoundPropertyDB(soundProperty, sinkID));
}
am_Error_e CAmControlReceiver::changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s & soundProperty, const am_sourceID_t sourceID)
{
- return mDatabaseHandler->changeMainSinkSoundPropertyDB(soundProperty, sourceID);
+ return (mDatabaseHandler->changeMainSinkSoundPropertyDB(soundProperty, sourceID));
}
am_Error_e CAmControlReceiver::changeSourceAvailabilityDB(const am_Availability_s & availability, const am_sourceID_t sourceID)
{
- return mDatabaseHandler->changeSourceAvailabilityDB(availability, sourceID);
+ return (mDatabaseHandler->changeSourceAvailabilityDB(availability, sourceID));
}
am_Error_e CAmControlReceiver::changeSystemPropertyDB(const am_SystemProperty_s & property)
{
- return mDatabaseHandler->changeSystemPropertyDB(property);
+ return (mDatabaseHandler->changeSystemPropertyDB(property));
}
am_Error_e CAmControlReceiver::removeMainConnectionDB(const am_mainConnectionID_t mainConnectionID)
{
- return mDatabaseHandler->removeMainConnectionDB(mainConnectionID);
+ return (mDatabaseHandler->removeMainConnectionDB(mainConnectionID));
}
am_Error_e CAmControlReceiver::removeSinkDB(const am_sinkID_t sinkID)
{
- return mDatabaseHandler->removeSinkDB(sinkID);
+ return (mDatabaseHandler->removeSinkDB(sinkID));
}
am_Error_e CAmControlReceiver::removeSourceDB(const am_sourceID_t sourceID)
{
- return mDatabaseHandler->removeSourceDB(sourceID);
+ return (mDatabaseHandler->removeSourceDB(sourceID));
}
am_Error_e CAmControlReceiver::removeGatewayDB(const am_gatewayID_t gatewayID)
{
- return mDatabaseHandler->removeGatewayDB(gatewayID);
+ return (mDatabaseHandler->removeGatewayDB(gatewayID));
}
am_Error_e CAmControlReceiver::removeCrossfaderDB(const am_crossfaderID_t crossfaderID)
{
- return mDatabaseHandler->removeCrossfaderDB(crossfaderID);
+ return (mDatabaseHandler->removeCrossfaderDB(crossfaderID));
}
am_Error_e CAmControlReceiver::removeDomainDB(const am_domainID_t domainID)
{
- return mDatabaseHandler->removeDomainDB(domainID);
+ return (mDatabaseHandler->removeDomainDB(domainID));
}
am_Error_e CAmControlReceiver::getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s & classInfo) const
{
- return mDatabaseHandler->getSourceClassInfoDB(sourceID, classInfo);
+ return (mDatabaseHandler->getSourceClassInfoDB(sourceID, classInfo));
}
am_Error_e CAmControlReceiver::getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s & sinkClass) const
{
- return mDatabaseHandler->getSinkClassInfoDB(sinkID, sinkClass);
+ return (mDatabaseHandler->getSinkClassInfoDB(sinkID, sinkClass));
}
am_Error_e CAmControlReceiver::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s & sinkData) const
{
- return mDatabaseHandler->getSinkInfoDB(sinkID, sinkData);
+ return (mDatabaseHandler->getSinkInfoDB(sinkID, sinkData));
}
am_Error_e CAmControlReceiver::getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s & sourceData) const
{
- return mDatabaseHandler->getSourceInfoDB(sourceID, sourceData);
+ return (mDatabaseHandler->getSourceInfoDB(sourceID, sourceData));
}
am_Error_e CAmControlReceiver::getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s & mainConnectionData) const
{
- return mDatabaseHandler->getMainConnectionInfoDB(mainConnectionID, mainConnectionData);
+ return (mDatabaseHandler->getMainConnectionInfoDB(mainConnectionID, mainConnectionData));
}
am_Error_e CAmControlReceiver::getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s & gatewayData) const
{
- return mDatabaseHandler->getGatewayInfoDB(gatewayID, gatewayData);
+ return (mDatabaseHandler->getGatewayInfoDB(gatewayID, gatewayData));
}
am_Error_e CAmControlReceiver::getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s & crossfaderData) const
{
- return mDatabaseHandler->getCrossfaderInfoDB(crossfaderID, crossfaderData);
+ return (mDatabaseHandler->getCrossfaderInfoDB(crossfaderID, crossfaderData));
}
am_Error_e CAmControlReceiver::getListSinksOfDomain(const am_domainID_t domainID, std::vector<am_sinkID_t> & listSinkID) const
{
- return mDatabaseHandler->getListSinksOfDomain(domainID, listSinkID);
+ return (mDatabaseHandler->getListSinksOfDomain(domainID, listSinkID));
}
am_Error_e CAmControlReceiver::getListSourcesOfDomain(const am_domainID_t domainID, std::vector<am_sourceID_t> & listSourceID) const
{
- return mDatabaseHandler->getListSourcesOfDomain(domainID, listSourceID);
+ return (mDatabaseHandler->getListSourcesOfDomain(domainID, listSourceID));
}
am_Error_e CAmControlReceiver::getListCrossfadersOfDomain(const am_domainID_t domainID, std::vector<am_crossfaderID_t> & listGatewaysID) const
{
- return mDatabaseHandler->getListCrossfadersOfDomain(domainID, listGatewaysID);
+ return (mDatabaseHandler->getListCrossfadersOfDomain(domainID, listGatewaysID));
}
am_Error_e CAmControlReceiver::getListGatewaysOfDomain(const am_domainID_t domainID, std::vector<am_gatewayID_t> & listGatewaysID) const
{
- return mDatabaseHandler->getListGatewaysOfDomain(domainID, listGatewaysID);
+ return (mDatabaseHandler->getListGatewaysOfDomain(domainID, listGatewaysID));
}
am_Error_e CAmControlReceiver::getListMainConnections(std::vector<am_MainConnection_s> & listMainConnections) const
{
- return mDatabaseHandler->getListMainConnections(listMainConnections);
+ return (mDatabaseHandler->getListMainConnections(listMainConnections));
}
am_Error_e CAmControlReceiver::getListDomains(std::vector<am_Domain_s> & listDomains) const
{
- return mDatabaseHandler->getListDomains(listDomains);
+ return (mDatabaseHandler->getListDomains(listDomains));
}
am_Error_e CAmControlReceiver::getListConnections(std::vector<am_Connection_s> & listConnections) const
{
- return mDatabaseHandler->getListConnections(listConnections);
+ return (mDatabaseHandler->getListConnections(listConnections));
}
am_Error_e CAmControlReceiver::getListSinks(std::vector<am_Sink_s> & listSinks) const
{
- return mDatabaseHandler->getListSinks(listSinks);
+ return (mDatabaseHandler->getListSinks(listSinks));
}
am_Error_e CAmControlReceiver::getListSources(std::vector<am_Source_s> & listSources) const
{
- return mDatabaseHandler->getListSources(listSources);
+ return (mDatabaseHandler->getListSources(listSources));
}
am_Error_e CAmControlReceiver::getListSourceClasses(std::vector<am_SourceClass_s> & listSourceClasses) const
{
- return mDatabaseHandler->getListSourceClasses(listSourceClasses);
+ return (mDatabaseHandler->getListSourceClasses(listSourceClasses));
}
am_Error_e CAmControlReceiver::getListHandles(std::vector<am_Handle_s> & listHandles) const
{
- return mRoutingSender->getListHandles(listHandles);
+ return (mRoutingSender->getListHandles(listHandles));
}
am_Error_e CAmControlReceiver::getListCrossfaders(std::vector<am_Crossfader_s> & listCrossfaders) const
{
- return mDatabaseHandler->getListCrossfaders(listCrossfaders);
+ return (mDatabaseHandler->getListCrossfaders(listCrossfaders));
}
am_Error_e CAmControlReceiver::getListGateways(std::vector<am_Gateway_s> & listGateways) const
{
- return mDatabaseHandler->getListGateways(listGateways);
+ return (mDatabaseHandler->getListGateways(listGateways));
}
am_Error_e CAmControlReceiver::getListSinkClasses(std::vector<am_SinkClass_s> & listSinkClasses) const
{
- return mDatabaseHandler->getListSinkClasses(listSinkClasses);
+ return (mDatabaseHandler->getListSinkClasses(listSinkClasses));
}
am_Error_e CAmControlReceiver::getListSystemProperties(std::vector<am_SystemProperty_s> & listSystemProperties) const
{
- return mDatabaseHandler->getListSystemProperties(listSystemProperties);
+ return (mDatabaseHandler->getListSystemProperties(listSystemProperties));
}
am_Error_e CAmControlReceiver::changeSinkClassInfoDB(const am_SinkClass_s & classInfo)
{
- return mDatabaseHandler->changeSinkClassInfoDB(classInfo);
+ return (mDatabaseHandler->changeSinkClassInfoDB(classInfo));
}
am_Error_e CAmControlReceiver::changeSourceClassInfoDB(const am_SourceClass_s & classInfo)
{
- return mDatabaseHandler->changeSourceClassInfoDB(classInfo);
+ return(mDatabaseHandler->changeSourceClassInfoDB(classInfo));
}
am_Error_e CAmControlReceiver::removeSinkClassDB(const am_sinkClass_t sinkClassID)
{
- return mDatabaseHandler->removeSinkClassDB(sinkClassID);
+ return (mDatabaseHandler->removeSinkClassDB(sinkClassID));
}
am_Error_e CAmControlReceiver::removeSourceClassDB(const am_sourceClass_t sourceClassID)
{
- return mDatabaseHandler->removeSourceClassDB(sourceClassID);
+ return (mDatabaseHandler->removeSourceClassDB(sourceClassID));
}
void CAmControlReceiver::setCommandReady()
@@ -490,7 +488,7 @@ void CAmControlReceiver::confirmControllerRundown()
am_Error_e CAmControlReceiver::getSocketHandler(CAmSocketHandler *& socketHandler)
{
socketHandler = mSocketHandler;
- return E_OK;
+ return (E_OK);
}
void CAmControlReceiver::setCommandRundown()
diff --git a/AudioManagerDaemon/src/CAmControlSender.cpp b/AudioManagerDaemon/src/CAmControlSender.cpp
index cc26c90..39c29a7 100644
--- a/AudioManagerDaemon/src/CAmControlSender.cpp
+++ b/AudioManagerDaemon/src/CAmControlSender.cpp
@@ -1,40 +1,39 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmControlSender.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmControlSender.cpp
+ * For further information see http://www.genivi.org/.
*
*/
#include "CAmControlSender.h"
-#include "TAmPluginTemplate.h"
-#include "shared/CAmDltWrapper.h"
#include <cassert>
#include <fstream>
#include <iostream>
#include <sstream>
#include <stdexcept>
+#include "TAmPluginTemplate.h"
+#include "shared/CAmDltWrapper.h"
-namespace am {
+namespace am
+{
-#define REQUIRED_INTERFACE_VERSION_MAJOR 1
-#define REQUIRED_INTERFACE_VERSION_MINOR 0
+#define REQUIRED_INTERFACE_VERSION_MAJOR 1 //!< major interface version. All versions smaller than this will be rejected
+#define REQUIRED_INTERFACE_VERSION_MINOR 0 //!< minor interface version. All versions smaller than this will be rejected
CAmControlSender::CAmControlSender(std::string controlPluginFile) :
mlibHandle(NULL), //
@@ -79,97 +78,97 @@ CAmControlSender::~CAmControlSender()
am_Error_e CAmControlSender::hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
{
- return mController->hookUserConnectionRequest(sourceID, sinkID, mainConnectionID);
+ return (mController->hookUserConnectionRequest(sourceID, sinkID, mainConnectionID));
}
am_Error_e CAmControlSender::hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID)
{
- return mController->hookUserDisconnectionRequest(connectionID);
+ return (mController->hookUserDisconnectionRequest(connectionID));
}
am_Error_e CAmControlSender::hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s & soundProperty)
{
- return mController->hookUserSetMainSinkSoundProperty(sinkID, soundProperty);
+ return (mController->hookUserSetMainSinkSoundProperty(sinkID, soundProperty));
}
am_Error_e CAmControlSender::hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s & soundProperty)
{
- return mController->hookUserSetMainSourceSoundProperty(sourceID, soundProperty);
+ return (mController->hookUserSetMainSourceSoundProperty(sourceID, soundProperty));
}
am_Error_e CAmControlSender::hookUserSetSystemProperty(const am_SystemProperty_s & property)
{
- return mController->hookUserSetSystemProperty(property);
+ return (mController->hookUserSetSystemProperty(property));
}
am_Error_e CAmControlSender::hookUserVolumeChange(const am_sinkID_t sinkID, const am_mainVolume_t newVolume)
{
- return mController->hookUserVolumeChange(sinkID, newVolume);
+ return (mController->hookUserVolumeChange(sinkID, newVolume));
}
am_Error_e CAmControlSender::hookUserVolumeStep(const am_sinkID_t sinkID, const int16_t increment)
{
- return mController->hookUserVolumeStep(sinkID, increment);
+ return (mController->hookUserVolumeStep(sinkID, increment));
}
am_Error_e CAmControlSender::hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
{
- return mController->hookUserSetSinkMuteState(sinkID, muteState);
+ return (mController->hookUserSetSinkMuteState(sinkID, muteState));
}
am_Error_e CAmControlSender::hookSystemRegisterDomain(const am_Domain_s & domainData, am_domainID_t & domainID)
{
- return mController->hookSystemRegisterDomain(domainData, domainID);
+ return (mController->hookSystemRegisterDomain(domainData, domainID));
}
am_Error_e CAmControlSender::hookSystemDeregisterDomain(const am_domainID_t domainID)
{
- return mController->hookSystemDeregisterDomain(domainID);
+ return (mController->hookSystemDeregisterDomain(domainID));
}
void CAmControlSender::hookSystemDomainRegistrationComplete(const am_domainID_t domainID)
{
- return mController->hookSystemDomainRegistrationComplete(domainID);
+ return (mController->hookSystemDomainRegistrationComplete(domainID));
}
am_Error_e CAmControlSender::hookSystemRegisterSink(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
{
- return mController->hookSystemRegisterSink(sinkData, sinkID);
+ return (mController->hookSystemRegisterSink(sinkData, sinkID));
}
am_Error_e CAmControlSender::hookSystemDeregisterSink(const am_sinkID_t sinkID)
{
- return mController->hookSystemDeregisterSink(sinkID);
+ return (mController->hookSystemDeregisterSink(sinkID));
}
am_Error_e CAmControlSender::hookSystemRegisterSource(const am_Source_s & sourceData, am_sourceID_t & sourceID)
{
- return mController->hookSystemRegisterSource(sourceData, sourceID);
+ return (mController->hookSystemRegisterSource(sourceData, sourceID));
}
am_Error_e CAmControlSender::hookSystemDeregisterSource(const am_sourceID_t sourceID)
{
- return mController->hookSystemDeregisterSource(sourceID);
+ return (mController->hookSystemDeregisterSource(sourceID));
}
am_Error_e CAmControlSender::hookSystemRegisterGateway(const am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
{
- return mController->hookSystemRegisterGateway(gatewayData, gatewayID);
+ return (mController->hookSystemRegisterGateway(gatewayData, gatewayID));
}
am_Error_e CAmControlSender::hookSystemDeregisterGateway(const am_gatewayID_t gatewayID)
{
- return mController->hookSystemDeregisterGateway(gatewayID);
+ return (mController->hookSystemDeregisterGateway(gatewayID));
}
am_Error_e CAmControlSender::hookSystemRegisterCrossfader(const am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
{
- return mController->hookSystemRegisterCrossfader(crossfaderData, crossfaderID);
+ return (mController->hookSystemRegisterCrossfader(crossfaderData, crossfaderID));
}
am_Error_e CAmControlSender::hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID)
{
- return mController->hookSystemDeregisterCrossfader(crossfaderID);
+ return (mController->hookSystemDeregisterCrossfader(crossfaderID));
}
void CAmControlSender::hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)
@@ -254,7 +253,7 @@ void CAmControlSender::cbAckSetSourceSoundProperty(const am_Handle_s handle, con
am_Error_e CAmControlSender::startupController(IAmControlReceive *controlreceiveinterface)
{
- return mController->startupController(controlreceiveinterface);
+ return (mController->startupController(controlreceiveinterface));
}
void CAmControlSender::cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
@@ -284,7 +283,7 @@ void CAmControlSender::setControllerRundown()
am_Error_e am::CAmControlSender::getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector<am_ConnectionFormat_e> listPossibleConnectionFormats, std::vector<am_ConnectionFormat_e> & listPrioConnectionFormats)
{
- return mController->getConnectionFormatChoice(sourceID, sinkID, listRoute, listPossibleConnectionFormats, listPrioConnectionFormats);
+ return (mController->getConnectionFormatChoice(sourceID, sinkID, listRoute, listPossibleConnectionFormats, listPrioConnectionFormats));
}
void CAmControlSender::getInterfaceVersion(std::string & version) const
diff --git a/AudioManagerDaemon/src/CAmDatabaseHandler.cpp b/AudioManagerDaemon/src/CAmDatabaseHandler.cpp
index b9da10e..a13b38c 100644
--- a/AudioManagerDaemon/src/CAmDatabaseHandler.cpp
+++ b/AudioManagerDaemon/src/CAmDatabaseHandler.cpp
@@ -1,53 +1,52 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmDatabaseHandler.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmDatabaseHandler.cpp
+ * For further information see http://www.genivi.org/.
*
*/
#include "CAmDatabaseHandler.h"
-#include "CAmDatabaseObserver.h"
#include <cassert>
#include <vector>
#include <fstream>
#include <sstream>
#include <string>
-#include "shared/CAmDltWrapper.h"
+#include "CAmDatabaseObserver.h"
#include "CAmRouter.h"
-
-#define DOMAIN_TABLE "Domains"
-#define SOURCE_CLASS_TABLE "SourceClasses"
-#define SINK_CLASS_TABLE "SinkClasses"
-#define SOURCE_TABLE "Sources"
-#define SINK_TABLE "Sinks"
-#define GATEWAY_TABLE "Gateways"
-#define CROSSFADER_TABLE "Crossfaders"
-#define CONNECTION_TABLE "Connections"
-#define MAINCONNECTION_TABLE "MainConnections"
-#define INTERRUPT_TABLE "Interrupts"
-#define MAIN_TABLE "MainTable"
-#define SYSTEM_TABLE "SystemProperties"
+#include "shared/CAmDltWrapper.h"
namespace am
{
+#define DOMAIN_TABLE "Domains" //!< domain table
+#define SOURCE_CLASS_TABLE "SourceClasses" //!< source class table
+#define SINK_CLASS_TABLE "SinkClasses" //!< sink class table
+#define SOURCE_TABLE "Sources" //!< source table
+#define SINK_TABLE "Sinks" //!< sink table
+#define GATEWAY_TABLE "Gateways" //!< gateway table
+#define CROSSFADER_TABLE "Crossfaders" //!< crossfader table
+#define CONNECTION_TABLE "Connections" //!< connection table
+#define MAINCONNECTION_TABLE "MainConnections" //!< main connection table
+#define SYSTEM_TABLE "SystemProperties" //!< system properties table
+
+/**
+ * table that holds table informations
+ */
const std::string databaseTables[] =
{ " Domains (domainID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50), busname VARCHAR(50), nodename VARCHAR(50), early BOOL, complete BOOL, state INTEGER, reserved BOOL);", //
" SourceClasses (sourceClassID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50));", //
@@ -62,21 +61,21 @@ const std::string databaseTables[] =
/**
* template to converts T to std::string
- * @param i the value to be converted
- * @return the string
+ * @param x T
+ * @return string
*/
template<typename T>
inline std::string i2s(T const& x)
{
std::ostringstream o;
o << x;
- return o.str();
+ return (o.str());
}
CAmDatabaseHandler::CAmDatabaseHandler(std::string databasePath) :
- mDatabase(NULL), //
+ mpDatabase(NULL), //
mPath(databasePath), //
- mDatabaseObserver(NULL), //
+ mpDatabaseObserver(NULL), //
mFirstStaticSink(true), //
mFirstStaticSource(true), //
mFirstStaticGateway(true), //
@@ -106,7 +105,7 @@ CAmDatabaseHandler::CAmDatabaseHandler(std::string databasePath) :
CAmDatabaseHandler::~CAmDatabaseHandler()
{
logInfo("Closed Database");
- sqlite3_close(mDatabase);
+ sqlite3_close(mpDatabase);
}
am_Error_e CAmDatabaseHandler::enterDomainDB(const am_Domain_s & domainData, am_domainID_t & domainID)
@@ -120,7 +119,7 @@ am_Error_e CAmDatabaseHandler::enterDomainDB(const am_Domain_s & domainData, am_
sqlite3_stmt* query = NULL, *queryFinal;
int eCode = 0;
std::string command = "SELECT domainID FROM " + std::string(DOMAIN_TABLE) + " WHERE name=?";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, domainData.name.c_str(), domainData.name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -134,16 +133,16 @@ am_Error_e CAmDatabaseHandler::enterDomainDB(const am_Domain_s & domainData, am_
else
{
logError("DatabaseHandler::enterDomainDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterDomainDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &queryFinal, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &queryFinal, NULL);
sqlite3_bind_text(queryFinal, 1, domainData.name.c_str(), domainData.name.size(), SQLITE_STATIC);
sqlite3_bind_text(queryFinal, 2, domainData.busname.c_str(), domainData.busname.size(), SQLITE_STATIC);
sqlite3_bind_text(queryFinal, 3, domainData.nodename.c_str(), domainData.nodename.size(), SQLITE_STATIC);
@@ -155,24 +154,24 @@ am_Error_e CAmDatabaseHandler::enterDomainDB(const am_Domain_s & domainData, am_
if ((eCode = sqlite3_step(queryFinal)) != SQLITE_DONE)
{
logError("DatabaseHandler::enterDomainDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(queryFinal)) != SQLITE_OK)
{
logError("DatabaseHandler::enterDomainDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- domainID = sqlite3_last_insert_rowid(mDatabase);
+ domainID = sqlite3_last_insert_rowid(mpDatabase);
logInfo("DatabaseHandler::enterDomainDB entered new domain with name=", domainData.name, "busname=", domainData.busname, "nodename=", domainData.nodename, "assigned ID:", domainID);
am_Domain_s domain = domainData;
domain.domainID = domainID;
- if (mDatabaseObserver)
- mDatabaseObserver->newDomain(domain);
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->newDomain(domain);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & mainConnectionData, am_mainConnectionID_t & connectionID)
@@ -186,7 +185,7 @@ am_Error_e CAmDatabaseHandler::enterMainConnectionDB(const am_MainConnection_s &
int eCode = 0;
int16_t delay = 0;
std::string command = "INSERT INTO " + std::string(MAINCONNECTION_TABLE) + "(sourceID, sinkID, connectionState, delay) VALUES (?,?,?,-1)";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, mainConnectionData.sourceID);
sqlite3_bind_int(query, 2, mainConnectionData.sinkID);
sqlite3_bind_int(query, 3, mainConnectionData.connectionState);
@@ -194,20 +193,20 @@ am_Error_e CAmDatabaseHandler::enterMainConnectionDB(const am_MainConnection_s &
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::enterMainConnectionDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterMainConnectionDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- connectionID = sqlite3_last_insert_rowid(mDatabase);
+ connectionID = sqlite3_last_insert_rowid(mpDatabase);
//now check the connectionTable for all connections in the route. IF connectionID exist
command = "SELECT delay FROM " + std::string(CONNECTION_TABLE) + (" WHERE connectionID=?");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_connectionID_t>::const_iterator elementIterator = mainConnectionData.listConnectionID.begin();
for (; elementIterator < mainConnectionData.listConnectionID.end(); ++elementIterator)
{
@@ -224,7 +223,7 @@ am_Error_e CAmDatabaseHandler::enterMainConnectionDB(const am_MainConnection_s &
else
{
logError("DatabaseHandler::enterMainConnectionDB did not find route for MainConnection:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -232,7 +231,7 @@ am_Error_e CAmDatabaseHandler::enterMainConnectionDB(const am_MainConnection_s &
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterMainConnectionDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//now we create a table with references to the connections;
@@ -240,7 +239,7 @@ am_Error_e CAmDatabaseHandler::enterMainConnectionDB(const am_MainConnection_s &
assert(this->sqQuery(command));
command = "INSERT INTO MainConnectionRoute" + i2s(connectionID) + "(connectionID) VALUES (?)";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_connectionID_t>::const_iterator listConnectionIterator(mainConnectionData.listConnectionID.begin());
for (; listConnectionIterator < mainConnectionData.listConnectionID.end(); ++listConnectionIterator)
{
@@ -248,7 +247,7 @@ am_Error_e CAmDatabaseHandler::enterMainConnectionDB(const am_MainConnection_s &
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::enterMainConnectionDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -256,12 +255,12 @@ am_Error_e CAmDatabaseHandler::enterMainConnectionDB(const am_MainConnection_s &
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterMainConnectionDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::enterMainConnectionDB entered new mainConnection with sourceID", mainConnectionData.sourceID, "sinkID:", mainConnectionData.sinkID, "delay:", delay, "assigned ID:", connectionID);
- if (mDatabaseObserver)
+ if (mpDatabaseObserver)
{
am_MainConnectionType_s mainConnection;
mainConnection.mainConnectionID = connectionID;
@@ -269,14 +268,14 @@ am_Error_e CAmDatabaseHandler::enterMainConnectionDB(const am_MainConnection_s &
mainConnection.delay = delay;
mainConnection.sinkID = mainConnectionData.sinkID;
mainConnection.sourceID = mainConnectionData.sourceID;
- mDatabaseObserver->newMainConnection(mainConnection);
- mDatabaseObserver->mainConnectionStateChanged(connectionID, mainConnectionData.connectionState);
+ mpDatabaseObserver->newMainConnection(mainConnection);
+ mpDatabaseObserver->mainConnectionStateChanged(connectionID, mainConnectionData.connectionState);
}
//finally, we update the delay value for the maintable
if (delay == 0)
delay = -1;
- return changeDelayMainConnection(delay, connectionID);
+ return (changeDelayMainConnection(delay, connectionID));
}
am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
@@ -285,7 +284,7 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
assert(sinkData.domainID!=0);
assert(!sinkData.name.empty());
assert(sinkData.sinkClassID!=0);
- // \todo: need to check if class exists?
+ //todo: need to check if class exists?
assert(!sinkData.listConnectionFormats.empty());
assert(sinkData.muteState>=MS_UNKNOWN && sinkData.muteState<=MS_MAX);
@@ -293,7 +292,7 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
int eCode = 0;
std::string command = "SELECT sinkID FROM " + std::string(SINK_TABLE) + " WHERE name=? AND reserved=1";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, sinkData.name.c_str(), sinkData.name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
@@ -313,7 +312,7 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
if (existSinkNameOrID(sinkData.sinkID, sinkData.name))
{
sqlite3_finalize(query);
- return E_ALREADY_EXISTS;
+ return (E_ALREADY_EXISTS);
}
command = "INSERT INTO " + std::string(SINK_TABLE) + "(name, domainID, sinkClassID, volume, visible, availability, availabilityReason, muteState, mainVolume, reserved, sinkID) VALUES (?,?,?,?,?,?,?,?,?,?,?)";
}
@@ -322,16 +321,16 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
{
logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterSinkDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &queryFinal, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &queryFinal, NULL);
sqlite3_bind_text(queryFinal, 1, sinkData.name.c_str(), sinkData.name.size(), SQLITE_STATIC);
sqlite3_bind_int(queryFinal, 2, sinkData.domainID);
sqlite3_bind_int(queryFinal, 3, sinkData.sinkClassID);
@@ -360,18 +359,18 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
{
logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(queryFinal);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(queryFinal)) != SQLITE_OK)
{
logError("DatabaseHandler::enterSinkDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//now read back the sinkID
command = "SELECT sinkID FROM " + std::string(SINK_TABLE) + " WHERE name=?";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, sinkData.name.c_str(), sinkData.name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -382,7 +381,7 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
sinkID = 0;
logError("DatabaseHandler::existSink database error!:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_finalize(query);
@@ -394,7 +393,7 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
//fill ConnectionFormats
command = "INSERT INTO SinkConnectionFormat" + i2s(sinkID) + std::string("(soundFormat) VALUES (?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_ConnectionFormat_e>::const_iterator connectionFormatIterator = sinkData.listConnectionFormats.begin();
for (; connectionFormatIterator < sinkData.listConnectionFormats.end(); ++connectionFormatIterator)
{
@@ -403,14 +402,14 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
{
logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
//Fill SinkSoundProperties
command = "INSERT INTO SinkSoundProperty" + i2s(sinkID) + std::string("(soundPropertyType,value) VALUES (?,?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_SoundProperty_s>::const_iterator SoundPropertyIterator = sinkData.listSoundProperties.begin();
for (; SoundPropertyIterator < sinkData.listSoundProperties.end(); ++SoundPropertyIterator)
{
@@ -420,7 +419,7 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
{
logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -432,7 +431,7 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
//Fill MainSinkSoundProperties
command = "INSERT INTO SinkMainSoundProperty" + i2s(sinkID) + std::string("(soundPropertyType,value) VALUES (?,?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_MainSoundProperty_s>::const_iterator mainSoundPropertyIterator = sinkData.listMainSoundProperties.begin();
for (; mainSoundPropertyIterator < sinkData.listMainSoundProperties.end(); ++mainSoundPropertyIterator)
{
@@ -442,7 +441,7 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
{
logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -451,9 +450,9 @@ am_Error_e CAmDatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID
logInfo("DatabaseHandler::enterSinkDB entered new sink with name", sinkData.name, "domainID:", sinkData.domainID, "classID:", sinkData.sinkClassID, "volume:", sinkData.volume, "assigned ID:", sinkID);
am_Sink_s sink = sinkData;
sink.sinkID = sinkID;
- if (mDatabaseObserver != NULL)
- mDatabaseObserver->newSink(sink);
- return E_OK;
+ if (mpDatabaseObserver != NULL)
+ mpDatabaseObserver->newSink(sink);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::enterCrossfaderDB(const am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
@@ -478,11 +477,11 @@ am_Error_e CAmDatabaseHandler::enterCrossfaderDB(const am_Crossfader_s & crossfa
{
//check if the ID already exists
if (existcrossFader(crossfaderData.crossfaderID))
- return E_ALREADY_EXISTS;
+ return (E_ALREADY_EXISTS);
command = "INSERT INTO " + std::string(CROSSFADER_TABLE) + "(name, sinkID_A, sinkID_B, sourceID, hotSink, crossfaderID) VALUES (?,?,?,?,?,?)";
}
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, crossfaderData.name.c_str(), crossfaderData.name.size(), SQLITE_STATIC);
sqlite3_bind_int(query, 2, crossfaderData.sinkID_A);
@@ -507,19 +506,19 @@ am_Error_e CAmDatabaseHandler::enterCrossfaderDB(const am_Crossfader_s & crossfa
{
logError("DatabaseHandler::enterCrossfaderDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterCrossfaderDB SQLITE Finalize error code:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//now read back the crossfaderID
command = "SELECT crossfaderID FROM " + std::string(CROSSFADER_TABLE) + " WHERE name=?";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, crossfaderData.name.c_str(), crossfaderData.name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -530,7 +529,7 @@ am_Error_e CAmDatabaseHandler::enterCrossfaderDB(const am_Crossfader_s & crossfa
crossfaderID = 0;
logError("DatabaseHandler::enterCrossfaderDB database error!:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_finalize(query);
@@ -538,9 +537,9 @@ am_Error_e CAmDatabaseHandler::enterCrossfaderDB(const am_Crossfader_s & crossfa
am_Crossfader_s crossfader(crossfaderData);
crossfader.crossfaderID = crossfaderID;
- if (mDatabaseObserver)
- mDatabaseObserver->newCrossfader(crossfader);
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->newCrossfader(crossfader);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::enterGatewayDB(const am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
@@ -571,11 +570,11 @@ am_Error_e CAmDatabaseHandler::enterGatewayDB(const am_Gateway_s & gatewayData,
{
//check if the ID already exists
if (existGateway(gatewayData.gatewayID))
- return E_ALREADY_EXISTS;
+ return (E_ALREADY_EXISTS);
command = "INSERT INTO " + std::string(GATEWAY_TABLE) + "(name, sinkID, sourceID, domainSinkID, domainSourceID, controlDomainID, gatewayID) VALUES (?,?,?,?,?,?,?)";
}
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, gatewayData.name.c_str(), gatewayData.name.size(), SQLITE_STATIC);
sqlite3_bind_int(query, 2, gatewayData.sinkID);
sqlite3_bind_int(query, 3, gatewayData.sourceID);
@@ -599,16 +598,16 @@ am_Error_e CAmDatabaseHandler::enterGatewayDB(const am_Gateway_s & gatewayData,
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::enterGatewayDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterGatewayDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- gatewayID = sqlite3_last_insert_rowid(mDatabase);
+ gatewayID = sqlite3_last_insert_rowid(mpDatabase);
//now the convertion matrix todo: change the map implementation sometimes to blob in sqlite
mListConnectionFormat.insert(std::make_pair(gatewayID, gatewayData.convertionMatrix));
@@ -620,7 +619,7 @@ am_Error_e CAmDatabaseHandler::enterGatewayDB(const am_Gateway_s & gatewayData,
//fill ConnectionFormats
command = "INSERT INTO GatewaySourceFormat" + i2s(gatewayID) + std::string("(soundFormat) VALUES (?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_ConnectionFormat_e>::const_iterator connectionFormatIterator = gatewayData.listSourceFormats.begin();
for (; connectionFormatIterator < gatewayData.listSourceFormats.end(); ++connectionFormatIterator)
{
@@ -628,13 +627,13 @@ am_Error_e CAmDatabaseHandler::enterGatewayDB(const am_Gateway_s & gatewayData,
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::enterGatewayDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
command = "INSERT INTO GatewaySinkFormat" + i2s(gatewayID) + std::string("(soundFormat) VALUES (?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
connectionFormatIterator = gatewayData.listSinkFormats.begin();
for (; connectionFormatIterator < gatewayData.listSinkFormats.end(); ++connectionFormatIterator)
{
@@ -642,7 +641,7 @@ am_Error_e CAmDatabaseHandler::enterGatewayDB(const am_Gateway_s & gatewayData,
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::enterGatewayDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -650,9 +649,9 @@ am_Error_e CAmDatabaseHandler::enterGatewayDB(const am_Gateway_s & gatewayData,
logInfo("DatabaseHandler::enterGatewayDB entered new gateway with name", gatewayData.name, "sourceID:", gatewayData.sourceID, "sinkID:", gatewayData.sinkID, "assigned ID:", gatewayID);
am_Gateway_s gateway = gatewayData;
gateway.gatewayID = gatewayID;
- if (mDatabaseObserver)
- mDatabaseObserver->newGateway(gateway);
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->newGateway(gateway);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_sourceID_t & sourceID)
@@ -670,7 +669,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
int eCode = 0;
std::string command = "SELECT sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE name=? AND reserved=1";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, sourceData.name.c_str(), sourceData.name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
@@ -690,7 +689,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
if (existSourceNameOrID(sourceData.sourceID, sourceData.name))
{
sqlite3_finalize(query);
- return E_ALREADY_EXISTS;
+ return (E_ALREADY_EXISTS);
}
command = "INSERT INTO " + std::string(SOURCE_TABLE) + "(name, domainID, sourceClassID, sourceState, volume, visible, availability, availabilityReason, interruptState, reserved, sourceID) VALUES (?,?,?,?,?,?,?,?,?,?,?)";
}
@@ -699,15 +698,15 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
{
logError("DatabaseHandler::enterSourceDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterSourceDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &queryFinal, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &queryFinal, NULL);
sqlite3_bind_text(queryFinal, 1, sourceData.name.c_str(), sourceData.name.size(), SQLITE_STATIC);
sqlite3_bind_int(queryFinal, 2, sourceData.domainID);
sqlite3_bind_int(queryFinal, 3, sourceData.sourceClassID);
@@ -736,19 +735,19 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
{
logError("DatabaseHandler::enterSourceDB SQLITE Step error code:", eCode);
sqlite3_finalize(queryFinal);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(queryFinal)) != SQLITE_OK)
{
logError("DatabaseHandler::enterSourceDB SQLITE Finalize error code:", eCode);
sqlite3_finalize(queryFinal);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//now read back the sinkID
command = "SELECT sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE name=?";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, sourceData.name.c_str(), sourceData.name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -759,7 +758,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
sourceID = 0;
logError("DatabaseHandler::existSink database error!:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_finalize(query);
@@ -771,7 +770,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
//fill ConnectionFormats
command = "INSERT INTO SourceConnectionFormat" + i2s(sourceID) + std::string("(soundFormat) VALUES (?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_ConnectionFormat_e>::const_iterator connectionFormatIterator = sourceData.listConnectionFormats.begin();
for (; connectionFormatIterator < sourceData.listConnectionFormats.end(); ++connectionFormatIterator)
{
@@ -780,14 +779,14 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
{
logError("DatabaseHandler::enterSourceDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
//Fill SinkSoundProperties
command = "INSERT INTO SourceSoundProperty" + i2s(sourceID) + std::string("(soundPropertyType,value) VALUES (?,?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_SoundProperty_s>::const_iterator SoundPropertyIterator = sourceData.listSoundProperties.begin();
for (; SoundPropertyIterator < sourceData.listSoundProperties.end(); ++SoundPropertyIterator)
{
@@ -797,7 +796,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
{
logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -809,7 +808,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
//Fill MainSinkSoundProperties
command = "INSERT INTO SourceMainSoundProperty" + i2s(sourceID) + std::string("(soundPropertyType,value) VALUES (?,?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_MainSoundProperty_s>::const_iterator mainSoundPropertyIterator = sourceData.listMainSoundProperties.begin();
for (; mainSoundPropertyIterator < sourceData.listMainSoundProperties.end(); ++mainSoundPropertyIterator)
{
@@ -819,7 +818,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
{
logError("DatabaseHandler::enterSourceDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -829,9 +828,9 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
am_Source_s source = sourceData;
source.sourceID = sourceID;
- if (mDatabaseObserver)
- mDatabaseObserver->newSource(source);
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->newSource(source);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID)
@@ -839,7 +838,7 @@ am_Error_e CAmDatabaseHandler::changeMainConnectionRouteDB(const am_mainConnecti
assert(mainconnectionID!=0);
if (!existMainConnection(mainconnectionID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL;
int eCode = 0;
@@ -847,7 +846,7 @@ am_Error_e CAmDatabaseHandler::changeMainConnectionRouteDB(const am_mainConnecti
int16_t delay = 0;
command = "SELECT delay FROM " + std::string(CONNECTION_TABLE) + (" WHERE connectionID=?");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_connectionID_t>::const_iterator elementIterator = listConnectionID.begin();
for (; elementIterator < listConnectionID.end(); ++elementIterator)
{
@@ -865,7 +864,7 @@ am_Error_e CAmDatabaseHandler::changeMainConnectionRouteDB(const am_mainConnecti
{
logError("DatabaseHandler::changeMainConnectionRouteDB did not find route for MainConnection:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -874,7 +873,7 @@ am_Error_e CAmDatabaseHandler::changeMainConnectionRouteDB(const am_mainConnecti
{
logError("DatabaseHandler::changeMainConnectionRouteDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//now we delete the data in the table
@@ -882,7 +881,7 @@ am_Error_e CAmDatabaseHandler::changeMainConnectionRouteDB(const am_mainConnecti
assert(this->sqQuery(command));
command = "INSERT INTO MainConnectionRoute" + i2s(mainconnectionID) + "(connectionID) VALUES (?)";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_connectionID_t>::const_iterator listConnectionIterator(listConnectionID.begin());
for (; listConnectionIterator != listConnectionID.end(); ++listConnectionIterator)
{
@@ -891,7 +890,7 @@ am_Error_e CAmDatabaseHandler::changeMainConnectionRouteDB(const am_mainConnecti
{
logError("DatabaseHandler::changeMainConnectionRouteDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -900,10 +899,10 @@ am_Error_e CAmDatabaseHandler::changeMainConnectionRouteDB(const am_mainConnecti
{
logError("DatabaseHandler::changeMainConnectionRouteDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeMainConnectionRouteDB entered new route:", mainconnectionID);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState)
@@ -917,26 +916,26 @@ am_Error_e CAmDatabaseHandler::changeMainConnectionStateDB(const am_mainConnecti
if (!existMainConnection(mainconnectionID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE " + std::string(MAINCONNECTION_TABLE) + " SET connectionState=? WHERE mainConnectionID=" + i2s(mainconnectionID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, connectionState);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeMainConnectionStateDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeMainConnectionStateDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeMainConnectionStateDB changed mainConnectionState of MainConnection:", mainconnectionID, "to:", connectionState);
- if (mDatabaseObserver)
- mDatabaseObserver->mainConnectionStateChanged(mainconnectionID, connectionState);
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->mainConnectionStateChanged(mainconnectionID, connectionState);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID)
@@ -949,28 +948,28 @@ am_Error_e CAmDatabaseHandler::changeSinkMainVolumeDB(const am_mainVolume_t main
if (!existSink(sinkID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE " + std::string(SINK_TABLE) + " SET mainVolume=? WHERE sinkID=" + i2s(sinkID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, mainVolume);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeSinkMainVolumeDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeSinkMainVolumeDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeSinkMainVolumeDB changed mainVolume of sink:", sinkID, "to:", mainVolume);
- if (mDatabaseObserver)
- mDatabaseObserver->volumeChanged(sinkID, mainVolume);
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->volumeChanged(sinkID, mainVolume);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSinkAvailabilityDB(const am_Availability_s & availability, const am_sinkID_t sinkID)
@@ -985,29 +984,30 @@ am_Error_e CAmDatabaseHandler::changeSinkAvailabilityDB(const am_Availability_s
if (!existSink(sinkID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE " + std::string(SINK_TABLE) + " SET availability=?, availabilityReason=? WHERE sinkID=" + i2s(sinkID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, availability.availability);
sqlite3_bind_int(query, 2, availability.availabilityReason);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeSinkAvailabilityDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
- }assert(sinkID!=0);
+ return (E_DATABASE_ERROR);
+ }
+ assert(sinkID!=0);
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeSinkAvailabilityDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeSinkAvailabilityDB changed sinkAvailability of sink:", sinkID, "to:", availability.availability, "Reason:", availability.availabilityReason);
- if (mDatabaseObserver && sourceVisible(sinkID))
- mDatabaseObserver->sinkAvailabilityChanged(sinkID, availability);
- return E_OK;
+ if (mpDatabaseObserver && sourceVisible(sinkID))
+ mpDatabaseObserver->sinkAvailabilityChanged(sinkID, availability);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID)
@@ -1021,26 +1021,26 @@ am_Error_e CAmDatabaseHandler::changDomainStateDB(const am_DomainState_e domainS
if (!existDomain(domainID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE " + std::string(DOMAIN_TABLE) + " SET state=? WHERE domainID=" + i2s(domainID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, domainState);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changDomainStateDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changDomainStateDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changDomainStateDB changed domainState of domain:", domainID, "to:", domainState);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID)
@@ -1054,29 +1054,30 @@ am_Error_e CAmDatabaseHandler::changeSinkMuteStateDB(const am_MuteState_e muteSt
if (!existSink(sinkID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE " + std::string(SINK_TABLE) + " SET muteState=? WHERE sinkID=" + i2s(sinkID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, muteState);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeSinkMuteStateDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
- }assert(sinkID!=0);
+ return (E_DATABASE_ERROR);
+ }
+ assert(sinkID!=0);
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeSinkMuteStateDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeSinkMuteStateDB changed sinkMuteState of sink:", sinkID, "to:", muteState);
- if (mDatabaseObserver)
- mDatabaseObserver->sinkMuteStateChanged(sinkID, muteState);
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->sinkMuteStateChanged(sinkID, muteState);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s & soundProperty, const am_sinkID_t sinkID)
@@ -1090,27 +1091,28 @@ am_Error_e CAmDatabaseHandler::changeMainSinkSoundPropertyDB(const am_MainSoundP
if (!existSink(sinkID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE SinkMainSoundProperty" + i2s(sinkID) + " SET value=? WHERE soundPropertyType=" + i2s(soundProperty.type);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, soundProperty.value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeMainSinkSoundPropertyDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
- }assert(sinkID!=0);
+ return (E_DATABASE_ERROR);
+ }
+ assert(sinkID!=0);
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeMainSinkSoundPropertyDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeMainSinkSoundPropertyDB changed MainSinkSoundProperty of sink:", sinkID, "type:", soundProperty.type, "to:", soundProperty.value);
- if (mDatabaseObserver)
- mDatabaseObserver->mainSinkSoundPropertyChanged(sinkID, soundProperty);
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->mainSinkSoundPropertyChanged(sinkID, soundProperty);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s & soundProperty, const am_sourceID_t sourceID)
@@ -1124,28 +1126,28 @@ am_Error_e CAmDatabaseHandler::changeMainSourceSoundPropertyDB(const am_MainSoun
if (!existSource(sourceID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE SourceMainSoundProperty" + i2s(sourceID) + " SET value=? WHERE soundPropertyType=" + i2s(soundProperty.type);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, soundProperty.value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeMainSourceSoundPropertyDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeMainSourceSoundPropertyDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeMainSourceSoundPropertyDB changed MainSinkSoundProperty of source:", sourceID, "type:", soundProperty.type, "to:", soundProperty.value);
- if (mDatabaseObserver)
- mDatabaseObserver->mainSourceSoundPropertyChanged(sourceID, soundProperty);
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->mainSourceSoundPropertyChanged(sourceID, soundProperty);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSourceAvailabilityDB(const am_Availability_s & availability, const am_sourceID_t sourceID)
@@ -1160,29 +1162,29 @@ am_Error_e CAmDatabaseHandler::changeSourceAvailabilityDB(const am_Availability_
if (!existSource(sourceID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE " + std::string(SOURCE_TABLE) + " SET availability=?, availabilityReason=? WHERE sourceID=" + i2s(sourceID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, availability.availability);
sqlite3_bind_int(query, 2, availability.availabilityReason);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeSourceAvailabilityDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeSourceAvailabilityDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeSourceAvailabilityDB changed changeSourceAvailabilityDB of source:", sourceID, "to:", availability.availability, "Reason:", availability.availabilityReason);
- if (mDatabaseObserver && sourceVisible(sourceID))
- mDatabaseObserver->sourceAvailabilityChanged(sourceID, availability);
- return E_OK;
+ if (mpDatabaseObserver && sourceVisible(sourceID))
+ mpDatabaseObserver->sourceAvailabilityChanged(sourceID, availability);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSystemPropertyDB(const am_SystemProperty_s & property)
@@ -1192,28 +1194,28 @@ am_Error_e CAmDatabaseHandler::changeSystemPropertyDB(const am_SystemProperty_s
int eCode = 0;
std::string command = "UPDATE " + std::string(SYSTEM_TABLE) + " set value=? WHERE type=?";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, property.value);
sqlite3_bind_int(query, 2, property.type);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeSystemPropertyDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeSystemPropertyDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeSystemPropertyDB changed system property");
- if (mDatabaseObserver)
- mDatabaseObserver->systemPropertyChanged(property);
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->systemPropertyChanged(property);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::removeMainConnectionDB(const am_mainConnectionID_t mainConnectionID)
@@ -1222,21 +1224,21 @@ am_Error_e CAmDatabaseHandler::removeMainConnectionDB(const am_mainConnectionID_
if (!existMainConnection(mainConnectionID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
std::string command = "DELETE from " + std::string(MAINCONNECTION_TABLE) + " WHERE mainConnectionID=" + i2s(mainConnectionID);
std::string command1 = "DROP table MainConnectionRoute" + i2s(mainConnectionID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
if (!sqQuery(command1))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
logInfo("DatabaseHandler::removeMainConnectionDB removed:", mainConnectionID);
- if (mDatabaseObserver)
+ if (mpDatabaseObserver)
{
- mDatabaseObserver->mainConnectionStateChanged(mainConnectionID, CS_DISCONNECTED);
- mDatabaseObserver->removedMainConnection(mainConnectionID);
+ mpDatabaseObserver->mainConnectionStateChanged(mainConnectionID, CS_DISCONNECTED);
+ mpDatabaseObserver->removedMainConnection(mainConnectionID);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::removeSinkDB(const am_sinkID_t sinkID)
@@ -1245,7 +1247,7 @@ am_Error_e CAmDatabaseHandler::removeSinkDB(const am_sinkID_t sinkID)
if (!existSink(sinkID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
bool visible = sinkVisible(sinkID);
@@ -1255,19 +1257,19 @@ am_Error_e CAmDatabaseHandler::removeSinkDB(const am_sinkID_t sinkID)
std::string command2 = "DROP table SinkMainSoundProperty" + i2s(sinkID);
std::string command3 = "DROP table SinkSoundProperty" + i2s(sinkID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
if (!sqQuery(command1))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
if (!sqQuery(command2))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
if (!sqQuery(command3))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
logInfo("DatabaseHandler::removeSinkDB removed:", sinkID);
- if (mDatabaseObserver != NULL)
- mDatabaseObserver->removedSink(sinkID, visible);
+ if (mpDatabaseObserver != NULL)
+ mpDatabaseObserver->removedSink(sinkID, visible);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::removeSourceDB(const am_sourceID_t sourceID)
@@ -1276,7 +1278,7 @@ am_Error_e CAmDatabaseHandler::removeSourceDB(const am_sourceID_t sourceID)
if (!existSource(sourceID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
bool visible = sourceVisible(sourceID);
@@ -1286,17 +1288,17 @@ am_Error_e CAmDatabaseHandler::removeSourceDB(const am_sourceID_t sourceID)
std::string command2 = "DROP table SourceMainSoundProperty" + i2s(sourceID);
std::string command3 = "DROP table SourceSoundProperty" + i2s(sourceID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
if (!sqQuery(command1))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
if (!sqQuery(command2))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
if (!sqQuery(command3))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
logInfo("DatabaseHandler::removeSourceDB removed:", sourceID);
- if (mDatabaseObserver)
- mDatabaseObserver->removedSource(sourceID, visible);
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->removedSource(sourceID, visible);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::removeGatewayDB(const am_gatewayID_t gatewayID)
@@ -1305,15 +1307,15 @@ am_Error_e CAmDatabaseHandler::removeGatewayDB(const am_gatewayID_t gatewayID)
if (!existGateway(gatewayID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
std::string command = "DELETE from " + std::string(GATEWAY_TABLE) + " WHERE gatewayID=" + i2s(gatewayID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
logInfo("DatabaseHandler::removeGatewayDB removed:", gatewayID);
- if (mDatabaseObserver)
- mDatabaseObserver->removeGateway(gatewayID);
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->removeGateway(gatewayID);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::removeCrossfaderDB(const am_crossfaderID_t crossfaderID)
@@ -1322,15 +1324,15 @@ am_Error_e CAmDatabaseHandler::removeCrossfaderDB(const am_crossfaderID_t crossf
if (!existcrossFader(crossfaderID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
std::string command = "DELETE from " + std::string(CROSSFADER_TABLE) + " WHERE crossfaderID=" + i2s(crossfaderID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
logInfo("DatabaseHandler::removeDomainDB removed:", crossfaderID);
- if (mDatabaseObserver)
- mDatabaseObserver->removeCrossfader(crossfaderID);
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->removeCrossfader(crossfaderID);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::removeDomainDB(const am_domainID_t domainID)
@@ -1339,15 +1341,15 @@ am_Error_e CAmDatabaseHandler::removeDomainDB(const am_domainID_t domainID)
if (!existDomain(domainID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
std::string command = "DELETE from " + std::string(DOMAIN_TABLE) + " WHERE domainID=" + i2s(domainID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
logInfo("DatabaseHandler::removeDomainDB removed:", domainID);
- if (mDatabaseObserver)
- mDatabaseObserver->removeDomain(domainID);
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->removeDomain(domainID);
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::removeSinkClassDB(const am_sinkClass_t sinkClassID)
@@ -1356,20 +1358,20 @@ am_Error_e CAmDatabaseHandler::removeSinkClassDB(const am_sinkClass_t sinkClassI
if (!existSinkClass(sinkClassID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
std::string command = "DELETE from " + std::string(SINK_CLASS_TABLE) + " WHERE sinkClassID=" + i2s(sinkClassID);
std::string command1 = "DROP table SinkClassProperties" + i2s(sinkClassID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
if (!sqQuery(command1))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
logInfo("DatabaseHandler::removeSinkClassDB removed:", sinkClassID);
- if (mDatabaseObserver)
- mDatabaseObserver->numberOfSinkClassesChanged();
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->numberOfSinkClassesChanged();
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::removeSourceClassDB(const am_sourceClass_t sourceClassID)
@@ -1378,18 +1380,18 @@ am_Error_e CAmDatabaseHandler::removeSourceClassDB(const am_sourceClass_t source
if (!existSourceClass(sourceClassID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
std::string command = "DELETE from " + std::string(SOURCE_CLASS_TABLE) + " WHERE sourceClassID=" + i2s(sourceClassID);
std::string command1 = "DROP table SourceClassProperties" + i2s(sourceClassID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
if (!sqQuery(command1))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
logInfo("DatabaseHandler::removeSourceClassDB removed:", sourceClassID);
- if (mDatabaseObserver)
- mDatabaseObserver->numberOfSourceClassesChanged();
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->numberOfSourceClassesChanged();
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::removeConnection(const am_connectionID_t connectionID)
@@ -1398,9 +1400,9 @@ am_Error_e CAmDatabaseHandler::removeConnection(const am_connectionID_t connecti
std::string command = "DELETE from " + std::string(CONNECTION_TABLE) + " WHERE connectionID=" + i2s(connectionID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
logInfo("DatabaseHandler::removeConnection removed:", connectionID);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s & classInfo) const
@@ -1409,13 +1411,13 @@ am_Error_e CAmDatabaseHandler::getSourceClassInfoDB(const am_sourceID_t sourceID
if (!existSource(sourceID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL;
int eCode = 0;
am_ClassProperty_s propertyTemp;
std::string command = "SELECT sourceClassID FROM " + std::string(SOURCE_TABLE) + " WHERE sourceID=" + (i2s(sourceID));
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -1425,17 +1427,17 @@ am_Error_e CAmDatabaseHandler::getSourceClassInfoDB(const am_sourceID_t sourceID
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::getSourceClassInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getSourceClassInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
command = "SELECT name FROM " + std::string(SOURCE_CLASS_TABLE) + " WHERE sourceClassID=" + (i2s(classInfo.sourceClassID));
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -1445,18 +1447,18 @@ am_Error_e CAmDatabaseHandler::getSourceClassInfoDB(const am_sourceID_t sourceID
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::getSourceClassInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getSourceClassInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out Properties
command = "SELECT classProperty, value FROM SourceClassProperties" + i2s(classInfo.sourceClassID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
propertyTemp.classProperty = (am_ClassProperty_e) sqlite3_column_int(query, 0);
@@ -1467,15 +1469,15 @@ am_Error_e CAmDatabaseHandler::getSourceClassInfoDB(const am_sourceID_t sourceID
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getSourceClassInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getSourceClassInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s & sinkData) const
@@ -1485,7 +1487,7 @@ am_Error_e CAmDatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s
if (!existSink(sinkID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL;
@@ -1494,7 +1496,7 @@ am_Error_e CAmDatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s
am_SoundProperty_s tempSoundProperty;
am_MainSoundProperty_s tempMainSoundProperty;
std::string command = "SELECT name, domainID, sinkClassID, volume, visible, availability, availabilityReason, muteState, mainVolume, sinkID FROM " + std::string(SINK_TABLE) + " WHERE reserved=0 and sinkID=" + i2s(sinkID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -1511,7 +1513,7 @@ am_Error_e CAmDatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s
//read out the connectionFormats
std::string commandConnectionFormat = "SELECT soundFormat FROM SinkConnectionFormat" + i2s(sinkID);
- sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
while ((eCode = sqlite3_step(qConnectionFormat)) == SQLITE_ROW)
{
tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qConnectionFormat, 0);
@@ -1522,12 +1524,12 @@ am_Error_e CAmDatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s
{
logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out sound properties
std::string commandSoundProperty = "SELECT soundPropertyType, value FROM SinkSoundProperty" + i2s(sinkID);
- sqlite3_prepare_v2(mDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
while ((eCode = sqlite3_step(qSoundProperty)) == SQLITE_ROW)
{
tempSoundProperty.type = (am_SoundPropertyType_e) sqlite3_column_int(qSoundProperty, 0);
@@ -1539,12 +1541,12 @@ am_Error_e CAmDatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s
{
logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out MainSoundProperties
std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SinkMainSoundProperty" + i2s(sinkID);
- sqlite3_prepare_v2(mDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL);
while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW)
{
tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0);
@@ -1556,7 +1558,7 @@ am_Error_e CAmDatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s
{
logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
}
@@ -1564,17 +1566,17 @@ am_Error_e CAmDatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s
{
logError("DatabaseHandler::getSinkInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s & sourceData) const
@@ -1583,7 +1585,7 @@ am_Error_e CAmDatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_
if (!existSource(sourceID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL;
@@ -1592,7 +1594,7 @@ am_Error_e CAmDatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_
am_SoundProperty_s tempSoundProperty;
am_MainSoundProperty_s tempMainSoundProperty;
std::string command = "SELECT name, domainID, sourceClassID, sourceState, volume, visible, availability, availabilityReason, interruptState, sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE reserved=0 AND sourceID=" + i2s(sourceID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -1609,7 +1611,7 @@ am_Error_e CAmDatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_
//read out the connectionFormats
std::string commandConnectionFormat = "SELECT soundFormat FROM SourceConnectionFormat" + i2s(sourceID);
- sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
while ((eCode = sqlite3_step(qConnectionFormat)) == SQLITE_ROW)
{
tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qConnectionFormat, 0);
@@ -1620,12 +1622,12 @@ am_Error_e CAmDatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_
{
logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out sound properties
std::string commandSoundProperty = "SELECT soundPropertyType, value FROM SourceSoundProperty" + i2s(sourceID);
- sqlite3_prepare_v2(mDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
while ((eCode = sqlite3_step(qSoundProperty)) == SQLITE_ROW)
{
tempSoundProperty.type = (am_SoundPropertyType_e) sqlite3_column_int(qSoundProperty, 0);
@@ -1637,12 +1639,12 @@ am_Error_e CAmDatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_
{
logError("DatabaseHandler::getSourceInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out MainSoundProperties
std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SourceMainSoundProperty" + i2s(sourceID);
- sqlite3_prepare_v2(mDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL);
while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW)
{
tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0);
@@ -1654,24 +1656,24 @@ am_Error_e CAmDatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_
{
logError("DatabaseHandler::getSourceInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
}
else if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getSourceInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getSourceInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e am::CAmDatabaseHandler::getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s & mainConnectionData) const
@@ -1679,14 +1681,14 @@ am_Error_e am::CAmDatabaseHandler::getMainConnectionInfoDB(const am_mainConnecti
assert(mainConnectionID!=0);
if (!existMainConnection(mainConnectionID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt *query = NULL, *query1 = NULL;
int eCode = 0;
am_MainConnection_s temp;
std::string command = "SELECT mainConnectionID, sourceID, sinkID, connectionState, delay FROM " + std::string(MAINCONNECTION_TABLE) + " WHERE mainConnectionID=" + i2s(mainConnectionID);
std::string command1 = "SELECT connectionID FROM MainConnectionRoute";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -1696,7 +1698,7 @@ am_Error_e am::CAmDatabaseHandler::getMainConnectionInfoDB(const am_mainConnecti
mainConnectionData.connectionState = (am_ConnectionState_e) sqlite3_column_int(query, 3);
mainConnectionData.delay = sqlite3_column_int(query, 4);
std::string statement = command1 + i2s(mainConnectionID);
- sqlite3_prepare_v2(mDatabase, statement.c_str(), -1, &query1, NULL);
+ sqlite3_prepare_v2(mpDatabase, statement.c_str(), -1, &query1, NULL);
while ((eCode = sqlite3_step(query1)) == SQLITE_ROW)
{
mainConnectionData.listConnectionID.push_back(sqlite3_column_int(query1, 0));
@@ -1706,16 +1708,16 @@ am_Error_e am::CAmDatabaseHandler::getMainConnectionInfoDB(const am_mainConnecti
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getMainConnectionInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getMainConnectionInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSinkClassInfoDB(const am_SinkClass_s& sinkClass)
@@ -1728,11 +1730,11 @@ am_Error_e CAmDatabaseHandler::changeSinkClassInfoDB(const am_SinkClass_s& sinkC
//check if the ID already exists
if (!existSinkClass(sinkClass.sinkClassID))
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
//fill ConnectionFormats
std::string command = "UPDATE SinkClassProperties" + i2s(sinkClass.sinkClassID) + " set value=? WHERE classProperty=?;";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_ClassProperty_s>::const_iterator Iterator = sinkClass.listClassProperties.begin();
for (; Iterator < sinkClass.listClassProperties.end(); ++Iterator)
{
@@ -1741,7 +1743,7 @@ am_Error_e CAmDatabaseHandler::changeSinkClassInfoDB(const am_SinkClass_s& sinkC
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::setSinkClassInfoDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -1749,11 +1751,11 @@ am_Error_e CAmDatabaseHandler::changeSinkClassInfoDB(const am_SinkClass_s& sinkC
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::setSinkClassInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::setSinkClassInfoDB set setSinkClassInfo");
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSourceClassInfoDB(const am_SourceClass_s& sourceClass)
@@ -1766,11 +1768,11 @@ am_Error_e CAmDatabaseHandler::changeSourceClassInfoDB(const am_SourceClass_s& s
//check if the ID already exists
if (!existSourceClass(sourceClass.sourceClassID))
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
//fill ConnectionFormats
std::string command = "UPDATE SourceClassProperties" + i2s(sourceClass.sourceClassID) + " set value=? WHERE classProperty=?;";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_ClassProperty_s>::const_iterator Iterator = sourceClass.listClassProperties.begin();
for (; Iterator < sourceClass.listClassProperties.end(); ++Iterator)
{
@@ -1779,7 +1781,7 @@ am_Error_e CAmDatabaseHandler::changeSourceClassInfoDB(const am_SourceClass_s& s
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::setSinkClassInfoDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -1787,11 +1789,11 @@ am_Error_e CAmDatabaseHandler::changeSourceClassInfoDB(const am_SourceClass_s& s
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::setSinkClassInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::setSinkClassInfoDB set setSinkClassInfo");
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s & sinkClass) const
@@ -1800,13 +1802,13 @@ am_Error_e CAmDatabaseHandler::getSinkClassInfoDB(const am_sinkID_t sinkID, am_S
if (!existSink(sinkID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL;
int eCode = 0;
am_ClassProperty_s propertyTemp;
std::string command = "SELECT sinkClassID FROM " + std::string(SINK_TABLE) + " WHERE sinkID=" + (i2s(sinkID));
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -1816,17 +1818,17 @@ am_Error_e CAmDatabaseHandler::getSinkClassInfoDB(const am_sinkID_t sinkID, am_S
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::getSinkClassInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getSinkClassInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
command = "SELECT name FROM " + std::string(SINK_CLASS_TABLE) + " WHERE sinkClassID=" + (i2s(sinkClass.sinkClassID));
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -1836,18 +1838,18 @@ am_Error_e CAmDatabaseHandler::getSinkClassInfoDB(const am_sinkID_t sinkID, am_S
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::getSinkClassInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getSinkClassInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out Properties
command = "SELECT classProperty, value FROM SinkClassProperties" + i2s(sinkClass.sinkClassID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
propertyTemp.classProperty = (am_ClassProperty_e) sqlite3_column_int(query, 0);
@@ -1858,15 +1860,15 @@ am_Error_e CAmDatabaseHandler::getSinkClassInfoDB(const am_sinkID_t sinkID, am_S
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getSinkClassInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getSinkClassInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s & gatewayData) const
@@ -1874,13 +1876,13 @@ am_Error_e CAmDatabaseHandler::getGatewayInfoDB(const am_gatewayID_t gatewayID,
assert(gatewayID!=0);
if (!existGateway(gatewayID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL, *qSinkConnectionFormat = NULL, *qSourceConnectionFormat = NULL;
int eCode = 0;
am_ConnectionFormat_e tempConnectionFormat;
std::string command = "SELECT name, sinkID, sourceID, domainSinkID, domainSourceID, controlDomainID, gatewayID FROM " + std::string(GATEWAY_TABLE) + " WHERE gatewayID=" + i2s(gatewayID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -1898,13 +1900,13 @@ am_Error_e CAmDatabaseHandler::getGatewayInfoDB(const am_gatewayID_t gatewayID,
if (iter == mListConnectionFormat.end())
{
logError("DatabaseHandler::getGatewayInfoDB database error with convertionFormat");
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
gatewayData.convertionMatrix = iter->second;
//read out the connectionFormats
std::string commandConnectionFormat = "SELECT soundFormat FROM GatewaySourceFormat" + i2s(gatewayData.gatewayID);
- sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qSourceConnectionFormat, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandConnectionFormat.c_str(), -1, &qSourceConnectionFormat, NULL);
while ((eCode = sqlite3_step(qSourceConnectionFormat)) == SQLITE_ROW)
{
tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qSourceConnectionFormat, 0);
@@ -1914,12 +1916,12 @@ am_Error_e CAmDatabaseHandler::getGatewayInfoDB(const am_gatewayID_t gatewayID,
if ((eCode = sqlite3_finalize(qSourceConnectionFormat)) != SQLITE_OK)
{
logError("DatabaseHandler::getGatewayInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out sound properties
commandConnectionFormat = "SELECT soundFormat FROM GatewaySinkFormat" + i2s(gatewayData.gatewayID);
- sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qSinkConnectionFormat, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandConnectionFormat.c_str(), -1, &qSinkConnectionFormat, NULL);
while ((eCode = sqlite3_step(qSinkConnectionFormat)) == SQLITE_ROW)
{
tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qSinkConnectionFormat, 0);
@@ -1929,7 +1931,7 @@ am_Error_e CAmDatabaseHandler::getGatewayInfoDB(const am_gatewayID_t gatewayID,
if ((eCode = sqlite3_finalize(qSinkConnectionFormat)) != SQLITE_OK)
{
logError("DatabaseHandler::getGatewayInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
}
@@ -1937,16 +1939,16 @@ am_Error_e CAmDatabaseHandler::getGatewayInfoDB(const am_gatewayID_t gatewayID,
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getGatewayInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getGatewayInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
@@ -1955,12 +1957,12 @@ am_Error_e CAmDatabaseHandler::getCrossfaderInfoDB(const am_crossfaderID_t cross
assert(crossfaderID!=0);
if (!existcrossFader(crossfaderID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL;
int eCode = 0;
std::string command = "SELECT name, sinkID_A, sinkID_B, sourceID, hotSink,crossfaderID FROM " + std::string(CROSSFADER_TABLE) + " WHERE crossfaderID=" + i2s(crossfaderID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -1975,16 +1977,16 @@ am_Error_e CAmDatabaseHandler::getCrossfaderInfoDB(const am_crossfaderID_t cross
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getCrossfaderInfoDB SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getCrossfaderInfoDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListSinksOfDomain(const am_domainID_t domainID, std::vector<am_sinkID_t> & listSinkID) const
@@ -1993,13 +1995,13 @@ am_Error_e CAmDatabaseHandler::getListSinksOfDomain(const am_domainID_t domainID
listSinkID.clear();
if (!existDomain(domainID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL;
int eCode = 0;
am_sinkID_t temp;
std::string command = "SELECT sinkID FROM " + std::string(SINK_TABLE) + " WHERE reserved=0 AND domainID=" + (i2s(domainID));
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2010,16 +2012,16 @@ am_Error_e CAmDatabaseHandler::getListSinksOfDomain(const am_domainID_t domainID
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getListSinksOfDomain SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSinksOfDomain SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListSourcesOfDomain(const am_domainID_t domainID, std::vector<am_sourceID_t> & listSourceID) const
@@ -2028,14 +2030,14 @@ am_Error_e CAmDatabaseHandler::getListSourcesOfDomain(const am_domainID_t domain
listSourceID.clear();
if (!existDomain(domainID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL;
int eCode = 0;
am_sourceID_t temp;
std::string command = "SELECT sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE reserved=0 AND domainID=" + i2s(domainID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2046,16 +2048,16 @@ am_Error_e CAmDatabaseHandler::getListSourcesOfDomain(const am_domainID_t domain
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getListSourcesOfDomain SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSourcesOfDomain SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListCrossfadersOfDomain(const am_domainID_t domainID, std::vector<am_crossfaderID_t> & listCrossfader) const
@@ -2064,14 +2066,14 @@ am_Error_e CAmDatabaseHandler::getListCrossfadersOfDomain(const am_domainID_t do
listCrossfader.clear();
if (!existDomain(domainID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL;
int eCode = 0;
am_crossfaderID_t temp;
std::string command = "SELECT c.crossfaderID FROM " + std::string(CROSSFADER_TABLE) + " c," + std::string(SOURCE_TABLE) + " s WHERE c.sourceID=s.sourceID AND s.domainID=" + i2s(domainID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2082,16 +2084,16 @@ am_Error_e CAmDatabaseHandler::getListCrossfadersOfDomain(const am_domainID_t do
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getListCrossfadersOfDomain SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListCrossfadersOfDomain SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
@@ -2101,14 +2103,14 @@ am_Error_e CAmDatabaseHandler::getListGatewaysOfDomain(const am_domainID_t domai
listGatewaysID.clear();
if (!existDomain(domainID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
sqlite3_stmt* query = NULL;
int eCode = 0;
am_gatewayID_t temp;
std::string command = "SELECT gatewayID FROM " + std::string(GATEWAY_TABLE) + " WHERE controlDomainID=" + i2s(domainID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2119,16 +2121,16 @@ am_Error_e CAmDatabaseHandler::getListGatewaysOfDomain(const am_domainID_t domai
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getListGatewaysOfDomain SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListGatewaysOfDomain SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListMainConnections(std::vector<am_MainConnection_s> & listMainConnections) const
@@ -2139,7 +2141,7 @@ am_Error_e CAmDatabaseHandler::getListMainConnections(std::vector<am_MainConnect
am_MainConnection_s temp;
std::string command = "SELECT mainConnectionID, sourceID, sinkID, connectionState, delay FROM " + std::string(MAINCONNECTION_TABLE);
std::string command1 = "SELECT connectionID FROM MainConnectionRoute";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2149,7 +2151,7 @@ am_Error_e CAmDatabaseHandler::getListMainConnections(std::vector<am_MainConnect
temp.connectionState = (am_ConnectionState_e) sqlite3_column_int(query, 3);
temp.delay = sqlite3_column_int(query, 4);
std::string statement = command1 + i2s(temp.mainConnectionID);
- sqlite3_prepare_v2(mDatabase, statement.c_str(), -1, &query1, NULL);
+ sqlite3_prepare_v2(mpDatabase, statement.c_str(), -1, &query1, NULL);
while ((eCode = sqlite3_step(query1)) == SQLITE_ROW)
{
temp.listConnectionID.push_back(sqlite3_column_int(query1, 0));
@@ -2160,16 +2162,16 @@ am_Error_e CAmDatabaseHandler::getListMainConnections(std::vector<am_MainConnect
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getListMainConnections SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListMainConnections SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListDomains(std::vector<am_Domain_s> & listDomains) const
@@ -2179,7 +2181,7 @@ am_Error_e CAmDatabaseHandler::getListDomains(std::vector<am_Domain_s> & listDom
int eCode = 0;
am_Domain_s temp;
std::string command = "SELECT domainID, name, busname, nodename, early, complete, state FROM " + std::string(DOMAIN_TABLE) + " WHERE reserved=0";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2197,17 +2199,17 @@ am_Error_e CAmDatabaseHandler::getListDomains(std::vector<am_Domain_s> & listDom
{
logError("DatabaseHandler::getListDomains SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListDomains SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListConnections(std::vector<am_Connection_s> & listConnections) const
@@ -2217,7 +2219,7 @@ am_Error_e CAmDatabaseHandler::getListConnections(std::vector<am_Connection_s> &
int eCode = 0;
am_Connection_s temp;
std::string command = "SELECT connectionID, sourceID, sinkID, delay, connectionFormat FROM " + std::string(CONNECTION_TABLE) + " WHERE reserved=0";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2232,16 +2234,16 @@ am_Error_e CAmDatabaseHandler::getListConnections(std::vector<am_Connection_s> &
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getListConnections SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListConnections SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks) const
@@ -2254,7 +2256,7 @@ am_Error_e CAmDatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks)
am_SoundProperty_s tempSoundProperty;
am_MainSoundProperty_s tempMainSoundProperty;
std::string command = "SELECT name, domainID, sinkClassID, volume, visible, availability, availabilityReason, muteState, mainVolume, sinkID FROM " + std::string(SINK_TABLE) + " WHERE reserved=0";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2271,7 +2273,7 @@ am_Error_e CAmDatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks)
//read out the connectionFormats
std::string commandConnectionFormat = "SELECT soundFormat FROM SinkConnectionFormat" + i2s(temp.sinkID);
- sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
while ((eCode = sqlite3_step(qConnectionFormat)) == SQLITE_ROW)
{
tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qConnectionFormat, 0);
@@ -2282,12 +2284,12 @@ am_Error_e CAmDatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks)
{
logError("DatabaseHandler::getListSinks SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out sound properties
std::string commandSoundProperty = "SELECT soundPropertyType, value FROM SinkSoundProperty" + i2s(temp.sinkID);
- sqlite3_prepare_v2(mDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
while ((eCode = sqlite3_step(qSoundProperty)) == SQLITE_ROW)
{
tempSoundProperty.type = (am_SoundPropertyType_e) sqlite3_column_int(qSoundProperty, 0);
@@ -2299,12 +2301,12 @@ am_Error_e CAmDatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks)
{
logError("DatabaseHandler::getListSinks SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out MainSoundProperties
std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SinkMainSoundProperty" + i2s(temp.sinkID);
- sqlite3_prepare_v2(mDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL);
while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW)
{
tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0);
@@ -2316,7 +2318,7 @@ am_Error_e CAmDatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks)
{
logError("DatabaseHandler::getListSinks SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
listSinks.push_back(temp);
temp.listConnectionFormats.clear();
@@ -2328,17 +2330,17 @@ am_Error_e CAmDatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks)
{
logError("DatabaseHandler::getListSinks SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSinks SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSources) const
@@ -2351,7 +2353,7 @@ am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSou
am_SoundProperty_s tempSoundProperty;
am_MainSoundProperty_s tempMainSoundProperty;
std::string command = "SELECT name, domainID, sourceClassID, sourceState, volume, visible, availability, availabilityReason, interruptState, sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE reserved=0";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2368,7 +2370,7 @@ am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSou
//read out the connectionFormats
std::string commandConnectionFormat = "SELECT soundFormat FROM SourceConnectionFormat" + i2s(temp.sourceID);
- sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
while ((eCode = sqlite3_step(qConnectionFormat)) == SQLITE_ROW)
{
tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qConnectionFormat, 0);
@@ -2379,12 +2381,12 @@ am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSou
{
logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out sound properties
std::string commandSoundProperty = "SELECT soundPropertyType, value FROM SourceSoundProperty" + i2s(temp.sourceID);
- sqlite3_prepare_v2(mDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
while ((eCode = sqlite3_step(qSoundProperty)) == SQLITE_ROW)
{
tempSoundProperty.type = (am_SoundPropertyType_e) sqlite3_column_int(qSoundProperty, 0);
@@ -2396,12 +2398,12 @@ am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSou
{
logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out MainSoundProperties
std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SourceMainSoundProperty" + i2s(temp.sourceID);
- sqlite3_prepare_v2(mDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL);
while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW)
{
tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0);
@@ -2413,7 +2415,7 @@ am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSou
{
logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
listSources.push_back(temp);
temp.listConnectionFormats.clear();
@@ -2425,17 +2427,17 @@ am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSou
{
logError("DatabaseHandler::getListSources SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListSourceClasses(std::vector<am_SourceClass_s> & listSourceClasses) const
@@ -2449,7 +2451,7 @@ am_Error_e CAmDatabaseHandler::getListSourceClasses(std::vector<am_SourceClass_s
std::string command = "SELECT sourceClassID, name FROM " + std::string(SOURCE_CLASS_TABLE);
std::string command2;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2458,7 +2460,7 @@ am_Error_e CAmDatabaseHandler::getListSourceClasses(std::vector<am_SourceClass_s
//read out Properties
command2 = "SELECT classProperty, value FROM SourceClassProperties" + i2s(classTemp.sourceClassID);
- sqlite3_prepare_v2(mDatabase, command2.c_str(), -1, &subQuery, NULL);
+ sqlite3_prepare_v2(mpDatabase, command2.c_str(), -1, &subQuery, NULL);
while ((eCode1 = sqlite3_step(subQuery)) == SQLITE_ROW)
{
@@ -2471,14 +2473,14 @@ am_Error_e CAmDatabaseHandler::getListSourceClasses(std::vector<am_SourceClass_s
{
logError("DatabaseHandler::getListSourceClasses SQLITE error code:", eCode1);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode1 = sqlite3_finalize(subQuery)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:", eCode1);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
listSourceClasses.push_back(classTemp);
}
@@ -2487,17 +2489,17 @@ am_Error_e CAmDatabaseHandler::getListSourceClasses(std::vector<am_SourceClass_s
{
logError("DatabaseHandler::getListSourceClasses SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListCrossfaders(std::vector<am_Crossfader_s> & listCrossfaders) const
@@ -2507,7 +2509,7 @@ am_Error_e CAmDatabaseHandler::getListCrossfaders(std::vector<am_Crossfader_s> &
int eCode = 0;
am_Crossfader_s tempData;
std::string command = "SELECT name, sinkID_A, sinkID_B, sourceID, hotSink,crossfaderID FROM " + std::string(CROSSFADER_TABLE);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2523,16 +2525,16 @@ am_Error_e CAmDatabaseHandler::getListCrossfaders(std::vector<am_Crossfader_s> &
if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::getListCrossfaders SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListCrossfaders SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListGateways(std::vector<am_Gateway_s> & listGateways) const
@@ -2544,7 +2546,7 @@ am_Error_e CAmDatabaseHandler::getListGateways(std::vector<am_Gateway_s> & listG
am_ConnectionFormat_e tempConnectionFormat;
std::string command = "SELECT name, sinkID, sourceID, domainSinkID, domainSourceID, controlDomainID, gatewayID FROM " + std::string(GATEWAY_TABLE);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2563,13 +2565,13 @@ am_Error_e CAmDatabaseHandler::getListGateways(std::vector<am_Gateway_s> & listG
{
logError("DatabaseHandler::getListGateways database error with convertionFormat");
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
temp.convertionMatrix = iter->second;
//read out the connectionFormats
std::string commandConnectionFormat = "SELECT soundFormat FROM GatewaySourceFormat" + i2s(temp.gatewayID);
- sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qSourceConnectionFormat, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandConnectionFormat.c_str(), -1, &qSourceConnectionFormat, NULL);
while ((eCode = sqlite3_step(qSourceConnectionFormat)) == SQLITE_ROW)
{
tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qSourceConnectionFormat, 0);
@@ -2580,12 +2582,12 @@ am_Error_e CAmDatabaseHandler::getListGateways(std::vector<am_Gateway_s> & listG
{
logError("DatabaseHandler::getListGateways SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//read out sound properties
commandConnectionFormat = "SELECT soundFormat FROM GatewaySinkFormat" + i2s(temp.gatewayID);
- sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qSinkConnectionFormat, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandConnectionFormat.c_str(), -1, &qSinkConnectionFormat, NULL);
while ((eCode = sqlite3_step(qSinkConnectionFormat)) == SQLITE_ROW)
{
tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qSinkConnectionFormat, 0);
@@ -2596,7 +2598,7 @@ am_Error_e CAmDatabaseHandler::getListGateways(std::vector<am_Gateway_s> & listG
{
logError("DatabaseHandler::getListGateways SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
listGateways.push_back(temp);
@@ -2608,17 +2610,17 @@ am_Error_e CAmDatabaseHandler::getListGateways(std::vector<am_Gateway_s> & listG
{
logError("DatabaseHandler::getListGateways SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListGateways SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListSinkClasses(std::vector<am_SinkClass_s> & listSinkClasses) const
@@ -2632,7 +2634,7 @@ am_Error_e CAmDatabaseHandler::getListSinkClasses(std::vector<am_SinkClass_s> &
std::string command = "SELECT sinkClassID, name FROM " + std::string(SINK_CLASS_TABLE);
std::string command2;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2641,7 +2643,7 @@ am_Error_e CAmDatabaseHandler::getListSinkClasses(std::vector<am_SinkClass_s> &
//read out Properties
command2 = "SELECT classProperty, value FROM SinkClassProperties" + i2s(classTemp.sinkClassID);
- sqlite3_prepare_v2(mDatabase, command2.c_str(), -1, &subQuery, NULL);
+ sqlite3_prepare_v2(mpDatabase, command2.c_str(), -1, &subQuery, NULL);
while ((eCode = sqlite3_step(subQuery)) == SQLITE_ROW)
{
@@ -2654,14 +2656,14 @@ am_Error_e CAmDatabaseHandler::getListSinkClasses(std::vector<am_SinkClass_s> &
{
logError("DatabaseHandler::getListSourceClasses SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(subQuery)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
listSinkClasses.push_back(classTemp);
}
@@ -2670,17 +2672,17 @@ am_Error_e CAmDatabaseHandler::getListSinkClasses(std::vector<am_SinkClass_s> &
{
logError("DatabaseHandler::getListSourceClasses SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListVisibleMainConnections(std::vector<am_MainConnectionType_s> & listConnections) const
@@ -2691,7 +2693,7 @@ am_Error_e CAmDatabaseHandler::getListVisibleMainConnections(std::vector<am_Main
am_MainConnectionType_s temp;
std::string command = "SELECT mainConnectionID, sourceID, sinkID, connectionState, delay FROM " + std::string(MAINCONNECTION_TABLE);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2707,17 +2709,17 @@ am_Error_e CAmDatabaseHandler::getListVisibleMainConnections(std::vector<am_Main
{
logError("DatabaseHandler::getListVisibleMainConnections SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListVisibleMainConnections SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListMainSinks(std::vector<am_SinkType_s> & listMainSinks) const
@@ -2728,7 +2730,7 @@ am_Error_e CAmDatabaseHandler::getListMainSinks(std::vector<am_SinkType_s> & lis
am_SinkType_s temp;
std::string command = "SELECT name, sinkID, availability, availabilityReason, muteState, mainVolume, sinkClassID FROM " + std::string(SINK_TABLE) + " WHERE visible=1 AND reserved=0";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2746,17 +2748,17 @@ am_Error_e CAmDatabaseHandler::getListMainSinks(std::vector<am_SinkType_s> & lis
{
logError("DatabaseHandler::getListSinks SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSinks SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListMainSources(std::vector<am_SourceType_s> & listMainSources) const
@@ -2766,7 +2768,7 @@ am_Error_e CAmDatabaseHandler::getListMainSources(std::vector<am_SourceType_s> &
int eCode = 0;
am_SourceType_s temp;
std::string command = "SELECT name, sourceClassID, availability, availabilityReason, sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE visible=1";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2783,31 +2785,31 @@ am_Error_e CAmDatabaseHandler::getListMainSources(std::vector<am_SourceType_s> &
{
logError("DatabaseHandler::getListSources SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s> & listSoundProperties) const
{
assert(sinkID!=0);
if (!existSink(sinkID))
- return E_DATABASE_ERROR; // todo: here we could change to non existen, but not shown in sequences
+ return (E_DATABASE_ERROR); // todo: here we could change to non existen, but not shown in sequences
listSoundProperties.clear();
sqlite3_stmt* query = NULL;
int eCode = 0;
am_MainSoundProperty_s temp;
std::string command = "SELECT soundPropertyType, value FROM SinkMainSoundProperty" + i2s(sinkID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2820,31 +2822,31 @@ am_Error_e CAmDatabaseHandler::getListMainSinkSoundProperties(const am_sinkID_t
{
logError("DatabaseHandler::getListMainSinkSoundProperties SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListMainSinkSoundProperties SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s> & listSourceProperties) const
{
assert(sourceID!=0);
if (!existSource(sourceID))
- return E_DATABASE_ERROR; // todo: here we could change to non existen, but not shown in sequences
+ return (E_DATABASE_ERROR); // todo: here we could change to non existen, but not shown in sequences
listSourceProperties.clear();
sqlite3_stmt* query = NULL;
int eCode = 0;
am_MainSoundProperty_s temp;
std::string command = "SELECT soundPropertyType, value FROM SourceMainSoundProperty" + i2s(sourceID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2857,17 +2859,17 @@ am_Error_e CAmDatabaseHandler::getListMainSourceSoundProperties(const am_sourceI
{
logError("DatabaseHandler::getListMainSinkSoundProperties SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListMainSinkSoundProperties SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getListSystemProperties(std::vector<am_SystemProperty_s> & listSystemProperties) const
@@ -2878,7 +2880,7 @@ am_Error_e CAmDatabaseHandler::getListSystemProperties(std::vector<am_SystemProp
int eCode = 0;
am_SystemProperty_s temp;
std::string command = "SELECT type, value FROM " + std::string(SYSTEM_TABLE);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2891,17 +2893,17 @@ am_Error_e CAmDatabaseHandler::getListSystemProperties(std::vector<am_SystemProp
{
logError("DatabaseHandler::getListSystemProperties SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getListSystemProperties SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e am::CAmDatabaseHandler::getListSinkConnectionFormats(const am_sinkID_t sinkID, std::vector<am_ConnectionFormat_e> & listConnectionFormats) const
@@ -2911,7 +2913,7 @@ am_Error_e am::CAmDatabaseHandler::getListSinkConnectionFormats(const am_sinkID_
int eCode = 0;
am_ConnectionFormat_e tempConnectionFormat;
std::string commandConnectionFormat = "SELECT soundFormat FROM SinkConnectionFormat" + i2s(sinkID);
- sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
while ((eCode = sqlite3_step(qConnectionFormat)) == SQLITE_ROW)
{
tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qConnectionFormat, 0);
@@ -2922,10 +2924,10 @@ am_Error_e am::CAmDatabaseHandler::getListSinkConnectionFormats(const am_sinkID_
{
logError("DatabaseHandler::getListSinkConnectionFormats SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e am::CAmDatabaseHandler::getListSourceConnectionFormats(const am_sourceID_t sourceID, std::vector<am_ConnectionFormat_e> & listConnectionFormats) const
@@ -2937,7 +2939,7 @@ am_Error_e am::CAmDatabaseHandler::getListSourceConnectionFormats(const am_sourc
//read out the connectionFormats
std::string commandConnectionFormat = "SELECT soundFormat FROM SourceConnectionFormat" + i2s(sourceID);
- sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
+ sqlite3_prepare_v2(mpDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
while ((eCode = sqlite3_step(qConnectionFormat)) == SQLITE_ROW)
{
tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qConnectionFormat, 0);
@@ -2948,10 +2950,10 @@ am_Error_e am::CAmDatabaseHandler::getListSourceConnectionFormats(const am_sourc
{
logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e am::CAmDatabaseHandler::getListGatewayConnectionFormats(const am_gatewayID_t gatewayID, std::vector<bool> & listConnectionFormat) const
@@ -2977,7 +2979,7 @@ am_Error_e CAmDatabaseHandler::getTimingInformation(const am_mainConnectionID_t
int eCode = 0;
std::string command = "SELECT delay FROM " + std::string(MAINCONNECTION_TABLE) + " WHERE mainConnectionID=" + i2s(mainConnectionID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -2988,43 +2990,43 @@ am_Error_e CAmDatabaseHandler::getTimingInformation(const am_mainConnectionID_t
{
logError("DatabaseHandler::getTimingInformation SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getTimingInformation SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if (delay == -1)
- return E_NOT_POSSIBLE;
+ return (E_NOT_POSSIBLE);
- return E_OK;
+ return (E_OK);
}
bool CAmDatabaseHandler::sqQuery(const std::string& query)
{
sqlite3_stmt* statement;
int eCode = 0;
- if ((eCode = sqlite3_exec(mDatabase, query.c_str(), NULL, &statement, NULL)) != SQLITE_OK)
+ if ((eCode = sqlite3_exec(mpDatabase, query.c_str(), NULL, &statement, NULL)) != SQLITE_OK)
{
logError("DatabaseHandler::sqQuery SQL Query failed:", query.c_str(), "error code:", eCode);
- return false;
+ return (false);
}
- return true;
+ return (true);
}
bool CAmDatabaseHandler::openDatabase()
{
- if (sqlite3_open_v2(mPath.c_str(), &mDatabase, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX, NULL) == SQLITE_OK)
+ if (sqlite3_open_v2(mPath.c_str(), &mpDatabase, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX, NULL) == SQLITE_OK)
{
logInfo("DatabaseHandler::openDatabase opened database");
- return true;
+ return (true);
}
logError("DatabaseHandler::openDatabase failed to open database");
- return false;
+ return (false);
}
am_Error_e CAmDatabaseHandler::changeDelayMainConnection(const am_timeSync_t & delay, const am_mainConnectionID_t & connectionID)
@@ -3034,16 +3036,16 @@ am_Error_e CAmDatabaseHandler::changeDelayMainConnection(const am_timeSync_t & d
sqlite3_stmt* query = NULL;
int eCode = 0;
std::string command = "SELECT mainConnectionID FROM " + std::string(MAINCONNECTION_TABLE) + " WHERE delay=? AND mainConnectionID=?";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, delay);
sqlite3_bind_int(query, 2, connectionID);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
sqlite3_finalize(query);
- return E_OK;
+ return (E_OK);
}
command = "UPDATE " + std::string(MAINCONNECTION_TABLE) + " SET delay=? WHERE mainConnectionID=?;";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, delay);
sqlite3_bind_int(query, 2, connectionID);
@@ -3051,20 +3053,20 @@ am_Error_e CAmDatabaseHandler::changeDelayMainConnection(const am_timeSync_t & d
{
logError("DatabaseHandler::changeDelayMainConnection SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeDelayMainConnection SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- if (mDatabaseObserver)
- mDatabaseObserver->timingInformationChanged(connectionID, delay);
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->timingInformationChanged(connectionID, delay);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::enterConnectionDB(const am_Connection_s& connection, am_connectionID_t& connectionID)
@@ -3078,7 +3080,7 @@ am_Error_e CAmDatabaseHandler::enterConnectionDB(const am_Connection_s& connecti
int eCode = 0;
std::string command = "INSERT INTO " + std::string(CONNECTION_TABLE) + "(sinkID, sourceID, delay, connectionFormat, reserved) VALUES (?,?,?,?,?)";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, connection.sinkID);
sqlite3_bind_int(query, 2, connection.sourceID);
sqlite3_bind_int(query, 3, connection.delay);
@@ -3089,20 +3091,20 @@ am_Error_e CAmDatabaseHandler::enterConnectionDB(const am_Connection_s& connecti
{
logError("DatabaseHandler::enterConnectionDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterConnectionDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- connectionID = sqlite3_last_insert_rowid(mDatabase);
+ connectionID = sqlite3_last_insert_rowid(mpDatabase);
logInfo("DatabaseHandler::enterConnectionDB entered new connection sourceID=", connection.sourceID, "sinkID=", connection.sinkID, "sourceID=", connection.sourceID, "connectionFormat=", connection.connectionFormat, "assigned ID=", connectionID);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::enterSinkClassDB(const am_SinkClass_s & sinkClass, am_sinkClass_t & sinkClassID)
@@ -3123,11 +3125,11 @@ am_Error_e CAmDatabaseHandler::enterSinkClassDB(const am_SinkClass_s & sinkClass
{
//check if the ID already exists
if (existSinkClass(sinkClass.sinkClassID))
- return E_ALREADY_EXISTS;
+ return (E_ALREADY_EXISTS);
command = "INSERT INTO " + std::string(SINK_CLASS_TABLE) + "(name, sinkClassID) VALUES (?,?)";
}
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, sinkClass.name.c_str(), sinkClass.name.size(), SQLITE_STATIC);
//if the ID is not created, we add it to the query
@@ -3147,17 +3149,17 @@ am_Error_e CAmDatabaseHandler::enterSinkClassDB(const am_SinkClass_s & sinkClass
{
logError("DatabaseHandler::enterSinkClassDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterSinkClassDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- sinkClassID = sqlite3_last_insert_rowid(mDatabase); //todo:change last_insert implementations for mulithread usage...
+ sinkClassID = sqlite3_last_insert_rowid(mpDatabase); //todo:change last_insert implementations for mulithread usage...
//now we need to create the additional tables:
command = "CREATE TABLE SinkClassProperties" + i2s(sinkClassID) + std::string("(classProperty INTEGER, value INTEGER)");
@@ -3165,7 +3167,7 @@ am_Error_e CAmDatabaseHandler::enterSinkClassDB(const am_SinkClass_s & sinkClass
//fill ConnectionFormats
command = "INSERT INTO SinkClassProperties" + i2s(sinkClassID) + std::string("(classProperty,value) VALUES (?,?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_ClassProperty_s>::const_iterator Iterator = sinkClass.listClassProperties.begin();
for (; Iterator < sinkClass.listClassProperties.end(); ++Iterator)
{
@@ -3175,7 +3177,7 @@ am_Error_e CAmDatabaseHandler::enterSinkClassDB(const am_SinkClass_s & sinkClass
{
logError("DatabaseHandler::enterSinkClassDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -3184,13 +3186,13 @@ am_Error_e CAmDatabaseHandler::enterSinkClassDB(const am_SinkClass_s & sinkClass
{
logError("DatabaseHandler::enterSinkClassDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::enterSinkClassDB entered new sinkClass");
- if (mDatabaseObserver)
- mDatabaseObserver->numberOfSinkClassesChanged();
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->numberOfSinkClassesChanged();
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::enterSourceClassDB(am_sourceClass_t & sourceClassID, const am_SourceClass_s & sourceClass)
@@ -3211,11 +3213,11 @@ am_Error_e CAmDatabaseHandler::enterSourceClassDB(am_sourceClass_t & sourceClass
{
//check if the ID already exists
if (existSourceClass(sourceClass.sourceClassID))
- return E_ALREADY_EXISTS;
+ return (E_ALREADY_EXISTS);
command = "INSERT INTO " + std::string(SOURCE_CLASS_TABLE) + "(name, sourceClassID) VALUES (?,?)";
}
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, sourceClass.name.c_str(), sourceClass.name.size(), SQLITE_STATIC);
//if the ID is not created, we add it to the query
@@ -3235,17 +3237,17 @@ am_Error_e CAmDatabaseHandler::enterSourceClassDB(am_sourceClass_t & sourceClass
{
logError("DatabaseHandler::enterSourceClassDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::enterSourceClassDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- sourceClassID = sqlite3_last_insert_rowid(mDatabase); //todo:change last_insert implementations for mulithread usage...
+ sourceClassID = sqlite3_last_insert_rowid(mpDatabase); //todo:change last_insert implementations for mulithread usage...
//now we need to create the additional tables:
command = "CREATE TABLE SourceClassProperties" + i2s(sourceClassID) + std::string("(classProperty INTEGER, value INTEGER)");
@@ -3253,7 +3255,7 @@ am_Error_e CAmDatabaseHandler::enterSourceClassDB(am_sourceClass_t & sourceClass
//fill ConnectionFormats
command = "INSERT INTO SourceClassProperties" + i2s(sourceClassID) + std::string("(classProperty,value) VALUES (?,?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
std::vector<am_ClassProperty_s>::const_iterator Iterator = sourceClass.listClassProperties.begin();
for (; Iterator < sourceClass.listClassProperties.end(); ++Iterator)
{
@@ -3263,7 +3265,7 @@ am_Error_e CAmDatabaseHandler::enterSourceClassDB(am_sourceClass_t & sourceClass
{
logError("DatabaseHandler::enterSourceClassDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
}
@@ -3272,14 +3274,14 @@ am_Error_e CAmDatabaseHandler::enterSourceClassDB(am_sourceClass_t & sourceClass
{
logError("DatabaseHandler::enterSourceClassDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::enterSourceClassDB entered new sourceClass");
- if (mDatabaseObserver)
- mDatabaseObserver->numberOfSourceClassesChanged();
- return E_OK;
+ if (mpDatabaseObserver)
+ mpDatabaseObserver->numberOfSourceClassesChanged();
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::enterSystemProperties(const std::vector<am_SystemProperty_s> & listSystemProperties)
@@ -3293,7 +3295,7 @@ am_Error_e CAmDatabaseHandler::enterSystemProperties(const std::vector<am_System
command = "INSERT INTO " + std::string(SYSTEM_TABLE) + " (type, value) VALUES (?,?)";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
for (; listIterator < listSystemProperties.end(); ++listIterator)
{
sqlite3_bind_int(query, 1, listIterator->type);
@@ -3303,7 +3305,7 @@ am_Error_e CAmDatabaseHandler::enterSystemProperties(const std::vector<am_System
{
logError("DatabaseHandler::enterSystemProperties SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
sqlite3_reset(query);
@@ -3313,20 +3315,25 @@ am_Error_e CAmDatabaseHandler::enterSystemProperties(const std::vector<am_System
{
logError("DatabaseHandler::enterSystemProperties SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::enterSystemProperties entered system properties");
- return E_OK;
+ return (E_OK);
}
+/**
+ * checks for a certain mainConnection
+ * @param mainConnectionID to be checked for
+ * @return true if it exists
+ */
bool CAmDatabaseHandler::existMainConnection(const am_mainConnectionID_t mainConnectionID) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT mainConnectionID FROM " + std::string(MAINCONNECTION_TABLE) + " WHERE mainConnectionID=" + i2s(mainConnectionID);
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
else if (eCode != SQLITE_ROW)
@@ -3335,16 +3342,21 @@ bool CAmDatabaseHandler::existMainConnection(const am_mainConnectionID_t mainCon
logError("DatabaseHandler::existMainConnection database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks for a certain Source
+ * @param sourceID to be checked for
+ * @return true if it exists
+ */
bool CAmDatabaseHandler::existSource(const am_sourceID_t sourceID) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE reserved=0 AND sourceID=" + i2s(sourceID);
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
else if (eCode != SQLITE_ROW)
@@ -3353,16 +3365,22 @@ bool CAmDatabaseHandler::existSource(const am_sourceID_t sourceID) const
logError("DatabaseHandler::existSource database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks if a source name or ID exists
+ * @param sourceID the sourceID
+ * @param name the name
+ * @return true if it exits
+ */
bool CAmDatabaseHandler::existSourceNameOrID(const am_sourceID_t sourceID, const std::string & name) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE reserved=0 AND (name=? OR sourceID=?)";
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
sqlite3_bind_int(query, 2, sourceID);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
@@ -3373,16 +3391,21 @@ bool CAmDatabaseHandler::existSourceNameOrID(const am_sourceID_t sourceID, const
logError("DatabaseHandler::existSource database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks if a name exits
+ * @param name the name
+ * @return true if it exits
+ */
bool CAmDatabaseHandler::existSourceName(const std::string & name) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE reserved=0 AND name=?";
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
@@ -3392,16 +3415,21 @@ bool CAmDatabaseHandler::existSourceName(const std::string & name) const
logError("DatabaseHandler::existSource database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks for a certain Sink
+ * @param sinkID to be checked for
+ * @return true if it exists
+ */
bool CAmDatabaseHandler::existSink(const am_sinkID_t sinkID) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT sinkID FROM " + std::string(SINK_TABLE) + " WHERE reserved=0 AND sinkID=" + i2s(sinkID);
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
else if (eCode != SQLITE_ROW)
@@ -3410,16 +3438,22 @@ bool CAmDatabaseHandler::existSink(const am_sinkID_t sinkID) const
logError("DatabaseHandler::existSink database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks if a sink with the ID or the name exists
+ * @param sinkID the ID
+ * @param name the name
+ * @return true if it exists.
+ */
bool CAmDatabaseHandler::existSinkNameOrID(const am_sinkID_t sinkID, const std::string & name) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT sinkID FROM " + std::string(SINK_TABLE) + " WHERE reserved=0 AND (name=? OR sinkID=?)";
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
sqlite3_bind_int(query, 2, sinkID);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
@@ -3430,16 +3464,21 @@ bool CAmDatabaseHandler::existSinkNameOrID(const am_sinkID_t sinkID, const std::
logError("DatabaseHandler::existSink database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks if a sink with the name exists
+ * @param name the name
+ * @return true if it exists
+ */
bool CAmDatabaseHandler::existSinkName(const std::string & name) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT sinkID FROM " + std::string(SINK_TABLE) + " WHERE reserved=0 AND name=?";
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
@@ -3449,16 +3488,21 @@ bool CAmDatabaseHandler::existSinkName(const std::string & name) const
logError("DatabaseHandler::existSink database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks for a certain domain
+ * @param domainID to be checked for
+ * @return true if it exists
+ */
bool CAmDatabaseHandler::existDomain(const am_domainID_t domainID) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT domainID FROM " + std::string(DOMAIN_TABLE) + " WHERE reserved=0 AND domainID=" + i2s(domainID);
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
else if (eCode != SQLITE_ROW)
@@ -3467,16 +3511,21 @@ bool CAmDatabaseHandler::existDomain(const am_domainID_t domainID) const
logError("DatabaseHandler::existDomain database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks for certain gateway
+ * @param gatewayID to be checked for
+ * @return true if it exists
+ */
bool CAmDatabaseHandler::existGateway(const am_gatewayID_t gatewayID) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT gatewayID FROM " + std::string(GATEWAY_TABLE) + " WHERE gatewayID=" + i2s(gatewayID);
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
else if (eCode != SQLITE_ROW)
@@ -3485,7 +3534,7 @@ bool CAmDatabaseHandler::existGateway(const am_gatewayID_t gatewayID) const
logError("DatabaseHandler::existGateway database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
am_Error_e CAmDatabaseHandler::getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t & domainID) const
@@ -3496,7 +3545,7 @@ am_Error_e CAmDatabaseHandler::getDomainOfSource(const am_sourceID_t sourceID, a
std::string command = "SELECT domainID FROM " + std::string(SOURCE_TABLE) + " WHERE sourceID=" + i2s(sourceID);
int eCode = 0;
am_Error_e returnVal = E_DATABASE_ERROR;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
domainID = sqlite3_column_int(query, 0);
@@ -3518,7 +3567,7 @@ am_Error_e am::CAmDatabaseHandler::getDomainOfSink(const am_sinkID_t sinkID, am_
std::string command = "SELECT domainID FROM " + std::string(SINK_TABLE) + " WHERE sinkID=" + i2s(sinkID);
int eCode = 0;
am_Error_e returnVal = E_DATABASE_ERROR;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
domainID = sqlite3_column_int(query, 0);
@@ -3532,13 +3581,18 @@ am_Error_e am::CAmDatabaseHandler::getDomainOfSink(const am_sinkID_t sinkID, am_
return (returnVal);
}
+/**
+ * checks for certain SinkClass
+ * @param sinkClassID
+ * @return true if it exists
+ */
bool CAmDatabaseHandler::existSinkClass(const am_sinkClass_t sinkClassID) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT sinkClassID FROM " + std::string(SINK_CLASS_TABLE) + " WHERE sinkClassID=" + i2s(sinkClassID);
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
else if (eCode != SQLITE_ROW)
@@ -3547,16 +3601,21 @@ bool CAmDatabaseHandler::existSinkClass(const am_sinkClass_t sinkClassID) const
logError("DatabaseHandler::existSinkClass database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks for certain sourceClass
+ * @param sourceClassID
+ * @return true if it exists
+ */
bool CAmDatabaseHandler::existSourceClass(const am_sourceClass_t sourceClassID) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT sourceClassID FROM " + std::string(SOURCE_CLASS_TABLE) + " WHERE sourceClassID=" + i2s(sourceClassID);
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
else if (eCode != SQLITE_ROW)
@@ -3565,7 +3624,7 @@ bool CAmDatabaseHandler::existSourceClass(const am_sourceClass_t sourceClassID)
logError("DatabaseHandler::existSinkClass database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
am_Error_e CAmDatabaseHandler::changeConnectionTimingInformation(const am_connectionID_t connectionID, const am_timeSync_t delay)
@@ -3576,7 +3635,7 @@ am_Error_e CAmDatabaseHandler::changeConnectionTimingInformation(const am_connec
int eCode = 0, eCode1 = 0;
std::string command = "UPDATE " + std::string(CONNECTION_TABLE) + " set delay=? WHERE connectionID=?";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, delay);
sqlite3_bind_int(query, 2, connectionID);
@@ -3584,14 +3643,14 @@ am_Error_e CAmDatabaseHandler::changeConnectionTimingInformation(const am_connec
{
logError("DatabaseHandler::changeConnectionTimingInformation SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeConnectionTimingInformation SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
//now we need to find all mainConnections that use the changed connection and update their timing
@@ -3599,14 +3658,14 @@ am_Error_e CAmDatabaseHandler::changeConnectionTimingInformation(const am_connec
int tempMainConnectionID;
//first get all route tables for all mainconnections
command = "SELECT name FROM sqlite_master WHERE type ='table' and name LIKE 'MainConnectionRoute%'";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &queryMainConnections, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &queryMainConnections, NULL);
while ((eCode = sqlite3_step(queryMainConnections)) == SQLITE_ROW)
{
//now check if the connection ID is in this table
std::string tablename = std::string((const char*) sqlite3_column_text(queryMainConnections, 0));
std::string command2 = "SELECT connectionID FROM " + tablename + " WHERE connectionID=" + i2s(connectionID);
- sqlite3_prepare_v2(mDatabase, command2.c_str(), -1, &queryMainConnectionSubIDs, NULL);
+ sqlite3_prepare_v2(mpDatabase, command2.c_str(), -1, &queryMainConnectionSubIDs, NULL);
if ((eCode1 = sqlite3_step(queryMainConnectionSubIDs)) == SQLITE_ROW)
{
//if the connection ID is in, recalculate the mainconnection delay
@@ -3617,7 +3676,7 @@ am_Error_e CAmDatabaseHandler::changeConnectionTimingInformation(const am_connec
{
logError("DatabaseHandler::changeConnectionTimingInformation SQLITE error code:", eCode1);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
}
@@ -3625,17 +3684,17 @@ am_Error_e CAmDatabaseHandler::changeConnectionTimingInformation(const am_connec
{
logError("DatabaseHandler::changeConnectionTimingInformation SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(queryMainConnections)) != SQLITE_OK)
{
logError("DatabaseHandler::changeConnectionTimingInformation SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeConnectionFinal(const am_connectionID_t connectionID)
@@ -3646,23 +3705,23 @@ am_Error_e CAmDatabaseHandler::changeConnectionFinal(const am_connectionID_t con
int eCode = 0;
std::string command = "UPDATE " + std::string(CONNECTION_TABLE) + " set reserved=0 WHERE connectionID=?";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, connectionID);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeConnectionFinal SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeConnectionFinal SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_timeSync_t CAmDatabaseHandler::calculateMainConnectionDelay(const am_mainConnectionID_t mainConnectionID) const
@@ -3673,7 +3732,7 @@ am_timeSync_t CAmDatabaseHandler::calculateMainConnectionDelay(const am_mainConn
int eCode = 0;
am_timeSync_t delay = 0;
am_timeSync_t min = 0;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
delay = sqlite3_column_int(query, 0);
@@ -3683,27 +3742,36 @@ am_timeSync_t CAmDatabaseHandler::calculateMainConnectionDelay(const am_mainConn
{
logError("DatabaseHandler::calculateMainConnectionDelay SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::calculateMainConnectionDelay SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if (min < 0)
delay = -1;
- return delay;
+ return (delay);
}
+/**
+ * registers the Observer at the Database
+ * @param iObserver pointer to the observer
+ */
void CAmDatabaseHandler::registerObserver(CAmDatabaseObserver *iObserver)
{
assert(iObserver!=NULL);
- mDatabaseObserver = iObserver;
+ mpDatabaseObserver = iObserver;
}
+/**
+ * gives information about the visibility of a source
+ * @param sourceID the sourceID
+ * @return true if source is visible
+ */
bool CAmDatabaseHandler::sourceVisible(const am_sourceID_t sourceID) const
{
assert(sourceID!=0);
@@ -3711,7 +3779,7 @@ bool CAmDatabaseHandler::sourceVisible(const am_sourceID_t sourceID) const
std::string command = "SELECT visible FROM " + std::string(SOURCE_TABLE) + " WHERE sourceID=" + i2s(sourceID);
int eCode = 0;
bool returnVal = false;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
{
returnVal = (bool) sqlite3_column_int(query, 0);
@@ -3722,16 +3790,21 @@ bool CAmDatabaseHandler::sourceVisible(const am_sourceID_t sourceID) const
logError("DatabaseHandler::sourceVisible database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * gives information about the visibility of a sink
+ * @param sinkID the sinkID
+ * @return true if source is visible
+ */
bool CAmDatabaseHandler::sinkVisible(const am_sinkID_t sinkID) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT visible FROM " + std::string(SINK_TABLE) + " WHERE reserved=0 AND sinkID=" + i2s(sinkID);
int eCode = 0;
bool returnVal = false;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
{
returnVal = sqlite3_column_int(query, 0);
@@ -3742,16 +3815,22 @@ bool CAmDatabaseHandler::sinkVisible(const am_sinkID_t sinkID) const
logError("DatabaseHandler::sinkVisible database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks if a connection already exists.
+ * Only takes sink, source and format information for search!
+ * @param connection the connection to be checked
+ * @return true if connections exists
+ */
bool CAmDatabaseHandler::existConnection(const am_Connection_s connection)
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT connectionID FROM " + std::string(CONNECTION_TABLE) + " WHERE sinkID=? AND sourceID=? AND connectionFormat=? AND reserved=0";
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, connection.sinkID);
sqlite3_bind_int(query, 2, connection.sourceID);
sqlite3_bind_int(query, 3, connection.connectionFormat);
@@ -3763,16 +3842,21 @@ bool CAmDatabaseHandler::existConnection(const am_Connection_s connection)
logError("DatabaseHandler::existMainConnection database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks if a connection with the given ID exists
+ * @param connectionID
+ * @return true if connection exits
+ */
bool CAmDatabaseHandler::existConnectionID(const am_connectionID_t connectionID)
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT connectionID FROM " + std::string(CONNECTION_TABLE) + " WHERE connectionID=? AND reserved=0";
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, connectionID);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
@@ -3782,16 +3866,21 @@ bool CAmDatabaseHandler::existConnectionID(const am_connectionID_t connectionID)
logError("DatabaseHandler::existMainConnection database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
+/**
+ * checks if a CrossFader exists
+ * @param crossfaderID the ID of the crossfader to be checked
+ * @return true if exists
+ */
bool CAmDatabaseHandler::existcrossFader(const am_crossfaderID_t crossfaderID) const
{
sqlite3_stmt* query = NULL;
std::string command = "SELECT crossfaderID FROM " + std::string(CROSSFADER_TABLE) + " WHERE crossfaderID=?";
int eCode = 0;
bool returnVal = true;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, crossfaderID);
if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
returnVal = false;
@@ -3801,7 +3890,7 @@ bool CAmDatabaseHandler::existcrossFader(const am_crossfaderID_t crossfaderID) c
logError("DatabaseHandler::existMainConnection database error!:", eCode);
}
sqlite3_finalize(query);
- return returnVal;
+ return (returnVal);
}
am_Error_e CAmDatabaseHandler::getSoureState(const am_sourceID_t sourceID, am_SourceState_e & sourceState) const
@@ -3811,7 +3900,7 @@ am_Error_e CAmDatabaseHandler::getSoureState(const am_sourceID_t sourceID, am_So
sourceState = SS_UNKNNOWN;
std::string command = "SELECT sourceState FROM " + std::string(SOURCE_TABLE) + " WHERE sourceID=" + i2s(sourceID);
int eCode = 0;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
sourceState = (am_SourceState_e) sqlite3_column_int(query, 0);
@@ -3821,7 +3910,7 @@ am_Error_e CAmDatabaseHandler::getSoureState(const am_sourceID_t sourceID, am_So
logError("DatabaseHandler::getSoureState database error!:", eCode);
}
sqlite3_finalize(query);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSourceState(const am_sourceID_t sourceID, const am_SourceState_e sourceState)
@@ -3831,22 +3920,22 @@ am_Error_e CAmDatabaseHandler::changeSourceState(const am_sourceID_t sourceID, c
sqlite3_stmt* query = NULL;
std::string command = "UPDATE " + std::string(SOURCE_TABLE) + " SET sourceState=? WHERE sourceID=" + i2s(sourceID);
int eCode = 0;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, sourceState);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeSourceState SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeSourceState SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getSinkVolume(const am_sinkID_t sinkID, am_volume_t & volume) const
@@ -3856,7 +3945,7 @@ am_Error_e CAmDatabaseHandler::getSinkVolume(const am_sinkID_t sinkID, am_volume
volume = -1;
std::string command = "SELECT volume FROM " + std::string(SINK_TABLE) + " WHERE sinkID=" + i2s(sinkID);
int eCode = 0;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
volume = sqlite3_column_int(query, 0);
@@ -3866,7 +3955,7 @@ am_Error_e CAmDatabaseHandler::getSinkVolume(const am_sinkID_t sinkID, am_volume
logError("DatabaseHandler::getSinkVolume database error!:", eCode);
}
sqlite3_finalize(query);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getSourceVolume(const am_sourceID_t sourceID, am_volume_t & volume) const
@@ -3876,7 +3965,7 @@ am_Error_e CAmDatabaseHandler::getSourceVolume(const am_sourceID_t sourceID, am_
volume = -1;
std::string command = "SELECT volume FROM " + std::string(SOURCE_TABLE) + " WHERE sourceID=" + i2s(sourceID);
int eCode = 0;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
volume = sqlite3_column_int(query, 0);
@@ -3886,19 +3975,19 @@ am_Error_e CAmDatabaseHandler::getSourceVolume(const am_sourceID_t sourceID, am_
logError("DatabaseHandler::getSourceVolume database error!:", eCode);
}
sqlite3_finalize(query);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getSinkSoundPropertyValue(const am_sinkID_t sinkID, const am_SoundPropertyType_e propertyType, uint16_t & value) const
{
assert(sinkID!=0);
if (!existSink(sinkID))
- return E_DATABASE_ERROR; // todo: here we could change to non existent, but not shown in sequences
+ return (E_DATABASE_ERROR); // todo: here we could change to non existent, but not shown in sequences
sqlite3_stmt* query = NULL;
int eCode = 0;
std::string command = "SELECT value FROM SinkSoundProperty" + i2s(sinkID) + " WHERE soundPropertyType=" + i2s(propertyType);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -3909,29 +3998,29 @@ am_Error_e CAmDatabaseHandler::getSinkSoundPropertyValue(const am_sinkID_t sinkI
{
logError("DatabaseHandler::getSinkSoundPropertyValue SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getSinkSoundPropertyValue SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getSourceSoundPropertyValue(const am_sourceID_t sourceID, const am_SoundPropertyType_e propertyType, uint16_t & value) const
{
assert(sourceID!=0);
if (!existSource(sourceID))
- return E_DATABASE_ERROR; // todo: here we could change to non existent, but not shown in sequences
+ return (E_DATABASE_ERROR); // todo: here we could change to non existent, but not shown in sequences
sqlite3_stmt* query = NULL;
int eCode = 0;
std::string command = "SELECT value FROM SourceSoundProperty" + i2s(sourceID) + " WHERE soundPropertyType=" + i2s(propertyType);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -3942,17 +4031,17 @@ am_Error_e CAmDatabaseHandler::getSourceSoundPropertyValue(const am_sourceID_t s
{
logError("DatabaseHandler::getSinkSoundPropertyValue SQLITE error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::getSinkSoundPropertyValue SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getDomainState(const am_domainID_t domainID, am_DomainState_e state) const
@@ -3962,7 +4051,7 @@ am_Error_e CAmDatabaseHandler::getDomainState(const am_domainID_t domainID, am_D
state = DS_UNKNOWN;
std::string command = "SELECT domainState FROM " + std::string(DOMAIN_TABLE) + " WHERE domainID=" + i2s(domainID);
int eCode = 0;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
state = (am_DomainState_e) sqlite3_column_int(query, 0);
@@ -3972,7 +4061,7 @@ am_Error_e CAmDatabaseHandler::getDomainState(const am_domainID_t domainID, am_D
logError("DatabaseHandler::getDomainState database error!:", eCode);
}
sqlite3_finalize(query);
- return E_OK;
+ return (E_OK);
}
@@ -3981,7 +4070,7 @@ am_Error_e CAmDatabaseHandler::peekDomain(const std::string & name, am_domainID_
sqlite3_stmt* query = NULL, *queryInsert = NULL;
std::string command = "SELECT domainID FROM " + std::string(DOMAIN_TABLE) + " WHERE name=?";
int eCode = 0, eCode1 = 0;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -3990,29 +4079,29 @@ am_Error_e CAmDatabaseHandler::peekDomain(const std::string & name, am_domainID_
else if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::peekDomain database error!:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
else
{
command = "INSERT INTO " + std::string(DOMAIN_TABLE) + " (name,reserved) VALUES (?,?)";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &queryInsert, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &queryInsert, NULL);
sqlite3_bind_text(queryInsert, 1, name.c_str(), name.size(), SQLITE_STATIC);
sqlite3_bind_int(queryInsert, 2, 1); //reservation flag
if ((eCode1 = sqlite3_step(queryInsert)) != SQLITE_DONE)
{
logError("DatabaseHandler::peekDomain SQLITE Step error code:", eCode1);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode1 = sqlite3_finalize(queryInsert)) != SQLITE_OK)
{
logError("DatabaseHandler::peekDomain SQLITE Finalize error code:", eCode1);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- domainID = sqlite3_last_insert_rowid(mDatabase);
+ domainID = sqlite3_last_insert_rowid(mpDatabase);
}
sqlite3_finalize(query);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::peekSink(const std::string & name, am_sinkID_t & sinkID)
@@ -4020,7 +4109,7 @@ am_Error_e CAmDatabaseHandler::peekSink(const std::string & name, am_sinkID_t &
sqlite3_stmt* query = NULL, *queryInsert = NULL;
std::string command = "SELECT sinkID FROM " + std::string(SINK_TABLE) + " WHERE name=?";
int eCode = 0, eCode1 = 0;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -4029,7 +4118,7 @@ am_Error_e CAmDatabaseHandler::peekSink(const std::string & name, am_sinkID_t &
else if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::peekSink database error!:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
else
{
@@ -4042,24 +4131,24 @@ am_Error_e CAmDatabaseHandler::peekSink(const std::string & name, am_sinkID_t &
{
command = "INSERT INTO " + std::string(SINK_TABLE) + " (name,reserved) VALUES (?,?)";
}
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &queryInsert, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &queryInsert, NULL);
sqlite3_bind_text(queryInsert, 1, name.c_str(), name.size(), SQLITE_STATIC);
sqlite3_bind_int(queryInsert, 2, 1); //reservation flag
if ((eCode1 = sqlite3_step(queryInsert)) != SQLITE_DONE)
{
logError("DatabaseHandler::peekSink SQLITE Step error code:", eCode1);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode1 = sqlite3_finalize(queryInsert)) != SQLITE_OK)
{
logError("DatabaseHandler::peekDomain SQLITE Finalize error code:", eCode1);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- sinkID = sqlite3_last_insert_rowid(mDatabase);
+ sinkID = sqlite3_last_insert_rowid(mpDatabase);
}
sqlite3_finalize(query);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::peekSource(const std::string & name, am_sourceID_t & sourceID)
@@ -4067,7 +4156,7 @@ am_Error_e CAmDatabaseHandler::peekSource(const std::string & name, am_sourceID_
sqlite3_stmt* query = NULL, *queryInsert = NULL;
std::string command = "SELECT sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE name=?";
int eCode = 0, eCode1 = 0;
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
@@ -4076,7 +4165,7 @@ am_Error_e CAmDatabaseHandler::peekSource(const std::string & name, am_sourceID_
else if (eCode != SQLITE_DONE)
{
logError("DatabaseHandler::peekSink database error!:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
else
{
@@ -4089,24 +4178,24 @@ am_Error_e CAmDatabaseHandler::peekSource(const std::string & name, am_sourceID_
{
command = "INSERT INTO " + std::string(SOURCE_TABLE) + " (name,reserved) VALUES (?,?)";
}
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &queryInsert, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &queryInsert, NULL);
sqlite3_bind_text(queryInsert, 1, name.c_str(), name.size(), SQLITE_STATIC);
sqlite3_bind_int(queryInsert, 2, 1); //reservation flag
if ((eCode1 = sqlite3_step(queryInsert)) != SQLITE_DONE)
{
logError("DatabaseHandler::peekSink SQLITE Step error code:", eCode1);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode1 = sqlite3_finalize(queryInsert)) != SQLITE_OK)
{
logError("DatabaseHandler::peekDomain SQLITE Finalize error code:", eCode1);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
- sourceID = sqlite3_last_insert_rowid(mDatabase);
+ sourceID = sqlite3_last_insert_rowid(mpDatabase);
}
sqlite3_finalize(query);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSinkVolume(const am_sinkID_t sinkID, const am_volume_t volume)
@@ -4119,27 +4208,27 @@ am_Error_e CAmDatabaseHandler::changeSinkVolume(const am_sinkID_t sinkID, const
if (!existSink(sinkID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE " + std::string(SINK_TABLE) + " SET volume=? WHERE sinkID=" + i2s(sinkID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, volume);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeSinkVolume SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeSinkVolume SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeSinkVolume changed volume of sink:", sinkID, "to:", volume);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSourceVolume(const am_sourceID_t sourceID, const am_volume_t volume)
@@ -4152,27 +4241,27 @@ am_Error_e CAmDatabaseHandler::changeSourceVolume(const am_sourceID_t sourceID,
if (!existSource(sourceID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE " + std::string(SOURCE_TABLE) + " SET volume=? WHERE sourceID=" + i2s(sourceID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, volume);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeSourceVolume SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeSourceVolume SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeSourceVolume changed volume of source=:", sourceID, "to:", volume);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSourceSoundPropertyDB(const am_SoundProperty_s & soundProperty, const am_sourceID_t sourceID)
@@ -4186,28 +4275,28 @@ am_Error_e CAmDatabaseHandler::changeSourceSoundPropertyDB(const am_SoundPropert
if (!existSource(sourceID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE SourceSoundProperty" + i2s(sourceID) + " SET value=? WHERE soundPropertyType=" + i2s(soundProperty.type);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, soundProperty.value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeSourceSoundPropertyDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeSourceSoundPropertyDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeSourceSoundPropertyDB changed SourceSoundProperty of source:", sourceID, "type:", soundProperty.type, "to:", soundProperty.value);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeSinkSoundPropertyDB(const am_SoundProperty_s & soundProperty, const am_sinkID_t sinkID)
@@ -4221,26 +4310,27 @@ am_Error_e CAmDatabaseHandler::changeSinkSoundPropertyDB(const am_SoundProperty_
if (!existSink(sinkID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE SinkSoundProperty" + i2s(sinkID) + " SET value=? WHERE soundPropertyType=" + i2s(soundProperty.type);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, soundProperty.value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeSinkSoundPropertyDB SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
- }assert(sinkID!=0);
+ return (E_DATABASE_ERROR);
+ }
+ assert(sinkID!=0);
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeSinkSoundPropertyDB SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeSinkSoundPropertyDB changed MainSinkSoundProperty of sink:", sinkID, "type:", soundProperty.type, "to:", soundProperty.value);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::changeCrossFaderHotSink(const am_crossfaderID_t crossfaderID, const am_HotSink_e hotsink)
@@ -4254,26 +4344,26 @@ am_Error_e CAmDatabaseHandler::changeCrossFaderHotSink(const am_crossfaderID_t c
if (!existcrossFader(crossfaderID))
{
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
command = "UPDATE " + std::string(CROSSFADER_TABLE) + " SET hotsink=? WHERE crossfaderID=" + i2s(crossfaderID);
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, hotsink);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
logError("DatabaseHandler::changeCrossFaderHotSink SQLITE Step error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
logError("DatabaseHandler::changeCrossFaderHotSink SQLITE Finalize error code:", eCode);
- return E_DATABASE_ERROR;
+ return (E_DATABASE_ERROR);
}
logInfo("DatabaseHandler::changeCrossFaderHotSink changed hotsink of crossfader=", crossfaderID, "to:", hotsink);
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmDatabaseHandler::getRoutingTree(bool onlyfree, CAmRoutingTree& tree, std::vector<CAmRoutingTreeItem*>& flatTree)
@@ -4301,7 +4391,7 @@ am_Error_e CAmDatabaseHandler::getRoutingTree(bool onlyfree, CAmRoutingTree& tre
parent = flatTree.at(i - 1);
rootID = parent->returnDomainID();
}
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, rootID);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
@@ -4331,13 +4421,13 @@ am_Error_e CAmDatabaseHandler::getRoutingTree(bool onlyfree, CAmRoutingTree& tre
am_Error_e am::CAmDatabaseHandler::peekSinkClassID(const std::string & name, am_sinkClass_t & sinkClassID)
{
if (name.empty())
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
am_Error_e returnVal = E_NON_EXISTENT;
sqlite3_stmt* query = NULL;
int eCode = 0;
std::string command = "SELECT sinkClassID FROM " + std::string(SINK_CLASS_TABLE) + " WHERE name=?";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
@@ -4357,19 +4447,19 @@ am_Error_e am::CAmDatabaseHandler::peekSinkClassID(const std::string & name, am_
logError("DatabaseHandler::peekSinkClassID SQLITE Finalize error code:", eCode);
returnVal = E_DATABASE_ERROR;
}
- return returnVal;
+ return (returnVal);
}
am_Error_e am::CAmDatabaseHandler::peekSourceClassID(const std::string & name, am_sourceClass_t & sourceClassID)
{
if (name.empty())
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
am_Error_e returnVal = E_NON_EXISTENT;
sqlite3_stmt* query = NULL;
int eCode = 0;
std::string command = "SELECT sourceClassID FROM " + std::string(SOURCE_CLASS_TABLE) + " WHERE name=?";
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_prepare_v2(mpDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
@@ -4389,7 +4479,7 @@ am_Error_e am::CAmDatabaseHandler::peekSourceClassID(const std::string & name, a
logError("DatabaseHandler::peekSourceClassID SQLITE Finalize error code:", eCode);
returnVal = E_DATABASE_ERROR;
}
- return returnVal;
+ return (returnVal);
}
void CAmDatabaseHandler::createTables()
diff --git a/AudioManagerDaemon/src/CAmDatabaseObserver.cpp b/AudioManagerDaemon/src/CAmDatabaseObserver.cpp
index 9bbc275..775b239 100644
--- a/AudioManagerDaemon/src/CAmDatabaseObserver.cpp
+++ b/AudioManagerDaemon/src/CAmDatabaseObserver.cpp
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmDatabaseObserver.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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 statiasyncCally or dynamiasyncCally with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
- * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
- * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+ * \file CAmDatabaseObserver.cpp
+ * For further information see http://www.genivi.org/.
*
*/
diff --git a/AudioManagerDaemon/src/CAmDbusWrapper.cpp b/AudioManagerDaemon/src/CAmDbusWrapper.cpp
index 082d62f..6148edf 100644
--- a/AudioManagerDaemon/src/CAmDbusWrapper.cpp
+++ b/AudioManagerDaemon/src/CAmDbusWrapper.cpp
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmSocketHandler.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * \file CAmDbusWrapper.cpp
+ * For further information see http://www.genivi.org/.
*
*/
@@ -35,6 +33,9 @@
namespace am
{
+/**
+ * introspectio header
+ */
#define ROOT_INTROSPECT_XML \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>" \
@@ -99,12 +100,12 @@ CAmDbusWrapper::CAmDbusWrapper(CAmSocketHandler* socketHandler) :
int ret = dbus_bus_request_name(mpDbusConnection, DBUS_SERVICE_PREFIX, DBUS_NAME_FLAG_DO_NOT_QUEUE, &mDBusError);
if (dbus_error_is_set(&mDBusError))
{
- logError("DBusWrapper::DBusWrapper Name Error",mDBusError.message);
+ logError("DBusWrapper::DBusWrapper Name Error", mDBusError.message);
dbus_error_free(&mDBusError);
}
if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret)
{
- logError("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner ! Another instance already running?",ret);
+ logError("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner ! Another instance already running?", ret);
exit(1);
}
}
@@ -123,9 +124,16 @@ CAmDbusWrapper::~CAmDbusWrapper()
}
}
+/**
+ * registers a callback that is entered as path below the main path.
+ * The configuration of the mainpath is done via DBusConfiguration.h
+ * @param vtable the vtable that holds a pointer to the callback that is called when the path is called from the dbus
+ * @param path the name of the path
+ * @param userdata pointer to the class that will handle the callback
+ */
void CAmDbusWrapper::registerCallback(const DBusObjectPathVTable* vtable, const std::string& path, void* userdata)
{
- logInfo("DBusWrapper::~registerCallback register callback:",path);
+ logInfo("DBusWrapper::~registerCallback register callback:", path);
std::string completePath = std::string(DBUS_SERVICE_OBJECT_PATH) + "/" + path;
dbus_error_init(&mDBusError);
@@ -133,12 +141,19 @@ void CAmDbusWrapper::registerCallback(const DBusObjectPathVTable* vtable, const
dbus_connection_register_object_path(mpDbusConnection, completePath.c_str(), vtable, userdata);
if (dbus_error_is_set(&mDBusError))
{
- logError("DBusWrapper::registerCallack error: ",mDBusError.message);
+ logError("DBusWrapper::registerCallack error: ", mDBusError.message);
dbus_error_free(&mDBusError);
}
mListNodes.push_back(path);
}
+/**
+ * internal callback for the root introspection
+ * @param conn
+ * @param msg
+ * @param reference
+ * @return
+ */
DBusHandlerResult CAmDbusWrapper::cbRootIntrospection(DBusConnection *conn, DBusMessage *msg, void *reference)
{
logInfo("DBusWrapper::~cbRootIntrospection called:");
@@ -180,14 +195,18 @@ DBusHandlerResult CAmDbusWrapper::cbRootIntrospection(DBusConnection *conn, DBus
// free the reply
dbus_message_unref(reply);
- return DBUS_HANDLER_RESULT_HANDLED;
+ return (DBUS_HANDLER_RESULT_HANDLED);
}
else
{
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ return (DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
}
}
+/**
+ * returns the dbus connection
+ * @param connection pointer to the connection
+ */
void CAmDbusWrapper::getDBusConnection(DBusConnection *& connection) const
{
connection = mpDbusConnection;
@@ -197,7 +216,7 @@ dbus_bool_t CAmDbusWrapper::addWatch(DBusWatch *watch, void *userData)
{
mpReference = (CAmDbusWrapper*) userData;
assert(mpReference!=0);
- return mpReference->addWatchDelegate(watch, userData);
+ return (mpReference->addWatchDelegate(watch, userData));
}
dbus_bool_t CAmDbusWrapper::addWatchDelegate(DBusWatch * watch, void* userData)
@@ -216,14 +235,14 @@ dbus_bool_t CAmDbusWrapper::addWatchDelegate(DBusWatch * watch, void* userData)
event |= POLLOUT;
}
- logInfo("DBusWrapper::addWatchDelegate entered new watch, fd=",dbus_watch_get_unix_fd(watch),"event flag=",event);
+ logInfo("DBusWrapper::addWatchDelegate entered new watch, fd=", dbus_watch_get_unix_fd(watch), "event flag=", event);
am_Error_e error = mpSocketHandler->addFDPoll(dbus_watch_get_unix_fd(watch), event, NULL, &pDbusFireCallback, &pDbusCheckCallback, &pDbusDispatchCallback, watch, handle);
//if everything is alright, add the watch and the handle to our map so we know this relationship
if (error == E_OK && handle != 0)
{
mMapHandleWatch.insert(std::make_pair(watch, handle));
- return true;
+ return (true);
}
logError("DBusWrapper::addWatchDelegate entering watch failed");
return (true);
@@ -243,7 +262,7 @@ void CAmDbusWrapper::removeWatchDelegate(DBusWatch *watch, void *userData)
iterator = mMapHandleWatch.find(watch);
if (iterator != mMapHandleWatch.end())
mpSocketHandler->removeFDPoll(iterator->second);
- logInfo("DBusWrapper::removeWatch removed watch with handle",iterator->second);
+ logInfo("DBusWrapper::removeWatch removed watch with handle", iterator->second);
mMapHandleWatch.erase(iterator);
}
@@ -279,13 +298,13 @@ dbus_bool_t CAmDbusWrapper::addTimeout(DBusTimeout *timeout, void* userData)
{
mpReference = (CAmDbusWrapper*) userData;
assert(mpReference!=0);
- return mpReference->addTimeoutDelegate(timeout, userData);
+ return (mpReference->addTimeoutDelegate(timeout, userData));
}
dbus_bool_t CAmDbusWrapper::addTimeoutDelegate(DBusTimeout *timeout, void* userData)
{
if (!dbus_timeout_get_enabled(timeout))
- return false;
+ return (false);
//calculate the timeout in timeval
timespec pollTimeout;
@@ -296,7 +315,7 @@ dbus_bool_t CAmDbusWrapper::addTimeoutDelegate(DBusTimeout *timeout, void* userD
//prepare handle and callback. new is eval, but there is no other choice because we need the pointer!
sh_timerHandle_t* handle = new sh_timerHandle_t;
mpListTimerhandles.push_back(handle);
- CAmShTimerCallBack* buffer = &pDbusTimerCallback;
+ IAmShTimerCallBack* buffer = &pDbusTimerCallback;
//add the timer to the pollLoop
mpSocketHandler->addTimer(pollTimeout, buffer, *handle, timeout);
@@ -307,7 +326,7 @@ dbus_bool_t CAmDbusWrapper::addTimeoutDelegate(DBusTimeout *timeout, void* userD
//save timeout in Socket context
userData = timeout;
logInfo("DBusWrapper::addTimeoutDelegate a timeout was added");
- return true;
+ return (true);
}
void CAmDbusWrapper::removeTimeout(DBusTimeout *timeout, void* userData)
@@ -354,8 +373,8 @@ bool am::CAmDbusWrapper::dbusDispatchCallback(const sh_pollHandle_t handle, void
if (dbus_connection_dispatch(mpDbusConnection) == DBUS_DISPATCH_COMPLETE)
returnVal = false;
dbus_connection_unref(mpDbusConnection);
-// logInfo("DBusWrapper::dbusDispatchCallback was called");
- return returnVal;
+ //logInfo("DBusWrapper::dbusDispatchCallback was called");
+ return (returnVal);
}
bool am::CAmDbusWrapper::dbusCheckCallback(const sh_pollHandle_t handle, void *userData)
@@ -367,8 +386,8 @@ bool am::CAmDbusWrapper::dbusCheckCallback(const sh_pollHandle_t handle, void *u
if (dbus_connection_get_dispatch_status(mpDbusConnection) == DBUS_DISPATCH_DATA_REMAINS)
returnVal = true;
dbus_connection_unref(mpDbusConnection);
-// logInfo("DBusWrapper::dbusCheckCallback was called");
- return returnVal;
+ //logInfo("DBusWrapper::dbusCheckCallback was called");
+ return (returnVal);
}
void am::CAmDbusWrapper::dbusFireCallback(const pollfd pollfd, const sh_pollHandle_t handle, void *userData)
@@ -392,7 +411,7 @@ void am::CAmDbusWrapper::dbusFireCallback(const pollfd pollfd, const sh_pollHand
dbus_connection_ref(mpDbusConnection);
dbus_watch_handle(watch, flags);
dbus_connection_unref(mpDbusConnection);
-// logInfo("DBusWrapper::dbusFireCallback was called");
+ //logInfo("DBusWrapper::dbusFireCallback was called");
}
void CAmDbusWrapper::toggleTimeoutDelegate(DBusTimeout *timeout, void* userData)
@@ -414,7 +433,8 @@ void CAmDbusWrapper::toggleTimeoutDelegate(DBusTimeout *timeout, void* userData)
else
{
mpSocketHandler->stopTimer(*handle);
- }logInfo("DBusWrapper::toggleTimeoutDelegate was called");
+ }
+ logInfo("DBusWrapper::toggleTimeoutDelegate was called");
}
void CAmDbusWrapper::dbusTimerCallback(sh_timerHandle_t handle, void *userData)
diff --git a/AudioManagerDaemon/src/CAmDltWrapper.cpp b/AudioManagerDaemon/src/CAmDltWrapper.cpp
index fc7e064..7890e64 100644
--- a/AudioManagerDaemon/src/CAmDltWrapper.cpp
+++ b/AudioManagerDaemon/src/CAmDltWrapper.cpp
@@ -1,30 +1,28 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmDltWrapper.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmDltWrapper.cpp
+ * For further information see http://www.genivi.org/.
*
*/
#include "shared/CAmDltWrapper.h"
-#include <string.h>
+#include <string>
#include <sstream>
#include <iostream>
@@ -41,7 +39,7 @@ CAmDltWrapper *CAmDltWrapper::instance(const bool enableNoDLTDebug)
if(enableNoDLTDebug)
mpDLTWrapper->enableNoDLTDebug(true);
#endif
- return mpDLTWrapper;
+ return (mpDLTWrapper);
}
void CAmDltWrapper::unregisterContext(DltContext & handle)
diff --git a/AudioManagerDaemon/src/CAmRouter.cpp b/AudioManagerDaemon/src/CAmRouter.cpp
index 265f77d..fd394a9 100644
--- a/AudioManagerDaemon/src/CAmRouter.cpp
+++ b/AudioManagerDaemon/src/CAmRouter.cpp
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmRouter.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmRouter.cpp
+ * For further information see http://www.genivi.org/.
*
*/
@@ -33,22 +31,30 @@
namespace am {
CAmRouter::CAmRouter(CAmDatabaseHandler* iDatabaseHandler, CAmControlSender* iSender) :
- mDatabaseHandler(iDatabaseHandler), //
- mControlSender(iSender)
+ mpDatabaseHandler(iDatabaseHandler), //
+ mpControlSender(iSender)
{
- assert(mDatabaseHandler);
- assert(mControlSender);
+ assert(mpDatabaseHandler);
+ assert(mpControlSender);
}
+/**
+ * returns the best route between a source and a sink
+ * @param onlyfree if true only free gateways are used
+ * @param sourceID
+ * @param sinkID
+ * @param returnList this list contains a set of routes
+ * @return E_OK in case of success
+ */
am_Error_e CAmRouter::getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s> & returnList)
{
returnList.clear();
//first find out in which domains the source and sink are
am_domainID_t sourceDomainID;
am_domainID_t sinkDomainID;
- if (mDatabaseHandler->getDomainOfSource(sourceID, sourceDomainID) != E_OK)
+ if (mpDatabaseHandler->getDomainOfSource(sourceID, sourceDomainID) != E_OK)
return (E_NON_EXISTENT);
- if (mDatabaseHandler->getDomainOfSink(sinkID, sinkDomainID) != E_OK)
+ if (mpDatabaseHandler->getDomainOfSink(sinkID, sinkDomainID) != E_OK)
return (E_NON_EXISTENT);
if (sourceDomainID == sinkDomainID) //shortcut if the domains are the same...
@@ -64,11 +70,11 @@ am_Error_e CAmRouter::getRoute(const bool onlyfree, const am_sourceID_t sourceID
route.route.clear();
//get the prio of the Controller:
- mControlSender->getConnectionFormatChoice(sourceID, sinkID, route, listFormats, listPriorityConnectionFormats);
+ mpControlSender->getConnectionFormatChoice(sourceID, sinkID, route, listFormats, listPriorityConnectionFormats);
//no possible connection, so no route ! But we report OK since there is no fault ...
if (listPriorityConnectionFormats.empty())
- return E_OK;
+ return (E_OK);
//return the first item as route:
am_RoutingElement_s routingElement;
@@ -85,7 +91,7 @@ am_Error_e CAmRouter::getRoute(const bool onlyfree, const am_sourceID_t sourceID
//push it to the return list - we are done here ...
returnList.push_back(actualRoute);
- return E_OK;
+ return (E_OK);
}
CAmRoutingTree routingtree(sourceDomainID); //Build up a Tree from the Source_Domain to every other domain.
@@ -96,7 +102,7 @@ am_Error_e CAmRouter::getRoute(const bool onlyfree, const am_sourceID_t sourceID
am_Route_s actualRoute; //holds the actual Route
am_sourceID_t lastSource = 0;
- mDatabaseHandler->getRoutingTree(onlyfree, routingtree, flattree); //Build up the tree out of the database as
+ mpDatabaseHandler->getRoutingTree(onlyfree, routingtree, flattree); //Build up the tree out of the database as
//we go through the returned flattree and look for our sink, after that flattree holds only treeItems that match
std::vector<CAmRoutingTreeItem*>::iterator iterator = flattree.begin();
@@ -121,7 +127,7 @@ am_Error_e CAmRouter::getRoute(const bool onlyfree, const am_sourceID_t sourceID
for (; gatewayIterator != listGatewayID.end(); ++gatewayIterator)
{
am_Gateway_s gatewayData;
- if (mDatabaseHandler->getGatewayInfoDB(*gatewayIterator, gatewayData) != E_OK)
+ if (mpDatabaseHandler->getGatewayInfoDB(*gatewayIterator, gatewayData) != E_OK)
return (E_UNKNOWN);
//at the beginning of the route, we connect first the source to the first gateway
@@ -168,8 +174,8 @@ void CAmRouter::listPossibleConnectionFormats(const am_sourceID_t sourceID, cons
{
std::vector<am_ConnectionFormat_e> listSourceFormats;
std::vector<am_ConnectionFormat_e> listSinkFormats;
- mDatabaseHandler->getListSinkConnectionFormats(sinkID, listSinkFormats);
- mDatabaseHandler->getListSourceConnectionFormats(sourceID, listSourceFormats);
+ mpDatabaseHandler->getListSinkConnectionFormats(sinkID, listSinkFormats);
+ mpDatabaseHandler->getListSourceConnectionFormats(sourceID, listSourceFormats);
std::sort(listSinkFormats.begin(), listSinkFormats.end()); //todo: this might be not needed if we use strictly sorted input
std::sort(listSourceFormats.begin(), listSourceFormats.end()); //todo: this might be not needed if we use strictly sorted input
std::insert_iterator<std::vector<am_ConnectionFormat_e> > inserter(listFormats, listFormats.begin());
@@ -210,7 +216,7 @@ am_Error_e CAmRouter::findBestWay(am_sinkID_t sinkID, am_sourceID_t sourceID, st
route.route = listRoute;
//let the controller decide:
- mControlSender->getConnectionFormatChoice(routeIterator->sourceID, routeIterator->sinkID, route, listMergeConnectionFormats, listPriorityConnectionFormats);
+ mpControlSender->getConnectionFormatChoice(routeIterator->sourceID, routeIterator->sinkID, route, listMergeConnectionFormats, listPriorityConnectionFormats);
//we have the list sorted after prios - now we try one after the other with the next part of the route
std::vector<am_ConnectionFormat_e>::iterator connectionFormatIterator = listPriorityConnectionFormats.begin();
@@ -221,10 +227,10 @@ am_Error_e CAmRouter::findBestWay(am_sinkID_t sinkID, am_sourceID_t sourceID, st
if (!listPriorityConnectionFormats.empty())
{
routeIterator->connectionFormat = listPriorityConnectionFormats.front();
- return E_OK;
+ return (E_OK);
}
else
- return E_NOT_POSSIBLE;
+ return (E_NOT_POSSIBLE);
}
for (; connectionFormatIterator != listPriorityConnectionFormats.end(); ++connectionFormatIterator)
@@ -243,7 +249,7 @@ void CAmRouter::listRestrictedOutputFormatsGateways(const am_gatewayID_t gateway
{
listFormats.clear();
am_Gateway_s gatewayData;
- mDatabaseHandler->getGatewayInfoDB(gatewayID, gatewayData);
+ mpDatabaseHandler->getGatewayInfoDB(gatewayID, gatewayData);
std::vector<am_ConnectionFormat_e>::const_iterator rowSinkIterator = gatewayData.listSinkFormats.begin();
std::vector<bool>::const_iterator matrixIterator = gatewayData.convertionMatrix.begin();
@@ -272,7 +278,7 @@ CAmRouter::~CAmRouter()
CAmRoutingTreeItem::CAmRoutingTreeItem(const am_domainID_t domainID, const am_gatewayID_t gatewayID, CAmRoutingTreeItem *parent) :
mDomainID(domainID), //
mGatewayID(gatewayID), //
- mParentItem(parent)
+ mpParentItem(parent)
{
assert(mDomainID!=0);
}
@@ -300,7 +306,7 @@ am_gatewayID_t CAmRoutingTreeItem::returnGatewayID() const
CAmRoutingTreeItem* CAmRoutingTreeItem::returnParent() const
{
- return (mParentItem);
+ return (mpParentItem);
}
CAmRoutingTreeItem::~CAmRoutingTreeItem()
@@ -318,7 +324,7 @@ CAmRoutingTreeItem *CAmRoutingTree::insertItem(const am_domainID_t domainID, con
CAmRoutingTreeItem *newTree = new CAmRoutingTreeItem(domainID, gatewayID, parent);
parent->appendChild(newTree);
mListChild.push_back(newTree);
- return newTree;
+ return (newTree);
}
void CAmRoutingTree::getRoute(CAmRoutingTreeItem *targetItem, std::vector<am_gatewayID_t>& listGateways)
diff --git a/AudioManagerDaemon/src/CAmRoutingReceiver.cpp b/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
index 8f489fb..3e9aa65 100644
--- a/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
+++ b/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
@@ -1,25 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmRoutingReceiver.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \section LicenseCAmRoutingReceiver.h
*
- * 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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
*
- * 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.
+ * \file CAmRoutingReceiver.cpp
+ * For further information see http://www.genivi.org/.
*
*/
@@ -36,37 +33,37 @@ namespace am
{
CAmRoutingReceiver::CAmRoutingReceiver(CAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmControlSender *iControlSender, CAmSocketHandler *iSocketHandler) :
- mDatabaseHandler(iDatabaseHandler), //
- mRoutingSender(iRoutingSender), //
- mControlSender(iControlSender), //
- mSocketHandler(iSocketHandler), //
+ mpDatabaseHandler(iDatabaseHandler), //
+ mpRoutingSender(iRoutingSender), //
+ mpControlSender(iControlSender), //
+ mpSocketHandler(iSocketHandler), //
mListStartupHandles(), //
mListRundownHandles(), //
mWaitStartup(false), //
mWaitRundown(false)
{
- assert(mDatabaseHandler!=NULL);
- assert(mRoutingSender!=NULL);
- assert(mControlSender!=NULL);
- assert(mSocketHandler!=NULL);
+ assert(mpDatabaseHandler!=NULL);
+ assert(mpRoutingSender!=NULL);
+ assert(mpControlSender!=NULL);
+ assert(mpSocketHandler!=NULL);
}
CAmRoutingReceiver::CAmRoutingReceiver(CAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmControlSender *iControlSender, CAmSocketHandler *iSocketHandler, CAmDbusWrapper *iDBusWrapper) :
- mDatabaseHandler(iDatabaseHandler), //
- mRoutingSender(iRoutingSender), //
- mControlSender(iControlSender), //
- mSocketHandler(iSocketHandler), //
- mDBusWrapper(iDBusWrapper), //
+ mpDatabaseHandler(iDatabaseHandler), //
+ mpRoutingSender(iRoutingSender), //
+ mpControlSender(iControlSender), //
+ mpSocketHandler(iSocketHandler), //
+ mpDBusWrapper(iDBusWrapper), //
mListStartupHandles(), //
mListRundownHandles(), //
mWaitStartup(false), //
mWaitRundown(false)
{
- assert(mDatabaseHandler!=NULL);
- assert(mRoutingSender!=NULL);
- assert(mControlSender!=NULL);
- assert(mSocketHandler!=NULL);
- assert(mDBusWrapper!=NULL);
+ assert(mpDatabaseHandler!=NULL);
+ assert(mpRoutingSender!=NULL);
+ assert(mpControlSender!=NULL);
+ assert(mpSocketHandler!=NULL);
+ assert(mpDBusWrapper!=NULL);
}
CAmRoutingReceiver::~CAmRoutingReceiver()
@@ -75,266 +72,266 @@ CAmRoutingReceiver::~CAmRoutingReceiver()
void CAmRoutingReceiver::ackConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error)
{
- mRoutingSender->removeHandle(handle);
+ mpRoutingSender->removeHandle(handle);
if (error == E_OK)
{
- mDatabaseHandler->changeConnectionFinal(connectionID);
+ mpDatabaseHandler->changeConnectionFinal(connectionID);
}
else
{
- mDatabaseHandler->removeConnection(connectionID);
+ mpDatabaseHandler->removeConnection(connectionID);
}
- mControlSender->cbAckConnect(handle, error);
+ mpControlSender->cbAckConnect(handle, error);
}
void CAmRoutingReceiver::ackDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error)
{
- mRoutingSender->removeHandle(handle);
+ mpRoutingSender->removeHandle(handle);
if (error == E_OK)
{
- mDatabaseHandler->removeConnection(connectionID);
+ mpDatabaseHandler->removeConnection(connectionID);
}
- mControlSender->cbAckDisconnect(handle, error);
+ mpControlSender->cbAckDisconnect(handle, error);
}
void CAmRoutingReceiver::ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
{
- CAmRoutingSender::am_handleData_c handleData = mRoutingSender->returnHandleData(handle);
+ CAmRoutingSender::am_handleData_c handleData = mpRoutingSender->returnHandleData(handle);
if (error == E_OK && handleData.sinkID != 0)
{
//todo: check if volume in handleData is same than volume. React to it.
- mDatabaseHandler->changeSinkVolume(handleData.sinkID, volume);
+ mpDatabaseHandler->changeSinkVolume(handleData.sinkID, volume);
}
- mRoutingSender->removeHandle(handle);
- mControlSender->cbAckSetSinkVolumeChange(handle, volume, error);
+ mpRoutingSender->removeHandle(handle);
+ mpControlSender->cbAckSetSinkVolumeChange(handle, volume, error);
}
void CAmRoutingReceiver::ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
{
- CAmRoutingSender::am_handleData_c handleData = mRoutingSender->returnHandleData(handle);
+ CAmRoutingSender::am_handleData_c handleData = mpRoutingSender->returnHandleData(handle);
if (error == E_OK && handleData.sourceID != 0)
{
//todo: check if volume in handleData is same than volume. React to it.
- mDatabaseHandler->changeSourceVolume(handleData.sourceID, volume);
+ mpDatabaseHandler->changeSourceVolume(handleData.sourceID, volume);
}
- mRoutingSender->removeHandle(handle);
- mControlSender->cbAckSetSourceVolumeChange(handle, volume, error);
+ mpRoutingSender->removeHandle(handle);
+ mpControlSender->cbAckSetSourceVolumeChange(handle, volume, error);
}
void CAmRoutingReceiver::ackSetSourceState(const am_Handle_s handle, const am_Error_e error)
{
- CAmRoutingSender::am_handleData_c handleData = mRoutingSender->returnHandleData(handle);
+ CAmRoutingSender::am_handleData_c handleData = mpRoutingSender->returnHandleData(handle);
if (error == E_OK && handleData.sourceID != 0)
{
//todo: check if volume in handleData is same than volume. React to it.
- mDatabaseHandler->changeSourceState(handleData.sourceID, handleData.sourceState);
+ mpDatabaseHandler->changeSourceState(handleData.sourceID, handleData.sourceState);
}
- mRoutingSender->removeHandle(handle);
- mControlSender->cbAckSetSourceState(handle, error);
+ mpRoutingSender->removeHandle(handle);
+ mpControlSender->cbAckSetSourceState(handle, error);
}
void CAmRoutingReceiver::ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
{
- CAmRoutingSender::am_handleData_c handleData = mRoutingSender->returnHandleData(handle);
+ CAmRoutingSender::am_handleData_c handleData = mpRoutingSender->returnHandleData(handle);
if (error == E_OK && handleData.sinkID != 0)
{
- mDatabaseHandler->changeSinkSoundPropertyDB(handleData.soundPropery, handleData.sinkID);
+ mpDatabaseHandler->changeSinkSoundPropertyDB(handleData.soundPropery, handleData.sinkID);
}
- mRoutingSender->removeHandle(handle);
- mControlSender->cbAckSetSinkSoundProperty(handle, error);
+ mpRoutingSender->removeHandle(handle);
+ mpControlSender->cbAckSetSinkSoundProperty(handle, error);
}
void am::CAmRoutingReceiver::ackSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error)
{
- CAmRoutingSender::am_handleData_c handleData = mRoutingSender->returnHandleData(handle);
+ CAmRoutingSender::am_handleData_c handleData = mpRoutingSender->returnHandleData(handle);
if (error == E_OK && handleData.sinkID != 0)
{
std::vector<am_SoundProperty_s>::const_iterator it = handleData.soundProperties->begin();
for (; it != handleData.soundProperties->end(); ++it)
{
- mDatabaseHandler->changeSinkSoundPropertyDB(*it, handleData.sinkID);
+ mpDatabaseHandler->changeSinkSoundPropertyDB(*it, handleData.sinkID);
}
delete handleData.soundProperties;
}
- mRoutingSender->removeHandle(handle);
- mControlSender->cbAckSetSinkSoundProperties(handle, error);
+ mpRoutingSender->removeHandle(handle);
+ mpControlSender->cbAckSetSinkSoundProperties(handle, error);
}
void CAmRoutingReceiver::ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error)
{
- CAmRoutingSender::am_handleData_c handleData = mRoutingSender->returnHandleData(handle);
+ CAmRoutingSender::am_handleData_c handleData = mpRoutingSender->returnHandleData(handle);
if (error == E_OK && handleData.sourceID != 0)
{
- mDatabaseHandler->changeSourceSoundPropertyDB(handleData.soundPropery, handleData.sourceID);
+ mpDatabaseHandler->changeSourceSoundPropertyDB(handleData.soundPropery, handleData.sourceID);
}
- mRoutingSender->removeHandle(handle);
- mControlSender->cbAckSetSourceSoundProperty(handle, error);
+ mpRoutingSender->removeHandle(handle);
+ mpControlSender->cbAckSetSourceSoundProperty(handle, error);
}
void am::CAmRoutingReceiver::ackSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error)
{
- CAmRoutingSender::am_handleData_c handleData = mRoutingSender->returnHandleData(handle);
+ CAmRoutingSender::am_handleData_c handleData = mpRoutingSender->returnHandleData(handle);
if (error == E_OK && handleData.sourceID != 0)
{
std::vector<am_SoundProperty_s>::const_iterator it = handleData.soundProperties->begin();
for (; it != handleData.soundProperties->end(); ++it)
{
- mDatabaseHandler->changeSourceSoundPropertyDB(*it, handleData.sourceID);
+ mpDatabaseHandler->changeSourceSoundPropertyDB(*it, handleData.sourceID);
}
delete handleData.soundProperties;
}
- mRoutingSender->removeHandle(handle);
- mControlSender->cbAckSetSourceSoundProperties(handle, error);
+ mpRoutingSender->removeHandle(handle);
+ mpControlSender->cbAckSetSourceSoundProperties(handle, error);
}
void CAmRoutingReceiver::ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error)
{
- CAmRoutingSender::am_handleData_c handleData = mRoutingSender->returnHandleData(handle);
+ CAmRoutingSender::am_handleData_c handleData = mpRoutingSender->returnHandleData(handle);
if (error == E_OK && handleData.crossfaderID != 0)
{
//todo: check if volume in handleData is same than volume. React to it.
- mDatabaseHandler->changeCrossFaderHotSink(handleData.crossfaderID, hotSink);
+ mpDatabaseHandler->changeCrossFaderHotSink(handleData.crossfaderID, hotSink);
}
- mRoutingSender->removeHandle(handle);
- mControlSender->cbAckCrossFade(handle, hotSink, error);
+ mpRoutingSender->removeHandle(handle);
+ mpControlSender->cbAckCrossFade(handle, hotSink, error);
}
void CAmRoutingReceiver::ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)
{
- mControlSender->hookSystemSourceVolumeTick(handle, sourceID, volume);
+ mpControlSender->hookSystemSourceVolumeTick(handle, sourceID, volume);
}
void CAmRoutingReceiver::ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)
{
- mControlSender->hookSystemSinkVolumeTick(handle, sinkID, volume);
+ mpControlSender->hookSystemSinkVolumeTick(handle, sinkID, volume);
}
am_Error_e CAmRoutingReceiver::peekDomain(const std::string & name, am_domainID_t & domainID)
{
- return mDatabaseHandler->peekDomain(name, domainID);
+ return (mpDatabaseHandler->peekDomain(name, domainID));
}
am_Error_e CAmRoutingReceiver::registerDomain(const am_Domain_s & domainData, am_domainID_t & domainID)
{
- return mControlSender->hookSystemRegisterDomain(domainData, domainID);
+ return (mpControlSender->hookSystemRegisterDomain(domainData, domainID));
}
am_Error_e CAmRoutingReceiver::deregisterDomain(const am_domainID_t domainID)
{
- return mControlSender->hookSystemDeregisterDomain(domainID);
+ return (mpControlSender->hookSystemDeregisterDomain(domainID));
}
am_Error_e CAmRoutingReceiver::registerGateway(const am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
{
- return mControlSender->hookSystemRegisterGateway(gatewayData, gatewayID);
+ return (mpControlSender->hookSystemRegisterGateway(gatewayData, gatewayID));
}
am_Error_e CAmRoutingReceiver::deregisterGateway(const am_gatewayID_t gatewayID)
{
- return mControlSender->hookSystemDeregisterGateway(gatewayID);
+ return (mpControlSender->hookSystemDeregisterGateway(gatewayID));
}
am_Error_e CAmRoutingReceiver::peekSink(const std::string& name, am_sinkID_t & sinkID)
{
- return mDatabaseHandler->peekSink(name, sinkID);
+ return (mpDatabaseHandler->peekSink(name, sinkID));
}
am_Error_e CAmRoutingReceiver::registerSink(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
{
- return mControlSender->hookSystemRegisterSink(sinkData, sinkID);
+ return (mpControlSender->hookSystemRegisterSink(sinkData, sinkID));
}
am_Error_e CAmRoutingReceiver::deregisterSink(const am_sinkID_t sinkID)
{
- return mControlSender->hookSystemDeregisterSink(sinkID);
+ return (mpControlSender->hookSystemDeregisterSink(sinkID));
}
am_Error_e CAmRoutingReceiver::peekSource(const std::string & name, am_sourceID_t & sourceID)
{
- return mDatabaseHandler->peekSource(name, sourceID);
+ return (mpDatabaseHandler->peekSource(name, sourceID));
}
am_Error_e CAmRoutingReceiver::registerSource(const am_Source_s & sourceData, am_sourceID_t & sourceID)
{
- return mControlSender->hookSystemRegisterSource(sourceData, sourceID);
+ return (mpControlSender->hookSystemRegisterSource(sourceData, sourceID));
}
am_Error_e CAmRoutingReceiver::deregisterSource(const am_sourceID_t sourceID)
{
- return mControlSender->hookSystemDeregisterSource(sourceID);
+ return (mpControlSender->hookSystemDeregisterSource(sourceID));
}
am_Error_e CAmRoutingReceiver::registerCrossfader(const am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
{
- return mControlSender->hookSystemRegisterCrossfader(crossfaderData, crossfaderID);
+ return (mpControlSender->hookSystemRegisterCrossfader(crossfaderData, crossfaderID));
}
am_Error_e CAmRoutingReceiver::deregisterCrossfader(const am_crossfaderID_t crossfaderID)
{
- return mControlSender->hookSystemDeregisterCrossfader(crossfaderID);
+ return (mpControlSender->hookSystemDeregisterCrossfader(crossfaderID));
}
void CAmRoutingReceiver::hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)
{
- return mControlSender->hookSystemInterruptStateChange(sourceID, interruptState);
+ return (mpControlSender->hookSystemInterruptStateChange(sourceID, interruptState));
}
void CAmRoutingReceiver::hookDomainRegistrationComplete(const am_domainID_t domainID)
{
- mControlSender->hookSystemDomainRegistrationComplete(domainID);
+ mpControlSender->hookSystemDomainRegistrationComplete(domainID);
}
void CAmRoutingReceiver::hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s & availability)
{
- mControlSender->hookSystemSinkAvailablityStateChange(sinkID, availability);
+ mpControlSender->hookSystemSinkAvailablityStateChange(sinkID, availability);
}
void CAmRoutingReceiver::hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s & availability)
{
- mControlSender->hookSystemSourceAvailablityStateChange(sourceID, availability);
+ mpControlSender->hookSystemSourceAvailablityStateChange(sourceID, availability);
}
void CAmRoutingReceiver::hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState)
{
- mControlSender->hookSystemDomainStateChange(domainID, domainState);
+ mpControlSender->hookSystemDomainStateChange(domainID, domainState);
}
void CAmRoutingReceiver::hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay)
{
- mDatabaseHandler->changeConnectionTimingInformation(connectionID, delay);
+ mpDatabaseHandler->changeConnectionTimingInformation(connectionID, delay);
}
void CAmRoutingReceiver::sendChangedData(const std::vector<am_EarlyData_s> & earlyData)
{
- mControlSender->hookSystemReceiveEarlyData(earlyData);
+ mpControlSender->hookSystemReceiveEarlyData(earlyData);
}
am_Error_e CAmRoutingReceiver::peekSinkClassID(const std::string& name, am_sinkClass_t& sinkClassID)
{
- return mDatabaseHandler->peekSinkClassID(name, sinkClassID);
+ return (mpDatabaseHandler->peekSinkClassID(name, sinkClassID));
}
am_Error_e CAmRoutingReceiver::peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID)
{
- return mDatabaseHandler->peekSourceClassID(name, sourceClassID);
+ return (mpDatabaseHandler->peekSourceClassID(name, sourceClassID));
}
am_Error_e CAmRoutingReceiver::getDBusConnectionWrapper(CAmDbusWrapper *& dbusConnectionWrapper) const
{
#ifdef WITH_DBUS_WRAPPER
- dbusConnectionWrapper = mDBusWrapper;
- return E_OK;
+ dbusConnectionWrapper = mpDBusWrapper;
+ return (E_OK);
#else
- return E_UNKNOWN;
+ return (E_UNKNOWN);
#endif
}
am_Error_e CAmRoutingReceiver::getSocketHandler(CAmSocketHandler *& socketHandler) const
{
- socketHandler = mSocketHandler;
- return E_OK;
+ socketHandler = mpSocketHandler;
+ return (E_OK);
}
void CAmRoutingReceiver::getInterfaceVersion(std::string & version) const
@@ -346,28 +343,28 @@ void CAmRoutingReceiver::confirmRoutingReady(const uint16_t handle)
{
mListStartupHandles.erase(std::remove(mListStartupHandles.begin(), mListStartupHandles.end(), handle), mListStartupHandles.end());
if (mWaitStartup && mListStartupHandles.empty())
- mControlSender->confirmRoutingReady();
+ mpControlSender->confirmRoutingReady();
}
void CAmRoutingReceiver::confirmRoutingRundown(const uint16_t handle)
{
mListRundownHandles.erase(std::remove(mListRundownHandles.begin(), mListRundownHandles.end(), handle), mListRundownHandles.end());
if (mWaitRundown && mListRundownHandles.empty())
- mControlSender->confirmCommandRundown();
+ mpControlSender->confirmCommandRundown();
}
uint16_t am::CAmRoutingReceiver::getStartupHandle()
{
uint16_t handle = ++handleCount; //todo: handle overflow
mListStartupHandles.push_back(handle);
- return handle;
+ return (handle);
}
uint16_t am::CAmRoutingReceiver::getRundownHandle()
{
uint16_t handle = ++handleCount; //todo: handle overflow
mListRundownHandles.push_back(handle);
- return handle;
+ return (handle);
}
void am::CAmRoutingReceiver::waitOnStartup(bool startup)
diff --git a/AudioManagerDaemon/src/CAmRoutingSender.cpp b/AudioManagerDaemon/src/CAmRoutingSender.cpp
index c134c3f..d14c826 100644
--- a/AudioManagerDaemon/src/CAmRoutingSender.cpp
+++ b/AudioManagerDaemon/src/CAmRoutingSender.cpp
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmRoutingSender.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * \file CAmRoutingSender.cpp
+ * For further information see http://www.genivi.org/.
*
*/
@@ -36,9 +34,12 @@
namespace am
{
-#define REQUIRED_INTERFACE_VERSION_MAJOR 1
-#define REQUIRED_INTERFACE_VERSION_MINOR 0
-
+#define REQUIRED_INTERFACE_VERSION_MAJOR 1 //!< major interface version. All versions smaller than this will be rejected
+#define REQUIRED_INTERFACE_VERSION_MINOR 0 //!< minor interface version. All versions smaller than this will be rejected
+/**
+ * macro to call all interfaces
+ *
+ */
#define CALL_ALL_INTERFACES(...) \
std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin(); \
std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end(); \
@@ -57,7 +58,7 @@ CAmRoutingSender::CAmRoutingSender(const std::vector<std::string>& listOfPluginD
mMapSinkInterface(), //
mMapSourceInterface(), //
mMapHandleInterface(), //
- mRoutingReceiver()
+ mpRoutingReceiver()
{
std::vector<std::string> sharedLibraryNameList;
std::vector<std::string>::const_iterator dirIter = listOfPluginDirectories.begin();
@@ -167,7 +168,7 @@ CAmRoutingSender::~CAmRoutingSender()
am_Error_e CAmRoutingSender::startupInterfaces(CAmRoutingReceiver *iRoutingReceiver)
{
- mRoutingReceiver = iRoutingReceiver;
+ mpRoutingReceiver = iRoutingReceiver;
am_Error_e returnError = E_OK;
std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
@@ -180,7 +181,7 @@ am_Error_e CAmRoutingSender::startupInterfaces(CAmRoutingReceiver *iRoutingRecei
returnError = error;
}
}
- return returnError;
+ return (returnError);
}
am_Error_e CAmRoutingSender::asyncAbort(const am_Handle_s& handle)
@@ -189,10 +190,10 @@ am_Error_e CAmRoutingSender::asyncAbort(const am_Handle_s& handle)
iter = mMapHandleInterface.find(handle.handle);
if (iter != mMapHandleInterface.end())
{
- return iter->second->asyncAbort(handle);
+ return (iter->second->asyncAbort(handle));
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
am_Error_e CAmRoutingSender::asyncConnect(am_Handle_s& handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat)
@@ -206,10 +207,10 @@ am_Error_e CAmRoutingSender::asyncConnect(am_Handle_s& handle, const am_connecti
handle = createHandle(handleData, H_CONNECT);
mMapConnectionInterface.insert(std::make_pair(connectionID, iter->second));
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncConnect(handle, connectionID, sourceID, sinkID, connectionFormat);
+ return (iter->second->asyncConnect(handle, connectionID, sourceID, sinkID, connectionFormat));
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
am_Error_e CAmRoutingSender::asyncDisconnect(am_Handle_s& handle, const am_connectionID_t connectionID)
@@ -224,10 +225,10 @@ am_Error_e CAmRoutingSender::asyncDisconnect(am_Handle_s& handle, const am_conne
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
am_Error_e returnVal = iter->second->asyncDisconnect(handle, connectionID);
mMapConnectionInterface.erase(iter);
- return returnVal;
+ return (returnVal);
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
am_Error_e CAmRoutingSender::asyncSetSinkVolume(am_Handle_s& handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time)
@@ -241,9 +242,9 @@ am_Error_e CAmRoutingSender::asyncSetSinkVolume(am_Handle_s& handle, const am_si
handleData.volume = volume;
handle = createHandle(handleData, H_SETSINKVOLUME);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSinkVolume(handle, sinkID, volume, ramp, time);
+ return (iter->second->asyncSetSinkVolume(handle, sinkID, volume, ramp, time));
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
am_Error_e CAmRoutingSender::asyncSetSourceVolume(am_Handle_s& handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time)
@@ -257,9 +258,9 @@ am_Error_e CAmRoutingSender::asyncSetSourceVolume(am_Handle_s& handle, const am_
handleData.volume = volume;
handle = createHandle(handleData, H_SETSOURCEVOLUME);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSourceVolume(handle, sourceID, volume, ramp, time);
+ return (iter->second->asyncSetSourceVolume(handle, sourceID, volume, ramp, time));
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
am_Error_e CAmRoutingSender::asyncSetSourceState(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SourceState_e state)
@@ -273,9 +274,9 @@ am_Error_e CAmRoutingSender::asyncSetSourceState(am_Handle_s& handle, const am_s
handleData.sourceState = state;
handle = createHandle(handleData, H_SETSOURCESTATE);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSourceState(handle, sourceID, state);
+ return (iter->second->asyncSetSourceState(handle, sourceID, state));
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
am_Error_e CAmRoutingSender::asyncSetSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
@@ -289,7 +290,7 @@ am_Error_e CAmRoutingSender::asyncSetSinkSoundProperty(am_Handle_s& handle, cons
handleData.soundPropery = soundProperty;
handle = createHandle(handleData, H_SETSINKSOUNDPROPERTY);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSinkSoundProperty(handle, sinkID, soundProperty);
+ return (iter->second->asyncSetSinkSoundProperty(handle, sinkID, soundProperty));
}
return (E_NON_EXISTENT);
}
@@ -305,7 +306,7 @@ am_Error_e CAmRoutingSender::asyncSetSourceSoundProperty(am_Handle_s& handle, co
handleData.soundPropery = soundProperty;
handle = createHandle(handleData, H_SETSOURCESOUNDPROPERTY);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSourceSoundProperty(handle, sourceID, soundProperty);
+ return (iter->second->asyncSetSourceSoundProperty(handle, sourceID, soundProperty));
}
return (E_NON_EXISTENT);
}
@@ -321,7 +322,7 @@ am_Error_e CAmRoutingSender::asyncSetSourceSoundProperties(am_Handle_s& handle,
handleData.soundProperties = new std::vector<am_SoundProperty_s>(listSoundProperties);
handle = createHandle(handleData, H_SETSOURCESOUNDPROPERTIES);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSourceSoundProperties(handle, sourceID, listSoundProperties);
+ return (iter->second->asyncSetSourceSoundProperties(handle, sourceID, listSoundProperties));
}
return (E_NON_EXISTENT);
}
@@ -337,7 +338,7 @@ am_Error_e CAmRoutingSender::asyncSetSinkSoundProperties(am_Handle_s& handle, co
handleData.soundProperties = new std::vector<am_SoundProperty_s>(listSoundProperties);
handle = createHandle(handleData, H_SETSINKSOUNDPROPERTIES);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSinkSoundProperties(handle, sinkID, listSoundProperties);
+ return (iter->second->asyncSetSinkSoundProperties(handle, sinkID, listSoundProperties));
}
return (E_NON_EXISTENT);
@@ -354,9 +355,9 @@ am_Error_e CAmRoutingSender::asyncCrossFade(am_Handle_s& handle, const am_crossf
handleData.hotSink = hotSink;
handle = createHandle(handleData, H_CROSSFADE);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncCrossFade(handle, crossfaderID, hotSink, rampType, time);
+ return (iter->second->asyncCrossFade(handle, crossfaderID, hotSink, rampType, time));
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
am_Error_e CAmRoutingSender::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
@@ -364,10 +365,15 @@ am_Error_e CAmRoutingSender::setDomainState(const am_domainID_t domainID, const
DomainInterfaceMap::iterator iter = mMapDomainInterface.begin();
iter = mMapDomainInterface.find(domainID);
if (iter != mMapDomainInterface.end())
- return iter->second->setDomainState(domainID, domainState);
- return E_NON_EXISTENT;
+ return (iter->second->setDomainState(domainID, domainState));
+ return (E_NON_EXISTENT);
}
+/**
+ * @author Christian
+ * this adds the domain to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
+ * This must be done whenever a domain is registered.
+ */
am_Error_e CAmRoutingSender::addDomainLookup(const am_Domain_s& domainData)
{
std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
@@ -377,13 +383,18 @@ am_Error_e CAmRoutingSender::addDomainLookup(const am_Domain_s& domainData)
if ((*iter).busName.compare(domainData.busname) == 0)
{
mMapDomainInterface.insert(std::make_pair(domainData.domainID, (*iter).routingInterface));
- return E_OK;
+ return (E_OK);
}
}
- return E_UNKNOWN;
+ return (E_UNKNOWN);
}
+/**
+ * @author Christian
+ * this adds the Source to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
+ * This must be done whenever a Source is registered.
+ */
am_Error_e CAmRoutingSender::addSourceLookup(const am_Source_s& sourceData)
{
DomainInterfaceMap::iterator iter = mMapDomainInterface.begin();
@@ -391,12 +402,17 @@ am_Error_e CAmRoutingSender::addSourceLookup(const am_Source_s& sourceData)
if (iter != mMapDomainInterface.end())
{
mMapSourceInterface.insert(std::make_pair(sourceData.sourceID, iter->second));
- return E_OK;
+ return (E_OK);
}
- return E_UNKNOWN;
+ return (E_UNKNOWN);
}
+/**
+ * @author Christian
+ * this adds the Sink to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
+ * This must be done whenever a Sink is registered.
+ */
am_Error_e CAmRoutingSender::addSinkLookup(const am_Sink_s& sinkData)
{
DomainInterfaceMap::iterator iter = mMapDomainInterface.begin();
@@ -404,12 +420,17 @@ am_Error_e CAmRoutingSender::addSinkLookup(const am_Sink_s& sinkData)
if (iter != mMapDomainInterface.end())
{
mMapSinkInterface.insert(std::make_pair(sinkData.sinkID, iter->second));
- return E_OK;
+ return (E_OK);
}
- return E_UNKNOWN;
+ return (E_UNKNOWN);
}
+/**
+ * @author Christian
+ * this adds the Crossfader to the lookup table of the Router. The data is used to have a quick lookup of the correct pluginInterface.
+ * This must be done whenever a Crossfader is registered.
+ */
am_Error_e CAmRoutingSender::addCrossfaderLookup(const am_Crossfader_s& crossfaderData)
{
DomainInterfaceMap::iterator iter = mMapSourceInterface.begin();
@@ -417,12 +438,16 @@ am_Error_e CAmRoutingSender::addCrossfaderLookup(const am_Crossfader_s& crossfad
if (iter != mMapSourceInterface.end())
{
mMapSourceInterface.insert(std::make_pair(crossfaderData.crossfaderID, iter->second));
- return E_OK;
+ return (E_OK);
}
- return E_UNKNOWN;
+ return (E_UNKNOWN);
}
+/**
+ * @author Christian
+ * this removes the Domain to the lookup table of the Router. This must be done everytime a domain is deregistered.
+ */
am_Error_e CAmRoutingSender::removeDomainLookup(const am_domainID_t domainID)
{
DomainInterfaceMap::iterator iter = mMapDomainInterface.begin();
@@ -430,12 +455,16 @@ am_Error_e CAmRoutingSender::removeDomainLookup(const am_domainID_t domainID)
if (iter != mMapDomainInterface.end())
{
mMapDomainInterface.erase(iter);
- return E_OK;
+ return (E_OK);
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
+/**
+ * @author Christian
+ * this removes the Source to the lookup table of the Router. This must be done everytime a source is deregistered.
+ */
am_Error_e CAmRoutingSender::removeSourceLookup(const am_sourceID_t sourceID)
{
SourceInterfaceMap::iterator iter = mMapSourceInterface.begin();
@@ -443,12 +472,16 @@ am_Error_e CAmRoutingSender::removeSourceLookup(const am_sourceID_t sourceID)
if (iter != mMapSourceInterface.end())
{
mMapSourceInterface.erase(iter);
- return E_OK;
+ return (E_OK);
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
+/**
+ * @author Christian
+ * this removes the Sink to the lookup table of the Router. This must be done everytime a sink is deregistered.
+ */
am_Error_e CAmRoutingSender::removeSinkLookup(const am_sinkID_t sinkID)
{
SinkInterfaceMap::iterator iter = mMapSinkInterface.begin();
@@ -456,12 +489,16 @@ am_Error_e CAmRoutingSender::removeSinkLookup(const am_sinkID_t sinkID)
if (iter != mMapSinkInterface.end())
{
mMapSinkInterface.erase(iter);
- return E_OK;
+ return (E_OK);
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
+/**
+ * @author Christian
+ * this removes the Crossfader to the lookup table of the Router. This must be done everytime a crossfader is deregistered.
+ */
am_Error_e CAmRoutingSender::removeCrossfaderLookup(const am_crossfaderID_t crossfaderID)
{
CrossfaderInterfaceMap::iterator iter = mMapCrossfaderInterface.begin();
@@ -469,17 +506,22 @@ am_Error_e CAmRoutingSender::removeCrossfaderLookup(const am_crossfaderID_t cros
if (iter != mMapCrossfaderInterface.end())
{
mMapCrossfaderInterface.erase(iter);
- return E_OK;
+ return (E_OK);
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
+/**
+ * removes a handle from the list
+ * @param handle to be removed
+ * @return E_OK in case of success
+ */
am_Error_e CAmRoutingSender::removeHandle(const am_Handle_s& handle)
{
if (mlistActiveHandles.erase(handle))
- return E_OK;
- return E_UNKNOWN;
+ return (E_OK);
+ return (E_UNKNOWN);
}
am_Error_e CAmRoutingSender::getListHandles(std::vector<am_Handle_s> & listHandles) const
@@ -490,18 +532,29 @@ am_Error_e CAmRoutingSender::getListHandles(std::vector<am_Handle_s> & listHandl
{
listHandles.push_back(it->first);
}
- return E_OK;
+ return (E_OK);
}
+/**
+ * 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 CAmRoutingSender::createHandle(const am_handleData_c& handleData, const am_Handle_e type)
{
am_Handle_s handle;
handle.handle = ++mHandleCount; //todo: handle overflows here...
handle.handleType = type;
mlistActiveHandles.insert(std::make_pair(handle, handleData));
- return handle;
+ return (handle);
}
+/**
+ * returns the data that belong to handles
+ * @param handle the handle
+ * @return a class holding the handle data
+ */
CAmRoutingSender::am_handleData_c CAmRoutingSender::returnHandleData(const am_Handle_s handle) const
{
HandlesMap::const_iterator it = mlistActiveHandles.begin();
@@ -511,26 +564,26 @@ CAmRoutingSender::am_handleData_c CAmRoutingSender::returnHandleData(const am_Ha
void CAmRoutingSender::setRoutingReady()
{
- mRoutingReceiver->waitOnStartup(false);
+ mpRoutingReceiver->waitOnStartup(false);
std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end();
for (; iter < iterEnd; ++iter)
{
- (*iter).routingInterface->setRoutingReady(mRoutingReceiver->getStartupHandle());
+ (*iter).routingInterface->setRoutingReady(mpRoutingReceiver->getStartupHandle());
}
- mRoutingReceiver->waitOnStartup(true);
+ mpRoutingReceiver->waitOnStartup(true);
}
void CAmRoutingSender::setRoutingRundown()
{
- mRoutingReceiver->waitOnRundown(false);
+ mpRoutingReceiver->waitOnRundown(false);
std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end();
for (; iter < iterEnd; ++iter)
{
- (*iter).routingInterface->setRoutingRundown(mRoutingReceiver->getStartupHandle());
+ (*iter).routingInterface->setRoutingRundown(mpRoutingReceiver->getStartupHandle());
}
- mRoutingReceiver->waitOnRundown(true);
+ mpRoutingReceiver->waitOnRundown(true);
}
void CAmRoutingSender::unloadLibraries(void)
@@ -550,7 +603,7 @@ am_Error_e CAmRoutingSender::getListPlugins(std::vector<std::string>& interfaces
{
interfaces.push_back(it->busName);
}
- return E_OK;
+ return (E_OK);
}
void CAmRoutingSender::getInterfaceVersion(std::string & version) const
diff --git a/AudioManagerDaemon/src/CAmSocketHandler.cpp b/AudioManagerDaemon/src/CAmSocketHandler.cpp
index 2d5c7d7..d13ea7b 100644
--- a/AudioManagerDaemon/src/CAmSocketHandler.cpp
+++ b/AudioManagerDaemon/src/CAmSocketHandler.cpp
@@ -1,24 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmDbusWrapper.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * \file CAmSocketHandler.cpp
+ * For further information see http://www.genivi.org/.
*
*/
@@ -37,7 +35,8 @@
//todo: implement time correction if timer was interrupted by call
//todo: change hitlist to a list that holds all information, because entering and removing items will be cheaper than with std::vector
-namespace am {
+namespace am
+{
CAmSocketHandler::CAmSocketHandler() :
mListPoll(), //
@@ -64,7 +63,7 @@ CAmSocketHandler::~CAmSocketHandler()
*/
void CAmSocketHandler::start_listenting()
{
- gDispatchDone=0;
+ gDispatchDone = 0;
int16_t pollStatus;
std::list<int16_t> hitList;
@@ -84,7 +83,7 @@ void CAmSocketHandler::start_listenting()
{
//first we go through the registered filedescriptors and check if someone needs preparation:
mListPoll_t::iterator prepIter = mListPoll.begin();
- CAmShPollPrepare *prep = NULL;
+ IAmShPollPrepare *prep = NULL;
for (; prepIter != mListPoll.end(); ++prepIter)
{
if ((prep = prepIter->prepareCB) != NULL)
@@ -156,7 +155,7 @@ void CAmSocketHandler::start_listenting()
std::list<int16_t>::iterator hListIt = hitList.begin();
for (; hListIt != hitList.end(); ++hListIt)
{
- CAmShPollFired* fire = NULL;
+ IAmShPollFired* fire = NULL;
if ((fire = listPoll.at(*hListIt).firedCB) != NULL)
fire->Call(mfdPollingArray.at(*hListIt), listPoll.at(*hListIt).handle, listPoll.at(*hListIt).userData);
}
@@ -165,7 +164,7 @@ void CAmSocketHandler::start_listenting()
hListIt = hitList.begin();
for (; hListIt != hitList.end(); ++hListIt)
{
- CAmShPollCheck* check = NULL;
+ IAmShPollCheck* check = NULL;
if ((check = listPoll.at(*hListIt).checkCB) != NULL)
{
if (!check->Call(listPoll.at(*hListIt).handle, listPoll.at(*hListIt).userData))
@@ -181,7 +180,7 @@ void CAmSocketHandler::start_listenting()
hListIt = hitList.begin();
for (; hListIt != hitList.end(); ++hListIt)
{
- CAmShPollDispatch *dispatch = NULL;
+ IAmShPollDispatch *dispatch = NULL;
if ((dispatch = listPoll.at(*hListIt).dispatchCB) != NULL)
{
if (!dispatch->Call(listPoll.at(*hListIt).handle, listPoll.at(*hListIt).userData))
@@ -215,15 +214,20 @@ void CAmSocketHandler::stop_listening()
/**
* Adds a filedescriptor to the polling loop
- * @param fd this is a valid filedescriptor
+ * @param fd the filedescriptor
* @param event the event flags
- * @param callback the callback that shall be called if the filedescriptor poll succeeded
+ * @param prepare a callback that is called before the loop is entered
+ * @param fired a callback that is called when the filedescriptor needs to be read
+ * @param check a callback that is called to check if further actions are neccessary
+ * @param dispatch a callback that is called to dispatch the received data
+ * @param userData a pointer to userdata that is always passed around
+ * @param handle the handle of this poll
* @return E_OK if the descriptor was added, E_NON_EXISTENT if the fd is not valid
*/
-am_Error_e CAmSocketHandler::addFDPoll(const int fd, const short event, CAmShPollPrepare *prepare, CAmShPollFired *fired, CAmShPollCheck *check, CAmShPollDispatch *dispatch, void *userData, sh_pollHandle_t & handle)
+am_Error_e CAmSocketHandler::addFDPoll(const int fd, const short event, IAmShPollPrepare *prepare, IAmShPollFired *fired, IAmShPollCheck *check, IAmShPollDispatch *dispatch, void *userData, sh_pollHandle_t & handle)
{
if (!fdIsValid(fd))
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
sh_poll_s pollData;
pollData.pollfdValue.fd = fd;
@@ -242,13 +246,13 @@ am_Error_e CAmSocketHandler::addFDPoll(const int fd, const short event, CAmShPo
mRecreatePollfds = true;
handle = pollData.handle;
- return E_OK;
+ return (E_OK);
}
/**
* removes a filedescriptor from the poll loop
- * @param fd the filedescriptor to be removed
- * @return E_OK in case of sucess, E_NON_EXISTENT or E_UNKNOWN if the fd in not registered
+ * @param handle
+ * @return
*/
am_Error_e CAmSocketHandler::removeFDPoll(const sh_pollHandle_t handle)
{
@@ -260,10 +264,10 @@ am_Error_e CAmSocketHandler::removeFDPoll(const sh_pollHandle_t handle)
{
iterator = mListPoll.erase(iterator);
mRecreatePollfds = true;
- return E_OK;
+ return (E_OK);
}
}
- return E_UNKNOWN;
+ return (E_UNKNOWN);
}
/**
@@ -271,12 +275,13 @@ am_Error_e CAmSocketHandler::removeFDPoll(const sh_pollHandle_t handle)
* This is not a high precise timer, it is very coarse. It is meant to be used for timeouts when waiting
* for an answer via a filedescriptor.
* One time timer. If you need again a timer, you need to add a new timer in the callback of the old one.
- * @param timeouts time until the callback is fired
- * @param callback the callback
- * @param handle the handle that is created for the timer is returned. Can be used to remove the timer
+ * @param timeouts timeouts time until the callback is fired
+ * @param callback callback the callback
+ * @param handle handle the handle that is created for the timer is returned. Can be used to remove the timer
+ * @param userData pointer always passed with the call
* @return E_OK in case of success
*/
-am_Error_e CAmSocketHandler::addTimer(const timespec timeouts, CAmShTimerCallBack*& callback, sh_timerHandle_t& handle, void * userData)
+am_Error_e CAmSocketHandler::addTimer(const timespec timeouts, IAmShTimerCallBack*& callback, sh_timerHandle_t& handle, void * userData)
{
assert(!((timeouts.tv_sec==0) && (timeouts.tv_nsec==0)));
assert(callback!=NULL);
@@ -298,7 +303,7 @@ am_Error_e CAmSocketHandler::addTimer(const timespec timeouts, CAmShTimerCallBac
//very important: sort the list so that the smallest value is front
mListActiveTimer.sort(compareCountdown);
mTimeout = mListActiveTimer.front().countdown;
- return E_OK;
+ return (E_OK);
}
/**
@@ -319,10 +324,10 @@ am_Error_e CAmSocketHandler::removeTimer(const sh_timerHandle_t handle)
if (it->handle == handle)
{
it = mListTimer.erase(it);
- return E_OK;
+ return (E_OK);
}
}
- return E_UNKNOWN;
+ return (E_UNKNOWN);
}
/**
@@ -354,7 +359,7 @@ am_Error_e CAmSocketHandler::restartTimer(const sh_timerHandle_t handle, const t
//very important: sort the list so that the smallest value is front
mListActiveTimer.sort(compareCountdown);
mTimeout = mListActiveTimer.front().countdown;
- return E_OK;
+ return (E_OK);
}
am_Error_e CAmSocketHandler::stopTimer(const sh_timerHandle_t handle)
@@ -375,17 +380,17 @@ am_Error_e CAmSocketHandler::stopTimer(const sh_timerHandle_t handle)
mTimeout.tv_nsec = -1;
mTimeout.tv_sec = -1;
}
- return E_OK;
+ return (E_OK);
}
}
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
/**
* updates the eventFlags of a poll
- * @param fd the filedescriptor of the poll
- * @param event the event flags
- * @return E_OK on succsess, E_NON_EXISTENT if fd was not found
+ * @param handle
+ * @param events
+ * @return @return E_OK on succsess, E_NON_EXISTENT if fd was not found
*/
am_Error_e CAmSocketHandler::updateEventFlags(const sh_pollHandle_t handle, const short events)
{
@@ -397,10 +402,10 @@ am_Error_e CAmSocketHandler::updateEventFlags(const sh_pollHandle_t handle, cons
{
iterator->pollfdValue.events = events;
mRecreatePollfds = true;
- return E_OK;
+ return (E_OK);
}
}
- return E_UNKNOWN;
+ return (E_UNKNOWN);
}
/**
@@ -460,14 +465,14 @@ void CAmSocketHandler::initTimer()
*/
inline int CAmSocketHandler::timespec2ms(const timespec & time)
{
- return (time.tv_nsec == -1 && time.tv_sec == -1) ? -1 : time.tv_sec * 1000 + time.tv_nsec / 1000000;
+ return ((time.tv_nsec == -1 && time.tv_sec == -1) ? -1 : time.tv_sec * 1000 + time.tv_nsec / 1000000);
}
inline timespec* CAmSocketHandler::insertTime(timespec& buffertime)
{
buffertime.tv_nsec = mTimeout.tv_nsec;
buffertime.tv_sec = mTimeout.tv_sec;
- return (mTimeout.tv_nsec == -1 && mTimeout.tv_sec == -1) ? NULL : &buffertime;
+ return ((mTimeout.tv_nsec == -1 && mTimeout.tv_sec == -1) ? NULL : &buffertime);
}
/**
diff --git a/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp b/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
index 92fb09d..46dccf3 100644
--- a/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
+++ b/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
@@ -1,24 +1,23 @@
/**
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
* Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmTelnetMenuHelper.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \date 24-Jan-2012
- * \author Frank Herchet (frank.fh.herchet@bmw.de)
*
- * \section License
- * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
- * Copyright (C) 2012, BMW AG Frank Herchet frank.fh.herchet@bmw.de
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
- * 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.
+ * \file CAmTelnetMenuHelper.cpp
+ * For further information see http://www.genivi.org/.
*
*/
diff --git a/AudioManagerDaemon/src/CAmTelnetServer.cpp b/AudioManagerDaemon/src/CAmTelnetServer.cpp
index 1274a8d..079e6e3 100644
--- a/AudioManagerDaemon/src/CAmTelnetServer.cpp
+++ b/AudioManagerDaemon/src/CAmTelnetServer.cpp
@@ -1,24 +1,23 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmTelnetServer.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
- * 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.
+ * \file CAmTelnetServer.cpp
+ * For further information see http://www.genivi.org/.
*
*/
@@ -37,78 +36,61 @@
#include <iterator>
#include "CAmDatabaseHandler.h"
#include "CAmRoutingSender.h"
-#include "shared/CAmDltWrapper.h"
#include "CAmTelnetMenuHelper.h"
+#include "shared/CAmDltWrapper.h"
-namespace am {
+namespace am
+{
-CAmTelnetServer* CAmTelnetServer::instance = NULL;
+CAmTelnetServer* CAmTelnetServer::mpInstance = NULL;
#define PRINT_BOOL(var) var ? output+="true\t\t" : output+="false\t\t";
-CAmTelnetServer::CAmTelnetServer(CAmSocketHandler *iSocketHandler, CAmCommandSender *iCommandSender, CAmCommandReceiver *iCommandReceiver, CAmRoutingSender *iRoutingSender, CAmRoutingReceiver *iRoutingReceiver, CAmControlSender *iControlSender, CAmControlReceiver *iControlReceiver, CAmDatabaseHandler *iDatabasehandler, CAmRouter *iRouter, unsigned int servPort, unsigned int maxConnections)
- :telnetConnectFiredCB(this,&CAmTelnetServer::connectSocket),
- telnetReceiveFiredCB(this,&CAmTelnetServer::receiveData),
- telnetDispatchCB(this,&CAmTelnetServer::dispatchData),
- telnetCheckCB(this,&CAmTelnetServer::check),
- mSocketHandler(iSocketHandler),
- mCommandSender(iCommandSender),
- mCommandReceiver(iCommandReceiver),
- mRoutingSender(iRoutingSender),
- mRoutingReceiver(iRoutingReceiver),
- mControlSender(iControlSender),
- mControlReceiver(iControlReceiver),
- mDatabasehandler(iDatabasehandler),
- mRouter(iRouter),
- mConnecthandle(),
- mMsgList(),
- mListConnections(),
- mConnectFD(NULL),
- mServerPort(servPort),
- mMaxConnections(maxConnections),
- mTelnetMenuHelper(iSocketHandler,iCommandSender,iCommandReceiver,iRoutingSender,iRoutingReceiver,iControlSender,iControlReceiver,iDatabasehandler,iRouter,this)
+CAmTelnetServer::CAmTelnetServer(CAmSocketHandler *iSocketHandler, CAmCommandSender *iCommandSender, CAmCommandReceiver *iCommandReceiver, CAmRoutingSender *iRoutingSender, CAmRoutingReceiver *iRoutingReceiver, CAmControlSender *iControlSender, CAmControlReceiver *iControlReceiver, CAmDatabaseHandler *iDatabasehandler, CAmRouter *iRouter, unsigned int servPort, unsigned int maxConnections) :
+ telnetConnectFiredCB(this, &CAmTelnetServer::connectSocket), telnetReceiveFiredCB(this, &CAmTelnetServer::receiveData), telnetDispatchCB(this, &CAmTelnetServer::dispatchData), telnetCheckCB(this, &CAmTelnetServer::check), mpSocketHandler(iSocketHandler), mpCommandSender(iCommandSender), mpCommandReceiver(iCommandReceiver), mpRoutingSender(iRoutingSender), mpRoutingReceiver(iRoutingReceiver), mpControlSender(iControlSender), mpControlReceiver(iControlReceiver), mpDatabasehandler(iDatabasehandler), mpRouter(iRouter), mConnecthandle(), mListMessages(), mListConnections(), mConnectFD(NULL), mServerPort(servPort), mMaxConnections(maxConnections), mTelnetMenuHelper(iSocketHandler, iCommandSender, iCommandReceiver, iRoutingSender, iRoutingReceiver, iControlSender, iControlReceiver,
+ iDatabasehandler, iRouter, this)
{
- assert(mSocketHandler!=NULL);
- assert(mCommandReceiver!=NULL);
- assert(mCommandSender!=NULL);
- assert(mControlSender!=NULL);
- assert(mControlReceiver!=NULL);
- assert(mRoutingSender!=NULL);
- assert(mRoutingReceiver!=NULL);
- assert(mDatabasehandler!=NULL);
- assert(mRouter!=NULL);
- assert(servPort!=0);
- assert(mMaxConnections!=0);
-
- instance = this;
- //mTelnetMenuHelper.setTelnetServer(this);
-
- int yes = 1;
- struct sockaddr_in servAddr;
+ assert(mpSocketHandler!=NULL);
+ assert(mpCommandReceiver!=NULL);
+ assert(mpCommandSender!=NULL);
+ assert(mpControlSender!=NULL);
+ assert(mpControlReceiver!=NULL);
+ assert(mpRoutingSender!=NULL);
+ assert(mpRoutingReceiver!=NULL);
+ assert(mpDatabasehandler!=NULL);
+ assert(mpRouter!=NULL);
+ assert(servPort!=0);
+ assert(mMaxConnections!=0);
+
+ mpInstance = this;
+ //mTelnetMenuHelper.setTelnetServer(this);
+
+ int yes = 1;
+ struct sockaddr_in servAddr;
//setup the port Listener
mConnectFD = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
setsockopt(mConnectFD, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int));
memset(&servAddr, 0, sizeof(servAddr));
- servAddr.sin_family = AF_INET;
+ servAddr.sin_family = AF_INET;
servAddr.sin_addr.s_addr = INADDR_ANY;
- servAddr.sin_port = htons(servPort);
+ servAddr.sin_port = htons(servPort);
bind(mConnectFD, (struct sockaddr *) &servAddr, sizeof(servAddr));
- if (listen(mConnectFD,mMaxConnections) < 0)
+ if (listen(mConnectFD, mMaxConnections) < 0)
{
- logError("TelnetServer::TelnetServerk cannot listen ",errno);
+ logError("TelnetServer::TelnetServerk cannot listen ", errno);
}
else
logInfo("TelnetServer::TelnetServer started listening on port", mServerPort);
- int a=1;
- ioctl (mConnectFD, FIONBIO, (char *) &a);
- setsockopt (mConnectFD, SOL_SOCKET, SO_KEEPALIVE, (char *) &a, sizeof (a));
+ int a = 1;
+ ioctl(mConnectFD, FIONBIO, (char *) &a);
+ setsockopt(mConnectFD, SOL_SOCKET, SO_KEEPALIVE, (char *) &a, sizeof(a));
short events = 0;
events |= POLLIN;
- mSocketHandler->addFDPoll(mConnectFD, events, NULL, &telnetConnectFiredCB, NULL, NULL, NULL, mConnecthandle);
+ mpSocketHandler->addFDPoll(mConnectFD, events, NULL, &telnetConnectFiredCB, NULL, NULL, NULL, mConnecthandle);
}
CAmTelnetServer::~CAmTelnetServer()
@@ -119,112 +101,95 @@ void CAmTelnetServer::connectSocket(const pollfd pfd, const sh_pollHandle_t hand
{
(void) handle;
(void) userData;
- //first, accept the connection, create a new filedescriptor
- struct sockaddr answer;
- socklen_t len=sizeof(answer);
- connection_s connection;
- connection.handle = 0;
- connection.filedescriptor = accept(pfd.fd, (struct sockaddr*)&answer, &len);
-
- // Notiy menuhelper
- mTelnetMenuHelper.newSocketConnection(connection.filedescriptor);
-
- //set the correct event:
- short event = 0;
- event |=POLLIN;
-
- //aded the filedescriptor to the sockethandler and register the callbacks for receiving the data
- mSocketHandler->addFDPoll(connection.filedescriptor,event,NULL,&telnetReceiveFiredCB,&telnetCheckCB,&telnetDispatchCB,NULL,connection.handle);
- mListConnections.push_back(connection);
+ //first, accept the connection, create a new filedescriptor
+ struct sockaddr answer;
+ socklen_t len = sizeof(answer);
+ connection_s connection;
+ connection.handle = 0;
+ connection.filedescriptor = accept(pfd.fd, (struct sockaddr*) &answer, &len);
+
+ // Notiy menuhelper
+ mTelnetMenuHelper.newSocketConnection(connection.filedescriptor);
+
+ //set the correct event:
+ short event = 0;
+ event |= POLLIN;
+
+ //aded the filedescriptor to the sockethandler and register the callbacks for receiving the data
+ mpSocketHandler->addFDPoll(connection.filedescriptor, event, NULL, &telnetReceiveFiredCB, &telnetCheckCB, &telnetDispatchCB, NULL, connection.handle);
+ mListConnections.push_back(connection);
}
void CAmTelnetServer::disconnectClient(int filedescriptor)
{
- std::vector<connection_s>::iterator iter = mListConnections.begin();
- while(iter != mListConnections.end())
- {
- if( filedescriptor == iter->filedescriptor )
- {
- if( E_OK == mSocketHandler->removeFDPoll(iter->handle))
- {
- mListConnections.erase(iter);
- close(filedescriptor);
- }
- else
- {
- // TODO: Handle error
- }
-
- break;
- }
- iter++;
- }
+ std::vector<connection_s>::iterator iter = mListConnections.begin();
+ while (iter != mListConnections.end())
+ {
+ if (filedescriptor == iter->filedescriptor)
+ {
+ if (E_OK == mpSocketHandler->removeFDPoll(iter->handle))
+ {
+ mListConnections.erase(iter);
+ close(filedescriptor);
+ }
+ else
+ {
+ // TODO: Handle error
+ }
+
+ break;
+ }
+ iter++;
+ }
}
void CAmTelnetServer::receiveData(const pollfd pollfd, const sh_pollHandle_t handle, void *userData)
{
(void) handle;
(void) userData;
- //initialize buffer
- char buffer[100];
- //read until buffer is full or no more data is there
- int read=recv(pollfd.fd,buffer,100,NULL);
- if (read>1)
- {
- //read the message and store it in a queue - its a telnet connection so data will be sent on enter !
- std::string msg=std::string(buffer,read);
- mMsgList.push(msg);
- }
+ //initialize buffer
+ char buffer[100];
+ //read until buffer is full or no more data is there
+ int read = recv(pollfd.fd, buffer, 100, NULL);
+ if (read > 1)
+ {
+ //read the message and store it in a queue - its a telnet connection so data will be sent on enter !
+ std::string msg = std::string(buffer, read);
+ mListMessages.push(msg);
+ }
}
bool CAmTelnetServer::dispatchData(const sh_pollHandle_t handle, void *userData)
{
(void) userData;
- std::vector<connection_s>::iterator iterator=mListConnections.begin();
- for(;iterator!=mListConnections.end();++iterator)
- {
- if(iterator->handle==handle) break;
- }
- //if (iterator==mListConnections.end()) return false;
-
- std::string command;
- std::queue<std::string> MsgQueue;
- if(!mMsgList.empty())
- {
- sliceCommand(mMsgList.front(),command,MsgQueue);
- mMsgList.pop();
- }
-
- mTelnetMenuHelper.enterCmdQueue(MsgQueue,iterator->filedescriptor);
+ std::vector<connection_s>::iterator iterator = mListConnections.begin();
+ for (; iterator != mListConnections.end(); ++iterator)
+ {
+ if (iterator->handle == handle)
+ break;
+ }
- // must return false to stop endless polling
- return false;
+ std::string command;
+ std::queue<std::string> MsgQueue;
+ if (!mListMessages.empty())
+ {
+ sliceCommand(mListMessages.front(), command, MsgQueue);
+ mListMessages.pop();
+ }
- /*
- mMsgList.pop();
- mMapCommand_t::iterator commandIter=mMapCommands.find(command);
- if (commandIter==mMapCommands.end())
- {
- send(iterator->filedescriptor,"Command not found!\n",20,0);
- }
- else
- {
- commandIter->second(msg,iterator->filedescriptor);
- //(*commandIter).second(msg,iterator->filedescriptor);
- }
+ mTelnetMenuHelper.enterCmdQueue(MsgQueue, iterator->filedescriptor);
- //remove the message from the queue and return false if there is no more message to read.
- if (mMsgList.size()!=0) return true;
- return false;
- */
+ // must return false to stop endless polling
+ return (false);
}
bool CAmTelnetServer::check(const sh_pollHandle_t handle, void *userData)
{
- (void)handle;
- (void)userData;
- if (mMsgList.size() != 0) return true;
- return false;
+ (void) handle;
+ (void) userData;
+ if (mListMessages.size() != 0)
+ return (true);
+ return (false);
}
void am::CAmTelnetServer::sliceCommand(const std::string & string, std::string & command, std::queue<std::string> & MsgQueue)
@@ -238,25 +203,18 @@ void am::CAmTelnetServer::sliceCommand(const std::string & string, std::string &
int c = 0;
- while(!endOfStream)
+ while (!endOfStream)
{
- cmd = *begin;
- MsgQueue.push(cmd);
- begin++;
-
- if(begin == end )
- {
- endOfStream = true;
- }
- c++;
+ cmd = *begin;
+ MsgQueue.push(cmd);
+ begin++;
+
+ if (begin == end)
+ {
+ endOfStream = true;
+ }
+ c++;
}
-
-
- /*
- command = *begin++;
- msg = std::vector<std::string>(begin, end);
- */
}
}
-
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index 4e95baa..9c5820d 100644
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -1,29 +1,24 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file main.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
+ *
+ * \file main.cpp
+ * For further information see http://www.genivi.org/.
*
- */
-
-/**
- * Please make sure to have read the documentation on genivi.org!
*/
//todo: create systemd compatibility
@@ -33,24 +28,15 @@
//todo: clean up startup sequences controller, command and routing interfaces----
//todo: package generation only works if package directory exists...
-#include <config.h>
+#include "config.h"
+
#ifdef WITH_TELNET
#include "CAmTelnetServer.h"
#endif
#ifdef WITH_DBUS_WRAPPER
#include <shared/CAmDbusWrapper.h>
#endif
-#include <shared/CAmSocketHandler.h>
-#include "CAmDatabaseHandler.h"
-#include "CAmControlSender.h"
-#include "CAmCommandSender.h"
-#include "CAmRoutingSender.h"
-#include "CAmRoutingReceiver.h"
-#include "CAmCommandReceiver.h"
-#include "CAmControlReceiver.h"
-#include "CAmDatabaseObserver.h"
-#include "CAmRouter.h"
-#include "shared/CAmDltWrapper.h"
+
#include <sys/resource.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -62,6 +48,18 @@
#include <cstring>
#include <cstdio>
#include <new>
+#include "CAmRouter.h"
+#include "CAmDatabaseHandler.h"
+#include "CAmControlSender.h"
+#include "CAmCommandSender.h"
+#include "CAmRoutingSender.h"
+#include "CAmRoutingReceiver.h"
+#include "CAmCommandReceiver.h"
+#include "CAmControlReceiver.h"
+#include "CAmDatabaseObserver.h"
+#include "shared/CAmDltWrapper.h"
+#include "shared/CAmSocketHandler.h"
+
DLT_DECLARE_CONTEXT(AudioManager)
@@ -94,6 +92,9 @@ unsigned int maxConnections = MAX_TELNETCONNECTIONS;
int fd0, fd1, fd2;
bool enableNoDLTDebug = false;
+/**
+ * the out of memory handler
+ */
void OutOfMemoryHandler()
{
logError("No more memory - bye");
@@ -101,6 +102,9 @@ void OutOfMemoryHandler()
exit(1);
}
+/**
+ * daemonizes the AudioManager
+ */
void daemonize()
{
umask(0);
@@ -149,6 +153,11 @@ void daemonize()
}
}
+/**
+ * parses the command line
+ * @param argc
+ * @param argv
+ */
void parseCommandLine(int argc, char **argv)
{
while (optind < argc)
@@ -211,7 +220,7 @@ void parseCommandLine(int argc, char **argv)
exit(-1);
break;
#ifndef WITH_DLT
- case 'V':
+ case 'V':
printf("[DLT] debug output to stdout enabled\n");
enableNoDLTDebug = true;
break;
@@ -225,6 +234,12 @@ void parseCommandLine(int argc, char **argv)
}
}
+/**
+ * the signal handler
+ * @param sig
+ * @param siginfo
+ * @param context
+ */
static void signalHandler(int sig, siginfo_t *siginfo, void *context)
{
(void) sig;
@@ -236,6 +251,12 @@ static void signalHandler(int sig, siginfo_t *siginfo, void *context)
exit(1);
}
+/**
+ * main
+ * @param argc
+ * @param argv
+ * @return
+ */
int main(int argc, char *argv[])
{
listCommandPluginDirs.push_back(std::string(DEFAULT_PLUGIN_COMMAND_DIR));
@@ -271,7 +292,6 @@ int main(int argc, char *argv[])
//Instantiate all classes. Keep in same order !
CAmSocketHandler iSocketHandler;
-
#ifdef WITH_DBUS_WRAPPER
CAmDbusWrapper iDBusWrapper(&iSocketHandler);
#endif /*WITH_DBUS_WRAPPER */
@@ -299,7 +319,6 @@ int main(int argc, char *argv[])
CAmDatabaseObserver iObserver(&iCommandSender,&iRoutingSender, &iSocketHandler);
#endif
-
iDatabaseHandler.registerObserver(&iObserver);
//startup all the Plugins and Interfaces
diff --git a/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp b/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp
index 6e9ead1..e1fdb5e 100644
--- a/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp
@@ -1,26 +1,24 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file controlInterfaceTest.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
*/
+
#include "CAmControlInterfaceTest.h"
#include <algorithm>
#include <string>
diff --git a/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.h b/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.h
index a39e9ed..22a09de 100644
--- a/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.h
+++ b/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.h
@@ -1,24 +1,21 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file controlInterfaceTest.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
*/
diff --git a/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt b/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt
index 54f7c35..fa5ad7c 100644
--- a/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt
@@ -1,24 +1,19 @@
+# Copyright (C) 2012, GENIVI Alliance, Inc.
+# Copyright (C) 2012, BMW AG
#
-# Copyright (C) 2011, BMW AG
+# This file is part of GENIVI Project AudioManager.
+#
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+#
+# copyright
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
#
-# GeniviAudioMananger AmControlInterfaceTest
-#
-# \file CMakeLists.txt
-#
-# \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.
+# For further information see http://www.genivi.org/.
#
cmake_minimum_required(VERSION 2.6)
diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
index a5948ed..89cd9a9 100644
--- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
+++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file databasetest.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#include "CAmDatabaseHandlerTest.h"
diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.h b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.h
index a66af97..384ad58 100644
--- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.h
+++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.h
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file databasetest.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#ifndef DATABASETEST_H_
diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
index da326da..6469e87 100644
--- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
@@ -1,24 +1,19 @@
+# Copyright (C) 2012, GENIVI Alliance, Inc.
+# Copyright (C) 2012, BMW AG
#
-# Copyright (C) 2011, BMW AG
+# This file is part of GENIVI Project AudioManager.
+#
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+#
+# copyright
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
#
-# GeniviAudioMananger AmDatabaseHandlerTest
-#
-# \file CMakeLists.txt
-#
-# \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.
+# For further information see http://www.genivi.org/.
#
cmake_minimum_required(VERSION 2.6)
diff --git a/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.cpp b/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.cpp
index 27ad546..9fc4bd4 100644
--- a/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.cpp
+++ b/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.cpp
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file databasetest.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#include "CAmRouterTest.h"
diff --git a/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.h b/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.h
index 53788be..70feb26 100644
--- a/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.h
+++ b/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.h
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file databasetest.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#ifndef DATABASETEST_H_
diff --git a/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
index 3c06729..117edd1 100644
--- a/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
@@ -1,24 +1,19 @@
+# Copyright (C) 2012, GENIVI Alliance, Inc.
+# Copyright (C) 2012, BMW AG
#
-# Copyright (C) 2011, BMW AG
+# This file is part of GENIVI Project AudioManager.
+#
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+#
+# copyright
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
#
-# GeniviAudioMananger DatbaseTest
-#
-# \file CMakeLists.txt
-#
-# \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.
+# For further information see http://www.genivi.org/.
#
cmake_minimum_required(VERSION 2.6)
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
index 3e8cd21..7c06f15 100644
--- a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file routingInterfaces.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#include "CAmRoutingInterfaceTest.h"
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h
index a66599d..5aef70e 100644
--- a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file routingInterfaces.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#ifndef ROUTINGINTERFACETEST_H_
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
index ac87e8d..1634bdf 100644
--- a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
@@ -1,24 +1,19 @@
+# Copyright (C) 2012, GENIVI Alliance, Inc.
+# Copyright (C) 2012, BMW AG
#
-# Copyright (C) 2011, BMW AG
+# This file is part of GENIVI Project AudioManager.
+#
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+#
+# copyright
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
#
-# GeniviAudioMananger AmRoutingInterfaceTest
-#
-# \file CMakeLists.txt
-#
-# \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.
+# For further information see http://www.genivi.org/.
#
cmake_minimum_required(VERSION 2.6)
diff --git a/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp b/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp
index b0b5639..5fb65ae 100644
--- a/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp
+++ b/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file sockethandlerTest.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#include "CAmSocketHandlerTest.h"
@@ -73,7 +69,7 @@ void am::CAmTimerCb::timer1Callback(sh_timerHandle_t handle, void* userData)
timespec timeout;
timeout.tv_nsec = 0;
timeout.tv_sec = 1;
- CAmShTimerCallBack *buf = &pTimer1Callback;
+ IAmShTimerCallBack *buf = &pTimer1Callback;
sh_timerHandle_t handle_;
mSocketHandler->addTimer(timeout, buf, handle_, NULL);
}
@@ -86,7 +82,7 @@ void am::CAmTimerCb::timer2Callback(sh_timerHandle_t handle, void* userData)
timespec timeout;
timeout.tv_nsec = 0;
timeout.tv_sec = 1;
- CAmShTimerCallBack *buf = &pTimer2Callback;
+ IAmShTimerCallBack *buf = &pTimer2Callback;
sh_timerHandle_t handle_;
mSocketHandler->addTimer(timeout, buf, handle_, NULL);
}
@@ -218,10 +214,10 @@ TEST(CAmSocketHandlerTest,playWithTimers)
timeout3.tv_sec = 2;
timeout4.tv_nsec = 0;
timeout4.tv_sec = 13;
- CAmShTimerCallBack* buf = &testCallback.pTimer1Callback;
- CAmShTimerCallBack* buf2 = &testCallback.pTimer2Callback;
- CAmShTimerCallBack* buf3 = &testCallback.pTimer3Callback;
- CAmShTimerCallBack* buf4 = &testCallback.pTimer4Callback;
+ IAmShTimerCallBack* buf = &testCallback.pTimer1Callback;
+ IAmShTimerCallBack* buf2 = &testCallback.pTimer2Callback;
+ IAmShTimerCallBack* buf3 = &testCallback.pTimer3Callback;
+ IAmShTimerCallBack* buf4 = &testCallback.pTimer4Callback;
sh_timerHandle_t handle;
myHandler.addTimer(timeoutTime, buf, handle, NULL);
myHandler.addTimer(timeout2, buf2, handle, NULL);
diff --git a/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.h b/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.h
index f45376e..fad6aa0 100644
--- a/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.h
+++ b/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.h
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file sockethandlerTest.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#ifndef SOCKETHANDLERTEST_H_
diff --git a/AudioManagerDaemon/test/AmSocketHandlerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmSocketHandlerTest/CMakeLists.txt
index 692b903..a13883c 100644
--- a/AudioManagerDaemon/test/AmSocketHandlerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmSocketHandlerTest/CMakeLists.txt
@@ -1,24 +1,19 @@
+# Copyright (C) 2012, GENIVI Alliance, Inc.
+# Copyright (C) 2012, BMW AG
#
-# Copyright (C) 2011, BMW AG
+# This file is part of GENIVI Project AudioManager.
+#
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+#
+# copyright
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
#
-# GeniviAudioMananger ControlInterfaceTest
-#
-# \file CMakeLists.txt
-#
-# \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.
+# For further information see http://www.genivi.org/.
#
cmake_minimum_required(VERSION 2.6)
diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp
index 2219834..ba9e11b 100644
--- a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp
+++ b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp
@@ -1,18 +1,35 @@
-/*
- * CAmTelnetServerTest.cpp
+/**
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
+ *
+ * This file is part of GENIVI Project AudioManager.
+ *
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ *
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * Created on: Feb 7, 2012
- * Author: demo
*/
-#include <sys/socket.h> /* for socket(), connect(), (), and recv() */
-#include <arpa/inet.h> /* for sockaddr_in and inet_addr() */
-#include <netdb.h> /* for struct hostent */
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <string>
#include "CAmTelnetServerTest.h"
#include "CAmCommandReceiver.h"
#include "CAmRoutingReceiver.h"
#include "CAmControlReceiver.h"
+#include "config.h"
using namespace testing;
diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h
index 7a87e68..d0d8216 100644
--- a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h
+++ b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h
@@ -1,8 +1,23 @@
-/*
- * CAmTelnetServerTest.h
+/**
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
+ *
+ * This file is part of GENIVI Project AudioManager.
+ *
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ *
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * Created on: Feb 7, 2012
- * Author: Frank Herchet
*/
#ifndef CAMTELNETSERVERTEST_H_
diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
index c70ec2d..dfa8952 100644
--- a/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
@@ -1,24 +1,19 @@
+# Copyright (C) 2012, GENIVI Alliance, Inc.
+# Copyright (C) 2012, BMW AG
#
-# Copyright (C) 2011, BMW AG
+# This file is part of GENIVI Project AudioManager.
+#
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+#
+# copyright
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
#
-# GeniviAudioMananger ControlInterfaceTest
-#
-# \file CMakeLists.txt
-#
-# \date 13-Feb-2012
-# \author Frank Herchet (frank.fh.herchet@bmw.de)
-#
-# \section License
-# GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-# Copyright (C) 2012, BMW AG Frank Herchet frank.fh.herchet@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.
+# For further information see http://www.genivi.org/.
#
cmake_minimum_required(VERSION 2.6)
diff --git a/AudioManagerDaemon/test/CAmCommonFunctions.cpp b/AudioManagerDaemon/test/CAmCommonFunctions.cpp
index 5136e59..5877a2b 100644
--- a/AudioManagerDaemon/test/CAmCommonFunctions.cpp
+++ b/AudioManagerDaemon/test/CAmCommonFunctions.cpp
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmCommonFunctions.cpp
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#include "CAmCommonFunctions.h"
diff --git a/AudioManagerDaemon/test/CAmCommonFunctions.h b/AudioManagerDaemon/test/CAmCommonFunctions.h
index 9d6b5e6..ec6c768 100644
--- a/AudioManagerDaemon/test/CAmCommonFunctions.h
+++ b/AudioManagerDaemon/test/CAmCommonFunctions.h
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file CAmCommonFunctions.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#ifndef COMMONHEADERS_H_
diff --git a/AudioManagerDaemon/test/CMakeLists.txt b/AudioManagerDaemon/test/CMakeLists.txt
index 97600a9..d3ba552 100644
--- a/AudioManagerDaemon/test/CMakeLists.txt
+++ b/AudioManagerDaemon/test/CMakeLists.txt
@@ -1,24 +1,19 @@
-#GENIVI AUDIOMANAGER
+# Copyright (C) 2012, GENIVI Alliance, Inc.
+# Copyright (C) 2012, BMW AG
#
-#Copyright (C) 2011, BMW AG
+# This file is part of GENIVI Project AudioManager.
+#
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+#
+# copyright
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
#
-#Datum 20.2.2012
-#author Christian Mueller (christian.ei.mueller@bmw.de)
-#
-#***********************************************************************************************************
-#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.
+# For further information see http://www.genivi.org/.
#
cmake_minimum_required(VERSION 2.6)
diff --git a/AudioManagerDaemon/test/IAmCommandBackdoor.h b/AudioManagerDaemon/test/IAmCommandBackdoor.h
index 650d3e1..051b2ae 100644
--- a/AudioManagerDaemon/test/IAmCommandBackdoor.h
+++ b/AudioManagerDaemon/test/IAmCommandBackdoor.h
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file IAmCommandBackdoor
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#ifndef COMMANDINTERFACEBACKDOOR_H_
diff --git a/AudioManagerDaemon/test/IAmControlBackdoor.h b/AudioManagerDaemon/test/IAmControlBackdoor.h
index 90a2c67..4f77ad6 100644
--- a/AudioManagerDaemon/test/IAmControlBackdoor.h
+++ b/AudioManagerDaemon/test/IAmControlBackdoor.h
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file IAmControlBackdoor.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#ifndef CONTROLINTERFACEBACKDOOR_H_
diff --git a/AudioManagerDaemon/test/IAmRoutingBackdoor.h b/AudioManagerDaemon/test/IAmRoutingBackdoor.h
index 9ffff54..a30102f 100644
--- a/AudioManagerDaemon/test/IAmRoutingBackdoor.h
+++ b/AudioManagerDaemon/test/IAmRoutingBackdoor.h
@@ -1,26 +1,22 @@
/**
- * Copyright (C) 2011, BMW AG
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
*
- * GeniviAudioMananger AudioManagerDaemon
+ * This file is part of GENIVI Project AudioManager.
*
- * \file IAmRoutingBackdoor.h
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
*
- * \date 20-Oct-2011 3:42:04 PM
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \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.
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
#ifndef ROUTINGINTERFACEBACKDOOR_H_
diff --git a/AudioManagerDaemon/test/MockIAmCommandSend.h b/AudioManagerDaemon/test/MockIAmCommandSend.h
index 1833511..1efd20a 100644
--- a/AudioManagerDaemon/test/MockIAmCommandSend.h
+++ b/AudioManagerDaemon/test/MockIAmCommandSend.h
@@ -1,27 +1,23 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file MockInterfaces.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.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
+ *
+ * This file is part of GENIVI Project AudioManager.
+ *
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ *
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
+ *
+ */
#ifndef MOCKCOMMANDINTERFACE_H_
#define MOCKCOMMANDINTERFACE_H_
diff --git a/AudioManagerDaemon/test/MockIAmControlSend.h b/AudioManagerDaemon/test/MockIAmControlSend.h
index dc45fab..382e475 100644
--- a/AudioManagerDaemon/test/MockIAmControlSend.h
+++ b/AudioManagerDaemon/test/MockIAmControlSend.h
@@ -1,27 +1,23 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file MockInterfaces.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.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
+ *
+ * This file is part of GENIVI Project AudioManager.
+ *
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ *
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
+ *
+ */
#ifndef MOCKCONTROLINTERFACE_H_
#define MOCKCONTROLINTERFACE_H_
diff --git a/AudioManagerDaemon/test/MockIAmRoutingSend.h b/AudioManagerDaemon/test/MockIAmRoutingSend.h
index 4e6c6cb..44b9195 100644
--- a/AudioManagerDaemon/test/MockIAmRoutingSend.h
+++ b/AudioManagerDaemon/test/MockIAmRoutingSend.h
@@ -1,27 +1,23 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file MockInterfaces.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.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
+ * Copyright (C) 2012, GENIVI Alliance, Inc.
+ * Copyright (C) 2012, BMW AG
+ *
+ * This file is part of GENIVI Project AudioManager.
+ *
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ *
+ * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ *
+ * For further information see http://www.genivi.org/.
+ *
+ */
#ifndef MOCKROUTINGINTERFACE_H_
#define MOCKROUTINGINTERFACE_H_