|
@@ -46,7 +46,7 @@ export enum IPlatform {
|
|
|
const classids = [1, 2, 6, 7, 8, 9, 3, 10, 11, 12, 13, 4, 14, 15, 16, 17, 30, 31, 35, 36, 46, 108]; // 大雅金唐, 竖笛教程, 声部训练展开的分类ID
|
|
|
|
|
|
// 乐器code码
|
|
|
-const musicalInstrumentCodeInfo = [
|
|
|
+export const musicalInstrumentCodeInfo = [
|
|
|
{
|
|
|
name: '排箫',
|
|
|
code: 'Panpipes',
|
|
@@ -253,6 +253,8 @@ const state = reactive({
|
|
|
scrollContainer: "musicAndSelection",
|
|
|
/** 是否是打击乐 */
|
|
|
isPercussion: false,
|
|
|
+ /** 评测标准 */
|
|
|
+ evaluationStandard: '',
|
|
|
/** 是否重复节拍器的时间 */
|
|
|
repeatedBeats: 0,
|
|
|
/**当前曲谱中所有声部名字 */
|
|
@@ -283,8 +285,10 @@ const state = reactive({
|
|
|
repeatInfo: [],
|
|
|
/** 多分轨的曲子,可支持筛选的分轨 */
|
|
|
canSelectTracks: [] as any,
|
|
|
- /** 声部codeId,用于匹配乐器指法、声部转调、特殊声部处理等 */
|
|
|
+ /** 声部codeId */
|
|
|
subjectCodeId: 0 as number,
|
|
|
+ /** 乐器codeId,用于匹配乐器指法、声部转调、特殊声部处理等 */
|
|
|
+ musicalCodeId: 0 as number,
|
|
|
/** 合奏曲目是否合并展示 */
|
|
|
isCombineRender: false,
|
|
|
/** 小节的持续时长,以后台设置的播放速度计算 */
|
|
@@ -793,9 +797,14 @@ const setState = (data: any, index: number) => {
|
|
|
state.partIndex = index;
|
|
|
state.trackId = data.track;
|
|
|
state.subjectId = data.subjectIds ? data.subjectIds.split(',')?.[0] : 0;
|
|
|
+ // 声部code
|
|
|
const subjectCode = data.subjectCodes ? data.subjectCodes.split(',')?.[0] : 0;
|
|
|
+ // 乐器code
|
|
|
+ let musicalCode = data.musicalInstrumentIdCodes ? data.musicalInstrumentIdCodes.split(',')?.[0] : 0;
|
|
|
const pitchSubject = musicalInstrumentCodeInfo.find((n) => n.code === subjectCode)
|
|
|
+ const pitchMusical = musicalInstrumentCodeInfo.find((n) => n.code === musicalCode)
|
|
|
state.subjectCodeId = pitchSubject ? pitchSubject.id : 0
|
|
|
+ state.musicalCodeId = pitchMusical ? pitchMusical.id : 0
|
|
|
state.categoriesId = data.musicCategoryId;
|
|
|
state.categoriesName = data.musicTagNames;
|
|
|
// state.enableEvaluation = data.isEvaluated ? true : false;
|
|
@@ -813,7 +822,7 @@ const setState = (data: any, index: number) => {
|
|
|
}
|
|
|
}
|
|
|
// 曲子包含节拍器,就不开启节拍器
|
|
|
- state.needTick = data.isUseSystemBeat ? true : false;
|
|
|
+ state.needTick = data.isUseSystemBeat && data.isPlayBeat ? true : false;
|
|
|
state.isOpenMetronome = data.isUseSystemBeat ? false : true;
|
|
|
state.isShowFingering = data.isShowFingering ? true : false;
|
|
|
state.music = data.music;
|
|
@@ -827,7 +836,6 @@ const setState = (data: any, index: number) => {
|
|
|
state.track = track ? track.replace(/ /g, "").toLocaleLowerCase() : "";
|
|
|
// 能否评测,根据当前声轨有无伴奏判断
|
|
|
state.enableEvaluation = state.accompany ? true : false
|
|
|
- state.enableNotation = data.isConvertibleScore === null ? true : data.isConvertibleScore;
|
|
|
state.isConcert = data.musicSheetType === "CONCERT" ? true : false;
|
|
|
// multiTracksSelection 返回为空,默认代表全部分轨
|
|
|
state.canSelectTracks = data.multiTracksSelection === "null" || data.multiTracksSelection === "" || data.multiTracksSelection === null ? [] : data.multiTracksSelection?.split(',');
|
|
@@ -843,6 +851,7 @@ const setState = (data: any, index: number) => {
|
|
|
*/
|
|
|
// state.isPercussion = isRhythmicExercises();
|
|
|
state.isPercussion = data.evaluationStandard === "AMPLITUDE" || data.evaluationStandard === "DECIBELS";
|
|
|
+ state.evaluationStandard = data.evaluationStandard?.toLocaleLowerCase() || ''
|
|
|
// 设置是否特殊曲谱, 是特殊曲谱取反(不理解之前的思考逻辑), 使用后台设置的速度
|
|
|
// state.isSpecialBookCategory = !classids.includes(data.musicCategoryId);
|
|
|
|
|
@@ -852,10 +861,11 @@ const setState = (data: any, index: number) => {
|
|
|
* 各平台的乐器声部id不统一,为了兼容处理老的数据,加上乐器code码,此码唯一
|
|
|
* 获取指法code
|
|
|
*/
|
|
|
- const code = state.isConcert ? matchVoicePart(state.trackId, "CONCERT") : matchVoicePart(state.subjectCodeId, "SINGLE");
|
|
|
+ const code = state.isConcert ? matchVoicePart(state.trackId, "CONCERT") : matchVoicePart(state.musicalCodeId, "SINGLE");
|
|
|
state.fingeringInfo = subjectFingering(code);
|
|
|
console.log("🚀 ~ state.fingeringInfo:", code, state.fingeringInfo, state.trackId, state.track);
|
|
|
|
|
|
+ state.musicalCodeId = state.fingeringInfo?.id || 0
|
|
|
// 如果切换的声轨没有指法,择指法开关置灰并且不可点击
|
|
|
if (!state.fingeringInfo.name && state.setting.displayFingering) {
|
|
|
state.setting.displayFingering = false
|
|
@@ -872,8 +882,25 @@ const setState = (data: any, index: number) => {
|
|
|
state.zoom = query.zoom || 1.5;
|
|
|
}
|
|
|
|
|
|
- //课堂乐器, 渲染类型: 五线谱, 简谱
|
|
|
- state.musicRenderType = query.musicRenderType || EnumMusicRenderType.firstTone;
|
|
|
+ /**
|
|
|
+ * 默认渲染什么谱面类型 & 能否转谱逻辑
|
|
|
+ * 渲染类型:首先取url参数musicRenderType,没有该参数则取musicalInstruments字段匹配的当前分轨的defaultScore,没有匹配到则取默认值('firstTone')
|
|
|
+ * 能否转谱:先取isConvertibleScore字段,如果isConvertibleScore为true,则取musicalInstruments字段匹配的当前分轨的transferFlag,都为true则可以转谱
|
|
|
+ *
|
|
|
+ */
|
|
|
+ let pitchTrack = null
|
|
|
+ if (state.isConcert) {
|
|
|
+ musicalCode = musicalInstrumentCodeInfo.find((item: any) => item.id === state.musicalCodeId)?.code
|
|
|
+ pitchTrack = data.musicalInstruments?.find((item: any) => item.code === musicalCode)
|
|
|
+ } else {
|
|
|
+ pitchTrack = data.musicalInstruments?.find((item: any) => item.code === musicalCode)
|
|
|
+ }
|
|
|
+ let musicalRenderType = ''
|
|
|
+ if (pitchTrack?.defaultScore) {
|
|
|
+ musicalRenderType = pitchTrack?.defaultScore === 'STAVE' ? 'staff' : pitchTrack?.defaultScore === 'JIAN' ? 'firstTone' : pitchTrack?.defaultScore === 'FIRST' ? 'fixedTone' : ''
|
|
|
+ }
|
|
|
+ state.musicRenderType = query.musicRenderType || musicalRenderType || EnumMusicRenderType.firstTone;
|
|
|
+ state.enableNotation = pitchTrack ? data.isConvertibleScore && pitchTrack.transferFlag : data.isConvertibleScore
|
|
|
console.log("state对象", state);
|
|
|
// 评测基准频率
|
|
|
state.baseFrequency = data.evaluationFrequency ? data.evaluationFrequency.split(",")[0] : 440
|