Added appletSetMediaPlaybackStateForApplication

This commit is contained in:
Cpasjuste 2018-12-21 10:16:20 +01:00 committed by yellows8
parent 59382cab1f
commit 8be5cad7f8
2 changed files with 41 additions and 0 deletions

View File

@ -160,6 +160,10 @@ Result appletGetDesiredLanguage(u64 *LanguageCode);
/// Only available with AppletType_*Application. /// Only available with AppletType_*Application.
Result appletSetTerminateResult(Result res); 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. /// Gets whether video recording is supported.
/// See also \ref appletInitializeGamePlayRecording. /// See also \ref appletInitializeGamePlayRecording.
Result appletIsGamePlayRecordingSupported(bool *flag); Result appletIsGamePlayRecordingSupported(bool *flag);

View File

@ -869,6 +869,43 @@ Result appletSetTerminateResult(Result res) {
return rc; 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) { Result appletBeginBlockingHomeButton(s64 val) {
IpcCommand c; IpcCommand c;
ipcInitialize(&c); ipcInitialize(&c);