mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
Merge c5390632e0
into d31ef12363
This commit is contained in:
commit
bc72808ec5
2 changed files with 41 additions and 1 deletions
source/funkin/ui/debug/charting
|
@ -6142,20 +6142,30 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
|
||||
fadeInWelcomeMusic(WELCOME_MUSIC_FADE_IN_DELAY, WELCOME_MUSIC_FADE_IN_DURATION);
|
||||
|
||||
// Reapply the volume.
|
||||
// Reapply the volume and playback rate.
|
||||
var instTargetVolume:Float = menubarItemVolumeInstrumental.value ?? 1.0;
|
||||
var vocalPlayerTargetVolume:Float = menubarItemVolumeVocalsPlayer.value ?? 1.0;
|
||||
var vocalOpponentTargetVolume:Float = menubarItemVolumeVocalsOpponent.value ?? 1.0;
|
||||
|
||||
var playbackRate = ((menubarItemPlaybackSpeed.value ?? 1.0) * 2.0) / 100.0;
|
||||
playbackRate = Math.floor(playbackRate / 0.05) * 0.05; // Round to nearest 5%
|
||||
playbackRate = Math.max(0.05, Math.min(2.0, playbackRate)); // Clamp to 5% to 200%
|
||||
|
||||
if (audioInstTrack != null)
|
||||
{
|
||||
audioInstTrack.volume = instTargetVolume;
|
||||
#if FLX_PITCH
|
||||
audioInstTrack.pitch = playbackRate;
|
||||
#end
|
||||
audioInstTrack.onComplete = null;
|
||||
}
|
||||
if (audioVocalTrackGroup != null)
|
||||
{
|
||||
audioVocalTrackGroup.playerVolume = vocalPlayerTargetVolume;
|
||||
audioVocalTrackGroup.opponentVolume = vocalOpponentTargetVolume;
|
||||
#if FLX_PITCH
|
||||
audioVocalTrackGroup.pitch = playbackRate;
|
||||
#end
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6309,6 +6319,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
|
||||
public function postLoadInstrumental():Void
|
||||
{
|
||||
// Reapply the volume and playback rate.
|
||||
var instTargetVolume:Float = menubarItemVolumeInstrumental.value ?? 1.0;
|
||||
var playbackRate = ((menubarItemPlaybackSpeed.value ?? 1.0) * 2.0) / 100.0;
|
||||
playbackRate = Math.floor(playbackRate / 0.05) * 0.05; // Round to nearest 5%
|
||||
playbackRate = Math.max(0.05, Math.min(2.0, playbackRate)); // Clamp to 5% to 200%
|
||||
if (audioInstTrack != null)
|
||||
{
|
||||
// Prevent the time from skipping back to 0 when the song ends.
|
||||
|
@ -6321,6 +6336,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
}
|
||||
audioVocalTrackGroup.pause();
|
||||
};
|
||||
audioInstTrack.volume = instTargetVolume;
|
||||
#if FLX_PITCH
|
||||
audioInstTrack.pitch = playbackRate;
|
||||
#end
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -6337,6 +6356,25 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
healthIconsDirty = true;
|
||||
}
|
||||
|
||||
public function postLoadVocals():Void
|
||||
{
|
||||
// Reapply the volume and playback rate.
|
||||
var vocalPlayerTargetVolume:Float = menubarItemVolumeVocalsPlayer.value ?? 1.0;
|
||||
var vocalOpponentTargetVolume:Float = menubarItemVolumeVocalsOpponent.value ?? 1.0;
|
||||
var playbackRate = ((menubarItemPlaybackSpeed.value ?? 1.0) * 2.0) / 100.0;
|
||||
playbackRate = Math.floor(playbackRate / 0.05) * 0.05; // Round to nearest 5%
|
||||
playbackRate = Math.max(0.05, Math.min(2.0, playbackRate)); // Clamp to 5% to 200%
|
||||
|
||||
if (audioVocalTrackGroup != null)
|
||||
{
|
||||
audioVocalTrackGroup.playerVolume = vocalPlayerTargetVolume;
|
||||
audioVocalTrackGroup.opponentVolume = vocalOpponentTargetVolume;
|
||||
#if FLX_PITCH
|
||||
audioVocalTrackGroup.pitch = playbackRate;
|
||||
#end
|
||||
}
|
||||
}
|
||||
|
||||
function hardRefreshOffsetsToolbox():Void
|
||||
{
|
||||
var offsetsToolbox:ChartEditorOffsetsToolbox = cast this.getToolbox(CHART_EDITOR_TOOLBOX_OFFSETS_LAYOUT);
|
||||
|
|
|
@ -146,6 +146,8 @@ class ChartEditorAudioHandler
|
|||
result = playVocals(state, DAD, opponentId, instId);
|
||||
// if (!result) return false;
|
||||
|
||||
state.postLoadVocals();
|
||||
|
||||
var perfE:Float = TimerUtil.start();
|
||||
|
||||
state.hardRefreshOffsetsToolbox();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue