82 lines
3.2 KiB
C++
82 lines
3.2 KiB
C++
//======================================================================================================
|
|
// Copyright 2016, NaturalPoint Inc.
|
|
//======================================================================================================
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "AnalogSystemBuildConfig.h"
|
|
|
|
namespace tinyxml2wc
|
|
{
|
|
class XMLElement;
|
|
}
|
|
|
|
namespace AnalogSystem
|
|
{
|
|
class AnalogChannelDescriptor;
|
|
class AnalogFrameBase;
|
|
class IDeviceManager;
|
|
class IPropVal;
|
|
|
|
/// <summary>
|
|
/// Interface for a Motive Device. Refer to PluginDeviceBase for details.
|
|
/// </summary>
|
|
class ANALOGSYSTEM_API IDevice
|
|
{
|
|
public:
|
|
IDevice() = default;
|
|
virtual ~IDevice() = default;
|
|
|
|
// operations
|
|
virtual bool Configure() = 0;
|
|
virtual bool Deconfigure() = 0;
|
|
virtual void Zero() = 0;
|
|
virtual bool PrepareForSync() = 0;
|
|
virtual bool PreCapture() = 0;
|
|
virtual bool StartCapture() = 0;
|
|
virtual bool StopCapture() = 0;
|
|
virtual bool PostCapture() = 0;
|
|
virtual bool IsCapturing() const = 0;
|
|
|
|
// channels
|
|
virtual int ChannelDescriptorCount() const = 0;
|
|
virtual AnalogChannelDescriptor* ChannelDescriptor( int index ) = 0;
|
|
virtual AnalogChannelDescriptor* ChannelDescriptor( const char* channelName ) = 0;
|
|
virtual int ActiveChannelCount() const = 0;
|
|
virtual int ChannelID( int index ) const = 0;
|
|
virtual AnalogChannelDescriptor* ActiveChannelDescriptor( int index ) = 0;
|
|
|
|
// data
|
|
virtual AnalogFrameBase* BeginFrameUpdate( long DeviceFrameID, bool wait = true ) = 0;
|
|
virtual void EndFrameUpdate() = 0;
|
|
virtual void UpdateDriftCorrection( long mocapFrameID ) = 0;
|
|
virtual const AnalogFrameBase* GetFrameByDeviceFrameID( long frameID ) const = 0;
|
|
virtual const AnalogFrameBase* GetFrameByBufferIndex( int index ) const = 0;
|
|
virtual int GetMostRecentFrameIndex() const = 0;
|
|
virtual long GetMostRecentFrameID() const = 0;
|
|
virtual bool MocapFrameIDToDeviceFrameIDs( long requestedMocapFrameID, long& deviceStart, long& deviceStop ) const = 0;
|
|
|
|
// events
|
|
virtual void OnPropertyChanged( const char* ) = 0;
|
|
virtual void OnChannelPropertyChanged( const char* channelName, const char* propertyName ) = 0;
|
|
virtual bool ValidatePropertyChange( const char* propertyName, const IPropVal& val ) = 0;
|
|
|
|
// IProfileSubscriber Interface
|
|
virtual std::wstring ProfileTypeName() const = 0;
|
|
virtual std::wstring ProfileLabel() const = 0;
|
|
virtual std::wstring ProfileDescription() const = 0;
|
|
virtual void SaveToProfile( tinyxml2wc::XMLElement& saveTo ) const = 0;
|
|
virtual bool LoadFromProfile( const tinyxml2wc::XMLElement& source ) = 0;
|
|
|
|
// helpers
|
|
virtual void SetDeviceManager( IDeviceManager* pDevManager ) = 0;
|
|
virtual IDeviceManager* DeviceManager() = 0;
|
|
virtual const char* LastError() const = 0;
|
|
virtual int MessageFromHost( const char* ) const = 0;
|
|
|
|
IDevice( const IDevice& other ) = delete;
|
|
IDevice& operator=( const IDevice& other ) = delete;
|
|
};
|
|
}
|