3 Commitit 66f5d5d93f ... f6673cc1bd

Tekijä SHA1 Viesti Päivämäärä
  TIANYONG f6673cc1bd Merge branch 'feature-tianyong-newVersion' into ktyq-test-new 3 viikkoa sitten
  TIANYONG 1f9101b935 fix: bug修复 3 viikkoa sitten
  TIANYONG 81352a2f3b feat: 计算节拍器时长修改 4 kuukautta sitten
4 muutettua tiedostoa jossa 9 lisäystä ja 5 poistoa
  1. 4 2
      src/helpers/formateMusic.ts
  2. 2 0
      src/state.ts
  3. 1 1
      src/view/music-score/index.tsx
  4. 2 2
      vite.config.ts

+ 4 - 2
src/helpers/formateMusic.ts

@@ -35,7 +35,7 @@ export const getFixTime = (speed: number) => {
 	const duration: any = getDuration(state.osmd as unknown as OpenSheetMusicDisplay);
 	let numerator = duration.numerator || 0;
 	let denominator = duration.denominator || 4;
-	const beatUnit = duration.beatUnit || "quarter";
+	const beatUnit = "quarter";
 	// if (state.repeatedBeats) {
 	// 	// 音频制作问题仅2拍不重复
 	// 	numerator = numerator === 2 ? 4 : numerator;
@@ -965,6 +965,7 @@ export const formatXML = (xml: string, xmlUrl?: string, resourceType?: string):
 				// TODO:删除妙极客曲子无意义的words
 				// wordArr?.push(word?.textContent)
 				if (word?.textContent && reg.test(word?.textContent) && word?.parentNode?.parentNode) {
+					// console.log('测试',1,measure)
 					measure.removeChild(word.parentNode.parentNode);
 					// deleteWordArr?.push(word?.textContent)
 				}
@@ -1558,7 +1559,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 			 * 曲子:1795013295024062466(春暖花开),如果音符有times信息,休止符没有times信息,此种规则是认为休止符不参与时值计算的,需要过滤掉该休止符
 			 */
 			let evNoteStartTime = 0, evNoteEndTime = 0;
-			if (state.isEvxml && note?.noteTimeInfo?.length === 0 && state.xmlHasTimes ) {
+			if (state.isEvxml && note?.noteTimeInfo?.length === 0 && state.xmlHasTimes && !state.isCustomNoteTime) {
 				// 找出这个音符前面音符的结束时间
 				let preNoteTImes = allNotes[allNotes.length - 1]?.endtime*1000
 				if(!preNoteTImes){
@@ -1980,6 +1981,7 @@ const analyzeEvxml = (xmlParse: any, xmlUrl?: string) => {
 	const denNum2 = xmlParse.getElementsByTagName("timegap")[0]?.getElementsByTagName("values")[0]?.getElementsByTagName("item")[1]?.getAttribute('den');
 	const timeGaps: any = xmlParse.getElementsByTagName("timegap")?.length ? Array.from(xmlParse.getElementsByTagName("timegap")?.[0]?.getElementsByTagName("values")?.[0]?.getElementsByTagName("item")) : [];
 	state.xmlHasTimes = !!xmlParse.getElementsByTagName("times")?.length
+	state.isCustomNoteTime = !!xmlParse.getElementsByTagName("custom-note-time")?.length
 	// 第一个音符的起始时间
 	const firstMeasure = xmlParse.getElementsByTagName("measure")[0];
 	if (firstMeasure) {

+ 2 - 0
src/state.ts

@@ -380,6 +380,8 @@ const state = reactive({
   headTopHeight: 0,
   /** 是否是来源于缓存的xml */
   xmlFromStore: false,
+  /** 是否是自定义的note时值 */
+  isCustomNoteTime: false,    
 });
 const browserInfo = browser();
 let offset_duration = 0;

+ 1 - 1
src/view/music-score/index.tsx

@@ -117,7 +117,7 @@ export default defineComponent({
 				renderSingleHorizontalStaffline: state.isSingleLine ? true : false,
 				// autoGenerateMultipleRestMeasuresFromRestMeasures: state.isSingleLine ? false : true, // 连续休止小节是否合并显示
 				autoGenerateMultipleRestMeasuresFromRestMeasures: state.setting.combineMultipleRest, // 是否自动合并休止小节
-				drawLyrics: ((state.playType === 'sing' || !state.isEvxml || state.isCreateImg || query.showLyrics === '1') && !state.isSimplePage) ? true : false, // 演唱模式才渲染歌词,simple页面不显示歌词
+				drawLyrics: ((state.playType === 'sing' || state.playType === 'play' || !state.isEvxml || state.isCreateImg || query.showLyrics === '1') && !state.isSimplePage) ? true : false, // 演唱模式才渲染歌词,simple页面不显示歌词
 				// darkMode: true, // 暗黑模式
 				// pageFormat: 'A4_P',
 				// autoBeam: true,

+ 2 - 2
vite.config.ts

@@ -84,9 +84,9 @@ export default defineConfig({
         // target: "https://kt.colexiu.com",
         // target: "https://test.lexiaoya.cn",
         // target: "https://kt.colexiu.com",
-        target: "https://test.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
+        // target: "https://test.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
         // target: "https://test.kt.colexiu.com",
-        // target: "https://mec.colexiu.com",
+        target: "https://mec.colexiu.com",
         changeOrigin: true,
         rewrite: (path) => path.replace(/^\/instrument/, ""),
       },