can bind OSC message to game inputs

This commit is contained in:
monsieurgustav
2015-02-04 22:35:23 +01:00
parent 852682cd6f
commit bde87ae9dc
15 changed files with 208 additions and 51 deletions
+17 -2
View File
@@ -1,10 +1,11 @@
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include <utility>
#include "OscSettings.generated.h"
class OscReceiverInputKey;
class UOscDispatcher;
UCLASS(config=Engine)
class UOscSettings : public UObject
@@ -27,11 +28,24 @@ public:
UPROPERTY(Config, EditAnywhere, Category=Send)
TArray<FString> SendTargets;
/**
* List of the messages treated as inputs.
*
* Every entry adds a key in the input mapping project setting.
* e.g. "/position/x" -> "OSC_position_x"
*/
UPROPERTY(Config, EditAnywhere, Category=Input)
TArray<FString> Inputs;
public:
void UpdateSendAddresses();
void Send(const uint8 *buffer, int32 length, int32 targetIndex);
void ClearKeyInputs(UOscDispatcher & dispatcher);
void UpdateKeyInputs(UOscDispatcher & dispatcher);
public:
/**
@@ -43,4 +57,5 @@ public:
private:
TSharedRef<FSocket> _sendSocket;
TArray<std::pair<FString, TSharedRef<FInternetAddr>>> _sendAddresses;
TArray<OscReceiverInputKey> _keyReceivers;
};