diff --git a/Compatible/Compatible.csproj b/Compatible/Compatible.csproj index c1010be..e0878f7 100644 --- a/Compatible/Compatible.csproj +++ b/Compatible/Compatible.csproj @@ -9,6 +9,6 @@ - + diff --git a/Qwilight/Compute/DefaultCompute.cs b/Qwilight/Compute/DefaultCompute.cs index c90aac9..7d3aa3c 100644 --- a/Qwilight/Compute/DefaultCompute.cs +++ b/Qwilight/Compute/DefaultCompute.cs @@ -1683,11 +1683,7 @@ var wasLastStatus = false; var handlingNoteID = 0; var paintedNoteID = 0; - var audioChannelMap = new Dictionary[2]; - for (var i = audioChannelMap.Length - 1; i >= 0; --i) - { - audioChannelMap[i] = new(); - } + var audioChannelMap = new Dictionary(); var loopingHandlerMillis = 0.0; var commentInputID = 0; var commentMultiplierID = 0; @@ -1711,7 +1707,7 @@ if (LoopingCounter <= waitModified + (audioLength ?? audioItemValue.Length)) { var bmsID = audioNote.BMSID; - StopLastEqualAudioItem(AudioSystem.MainAudio, bmsID); + StopLastEqualAudioItem(bmsID); lock (LoadedCSX) { if (HasContents) @@ -1725,7 +1721,7 @@ }, AudioSystem.MainAudio, AudioMultiplier, IsCounterWave, this); if (!string.IsNullOrEmpty(bmsID)) { - audioChannelMap[AudioSystem.MainAudio][bmsID] = audioChannel; + audioChannelMap[bmsID] = audioChannel; } } } @@ -2784,7 +2780,7 @@ if (lastEventPosition < LoopingCounter + audioItemValue.Length) { var bmsID = audioNote.BMSID; - StopLastEqualAudioItem(AudioSystem.InputAudio, bmsID); + StopLastEqualAudioItem(bmsID); lock (LoadedCSX) { if (HasContents) @@ -2799,7 +2795,7 @@ }, AudioSystem.InputAudio, AudioMultiplier, IsCounterWave, this, 0.0, inputPower); if (!string.IsNullOrEmpty(bmsID)) { - audioChannelMap[AudioSystem.InputAudio][bmsID] = audioChannel; + audioChannelMap[bmsID] = audioChannel; } } } @@ -2826,7 +2822,7 @@ if (lastEventPosition < LoopingCounter + (audioNote.Length ?? audioItemValue.Length)) { var bmsID = audioNote.BMSID; - StopLastEqualAudioItem(AudioSystem.InputAudio, bmsID); + StopLastEqualAudioItem(bmsID); lock (LoadedCSX) { if (HasContents) @@ -2842,7 +2838,7 @@ note.AudioChannels.Add(audioChannel); if (!string.IsNullOrEmpty(bmsID)) { - audioChannelMap[AudioSystem.InputAudio][bmsID] = audioChannel; + audioChannelMap[bmsID] = audioChannel; } } } @@ -2861,8 +2857,8 @@ var lastEventPosition = IsInEvents ? _eventPositions.Last() : LoopingCounter; if (lastEventPosition < LoopingCounter + banalAudioValue.Length) { - StopLastEqualAudioItem(AudioSystem.InputAudio, nameof(AudioSystem.Instance.BanalAudio)); - audioChannelMap[AudioSystem.InputAudio][nameof(AudioSystem.Instance.BanalAudio)] = AudioSystem.Instance.Handle(new() + StopLastEqualAudioItem(nameof(AudioSystem.Instance.BanalAudio)); + audioChannelMap[nameof(AudioSystem.Instance.BanalAudio)] = AudioSystem.Instance.Handle(new() { AudioItem = banalAudioValue }, AudioSystem.InputAudio, AudioMultiplier, false, this, 0.0, inputPower); @@ -4182,9 +4178,9 @@ } } - void StopLastEqualAudioItem(int audioVariety, string bmsID) + void StopLastEqualAudioItem(string bmsID) { - if (Configure.Instance.StopLastEqualAudio && !string.IsNullOrEmpty(bmsID) && audioChannelMap[audioVariety].TryGetValue(bmsID, out var audioChannel)) + if (Configure.Instance.StopLastEqualAudio && !string.IsNullOrEmpty(bmsID) && audioChannelMap.TryGetValue(bmsID, out var audioChannel)) { AudioSystem.Instance.Stop(audioChannel); } diff --git a/Qwilight/Qwilight.csproj b/Qwilight/Qwilight.csproj index aa0868b..cfcd787 100644 --- a/Qwilight/Qwilight.csproj +++ b/Qwilight/Qwilight.csproj @@ -65,7 +65,7 @@ - +