92 lines
4.1 KiB
C++
92 lines
4.1 KiB
C++
//======================================================================================================
|
|
// Copyright 2016, NaturalPoint Inc.
|
|
//======================================================================================================
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include "AnalogSystemBuildConfig.h"
|
|
|
|
namespace AnalogSystem
|
|
{
|
|
class IDeviceFactory;
|
|
class IDevice;
|
|
|
|
/// <summary>Error message type </summary>
|
|
enum MessageType
|
|
{
|
|
MessageType_StatusInfo = 0, // To be displayed as info item in StatusLog Panel
|
|
MessageType_StatusError, // To be displayed as error item in StatusLog Panel
|
|
MessageType_StatusErrorAggregate, // To be displayed as error item in StatusLog Panel (aggregate)
|
|
MessageType_DialogError, // To be displayed as error MessageBox (critical stop)
|
|
MessageType_Internal, // Do not display
|
|
MessageType_RequestRestart, // Device requests restart
|
|
MessageType_PrepareForSync, // Prepare device for live sync startup
|
|
MessageType_RequestResync, // request resync
|
|
MessageType_UpdateFromProfile, // apply profile settings to device
|
|
MessageType_Hotplug_Add, // add device after startup (hotplugged)
|
|
MessageType_Hotplug_Remove // remove device after startup (hotplugged)
|
|
};
|
|
|
|
/// <summary>App run mode state </summary>
|
|
enum AppRunMode
|
|
{
|
|
RunMode_Undefined = -1,
|
|
RunMode_Live = 0,
|
|
RunMode_Recording = 1,
|
|
RunMode_Playback = 2
|
|
};
|
|
|
|
/// <summary>Plugin to Motive communication interface</summary>
|
|
class ANALOGSYSTEM_API IDeviceManager
|
|
{
|
|
public:
|
|
IDeviceManager() = default;
|
|
virtual ~IDeviceManager() = default;
|
|
|
|
/// <summary>Registers the device factory with Motive. 1 Factory per device instance.</summary>
|
|
/// <param name="df">The plugin device factory</param>
|
|
virtual void RegisterDeviceFactory( std::unique_ptr<IDeviceFactory> df ) = 0;
|
|
|
|
/// <summary>Dynamically add device (hotplug) from Motive's list of devices.</summary>
|
|
/// <param name="df">The device factorye</param>
|
|
virtual bool AddDevice( std::unique_ptr<IDeviceFactory> df ) = 0;
|
|
|
|
/// <summary>Dynamically remove a device (hotplug) from Motive's list of devices.</summary>
|
|
/// <param name="deviceName">The plugin device</param>
|
|
virtual bool RemoveDevice( const char* deviceName ) = 0;
|
|
|
|
/// <summary>Notifies Motive when device configuration requires an application configuration update.</summary>
|
|
/// <param name="pDevice">The plugin device</param>
|
|
virtual bool UpdateDeviceConfiguration( IDevice* pDevice ) = 0;
|
|
|
|
/// <summary>Notifies Motive with a message.</summary>
|
|
virtual void MessageToHost( const char* message, int messageType = 0 ) = 0;
|
|
|
|
/// <summary>Notifies Motive with a message.</summary>
|
|
/// <param name="pDevice">The plugin device</param>
|
|
virtual void MessageToHost( IDevice* pDevice, const char* message, int messageType = 0 ) = 0;
|
|
|
|
/// <summary>Gets the number of slaves associated with a master device.</summary>
|
|
/// <param name="pMasterDevice">The master device.</param>
|
|
virtual int SlaveDeviceCount( IDevice* pMasterDevice ) = 0;
|
|
|
|
/// <summary>Get a slave deive by index</summary>
|
|
/// <param name="pMasterDevice">The master device.</param>
|
|
/// <param name="slaveIndex">Slave index.</param>
|
|
virtual IDevice* SlaveDevice( IDevice* pMasterDevice, int slaveIndex ) = 0;
|
|
|
|
/// <summary>Get a device by serial number</summary>
|
|
/// <param name="serial">Deviceserial number</param>
|
|
virtual IDevice* GetDevice( const char* serial ) = 0;
|
|
|
|
/// <summary>Gets current app playback state</summary>
|
|
virtual AppRunMode HostRunMode() = 0;
|
|
|
|
/// <summary>Gets an Motive application-wide setting</summary>
|
|
virtual bool GetProperty(const char* propertyName, char** propertyValue) = 0;
|
|
|
|
IDeviceManager( const IDeviceManager& other ) = delete;
|
|
IDeviceManager& operator=( const IDeviceManager& other ) = delete;
|
|
};
|
|
} |