From 8080fe942cc19c6c2ea0db0cdcc92e7b0a329881 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 20 Nov 2020 20:38:26 +0900 Subject: [PATCH 1/3] Fix samples being played more than once on skin change --- osu.Game/Skinning/SkinnableSound.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/SkinnableSound.cs b/osu.Game/Skinning/SkinnableSound.cs index 24dddaf758..a6347fe05a 100644 --- a/osu.Game/Skinning/SkinnableSound.cs +++ b/osu.Game/Skinning/SkinnableSound.cs @@ -152,7 +152,7 @@ namespace osu.Game.Skinning SamplesContainer.Add(sample); } - if (wasPlaying) + if (wasPlaying && !Looping) Play(); } From a3b1d14f178620fd9556efad890a7a4874f4230c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 22 Nov 2020 14:44:39 +0900 Subject: [PATCH 2/3] Apply similar fix to PoolableSkinnableSound --- osu.Game/Skinning/PoolableSkinnableSample.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/PoolableSkinnableSample.cs b/osu.Game/Skinning/PoolableSkinnableSample.cs index adc58ee94e..65f97ff909 100644 --- a/osu.Game/Skinning/PoolableSkinnableSample.cs +++ b/osu.Game/Skinning/PoolableSkinnableSample.cs @@ -101,7 +101,7 @@ namespace osu.Game.Skinning sampleContainer.Add(Sample = new DrawableSample(ch) { Looping = Looping }); // Start playback internally for the new sample if the previous one was playing beforehand. - if (wasPlaying) + if (wasPlaying && !Looping) Play(); } From f6d15b975704c8358fa4eda4c8cbec19597aa252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sun, 6 Dec 2020 18:59:38 +0100 Subject: [PATCH 3/3] Invert back-to-front logic --- osu.Game/Skinning/PoolableSkinnableSample.cs | 2 +- osu.Game/Skinning/SkinnableSound.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/PoolableSkinnableSample.cs b/osu.Game/Skinning/PoolableSkinnableSample.cs index a59fcfea27..cc6b85a13e 100644 --- a/osu.Game/Skinning/PoolableSkinnableSample.cs +++ b/osu.Game/Skinning/PoolableSkinnableSample.cs @@ -102,7 +102,7 @@ namespace osu.Game.Skinning sampleContainer.Add(Sample = new DrawableSample(ch) { Looping = Looping }); // Start playback internally for the new sample if the previous one was playing beforehand. - if (wasPlaying && !Looping) + if (wasPlaying && Looping) Play(); } diff --git a/osu.Game/Skinning/SkinnableSound.cs b/osu.Game/Skinning/SkinnableSound.cs index 166f005473..645c08cd00 100644 --- a/osu.Game/Skinning/SkinnableSound.cs +++ b/osu.Game/Skinning/SkinnableSound.cs @@ -159,7 +159,7 @@ namespace osu.Game.Skinning samplesContainer.Add(sample); } - if (wasPlaying && !Looping) + if (wasPlaying && Looping) Play(); }