mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-23 21:32:39 +02:00
Added appletSetMediaPlaybackStateForApplication
This commit is contained in:
parent
59382cab1f
commit
8be5cad7f8
@ -160,6 +160,10 @@ Result appletGetDesiredLanguage(u64 *LanguageCode);
|
||||
/// Only available with AppletType_*Application.
|
||||
Result appletSetTerminateResult(Result res);
|
||||
|
||||
/// Set media playback state.
|
||||
/// If state is set to true, screen dimming and auto sleep is disabled.
|
||||
Result appletSetMediaPlaybackStateForApplication(bool state);
|
||||
|
||||
/// Gets whether video recording is supported.
|
||||
/// See also \ref appletInitializeGamePlayRecording.
|
||||
Result appletIsGamePlayRecordingSupported(bool *flag);
|
||||
|
@ -869,6 +869,43 @@ Result appletSetTerminateResult(Result res) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result appletSetMediaPlaybackStateForApplication(bool state) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
|
||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
u8 state;
|
||||
} *raw;
|
||||
|
||||
raw = serviceIpcPrepareHeader(&g_appletIFunctions, &c, sizeof(*raw));
|
||||
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 60;
|
||||
raw->state = state;
|
||||
|
||||
Result rc = serviceIpcDispatch(&g_appletIFunctions);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
} *resp;
|
||||
|
||||
serviceIpcParse(&g_appletIFunctions, &r, sizeof(*resp));
|
||||
resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result appletBeginBlockingHomeButton(s64 val) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
Loading…
Reference in New Issue
Block a user