|
@@ -2138,16 +2138,16 @@ export struct LocalMusic {
|
|
|
//
|
|
//
|
|
|
// this.showCutDialogForMultipleFiles(true, 'music_cut_current')
|
|
// this.showCutDialogForMultipleFiles(true, 'music_cut_current')
|
|
|
// })
|
|
// })
|
|
|
- Button('复制', { type: ButtonType.Circle, stateEffect: true })
|
|
|
|
|
- .width('35%')
|
|
|
|
|
- .height(60)
|
|
|
|
|
- .id('music_copy_current')// .visibility(this.isHasDir?Visibility.None:Visibility.None)
|
|
|
|
|
- .margin({ top: 10, bottom: 10, right: 6 })
|
|
|
|
|
- .backgroundColor(this.themeColor)
|
|
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
|
|
|
- .onClick(() => {
|
|
|
|
|
- this.showCopyDialogForMultipleFiles(false, 'music_copy_current')
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // Button('复制', { type: ButtonType.Circle, stateEffect: true })
|
|
|
|
|
+ // .width('35%')
|
|
|
|
|
+ // .height(60)
|
|
|
|
|
+ // .id('music_copy_current')// .visibility(this.isHasDir?Visibility.None:Visibility.None)
|
|
|
|
|
+ // .margin({ top: 10, bottom: 10, right: 6 })
|
|
|
|
|
+ // .backgroundColor(this.themeColor)
|
|
|
|
|
+ // .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
|
|
|
+ // .onClick(() => {
|
|
|
|
|
+ // this.showCopyDialogForMultipleFiles(false, 'music_copy_current')
|
|
|
|
|
+ // })
|
|
|
|
|
|
|
|
Button('删除', { type: ButtonType.Circle, stateEffect: true })
|
|
Button('删除', { type: ButtonType.Circle, stateEffect: true })
|
|
|
.width('35%')
|
|
.width('35%')
|
|
@@ -4811,7 +4811,7 @@ export struct LocalMusic {
|
|
|
TYER:this.yearStr,
|
|
TYER:this.yearStr,
|
|
|
genre:this.genreStr,
|
|
genre:this.genreStr,
|
|
|
track:this.trackStr,
|
|
track:this.trackStr,
|
|
|
- albumartist:this.albumArtistStr,
|
|
|
|
|
|
|
+ album_artist:this.albumArtistStr,
|
|
|
TPE2:this.albumArtistStr,//ID3v2 中通常没有专门的 "专辑艺术家" 字段,但有些软件会使用 TPE2 来表示专辑艺
|
|
TPE2:this.albumArtistStr,//ID3v2 中通常没有专门的 "专辑艺术家" 字段,但有些软件会使用 TPE2 来表示专辑艺
|
|
|
COMPOSER:this.composerStr,
|
|
COMPOSER:this.composerStr,
|
|
|
lyricist:this.lyricistStr,
|
|
lyricist:this.lyricistStr,
|
|
@@ -4905,11 +4905,11 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
Image(StrUtil.isNotEmpty(this.imagePathStr)?this.imagePathStr.startsWith('http')?
|
|
Image(StrUtil.isNotEmpty(this.imagePathStr)?this.imagePathStr.startsWith('http')?
|
|
|
this.imagePathStr:fileUri.getUriFromPath(this.imagePathStr):
|
|
this.imagePathStr:fileUri.getUriFromPath(this.imagePathStr):
|
|
|
- StrUtil.isEmpty(item.pixelMapPath) ? $r('app.media.music_red') :
|
|
|
|
|
|
|
+ StrUtil.isEmpty(item.pixelMapPath) ? $r('app.media.add') :
|
|
|
item.pixelMapPath)
|
|
item.pixelMapPath)
|
|
|
.fillColor(this.themeColor)
|
|
.fillColor(this.themeColor)
|
|
|
- .height(55)
|
|
|
|
|
- .width(55)
|
|
|
|
|
|
|
+ .height(66)
|
|
|
|
|
+ .width(66)
|
|
|
.borderRadius('100%')
|
|
.borderRadius('100%')
|
|
|
.clip(true)
|
|
.clip(true)
|
|
|
.opacity(this.opacityItem)// 绑定透明度
|
|
.opacity(this.opacityItem)// 绑定透明度
|
|
@@ -5094,6 +5094,58 @@ export struct LocalMusic {
|
|
|
.margin({ top: 10, bottom: 10 })
|
|
.margin({ top: 10, bottom: 10 })
|
|
|
.justifyContent(FlexAlign.Start)
|
|
.justifyContent(FlexAlign.Start)
|
|
|
|
|
|
|
|
|
|
+ Row() {
|
|
|
|
|
+ Column(){
|
|
|
|
|
+ Text('歌词:')
|
|
|
|
|
+ .fontSize(14)
|
|
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
|
|
+ .margin({ left: 22 })
|
|
|
|
|
+
|
|
|
|
|
+ Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
|
|
+ SymbolGlyph($r('sys.symbol.trash_fill'))
|
|
|
|
|
+ .fontSize(25)
|
|
|
|
|
+ .alignSelf(ItemAlign.Center)
|
|
|
|
|
+ .margin({ left: 22,top:25})
|
|
|
|
|
+ }
|
|
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
|
|
+ .visibility(StrUtil.isEmpty(this.tempLyricContent)&&StrUtil.isEmpty(this.lyricConStr)?
|
|
|
|
|
+ Visibility.None:Visibility.Visible)
|
|
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
|
|
|
|
|
+ .onClick(()=>{
|
|
|
|
|
+ this.lyricConStr = ''
|
|
|
|
|
+ this.lyricContent = ''
|
|
|
|
|
+ this.tempLyricContent = ''
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
|
|
+ SymbolGlyph($r('sys.symbol.plus'))
|
|
|
|
|
+ .fontSize(25)
|
|
|
|
|
+ .alignSelf(ItemAlign.Center)
|
|
|
|
|
+ .margin({ left: 22,top:25})
|
|
|
|
|
+ }
|
|
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
|
|
|
|
|
+ .onClick( ()=>{
|
|
|
|
|
+ this.callFilePickerSelectFileForLyric()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ TextArea({ text: StrUtil.isNotEmpty(this.lyricConStr)?this.lyricConStr:
|
|
|
|
|
+ this.tempLyricContent })
|
|
|
|
|
+ .type(TextAreaType.NORMAL)
|
|
|
|
|
+ .height(StrUtil.isEmpty(this.lyricConStr)&&StrUtil.isEmpty(this.tempLyricContent)?100:'auto')
|
|
|
|
|
+ .fontSize(14)
|
|
|
|
|
+ .layoutWeight(1)
|
|
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
|
|
+ .margin({ right: 20, left: 10 })
|
|
|
|
|
+ .onChange((val: string) => {
|
|
|
|
|
+ this.lyricConStr = val
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .margin({ top: 10, bottom: 10 })
|
|
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
|
|
+
|
|
|
Row() {
|
|
Row() {
|
|
|
Text('年份:')
|
|
Text('年份:')
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
@@ -5257,45 +5309,7 @@ export struct LocalMusic {
|
|
|
.margin({ top: 10, bottom: 10 })
|
|
.margin({ top: 10, bottom: 10 })
|
|
|
.justifyContent(FlexAlign.Start)
|
|
.justifyContent(FlexAlign.Start)
|
|
|
|
|
|
|
|
- Row() {
|
|
|
|
|
- Column(){
|
|
|
|
|
- Text('歌词:')
|
|
|
|
|
- .fontSize(14)
|
|
|
|
|
- .fontColor($r('app.color.text_color'))
|
|
|
|
|
- .margin({ left: 22 })
|
|
|
|
|
-
|
|
|
|
|
- Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
|
|
- SymbolGlyph($r('sys.symbol.trash_fill'))
|
|
|
|
|
- .fontSize(25)
|
|
|
|
|
- .alignSelf(ItemAlign.Center)
|
|
|
|
|
- .margin({ left: 22,top:15})
|
|
|
|
|
- }
|
|
|
|
|
- .backgroundColor(Color.Transparent)
|
|
|
|
|
- .visibility(StrUtil.isEmpty(this.tempLyricContent)&&StrUtil.isEmpty(this.lyricConStr)?
|
|
|
|
|
- Visibility.None:Visibility.Visible)
|
|
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
|
|
|
|
|
- .onClick(()=>{
|
|
|
|
|
- this.lyricConStr = ''
|
|
|
|
|
- this.lyricContent = ''
|
|
|
|
|
- this.tempLyricContent = ''
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- TextArea({ text: StrUtil.isNotEmpty(this.lyricConStr)?this.lyricConStr:
|
|
|
|
|
- this.tempLyricContent })
|
|
|
|
|
- .type(TextAreaType.NORMAL)
|
|
|
|
|
- .height('auto')
|
|
|
|
|
- .fontSize(14)
|
|
|
|
|
- .layoutWeight(1)
|
|
|
|
|
- .fontColor($r('app.color.text_color'))
|
|
|
|
|
- .margin({ right: 20, left: 10 })
|
|
|
|
|
- .onChange((val: string) => {
|
|
|
|
|
- this.lyricConStr = val
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .margin({ top: 10, bottom: 10 })
|
|
|
|
|
- .justifyContent(FlexAlign.Start)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Row() {
|
|
Row() {
|
|
@@ -6817,7 +6831,7 @@ export struct LocalMusic {
|
|
|
* - 支持加密歌词文件(.lrcc),自动检测并解密。
|
|
* - 支持加密歌词文件(.lrcc),自动检测并解密。
|
|
|
* - 歌词内容解析后通过lyricController驱动UI渲染。
|
|
* - 歌词内容解析后通过lyricController驱动UI渲染。
|
|
|
*/
|
|
*/
|
|
|
- async initLyric(lyricPath: string, isOnLineAndToast?: boolean, isApi2?: boolean) {
|
|
|
|
|
|
|
+ async initLyric(lyricPath: string, isOnLineAndToast?: boolean, isApi2?: boolean, isLocal?: boolean) {
|
|
|
if (StrUtil.isEmpty(lyricPath)) {
|
|
if (StrUtil.isEmpty(lyricPath)) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -6866,7 +6880,7 @@ export struct LocalMusic {
|
|
|
if(lyContent&&StrUtil.isNotEmpty(lyContent)){//取数据库里面的歌词lyContent
|
|
if(lyContent&&StrUtil.isNotEmpty(lyContent)){//取数据库里面的歌词lyContent
|
|
|
neiqianLrc = lyContent
|
|
neiqianLrc = lyContent
|
|
|
}
|
|
}
|
|
|
- if (StrUtil.isNotEmpty(neiqianLrc) && !isOnLineAndToast) {
|
|
|
|
|
|
|
+ if (StrUtil.isNotEmpty(neiqianLrc) && !isOnLineAndToast&&!isLocal&&!isLocal) {
|
|
|
console.log("onecold 找到内嵌歌词 neiqianLrc =" + neiqianLrc)
|
|
console.log("onecold 找到内嵌歌词 neiqianLrc =" + neiqianLrc)
|
|
|
//赋值给this.lyricContent,播控中心才可以显示歌词
|
|
//赋值给this.lyricContent,播控中心才可以显示歌词
|
|
|
this.lyricContent = neiqianLrc
|
|
this.lyricContent = neiqianLrc
|
|
@@ -7005,6 +7019,9 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
console.info(`onecold The content of file2: ${fileContent}`);
|
|
console.info(`onecold The content of file2: ${fileContent}`);
|
|
|
this.lyricContent = fileContent
|
|
this.lyricContent = fileContent
|
|
|
|
|
+ if(isLocal){//编辑标签选择本地歌词需要赋值给this.lyricConStr
|
|
|
|
|
+ this.lyricConStr = fileContent
|
|
|
|
|
+ }
|
|
|
// 将文件内容按行分割成字符串数组
|
|
// 将文件内容按行分割成字符串数组
|
|
|
let lines = fileContent.split('\n').map(line => line.trim());
|
|
let lines = fileContent.split('\n').map(line => line.trim());
|
|
|
console.info(`onecold The content of file: ${fileContent}`);
|
|
console.info(`onecold The content of file: ${fileContent}`);
|
|
@@ -10040,7 +10057,7 @@ export struct LocalMusic {
|
|
|
fileIo.copyFileSync(file.fd, file2.fd)
|
|
fileIo.copyFileSync(file.fd, file2.fd)
|
|
|
fileIo.closeSync(file);
|
|
fileIo.closeSync(file);
|
|
|
fileIo.closeSync(file2);
|
|
fileIo.closeSync(file2);
|
|
|
- this.initLyric(filePath)
|
|
|
|
|
|
|
+ this.initLyric(filePath,false,false,true)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|