diff options
| author | Grigoriy <[email protected]> | 2018-03-12 00:30:49 +0300 |
|---|---|---|
| committer | Grigoriy <[email protected]> | 2018-03-12 00:30:49 +0300 |
| commit | 2415f5df72265afb368d5189b91cbe6242da4e5f (patch) | |
| tree | fa8a83d9e74b9d1c276e2f34f5a71fe7d6e91680 /Source/NVIDIAGfeSDK/Public | |
| parent | Delete .gitignore (diff) | |
| download | gfesdk-ue4plugin-2415f5df72265afb368d5189b91cbe6242da4e5f.tar.xz gfesdk-ue4plugin-2415f5df72265afb368d5189b91cbe6242da4e5f.zip | |
First commit
Diffstat (limited to 'Source/NVIDIAGfeSDK/Public')
| -rw-r--r-- | Source/NVIDIAGfeSDK/Public/GfeSDKCore.h | 27 | ||||
| -rw-r--r-- | Source/NVIDIAGfeSDK/Public/GfeSDKHighlights.h | 33 | ||||
| -rw-r--r-- | Source/NVIDIAGfeSDK/Public/HighLightBlueprint.h | 321 | ||||
| -rw-r--r-- | Source/NVIDIAGfeSDK/Public/INVIDIAGfeSDK.h | 49 | ||||
| -rw-r--r-- | Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKPublicPCH.h | 11 | ||||
| -rw-r--r-- | Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKTypes.h | 279 |
6 files changed, 720 insertions, 0 deletions
diff --git a/Source/NVIDIAGfeSDK/Public/GfeSDKCore.h b/Source/NVIDIAGfeSDK/Public/GfeSDKCore.h new file mode 100644 index 0000000..c2100c1 --- /dev/null +++ b/Source/NVIDIAGfeSDK/Public/GfeSDKCore.h @@ -0,0 +1,27 @@ +/* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
+*
+* NVIDIA CORPORATION and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an express
+* license agreement from NVIDIA CORPORATION is strictly prohibited.
+*/
+
+#pragma once
+
+#include "NVIDIAGfeSDKPublicPCH.h"
+
+class NVIDIAGFESDK_API FGfeSDKCore
+{
+public:
+ FGfeSDKCore(GfeSDK::NVGSDK_HANDLE* GFEHandle_); // Takes ownership
+ ~FGfeSDKCore();
+
+ void Poll();
+ void RequestPermissionsAsync(FGfeSDKRequestPermissionsParams const& Params, GfeSDK::NVGSDK_EmptyCallback Callback, void* Context);
+ void GetUILanguageAsync(GfeSDK::NVGSDK_GetUILanguageCallback Callback, void* Context);
+
+ friend class FNVIDIAGfeSDK;
+private:
+ GfeSDK::NVGSDK_HANDLE* GFEHandle;
+};
diff --git a/Source/NVIDIAGfeSDK/Public/GfeSDKHighlights.h b/Source/NVIDIAGfeSDK/Public/GfeSDKHighlights.h new file mode 100644 index 0000000..e1e3842 --- /dev/null +++ b/Source/NVIDIAGfeSDK/Public/GfeSDKHighlights.h @@ -0,0 +1,33 @@ +/* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
+*
+* NVIDIA CORPORATION and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an express
+* license agreement from NVIDIA CORPORATION is strictly prohibited.
+*/
+
+#pragma once
+
+#include "NVIDIAGfeSDKPublicPCH.h"
+#include "gfesdk/sdk_types.h"
+
+class NVIDIAGFESDK_API FGfeSDKHighlights
+{
+public:
+ FGfeSDKHighlights(GfeSDK::NVGSDK_HANDLE* Handle);
+ virtual ~FGfeSDKHighlights();
+
+ virtual void ConfigureAsync(FGfeSDKHighlightConfigParams const& Params, GfeSDK::NVGSDK_EmptyCallback callback, void* Context);
+ virtual void GetUserSettingsAsync(GfeSDK::NVGSDK_Highlights_GetUserSettingsCallback Callback, void* Context) const;
+ virtual void OpenGroupAsync(FGfeSDKHighlightOpenGroupParams const& Params, GfeSDK::NVGSDK_EmptyCallback Callback, void* Context);
+ virtual void CloseGroupAsync(FGfeSDKHighlightCloseGroupParams const& Params, GfeSDK::NVGSDK_EmptyCallback Callback, void* Context);
+ virtual void SetScreenshotHighlightAsync(FGfeSDKHighlightScreenshotParams const& Params, GfeSDK::NVGSDK_EmptyCallback Callback, void* Context);
+ virtual void SetVideoHighlightAsync(FGfeSDKHighlightVideoParams const& Params, GfeSDK::NVGSDK_EmptyCallback Callback, void* Context);
+ virtual void OpenSummaryAsync(FGfeSDKHighlightSummaryParams const& Params, GfeSDK::NVGSDK_EmptyCallback Callback, void* Context);
+ virtual void GetNumberOfHighlightsAsync(FGfeSDKHighlightGroupView const& GroupView, GfeSDK::NVGSDK_Highlights_GetNumberOfHighlightsCallback Callback, void* Context);
+ virtual int32 GetNumberOfHighlights(FGfeSDKHighlightGroupView const& GroupView);
+ virtual void Poll();
+private:
+ GfeSDK::NVGSDK_HANDLE* GFEHandle;
+};
diff --git a/Source/NVIDIAGfeSDK/Public/HighLightBlueprint.h b/Source/NVIDIAGfeSDK/Public/HighLightBlueprint.h new file mode 100644 index 0000000..46cd053 --- /dev/null +++ b/Source/NVIDIAGfeSDK/Public/HighLightBlueprint.h @@ -0,0 +1,321 @@ +// Fill out your copyright notice in the Description page of Project Settings.
+
+#pragma once
+#include "NVIDIAGfeSDKPrivatePCH.h"
+#include "CoreMinimal.h"
+#include "Kismet/BlueprintFunctionLibrary.h"
+#include "Kismet/BlueprintAsyncActionBase.h"
+#include <gfesdk/bindings/cpp/highlights/highlights_types_cpp.h>
+#include "NVIDIAGfeSDKTypes.h"
+#include "HighLightBlueprint.generated.h"
+
+//---------------------------------------------------------------------------
+
+UCLASS()
+class UHighlightsFunctionLibrary : public UBlueprintFunctionLibrary
+{
+ GENERATED_UCLASS_BODY()
+public:
+ // This function should be called periodically.
+ // It is used to receive callbacks.
+ // Can be called in Tick event
+ UFUNCTION(BlueprintCallable, Category = "Shadowplay Highlights")
+ static void Poll();
+ // This function is for convenience
+ // It chesks if the permissions to use Video or Screenshots functions are granted
+ // It returns the actual enumeration values for each function
+ UFUNCTION(BlueprintCallable, Category = "Shadowplay Highlights")
+ static void ChekIfHighlightsAvailable(const FGfeSDKCreateResponse& InitProperties, bool &VideoGranted, bool &ScreenshotsGranted, EGfeSDKPermission &Video, EGfeSDKPermission &Screenshots);
+};
+
+
+//---------------------------------------------------------------------------
+
+DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnHighlightsCallback);
+DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnHighlightsOperationResultCallback, EGfeSDKReturnCode, GfeSdkReturnCode);
+DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnHighlightsInitCallback, EGfeSDKReturnCode, GfeSdkReturnCode, FGfeSDKCreateResponse, GfeSdkProperties);
+DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnGetNumberOfHighlightsCallback, EGfeSDKReturnCode, GfeSdkReturnCode, int32, NumberOfHighlights);
+
+UCLASS()
+class UInitHighlights : public UBlueprintAsyncActionBase
+{
+ GENERATED_BODY()
+public:
+ // Called when there is a successful init
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsInitCallback OnSuccess;
+
+ // Called when there is an unsuccessful init
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnFailure;
+
+ // Initializes the Highlights client. Should be called first, all other functions will fail otherwise. Takes the game name and desired Highlights options as an input.
+ // Requests Highlights permissions to recorde Video or Screenshots according to the input checkboxes
+ // Use the GFE Request Permissions function if desired permissions are not granted to you.
+ UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"), Category = "Shadowplay Highlights")
+ static UInitHighlights* InitHighlights(UObject* WorldContextObject, const FString InGameName, const bool Video, const bool Screenshots);
+
+ // UBlueprintAsyncActionBase interface
+ virtual void Activate() override;
+ // End of UBlueprintAsyncActionBase interface
+
+private:
+ FCriticalSection CS;
+ UObject* WorldContextObject;
+ FString GameName;
+ TArray<EGfeSDKScope> RequestedPermissions;
+
+ // Permissions for Highlights
+ TMap<EGfeSDKScope, EGfeSDKPermission> mLastScopePermissions;
+ TArray<EGfeSDKScope> mPermissionsNeeded;
+
+ void Callback();
+ void OnPermissionsChanged(FGfeSDKPermissionsChangedData const& PermissionsChangedData);
+};
+
+//---------------------------------------------------------------------------
+
+UCLASS()
+class UHighlightsConfigureAsync : public UBlueprintAsyncActionBase
+{
+ GENERATED_BODY()
+public:
+ // Called when there is a successful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnSuccess;
+
+ // Called when there is an unsuccessful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnFailure;
+
+ // Configures the highlights system and defines the highlight types.
+ // Should be called once in game (or can be called if the highlight type list changed, for example for another game type).
+ // Should be called after init and before the OpenGroup functions
+ // Uses Poll function to receive callbacks
+ UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"), Category = "Shadowplay Highlights")
+ static UHighlightsConfigureAsync* HighlightsConfigure(UObject* WorldContextObject, const FGfeSDKHighlightConfigParams& ConfigParams);
+
+ // UBlueprintAsyncActionBase interface
+ virtual void Activate() override;
+ // End of UBlueprintAsyncActionBase interface
+
+private:
+ UObject* WorldContextObject;
+ FGfeSDKHighlightConfigParams ConfigParams;
+ static void __stdcall OnConfigureCallback(GfeSDK::NVGSDK_RetCode rt, void* context);
+};
+
+//---------------------------------------------------------------------------
+
+UCLASS()
+class UHighlightsOpenGroupAsync : public UBlueprintAsyncActionBase
+{
+ GENERATED_BODY()
+public:
+ // Called when there is a successful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnSuccess;
+
+ // Called when there is an unsuccessful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnFailure;
+
+ // Opens the group of highlights
+ // Uses Poll function to receive callbacks
+ UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"), Category = "Shadowplay Highlights")
+ static UHighlightsOpenGroupAsync* HighlightsOpenGroup(UObject* WorldContextObject, const FGfeSDKHighlightOpenGroupParams& Params);
+
+ // UBlueprintAsyncActionBase interface
+ virtual void Activate() override;
+ // End of UBlueprintAsyncActionBase interface
+
+private:
+ UObject* WorldContextObject;
+ FGfeSDKHighlightOpenGroupParams Params;
+ static void __stdcall OnOpenGroupCallback(GfeSDK::NVGSDK_RetCode rt, void* context);
+};
+
+//---------------------------------------------------------------------------
+
+UCLASS()
+class UHighlightsCloseGroupAsync : public UBlueprintAsyncActionBase
+{
+ GENERATED_BODY()
+public:
+ // Called when there is a successful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnSuccess;
+
+ // Called when there is an unsuccessful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnFailure;
+
+ // Closes the group of highlights
+ // Uses Poll function to receive callbacks
+ UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"), Category = "Shadowplay Highlights")
+ static UHighlightsCloseGroupAsync* HighlightsCloseGroup(UObject* WorldContextObject, const FString& GroupId, const bool& DestroyHighlights);
+
+ // UBlueprintAsyncActionBase interface
+ virtual void Activate() override;
+ // End of UBlueprintAsyncActionBase interface
+
+private:
+ UObject* WorldContextObject;
+ FGfeSDKHighlightCloseGroupParams Params;
+ static void __stdcall OnCloseGroupCallback(GfeSDK::NVGSDK_RetCode rt, void* context);
+};
+
+//---------------------------------------------------------------------------
+
+UCLASS()
+class UHighlightsSetScreenshotAsync : public UBlueprintAsyncActionBase
+{
+ GENERATED_BODY()
+public:
+ // Called when there is a successful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnSuccess;
+
+ // Called when there is an unsuccessful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnFailure;
+
+ // Takes screenshot of the game
+ // Uses Poll function to receive callbacks
+ UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"), Category = "Shadowplay Highlights")
+ static UHighlightsSetScreenshotAsync* HighlightsSetScreenshot(UObject* WorldContextObject, const FString& GroupId, const FString& HighlightId);
+
+ // UBlueprintAsyncActionBase interface
+ virtual void Activate() override;
+ // End of UBlueprintAsyncActionBase interface
+
+private:
+ UObject* WorldContextObject;
+ FGfeSDKHighlightScreenshotParams Params;
+ static void __stdcall OnSetScreenshotCallback(GfeSDK::NVGSDK_RetCode rt, void* context);
+};
+
+//---------------------------------------------------------------------------
+
+UCLASS()
+class UHighlightsSetVideoAsync : public UBlueprintAsyncActionBase
+{
+ GENERATED_BODY()
+public:
+ // Called when there is a successful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnSuccess;
+
+ // Called when there is an unsuccessful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnFailure;
+
+ // Records the video of the gameplay
+ // GroupID is the name of the group this highlight is related to
+ // HighlightID is the name of the Highlight
+ // StartDelta and EndDelta are the time range in miliseconds from the current moment.
+ // For example StartDelta can be set to -2000 and EndDelta to 3000 - that corresponds to {get the video of two seconds before this moment and record 3 seconds more from this moment}
+ // Uses Poll function to receive callbacks
+ UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"), Category = "Shadowplay Highlights")
+ static UHighlightsSetVideoAsync* HighlightsSetVideo(UObject* WorldContextObject, const FString& GroupId, const FString& HighlightId, const int32& StartDelta, const int32& EndDelta);
+
+ // UBlueprintAsyncActionBase interface
+ virtual void Activate() override;
+ // End of UBlueprintAsyncActionBase interface
+
+private:
+ UObject* WorldContextObject;
+ FGfeSDKHighlightVideoParams Params;
+ static void __stdcall OnSetVideoCallback(GfeSDK::NVGSDK_RetCode rt, void* context);
+};
+
+//---------------------------------------------------------------------------
+
+UCLASS()
+class UHighlightsSummaryAsync : public UBlueprintAsyncActionBase
+{
+ GENERATED_BODY()
+public:
+ // Called when there is a successful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnSuccess;
+
+ // Called when there is an unsuccessful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnFailure;
+
+ // Shows the Shadowplay Highlights Summary interface
+ // Uses Poll function to receive callbacks
+ UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"), Category = "Shadowplay Highlights")
+ static UHighlightsSummaryAsync* HighlightsOpenSummary(UObject* WorldContextObject, const FGfeSDKHighlightSummaryParams& Params);
+
+ // UBlueprintAsyncActionBase interface
+ virtual void Activate() override;
+ // End of UBlueprintAsyncActionBase interface
+
+private:
+ UObject* WorldContextObject;
+ FGfeSDKHighlightSummaryParams Params;
+ static void __stdcall OnOpenSummaryCallback(GfeSDK::NVGSDK_RetCode rt, void* context);
+};
+
+//---------------------------------------------------------------------------
+
+UCLASS()
+class UHighlightsGetNumberAsync : public UBlueprintAsyncActionBase
+{
+ GENERATED_BODY()
+public:
+ // Called when there is a successful query
+ UPROPERTY(BlueprintAssignable)
+ FOnGetNumberOfHighlightsCallback OnSuccess;
+
+ // Called when there is an unsuccessful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnFailure;
+
+ // Gets number of highlights recorded according to the specified input filtering values
+ // Uses Poll function to receive callbacks
+ UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"), Category = "Shadowplay Highlights")
+ static UHighlightsGetNumberAsync* HighlightsGetNumberOfHighlights(UObject* WorldContextObject, const FString& GroupID, const EGfeSDKHighlightType& TagFilter, const EGfeSDKHighlightSignificance& SignificanceFilter);
+
+ // UBlueprintAsyncActionBase interface
+ virtual void Activate() override;
+ // End of UBlueprintAsyncActionBase interface
+
+private:
+ UObject* WorldContextObject;
+ FGfeSDKHighlightGroupView Params;
+ static void __stdcall OnGetNumberCallback(GfeSDK::NVGSDK_RetCode rt, GfeSDK::NVGSDK_Highlights_NumberOfHighlights const* NumberOfHighlights, void* context);
+};
+
+//---------------------------------------------------------------------------
+
+UCLASS()
+class URequestPermissionsAsync : public UBlueprintAsyncActionBase
+{
+ GENERATED_BODY()
+public:
+ // Called when there is a successful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnSuccess;
+
+ // Called when there is an unsuccessful query
+ UPROPERTY(BlueprintAssignable)
+ FOnHighlightsOperationResultCallback OnFailure;
+
+ // Requests permissions to use the specified Shadowplay Highlights features
+ // Use this function to request the permission if the InitHighlights function failed to grant the desired permissions
+ // Uses Poll function to receive callbacks
+ UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"), Category = "Shadowplay Highlights")
+ static URequestPermissionsAsync* GFERequestPermissions(UObject* WorldContextObject, const bool Video, const bool Screenshots);
+
+ // UBlueprintAsyncActionBase interface
+ virtual void Activate() override;
+ // End of UBlueprintAsyncActionBase interface
+
+private:
+ UObject* WorldContextObject;
+ FGfeSDKRequestPermissionsParams Params;
+ static void __stdcall OnGetNumberCallback(GfeSDK::NVGSDK_RetCode rt, void* context);
+};
\ No newline at end of file diff --git a/Source/NVIDIAGfeSDK/Public/INVIDIAGfeSDK.h b/Source/NVIDIAGfeSDK/Public/INVIDIAGfeSDK.h new file mode 100644 index 0000000..73378ea --- /dev/null +++ b/Source/NVIDIAGfeSDK/Public/INVIDIAGfeSDK.h @@ -0,0 +1,49 @@ +/* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
+*
+* NVIDIA CORPORATION and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an express
+* license agreement from NVIDIA CORPORATION is strictly prohibited.
+*/
+
+#pragma once
+
+#include "NVIDIAGfeSDKPublicPCH.h"
+
+class INVIDIAGfeSDK : public IModuleInterface
+{
+public:
+ /**
+ * Singleton-like access to this module's interface. This is just for convenience!
+ * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already.
+ *
+ * @return Returns singleton instance, loading the module on demand if needed
+ */
+ static inline INVIDIAGfeSDK& Get()
+ {
+ return FModuleManager::LoadModuleChecked<INVIDIAGfeSDK>("NVIDIAGfeSDK");
+ }
+
+ /**
+ * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true.
+ *
+ * @return True if the module is loaded and ready to use
+ */
+ static inline bool IsAvailable()
+ {
+ return FModuleManager::Get().IsModuleLoaded("NVIDIAGfeSDK");
+ }
+
+ // Controls the log level of GfeSDK's internal logfile
+ virtual GfeSDK::NVGSDK_RetCode SetFileLogLevel(ELogVerbosity::Type Level) = 0;
+ // Controls the log level of logs that GfeSDK sends to the unreal logfile
+ virtual GfeSDK::NVGSDK_RetCode SetUnrealLogLevel(ELogVerbosity::Type Level) = 0;
+
+ virtual EGfeSDKReturnCode Create(FGfeSDKCreateInputParams const& InputParams, FGfeSDKCreateResponse& Response) = 0;
+ virtual void Release() = 0;
+ virtual FGfeSDKCore* Core() = 0;
+ virtual FGfeSDKHighlights* Highlights() = 0;
+
+ FGfeSDKOnPermissionsChanged PermissionsChangedDelegate;
+};
diff --git a/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKPublicPCH.h b/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKPublicPCH.h new file mode 100644 index 0000000..8b446f7 --- /dev/null +++ b/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKPublicPCH.h @@ -0,0 +1,11 @@ +#include "ModuleManager.h"
+#include "CoreMinimal.h"
+//#include "Engine.h"
+#include "UniquePtr.h"
+
+#include "NVIDIAGfeSDKTypes.h"
+#include "GfeSDKCore.h"
+#include "GfeSDKHighlights.h"
+#include "gfesdk/bindings/cpp/sdk_types_cpp.h"
+#include "gfesdk/bindings/cpp/isdk_cpp.h"
+#include "gfesdk/bindings/cpp/highlights/ihighlights_cpp.h"
diff --git a/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKTypes.h b/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKTypes.h new file mode 100644 index 0000000..02e3b79 --- /dev/null +++ b/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKTypes.h @@ -0,0 +1,279 @@ +#pragma once
+
+#include "NVIDIAGfeSDKTypes.generated.h"
+
+UENUM(BlueprintType)
+enum class EGfeSDKReturnCode : uint8
+{
+ Success = 0,
+ SuccessIpcOldSdk = 1,
+ SuccessIpcOldGfe = 2,
+ Error = 3,
+ ErrorGfeVersion = 4,
+ ErrorSdkVersion = 5,
+ ErrorModuleNotLoaded = 6,
+ ErrorWrongTimeRangeSet = 7
+};
+
+UENUM(BlueprintType)
+enum class EGfeSDKScope : uint8
+{
+ Highlights = 0,
+ HighlightsRecordVideo = 1,
+ HighlightsRecordScreenshot = 2,
+ MAX = 3
+};
+
+UENUM(BlueprintType)
+enum class EGfeSDKPermission : uint8
+{
+ Granted = 0,
+ Denied = 1,
+ MustAsk = 2,
+ Unknown = 3,
+ MAX= 4
+};
+
+UENUM(BlueprintType)
+enum class EGfeSDKHighlightType : uint8
+{
+ NONE = 0x00,
+ Milestone = 0x01,
+ Achievement = 0x02,
+ Incident = 0x04,
+ StateChange = 0x08,
+ MAX = 0x10
+};
+
+// This different from the version in sdk_types.h because
+// UE4 only supports 8 bit enums. It must be translated
+UENUM(BlueprintType)
+enum class EGfeSDKHighlightSignificance : uint8
+{
+ NONE = 0x00,
+ ExtremelyBad = 0x01,
+ VeryBad = 0x02,
+ Bad = 0x04,
+ Neutral = 0x08,
+ Good = 0x10,
+ VeryGood = 0x20,
+ ExtremelyGood = 0x40,
+ MAX = 0x80
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKCreateInputParams
+{
+ GENERATED_BODY()
+
+ FGfeSDKCreateInputParams()
+ {
+ AppName = TEXT("Undefined");
+ PollForCallbacks = false;
+ }
+
+ UPROPERTY()
+ FString AppName;
+
+ UPROPERTY()
+ TArray<EGfeSDKScope> RequiredScopes;
+
+ UPROPERTY()
+ bool PollForCallbacks;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKCreateResponse
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKCreateResponse()
+ {
+ VersionMajor = -1;
+ VersionMinor = -1;
+ NVIDIAGfeVersion = TEXT("Undefined");
+ }
+
+ UPROPERTY()
+ uint16 VersionMajor;
+
+ UPROPERTY()
+ uint16 VersionMinor;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString NVIDIAGfeVersion;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ TMap<EGfeSDKScope, EGfeSDKPermission> ScopePermissions;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKHighlightDefinition
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKHighlightDefinition()
+ {
+ UserDefaultInterest = true;
+ HighlightTags = static_cast<EGfeSDKHighlightType>(0x0);
+ Significance = static_cast<EGfeSDKHighlightSignificance>(0x0);
+ }
+
+ FGfeSDKHighlightDefinition(FString const& Id_, bool UserDefaultInterest_, EGfeSDKHighlightType Tags_, EGfeSDKHighlightSignificance Sig_, TMap<FString, FString> Table_) :
+ Id(Id_), UserDefaultInterest(UserDefaultInterest_), HighlightTags(Tags_), Significance(Sig_), NameTranslationTable(Table_) {}
+ // Defines the highlight type name
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString Id;
+ // If set to true, the highlight will be recorded, otherwise the Shadowplay will lookup the GFE database and user's options.
+ // If it's not found there or user switched of the highlihts for this game, it will be treated as irrelevant.
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ bool UserDefaultInterest;
+ // Tag that defines the type of the highlight
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ EGfeSDKHighlightType HighlightTags;
+ // This property defines how good or bad the recorded event is in terms of the gameplay
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ EGfeSDKHighlightSignificance Significance;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ TMap<FString, FString> NameTranslationTable;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKHighlightConfigParams
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKHighlightConfigParams() {}
+
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ TArray<FGfeSDKHighlightDefinition> HighlightDefinitions;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString DefaultLocale;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKRequestPermissionsParams
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKRequestPermissionsParams() {}
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ TArray<EGfeSDKScope> Scopes;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKPermissionsChangedData
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKPermissionsChangedData() {}
+
+ UPROPERTY()
+ TMap<EGfeSDKScope, EGfeSDKPermission> ScopePermissions;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKHighlightOpenGroupParams
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKHighlightOpenGroupParams() {}
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString GroupId;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ TMap<FString, FString> GroupDescriptionTranslationTable;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKHighlightCloseGroupParams
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKHighlightCloseGroupParams():
+ DestroyHighlights(false)
+ {}
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString GroupId;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ bool DestroyHighlights;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKHighlightScreenshotParams
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKHighlightScreenshotParams() {}
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString GroupId;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString HighlightId;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKHighlightVideoParams
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKHighlightVideoParams()
+ {
+ StartDelta = 0;
+ EndDelta = 0;
+ }
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString GroupId;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString HighlightId;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ int32 StartDelta;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ int32 EndDelta;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKHighlightGroupView
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKHighlightGroupView() :
+ TagsFilter(EGfeSDKHighlightType::NONE),
+ SignificanceFilter(EGfeSDKHighlightSignificance::NONE)
+ {}
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString GroupId;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ EGfeSDKHighlightType TagsFilter;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ EGfeSDKHighlightSignificance SignificanceFilter;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKHighlightSummaryParams
+{
+ GENERATED_USTRUCT_BODY()
+
+ FGfeSDKHighlightSummaryParams() {}
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ TArray<FGfeSDKHighlightGroupView> GroupViews;
+};
+
+
+DECLARE_DELEGATE_OneParam(FGfeSDKOnPermissionsChanged, FGfeSDKPermissionsChangedData const&);
|