mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-10-09 00:09:42 +00:00
wip instruction decoding
This commit is contained in:
@@ -2,11 +2,27 @@
|
||||
|
||||
FTtsRequest UProtocolLibrary::DecodeTtsPayload(const FString& payload)
|
||||
{
|
||||
FTtsRequest request = FTtsRequest();
|
||||
FString input = payload;
|
||||
|
||||
request.Username = FString(TEXT("user"));
|
||||
request.VoiceName = FString(TEXT("sonic"));
|
||||
request.Text = FString(TEXT("gotta go fast"));
|
||||
FString username = TEXT("");
|
||||
FString voiceName = TEXT("");
|
||||
FString text = TEXT("");
|
||||
|
||||
FString Left, Right;
|
||||
|
||||
if (input.Split(TEXT("|"), &Left, &input)) {
|
||||
username = Left;
|
||||
|
||||
if (input.Split(TEXT("|"), &Left, &Right)) {
|
||||
voiceName = Left;
|
||||
text = Right;
|
||||
}
|
||||
}
|
||||
|
||||
FTtsRequest request = FTtsRequest();
|
||||
request.Username = username;
|
||||
request.VoiceName = voiceName;
|
||||
request.Text = text;
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
|
||||
#include "ProtocolTypes.h"
|
||||
|
||||
#include "ProtocolLibrary.generated.h"
|
||||
|
||||
UCLASS()
|
||||
@@ -16,6 +15,7 @@ class EVENTCENTERPLUGIN_API UProtocolLibrary : public UBlueprintFunctionLibrary
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Decode TTS instructions
|
||||
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
|
||||
static FTtsRequest DecodeTtsPayload(const FString& payload);
|
||||
};
|
||||
|
||||
@@ -6,24 +6,6 @@
|
||||
|
||||
#include "ProtocolTypes.generated.h"
|
||||
|
||||
/*UCLASS()
|
||||
class EVENTCENTERPLUGIN_API UTtsRequest : public UObject {
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
inline UTtsRequest() {
|
||||
}
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||
FString Username;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||
FString VoiceName;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||
FString Text;
|
||||
};*/
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct EVENTCENTERPLUGIN_API FTtsRequest {
|
||||
GENERATED_BODY()
|
||||
|
||||
Reference in New Issue
Block a user