|
@@ -914,6 +914,7 @@ export const resetPlaybackToStart = () => {
|
|
|
|
|
|
/** 跳转到指定音符 */
|
|
|
export const gotoCustomNote = (index: number) => {
|
|
|
+ console.log('跳转位置1111',index)
|
|
|
try {
|
|
|
state.osmd.cursor.reset();
|
|
|
} catch (error) { }
|
|
@@ -1042,6 +1043,7 @@ export const gotoNext = (note: any, skipNote?: boolean) => {
|
|
|
let prev = state.activeNoteIndex;
|
|
|
state.activeNoteIndex = num;
|
|
|
state.activeMeasureIndex = note.MeasureNumberXML;
|
|
|
+ osmd.cursor.activeMeasureNum = note.MeasureNumberXML;
|
|
|
dynamicShowPlaySpeed(state.activeNoteIndex);
|
|
|
if (prev && num - prev === 1) {
|
|
|
// console.log('跳转音符',11111,osmd.cursor)
|
|
@@ -1052,14 +1054,19 @@ export const gotoNext = (note: any, skipNote?: boolean) => {
|
|
|
// }
|
|
|
osmd.cursor.next();
|
|
|
|
|
|
- } else if (prev && num - prev > 0) {
|
|
|
+ } else if (prev >= 0 && num - prev > 0) {
|
|
|
while (num - prev > 0) {
|
|
|
prev++;
|
|
|
// console.log('跳转音符',22222)
|
|
|
osmd.cursor.next();
|
|
|
}
|
|
|
- } else {
|
|
|
- gotoCustomNote(num);
|
|
|
+ } else if (prev >= 0) {
|
|
|
+ // gotoCustomNote(num);
|
|
|
+ while (prev - num > 0) {
|
|
|
+ prev--;
|
|
|
+ // console.log('跳转音符',22222)
|
|
|
+ osmd.cursor.previous();
|
|
|
+ }
|
|
|
}
|
|
|
/* 取消光标了 */
|
|
|
// try {
|
|
@@ -1135,7 +1142,7 @@ export const handleSetSpeed = (speed: number) => {
|
|
|
// setStorageSpeed(state.examSongId, speed);
|
|
|
state.speed = speed;
|
|
|
// 当前的音符
|
|
|
- const currentItem: any = (state.sectionStatus && state.section.length === 2) ? state.sectionFirst || state.section[0] : state.times[state.activeNoteIndex];
|
|
|
+ const currentItem: any = (state.sectionStatus && state.section.length === 2) ? state.section[0] : state.times[state.activeNoteIndex];
|
|
|
state.basePlayRate = currentItem?.measureSpeed ? state.speed / currentItem.measureSpeed : state.speed / state.originSpeed;
|
|
|
const actualRate = state.originAudioPlayRate * state.basePlayRate;
|
|
|
console.log('速度设置',speed,'小节计算的倍率',state.basePlayRate,'实际播放倍率',actualRate)
|
|
@@ -1294,7 +1301,7 @@ export const hanldeDirectSelection = (list: any[]) => {
|
|
|
setTimeout(() => {
|
|
|
state.section = formateSelectMearure(list);
|
|
|
// 选段完成后,需要根据预报小节的速度,设置右下角显示的速度
|
|
|
- const currentItem: any = (state.sectionStatus && state.section.length === 2) ? state.sectionFirst || state.section[0] : state.times[state.activeNoteIndex];
|
|
|
+ const currentItem: any = (state.sectionStatus && state.section.length === 2) ? state.section[0] : state.times[state.activeNoteIndex];
|
|
|
if (currentItem.measureSpeed && query.workRecord === undefined && query.evaluatingRecord === undefined) {
|
|
|
handleSetSpeed(currentItem.measureSpeed);
|
|
|
}
|