|
@@ -425,7 +425,13 @@ export const onPlay = () => {
|
|
|
const autoResetPlay = () => {
|
|
|
// 作业模式,出现作业提交弹窗时,不进行自动重播逻辑
|
|
|
if (state.modeType !== "practise" || state.showWorkDonePop) return;
|
|
|
- skipNotePlay(0, true);
|
|
|
+ // 如果是midi的曲子,并且有选段,重置到预备小节的位置
|
|
|
+ if (state.isAppPlay && state.section.length === 2) {
|
|
|
+ const startItemINdex = state.sectionFirst ? state.sectionFirst.i : state.section[1].i;
|
|
|
+ skipNotePlay(startItemINdex, true);
|
|
|
+ } else {
|
|
|
+ skipNotePlay(0, true);
|
|
|
+ }
|
|
|
// 没有开启自动重播, 不是练习模式
|
|
|
if (!state.setting.repeatAutoPlay) return;
|
|
|
offsetTop = 0;
|
|
@@ -584,12 +590,17 @@ const handlePlaying = () => {
|
|
|
|
|
|
};
|
|
|
/** 跳转到指定音符开始播放 */
|
|
|
-export const skipNotePlay = async (itemIndex: number, isStart = false) => {
|
|
|
+export const skipNotePlay = async (itemIndex: number, isStart = false, handType?: string) => {
|
|
|
if (state.isPreView) return;
|
|
|
- console.log('点击音符')
|
|
|
// 点击或者重播的时候清除一行谱的时间信息
|
|
|
state.isSingleLine && (smoothAnimationState.oldCurrentTime = 0)
|
|
|
+ if (handType === 'manual' && (query.workRecord)) return;
|
|
|
const item = state.times[itemIndex];
|
|
|
+ // 如果是选段状态,可以点击段落范围内的音符,从当前音符开始播放,如果不是段落内的音符,直接return
|
|
|
+ if (handType === 'manual' && state.section.length === 2 && !(item.MeasureNumberXML >= state.section[0].MeasureNumberXML && item.MeasureNumberXML <= state.section[1].MeasureNumberXML)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ console.log('点击音符')
|
|
|
let itemTime = item.time;
|
|
|
if (isStart) {
|
|
|
itemTime = 0;
|
|
@@ -656,7 +667,8 @@ export const togglePlay = async (playState: "play" | "paused", isForceCLoseToast
|
|
|
}
|
|
|
skipNotePlay(state.activeNoteIndex, false);
|
|
|
await api_cloudChangeSpeed({
|
|
|
- speed: state.modeType === "evaluating" ? state.originSpeed : state.speed,
|
|
|
+ // speed: state.modeType === "evaluating" ? state.originSpeed : state.speed,
|
|
|
+ speed: state.speed,
|
|
|
originalSpeed: state.originSpeed,
|
|
|
songID: state.examSongId,
|
|
|
});
|
|
@@ -1444,7 +1456,7 @@ function initMusicSource(data: any, tracks: string[], partIndex: number, workRec
|
|
|
state.partListNames = tracks
|
|
|
}
|
|
|
// 当没有任何曲目的时候报错
|
|
|
- if (!musicObj?.audioFileUrl && !accompanyObj?.audioFileUrl && !fanSongObj?.audioFileUrl && !banSongObj?.audioFileUrl && !fanSongObj?.solmizationFileUrl && !fanSongObj?.femaleSolmizationFileUrl) {
|
|
|
+ if (!musicObj?.audioFileUrl && !accompanyObj?.audioFileUrl && !fanSongObj?.audioFileUrl && !banSongObj?.audioFileUrl && !fanSongObj?.solmizationFileUrl && !fanSongObj?.femaleSolmizationFileUrl && data.playMode !== 'MIDI') {
|
|
|
state.noMusicSource = true // 没有音源文件
|
|
|
// 独奏的时候
|
|
|
if(musicSheetType === "SINGLE"){
|
|
@@ -1609,6 +1621,10 @@ const setState = (data: any, index: number) => {
|
|
|
state.isShowFingering = data.isShowFingering ? true : false;
|
|
|
// 设置曲谱的播放模式, APP播放(midi音频是app播放) | h5播放
|
|
|
state.isAppPlay = data.playMode === 'MIDI';
|
|
|
+ if (state.isAppPlay) {
|
|
|
+ state.isOpenMetronome = false
|
|
|
+ state.isSingOpenMetronome = false
|
|
|
+ }
|
|
|
state.midiUrl = data.midiFileUrl;
|
|
|
state.parentCategoriesId = data.musicTag;
|
|
|
state.musicSheetCategoriesId = data.musicCategoryId;
|