Skip to content

Commit

Permalink
use RemoteHandlerInternals instead of InterfaceList
Browse files Browse the repository at this point in the history
  • Loading branch information
Georgiy Frolov committed Mar 10, 2016
1 parent 6a18aad commit 0d41b05
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/osvr/Client/GestureRemoteFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

// Internal Includes
#include "GestureRemoteFactory.h"
#include "RemoteHandlerInternals.h"
#include "VRPNConnectionCollection.h"
#include <osvr/Common/ClientContext.h>
#include <osvr/Common/ClientInterface.h>
Expand Down Expand Up @@ -55,7 +56,7 @@ namespace client {
common::InterfaceList &ifaces,
common::ClientContext *ctx)
: m_dev(common::createClientDevice(deviceName, conn)),
m_interfaces(ifaces), m_all(!sensor.is_initialized()),
m_internals(ifaces), m_all(!sensor.is_initialized()),
m_sensor(sensor), m_ctx(ctx) {

m_sysComponent = m_ctx->getSystemComponent();
Expand Down Expand Up @@ -92,8 +93,8 @@ namespace client {
}

OSVR_GestureReport report;
util::StringID id =
m_gestureNameMap->corrMap.convertPeerToLocalID(util::PeerStringID(data.gestureID.value()));
util::StringID id = m_gestureNameMap->corrMap.convertPeerToLocalID(
util::PeerStringID(data.gestureID.value()));
if (id.empty()) {
// could not find a peer to local mapping, discarding report
return;
Expand All @@ -102,13 +103,11 @@ namespace client {
report.sensor = data.sensor;
report.state = data.gestureState;
report.gestureID = id.value();
for (auto &iface : m_interfaces) {
iface->triggerCallbacks(timestamp, report);
}
m_internals.setStateAndTriggerCallbacks(timestamp, report);
}

common::BaseDevicePtr m_dev;
common::InterfaceList &m_interfaces;
RemoteHandlerInternals m_internals;
bool m_all;
boost::optional<OSVR_ChannelCount> m_sensor;
// map to keep track of gesture map and server to local ID map
Expand Down

0 comments on commit 0d41b05

Please sign in to comment.