From 702cdd01720c65a4230c30665df351fba56832b2 Mon Sep 17 00:00:00 2001 From: TotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:21:52 +0100 Subject: [PATCH] don't track previous playing state when launching a new title the idea was that if the user launches a game, then pauses the music using pause, then closes the game and reopens the same game, it would remember this paused state. however, this is both confusing to the users and myself (lol). I am not sure why i added this feature. if the user wants to music to remain paused/playing, then should just set the per title config. --- sys-tune/source/impl/music_player.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/sys-tune/source/impl/music_player.cpp b/sys-tune/source/impl/music_player.cpp index d8c409e..f7f05d6 100644 --- a/sys-tune/source/impl/music_player.cpp +++ b/sys-tune/source/impl/music_player.cpp @@ -438,10 +438,6 @@ namespace tune::impl { } void PmdmntThreadFunc(void *ptr) { - u64 previous_tid{}; - u64 current_tid{}; - bool previous_state{}; - while (g_should_run) { u64 pid{}, new_tid{}; if (pm::PollCurrentPidTid(&pid, &new_tid)) { @@ -455,20 +451,12 @@ namespace tune::impl { SetTitleVolume(std::clamp(config::get_title_volume(new_tid), 0.f, VOLUME_MAX)); } - if (new_tid == previous_tid) { - g_should_pause = previous_state; + // TODO: fade song in rather than abruptly playing to avoid jump scares + if (config::has_title_enabled(new_tid)) { + g_should_pause = !config::get_title_enabled(new_tid); } else { - previous_state = g_should_pause; - // TODO: fade song in rather than abruptly playing to avoid jump scares - if (config::has_title_enabled(new_tid)) { - g_should_pause = !config::get_title_enabled(new_tid); - } else { - g_should_pause = !config::get_title_enabled_default(); - } + g_should_pause = !config::get_title_enabled_default(); } - - previous_tid = current_tid; - current_tid = new_tid; } // sadly, we can't simply apply auda when the title changes