|
@@ -759,16 +759,16 @@ export const skipNotePlay = async (itemIndex: number, isStart = false) => {
|
|
|
|
|
|
/**
|
|
|
* 切换曲谱播放状态
|
|
|
- * @param playState 可选: 默认 undefined, 需要切换的状态 play:播放, paused: 暂停
|
|
|
+ * @param playState 需要切换的状态 play:播放, paused: 暂停
|
|
|
*/
|
|
|
-export const togglePlay = async (playState?: "play" | "paused", sourceType?: string) => {
|
|
|
+export const togglePlay = async (playState: "play" | "paused", sourceType?: string) => {
|
|
|
// 如果mp3资源还在加载中,给出提示
|
|
|
if (!state.isAppPlay && !state.audioDone) {
|
|
|
if (sourceType !== 'courseware') showToast('音频资源加载中,请稍后')
|
|
|
return
|
|
|
}
|
|
|
// 播放之前 当为评测模式和不为MIDI时候按 是否禁用节拍器 切换音源
|
|
|
- if ((playState ? playState : state.playState === "paused" ? "play" : "paused") === 'play' && state.modeType === "practise" && state.playMode !== "MIDI") {
|
|
|
+ if (playState === 'play' && state.modeType === "practise" && state.playMode !== "MIDI") {
|
|
|
console.log("设置音源")
|
|
|
changeSongSourceByBate(metronomeData.disable)
|
|
|
}
|
|
@@ -779,6 +779,8 @@ export const togglePlay = async (playState?: "play" | "paused", sourceType?: str
|
|
|
songID: state.examSongId,
|
|
|
})
|
|
|
state.playState = 'paused'
|
|
|
+ // 当在节拍器播放期间暂停的话 就暂停节拍器
|
|
|
+ closeTick()
|
|
|
return
|
|
|
}
|
|
|
skipNotePlay(state.activeNoteIndex, false);
|
|
@@ -791,7 +793,7 @@ export const togglePlay = async (playState?: "play" | "paused", sourceType?: str
|
|
|
const status = cloudGetMediaStatus?.content.status === "suspend" ? "play" : "paused"
|
|
|
state.playState = status
|
|
|
} else {
|
|
|
- state.playState = playState ? playState : state.playState === "paused" ? "play" : "paused";
|
|
|
+ state.playState = playState;
|
|
|
}
|
|
|
if (state.playState === "play" && state.sectionStatus && state.section.length == 2 && state.playProgress === 0) {
|
|
|
resetPlaybackToStart();
|