mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-10-26 13:59:58 +00:00
Add a connection status callback to notify when the connection becomes lossy
This commit is contained in:
1 parent
4a7d28038d
commit
71a69204e9
3 files changed
+47
No files matched your search
@@ -35,6 +35,7 @@ static void fakeClConnectionStarted(void) {}
|
||||
static void fakeClConnectionTerminated(long errorCode) {}
|
||||
static void fakeClLogMessage(const char* format, ...) {}
|
||||
static void fakeClRumble(unsigned short controllerNumber, unsigned short lowFreqMotor, unsigned short highFreqMotor) {}
|
||||
static void fakeClConnectionStatusUpdate(int connectionStatus) {}
|
||||
|
||||
static CONNECTION_LISTENER_CALLBACKS fakeClCallbacks = {
|
||||
.stageStarting = fakeClStageStarting,
|
||||
@@ -44,6 +45,7 @@ static CONNECTION_LISTENER_CALLBACKS fakeClCallbacks = {
|
||||
.connectionTerminated = fakeClConnectionTerminated,
|
||||
.logMessage = fakeClLogMessage,
|
||||
.rumble = fakeClRumble,
|
||||
.connectionStatusUpdate = fakeClConnectionStatusUpdate
|
||||
};
|
||||
|
||||
void fixupMissingCallbacks(PDECODER_RENDERER_CALLBACKS* drCallbacks, PAUDIO_RENDERER_CALLBACKS* arCallbacks,
|
||||
@@ -116,5 +118,8 @@ void fixupMissingCallbacks(PDECODER_RENDERER_CALLBACKS* drCallbacks, PAUDIO_REND
|
||||
if ((*clCallbacks)->rumble == NULL) {
|
||||
(*clCallbacks)->rumble = fakeClRumble;
|
||||
}
|
||||
if ((*clCallbacks)->connectionStatusUpdate == NULL) {
|
||||
(*clCallbacks)->connectionStatusUpdate = fakeClConnectionStatusUpdate;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user