aboutsummaryrefslogtreecommitdiff
path: root/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKTypes.h
blob: de5a1a0faa8180ab763377e8d9221037115ab3e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
#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,
	ErrorGeneric = 8,
	ErrorNotImplemented = 9,
	ErrorInvalidParameter = 10,
	ErrorNotSet = 11,
	ErrorShadowplayIRDisabled = 12,
	ErrorSDKInUse = 13,
	ErrorGroupNotFound = 14,
	ErrorFileNotFound = 15,
	ErrorHighlightsSetupFailed = 16,
	ErrorHighlightsNotConfigured = 17,
	ErrorHighlightSaveFailed = 18,
	ErrorUnexpectedException = 19,
	ErrorNoHighlights = 20,
	ErrorNoConnection = 21,
	ErrorPermissionNotGranted = 22,
	ErrorPermissionDenied = 23,
	ErrorInvalidHandle = 24,
	ErrorUnhandledException = 25,
	ErrorOutOfMemory = 26,
	ErrorLoadLibrary = 27,
	ErrorLibraryCallFailed = 28,
	ErrorIPCFailed = 29,
	ErrorConnection = 30,
	ErrorLibCallTimeout = 32,
	ErrorApplicationLookupFailed = 33,
	ErrorApplicationNotKnown = 34,
	ErrorFeatureDisabled = 35,
	ErrorAppNoOptimization = 36,
	ErrorAppSettingsRead = 37,
	ErrorAppSettingsWrite = 38
};

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,
	Unannounced = 0x10,
    MAX         = 0x20
};

// 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&);