diff options
-rw-r--r-- | AudioManagerDaemon/src/CAmCommandSender.cpp | 32 | ||||
-rw-r--r-- | AudioManagerDaemon/src/CAmRoutingSender.cpp | 29 |
2 files changed, 52 insertions, 9 deletions
diff --git a/AudioManagerDaemon/src/CAmCommandSender.cpp b/AudioManagerDaemon/src/CAmCommandSender.cpp index fc71ce5..2199a42 100644 --- a/AudioManagerDaemon/src/CAmCommandSender.cpp +++ b/AudioManagerDaemon/src/CAmCommandSender.cpp @@ -32,7 +32,6 @@ namespace am #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 */ @@ -241,25 +240,48 @@ void CAmCommandSender::cbRemovedSource(const am_sourceID_t source) void CAmCommandSender::setCommandReady() { mCommandReceiver->waitOnStartup(false); + + //create a list of handles + std::vector<uint16_t> listStartupHandles; + for (size_t i = 0; i <= mListInterfaces.size(); i++) + { + listStartupHandles.push_back(mCommandReceiver->getStartupHandle()); + } + + //set the receiver ready to wait for replies + mCommandReceiver->waitOnStartup(true); + + //now do the calls std::vector<IAmCommandSend*>::iterator iter = mListInterfaces.begin(); std::vector<IAmCommandSend*>::iterator iterEnd = mListInterfaces.end(); + std::vector<uint16_t>::const_iterator handleIter(listStartupHandles.begin()); for (; iter < iterEnd; ++iter) { - (*iter)->setCommandReady(mCommandReceiver->getStartupHandle()); + (*iter)->setCommandReady(*(handleIter++)); } - mCommandReceiver->waitOnStartup(true); } void CAmCommandSender::setCommandRundown() { mCommandReceiver->waitOnRundown(false); + //create a list of handles + std::vector<uint16_t> listStartupHandles; + for (size_t i = 0; i <= mListInterfaces.size(); i++) + { + listStartupHandles.push_back(mCommandReceiver->getRundownHandle()); + } + + //set the receiver ready to wait for replies + mCommandReceiver->waitOnRundown(true); + + //now do the calls std::vector<IAmCommandSend*>::iterator iter = mListInterfaces.begin(); std::vector<IAmCommandSend*>::iterator iterEnd = mListInterfaces.end(); + std::vector<uint16_t>::const_iterator handleIter(listStartupHandles.begin()); for (; iter < iterEnd; ++iter) { - (*iter)->setCommandRundown(mCommandReceiver->getRundownHandle()); + (*iter)->setCommandRundown(*(handleIter++)); } - mCommandReceiver->waitOnRundown(true); } void CAmCommandSender::getInterfaceVersion(std::string & version) const diff --git a/AudioManagerDaemon/src/CAmRoutingSender.cpp b/AudioManagerDaemon/src/CAmRoutingSender.cpp index 09e0a2e..b6279a7 100644 --- a/AudioManagerDaemon/src/CAmRoutingSender.cpp +++ b/AudioManagerDaemon/src/CAmRoutingSender.cpp @@ -553,25 +553,46 @@ CAmRoutingSender::am_handleData_c CAmRoutingSender::returnHandleData(const am_Ha void CAmRoutingSender::setRoutingReady() { mpRoutingReceiver->waitOnStartup(false); + + //create a list of handles + std::vector<uint16_t> listStartupHandles; + for (size_t i = 0; i <= mListInterfaces.size(); i++) + { + listStartupHandles.push_back(mpRoutingReceiver->getStartupHandle()); + } + + //set the receiver ready to wait for replies + mpRoutingReceiver->waitOnStartup(true); + std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin(); std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end(); + std::vector<uint16_t>::const_iterator handleIter(listStartupHandles.begin()); for (; iter < iterEnd; ++iter) { - (*iter).routingInterface->setRoutingReady(mpRoutingReceiver->getStartupHandle()); + (*iter).routingInterface->setRoutingReady(*(handleIter++)); } - mpRoutingReceiver->waitOnStartup(true); } void CAmRoutingSender::setRoutingRundown() { mpRoutingReceiver->waitOnRundown(false); + //create a list of handles + std::vector<uint16_t> listStartupHandles; + for (size_t i = 0; i <= mListInterfaces.size(); i++) + { + listStartupHandles.push_back(mpRoutingReceiver->getRundownHandle()); + } + + //set the receiver ready to wait for replies + mpRoutingReceiver->waitOnRundown(true); + std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin(); std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end(); + std::vector<uint16_t>::const_iterator handleIter(listStartupHandles.begin()); for (; iter < iterEnd; ++iter) { - (*iter).routingInterface->setRoutingRundown(mpRoutingReceiver->getStartupHandle()); + (*iter).routingInterface->setRoutingRundown(*(handleIter++)); } - mpRoutingReceiver->waitOnRundown(true); } void CAmRoutingSender::unloadLibraries(void) |