mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-04-17 13:49:59 +00:00
Add a connection status callback to notify when the connection becomes lossy
This commit is contained in:
@@ -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