only disable audio in applet mode if an app is suspended, bump version.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(sphaira_VERSION 0.6.1)
|
||||
set(sphaira_VERSION 0.6.2)
|
||||
|
||||
project(sphaira
|
||||
VERSION ${sphaira_VERSION}
|
||||
|
||||
@@ -119,6 +119,21 @@ public:
|
||||
return type == AppletType_Application || type == AppletType_SystemApplication;
|
||||
}
|
||||
|
||||
static auto IsApplet() -> bool {
|
||||
return !IsApplication();
|
||||
}
|
||||
|
||||
// returns true if launched in applet mode with a title suspended in the background.
|
||||
static auto IsAppletWithSuspendedApp() -> bool {
|
||||
R_UNLESS(IsApplet(), false);
|
||||
R_TRY_RESULT(pmdmntInitialize(), false);
|
||||
ON_SCOPE_EXIT(pmdmntExit());
|
||||
|
||||
u64 pid;
|
||||
return R_SUCCEEDED(pmdmntGetApplicationProcessId(&pid));
|
||||
}
|
||||
|
||||
|
||||
// private:
|
||||
static constexpr inline auto CONFIG_PATH = "/config/sphaira/config.ini";
|
||||
static constexpr inline auto PLAYLOG_PATH = "/config/sphaira/playlog.ini";
|
||||
|
||||
@@ -1282,9 +1282,11 @@ App::App(const char* argv0) {
|
||||
}
|
||||
}
|
||||
|
||||
// only enable audio in non-applet mode due to audren fatal.
|
||||
// disable audio in applet mode with a suspended application due to audren fatal.
|
||||
// see: https://github.com/ITotalJustice/sphaira/issues/92
|
||||
if (IsApplication()) {
|
||||
if (IsAppletWithSuspendedApp()) {
|
||||
App::Notify("Audio disabled due to suspended game"_i18n);
|
||||
} else {
|
||||
plsrPlayerInit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user