diff options
author | christian mueller <christian.ei.mueller@bmw.de> | 2012-02-09 12:38:18 +0100 |
---|---|---|
committer | christian mueller <christian.ei.mueller@bmw.de> | 2012-02-09 12:38:18 +0100 |
commit | 84b90467e8e9dcaafaf75738f4bf9840365424b9 (patch) | |
tree | 7e79c272a8de465df63f742f0e894c462d0e61ae | |
parent | 8d3ad577f57e0a45ef9c0e2f1ce99957445f0eb8 (diff) | |
download | audiomanager-84b90467e8e9dcaafaf75738f4bf9840365424b9.tar.gz |
* adoption of RoutinInterfaceAsync to testHMI
* adoption of projekttypes.h to HMI
* comment out wrapper dlt messages because too much pollution
-rw-r--r-- | AudioManagerDaemon/src/DBusWrapper.cpp | 6 | ||||
-rw-r--r-- | CHANGELOG | 12 | ||||
-rw-r--r-- | PluginControlInterface/include/ControlSender.h | 29 | ||||
-rw-r--r-- | PluginControlInterface/src/ControlSender.cpp | 53 | ||||
-rw-r--r-- | PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp | 12 | ||||
-rw-r--r-- | includes/config.h | 2 | ||||
-rw-r--r-- | includes/projecttypes.h | 7 |
7 files changed, 91 insertions, 30 deletions
diff --git a/AudioManagerDaemon/src/DBusWrapper.cpp b/AudioManagerDaemon/src/DBusWrapper.cpp index 830dd39..ac073a5 100644 --- a/AudioManagerDaemon/src/DBusWrapper.cpp +++ b/AudioManagerDaemon/src/DBusWrapper.cpp @@ -404,7 +404,7 @@ bool am::DBusWrapper::dbusDispatchCallback(const sh_pollHandle_t handle, void *u if (dbus_connection_dispatch(mDbusConnection) == DBUS_DISPATCH_COMPLETE) returnVal = false; dbus_connection_unref(mDbusConnection); - logInfo("DBusWrapper::dbusDispatchCallback was called"); +// logInfo("DBusWrapper::dbusDispatchCallback was called"); return returnVal; } @@ -417,7 +417,7 @@ bool am::DBusWrapper::dbusCheckCallback(const sh_pollHandle_t handle, void *user if (dbus_connection_get_dispatch_status(mDbusConnection) == DBUS_DISPATCH_DATA_REMAINS) returnVal = true; dbus_connection_unref(mDbusConnection); - logInfo("DBusWrapper::dbusCheckCallback was called"); +// logInfo("DBusWrapper::dbusCheckCallback was called"); return returnVal; } @@ -442,7 +442,7 @@ void am::DBusWrapper::dbusFireCallback(const pollfd pollfd, const sh_pollHandle_ dbus_connection_ref(mDbusConnection); dbus_watch_handle(watch, flags); dbus_connection_unref(mDbusConnection); - logInfo("DBusWrapper::dbusFireCallback was called"); +// logInfo("DBusWrapper::dbusFireCallback was called"); } void DBusWrapper::toggleTimeoutDelegate(DBusTimeout *timeout, void* userData) @@ -1,3 +1,15 @@ +commit 8d3ad577f57e0a45ef9c0e2f1ce99957445f0eb8 +Author: christian mueller <christian.ei.mueller@bmw.de> + + * more changes regarding test controller. Now a very basic connect is supported + +commit e924eb3ec4717647d61e9ec4d5cc74f81ea749b9 +Author: christian mueller <christian.ei.mueller@bmw.de> + + * changed main to register observer (thanks TGO) + * changed command DBUSplugin to register Connection at 2nd DBUSMessageHandler Instance (thanks TGO) + * Expanded dummyController functionality + commit 9f9f6fc7d283c60166431c5175b6bbaa53a23c9c Author: christian mueller <christian.ei.mueller@bmw.de> diff --git a/PluginControlInterface/include/ControlSender.h b/PluginControlInterface/include/ControlSender.h index 834c432..d21856b 100644 --- a/PluginControlInterface/include/ControlSender.h +++ b/PluginControlInterface/include/ControlSender.h @@ -82,13 +82,34 @@ public: private: ControlReceiveInterface * mControlReceiveInterface; - struct handleStack + struct handleStatus { - bool ok; + bool status; am_Handle_s handle; }; - std::list<handleStack> mListOpenHandles; - am_mainConnectionID_t mCurrentID; + + struct mainConnectionSet + { + am_mainConnectionID_t connectionID; + std::vector<handleStatus> listHandleStaus; + }; + + class findHandle + { + am_Handle_s mHandle; + public: + explicit findHandle(am_Handle_s handle) : + mHandle(handle) + { + } + bool operator()(handleStatus* handle) const + { + return (handle->handle.handle == mHandle.handle); + } + }; + + std::vector<mainConnectionSet> mListOpenConnections; + ; }; #endif /* CONTROLSENDER_H_ */ diff --git a/PluginControlInterface/src/ControlSender.cpp b/PluginControlInterface/src/ControlSender.cpp index be750fe..c65059d 100644 --- a/PluginControlInterface/src/ControlSender.cpp +++ b/PluginControlInterface/src/ControlSender.cpp @@ -40,7 +40,8 @@ extern "C" void destroyControlPluginInterface(ControlSendInterface* controlSendI } ControlSenderPlugin::ControlSenderPlugin() : - mControlReceiveInterface(NULL) + mControlReceiveInterface(NULL), + mListOpenConnections() { } @@ -76,15 +77,17 @@ am_Error_e ControlSenderPlugin::hookUserConnectionRequest(const am_sourceID_t so mControlReceiveInterface->getRoute(true, sourceID, sinkID, listRoutes); if (listRoutes.empty()) return E_NOT_POSSIBLE; + + std::vector<handleStatus> listHandleStaus; std::vector<am_RoutingElement_s>::iterator it(listRoutes[0].route.begin()); for (; it != listRoutes[0].route.end(); ++it) { mControlReceiveInterface->connect(handle, connectionID, it->connectionFormat, it->sourceID, it->sinkID); //this is primitive and works only for one connect at a time... otherwise the handles get mixed up! - handleStack stack; - stack.handle=handle; - stack.ok=false; - mListOpenHandles.push_back(stack); + handleStatus status; + status.handle=handle; + status.status=false; + listHandleStaus.push_back(status); } am_MainConnection_s mainConnectionData; mainConnectionData.connectionID=0; @@ -92,7 +95,10 @@ am_Error_e ControlSenderPlugin::hookUserConnectionRequest(const am_sourceID_t so mainConnectionData.delay=0; mainConnectionData.route=listRoutes[0]; mControlReceiveInterface->enterMainConnectionDB(mainConnectionData,mainConnectionID); - mCurrentID=mainConnectionID; + mainConnectionSet set; + set.connectionID=mainConnectionID; + set.listHandleStaus=listHandleStaus; + mListOpenConnections.push_back(set); return E_OK; } @@ -268,20 +274,27 @@ void ControlSenderPlugin::cbAckConnect(const am_Handle_s handle, const am_Error_ //here is no error check !!!! //\todo: add error check here //\todo: algorith can be much better written here - bool allOk = true; - std::list<handleStack>::iterator it(mListOpenHandles.begin()); - - for (; it != mListOpenHandles.end(); ++it) - { - if (it->handle.handle == handle.handle) - it->ok = true; - allOk = allOk && it->ok; - } - - if (allOk) - { - mControlReceiveInterface->changeMainConnectionStateDB(mCurrentID,CS_CONNECTED); - } + std::vector<mainConnectionSet>::iterator it(mListOpenConnections.begin()); +// for(;it!=mListOpenConnections.end();++it) +// { +// std::vector<handleStatus>::iterator hit; +// hit=std::find_if(it->listHandleStaus.begin(),it->listHandleStaus.end(),findHandle); +// } +// +// bool allOk = true; +// std::list<handleStack>::iterator it(mListOpenHandles.begin()); +// +// for (; it != mListOpenHandles.end(); ++it) +// { +// if (it->handle.handle == handle.handle) +// it->ok = true; +// allOk = allOk && it->ok; +// } +// +// if (allOk) +// { +// mControlReceiveInterface->changeMainConnectionStateDB(mCurrentID,CS_CONNECTED); +// } } void ControlSenderPlugin::cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID) diff --git a/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp b/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp index 7594260..0b0b027 100644 --- a/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp +++ b/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp @@ -765,6 +765,16 @@ std::vector<am_Sink_s> AsyncRoutingSender::createSinkTable() am_SoundProperty_s sp; sp.type = SP_BASS; sp.value = 0; + + std::vector<am_MainSoundProperty_s> listMainSoundProperties; + am_MainSoundProperty_s msp; + msp.type=MSP_BASS; + msp.value=5; + listMainSoundProperties.push_back(msp); + msp.type=MSP_MID; + listMainSoundProperties.push_back(msp); + msp.type=MSP_TREBLE; + listMainSoundProperties.push_back(msp); for (int16_t i = 0; i <= 10; i++) { std::stringstream temp; @@ -777,9 +787,11 @@ std::vector<am_Sink_s> AsyncRoutingSender::createSinkTable() item.available.availability = A_AVAILABLE; item.available.availabilityReason = AR_UNKNOWN; item.listSoundProperties.push_back(sp); + item.listMainSoundProperties=listMainSoundProperties; item.visible = true; item.listConnectionFormats.push_back(CF_ANALOG); item.muteState=MS_MUTED; + item.mainVolume=0; table.push_back(item); } return (table); diff --git a/includes/config.h b/includes/config.h index 9268d98..67879cc 100644 --- a/includes/config.h +++ b/includes/config.h @@ -1,7 +1,7 @@ #ifndef _CONFIG_H #define _CONFIG_H -#define DAEMONVERSION "ver-0.0.9-5-g9f9f6fc" +#define DAEMONVERSION "ver-0.0.9-7-g8d3ad57" #define WITH_DBUS_WRAPPER #define WITH_SOCKETHANDLER_LOOP diff --git a/includes/projecttypes.h b/includes/projecttypes.h index 8ad8bfa..2f84f4c 100644 --- a/includes/projecttypes.h +++ b/includes/projecttypes.h @@ -129,8 +129,11 @@ namespace am { * gives the navigation offset in percent */ MSP_NAVIGATION_OFFSET = 0, - MSP_TEST = 1, - MSP_MAX = 2, + MSP_TEST = 1,
+ MSP_BASS = 2,
+ MSP_TREBLE = 3,
+ MSP_MID = 4, + MSP_MAX = 5, MSP_MIN = MSP_NAVIGATION_OFFSET }; |