Skip to content

Commit

Permalink
don't track previous playing state when launching a new title
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ITotalJustice committed Aug 23, 2023
1 parent 2e7f295 commit 702cdd0
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions sys-tune/source/impl/music_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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
Expand Down

0 comments on commit 702cdd0

Please sign in to comment.