|
@@ -104,7 +104,13 @@ import { AudioFormatConverter } from './AudioFormatConverter';
|
|
|
import { MergeAudio } from './MergeAudio';
|
|
import { MergeAudio } from './MergeAudio';
|
|
|
import { AIVoiceSeparation } from './AIVoiceSeparation';
|
|
import { AIVoiceSeparation } from './AIVoiceSeparation';
|
|
|
import { WebDavUrlUtil } from '../common/util/WebDavUrlUtil';
|
|
import { WebDavUrlUtil } from '../common/util/WebDavUrlUtil';
|
|
|
-
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ hdsEffect,
|
|
|
|
|
+ HdsVisualComponent,
|
|
|
|
|
+ HdsSceneController,
|
|
|
|
|
+ HdsSceneType,
|
|
|
|
|
+ HdsVisualComponentAttribute,
|
|
|
|
|
+} from '@kit.UIDesignKit';
|
|
|
const TAG = 'LocalMusic';
|
|
const TAG = 'LocalMusic';
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -219,6 +225,21 @@ const ITEM_HEIGHT_BIG: number = 78; // 列表项大高度
|
|
|
@Preview
|
|
@Preview
|
|
|
@Component
|
|
@Component
|
|
|
export struct LocalMusic {
|
|
export struct LocalMusic {
|
|
|
|
|
+ @State sceneBgController: HdsSceneController = new HdsSceneController()
|
|
|
|
|
+ .setSceneParams({
|
|
|
|
|
+ backgroundMaskColors: [Color.Green, Color.Red],
|
|
|
|
|
+ firstEdgeFlowLight: {
|
|
|
|
|
+ startPos: 0,
|
|
|
|
|
+ endPos: 0.5,
|
|
|
|
|
+ color: Color.Red
|
|
|
|
|
+ },
|
|
|
|
|
+ secondEdgeFlowLight: {
|
|
|
|
|
+ startPos: 0,
|
|
|
|
|
+ endPos: -0.5,
|
|
|
|
|
+ color: Color.Green
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ // @State controller: hdsEffect.ShaderEffectController = new hdsEffect.ShaderEffectController();
|
|
|
@State isEditAudio:boolean = false
|
|
@State isEditAudio:boolean = false
|
|
|
@State isExtractAcc:boolean = false
|
|
@State isExtractAcc:boolean = false
|
|
|
@State isConverter:boolean = false
|
|
@State isConverter:boolean = false
|
|
@@ -3636,7 +3657,7 @@ export struct LocalMusic {
|
|
|
? Visibility.Visible : Visibility.None)
|
|
? Visibility.Visible : Visibility.None)
|
|
|
.fontColor(this.currentSong?.filePath === item.filePath ? this.themeColor :
|
|
.fontColor(this.currentSong?.filePath === item.filePath ? this.themeColor :
|
|
|
Color.Gray)
|
|
Color.Gray)
|
|
|
- .margin({ left: 10 })
|
|
|
|
|
|
|
+ .margin({ left: StrUtil.isEmpty(item.artist) ?0:10 })
|
|
|
}
|
|
}
|
|
|
.gesture(LongPressGesture()
|
|
.gesture(LongPressGesture()
|
|
|
.onAction(async () => {
|
|
.onAction(async () => {
|
|
@@ -8503,7 +8524,16 @@ export struct LocalMusic {
|
|
|
@Builder
|
|
@Builder
|
|
|
IjkMusicPlayerView() {
|
|
IjkMusicPlayerView() {
|
|
|
|
|
|
|
|
- Column() {
|
|
|
|
|
|
|
+ Stack() {
|
|
|
|
|
+
|
|
|
|
|
+ HdsVisualComponent()
|
|
|
|
|
+ .scene(HdsSceneType.DUAL_EDGE_FLOW_LIGHT_WITH_BACKGROUND_MASK, this.sceneBgController, () => {
|
|
|
|
|
+ console.info('Succeeded in finishing');
|
|
|
|
|
+ })
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .height('100%')
|
|
|
|
|
+ .visibility(this.isShowBgLiuGUANG?Visibility.Visible:Visibility.None)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
Column() {
|
|
Column() {
|
|
|
|
|
|
|
@@ -10017,6 +10047,34 @@ export struct LocalMusic {
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
this.getImageColor()
|
|
this.getImageColor()
|
|
|
})
|
|
})
|
|
|
|
|
+ // .visualEffect(new hdsEffect.HdsEffectBuilder()
|
|
|
|
|
+ // .shaderEffect({
|
|
|
|
|
+ // effectType: hdsEffect.EffectType.DUAL_EDGE_FLOW_LIGHT,
|
|
|
|
|
+ // animation: {
|
|
|
|
|
+ // duration: 4000,
|
|
|
|
|
+ // iterations: -1,
|
|
|
|
|
+ // autoPlay: true,
|
|
|
|
|
+ // onFinish: () => {
|
|
|
|
|
+ // console.info('Succeeded in finishing');
|
|
|
|
|
+ // }
|
|
|
|
|
+ // },
|
|
|
|
|
+ // controller: this.controller,
|
|
|
|
|
+ // params: {
|
|
|
|
|
+ // firstEdgeFlowLight: {
|
|
|
|
|
+ // startPos: 0,
|
|
|
|
|
+ // endPos: 1.0,
|
|
|
|
|
+ // color: '#1AD0F1',
|
|
|
|
|
+ // },
|
|
|
|
|
+ // secondEdgeFlowLight: {
|
|
|
|
|
+ // startPos: 0.5,
|
|
|
|
|
+ // endPos: 1.5,
|
|
|
|
|
+ // color: '#FFA4E5',
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .buildEffect())
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
this.musicNameInfo(false)
|
|
this.musicNameInfo(false)
|
|
|
} else {
|
|
} else {
|
|
@@ -11355,9 +11413,9 @@ export struct LocalMusic {
|
|
|
Image(more.image)
|
|
Image(more.image)
|
|
|
.width(24)
|
|
.width(24)
|
|
|
.height(24)
|
|
.height(24)
|
|
|
|
|
+ .fillColor(Color.White)
|
|
|
.margin({ left: 10, right: 10 })
|
|
.margin({ left: 10, right: 10 })
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
-
|
|
|
|
|
this.doMore(more.id)
|
|
this.doMore(more.id)
|
|
|
})
|
|
})
|
|
|
Text(more.id == 17 ? (this.isLandscape ? '竖屏模式' : '横屏模式') : more.title)
|
|
Text(more.id == 17 ? (this.isLandscape ? '竖屏模式' : '横屏模式') : more.title)
|
|
@@ -11496,6 +11554,22 @@ export struct LocalMusic {
|
|
|
.width(48)
|
|
.width(48)
|
|
|
.height(24);
|
|
.height(24);
|
|
|
|
|
|
|
|
|
|
+ Toggle({ type: ToggleType.Switch, isOn: this.isShowBgLiuGUANG })
|
|
|
|
|
+ .selectedColor(this.themeColor)
|
|
|
|
|
+ .switchPointColor(Color.White)
|
|
|
|
|
+ .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
|
|
+ .margin({ right: 15 })
|
|
|
|
|
+ .visibility(more.id == 21 ? Visibility.Visible : Visibility.None)
|
|
|
|
|
+ .onChange((checked: boolean) => { // 是否开启背景流光效果
|
|
|
|
|
+ if (more.id == 21) {
|
|
|
|
|
+ this.isShowBgLiuGUANG = checked;
|
|
|
|
|
+ PreferencesUtil.putSync('isShowBgLiuGUANG',this.isShowBgLiuGUANG)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ .width(48)
|
|
|
|
|
+ .height(24);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -11573,12 +11647,15 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
{ id: 13, image: $r('app.media.rectangle'), title: '封面方形' },
|
|
{ id: 13, image: $r('app.media.rectangle'), title: '封面方形' },
|
|
|
|
|
|
|
|
|
|
+ { id : 21, image: $r('app.media.music_red'), title: '开启背景流光' },
|
|
|
|
|
+
|
|
|
{ id: 8, image: $r('app.media.cut_current'), title: '保存播放模式' },
|
|
{ id: 8, image: $r('app.media.cut_current'), title: '保存播放模式' },
|
|
|
|
|
|
|
|
{ id: 7, image: $r('app.media.playlist2'), title: '播放背景随音乐封面' },
|
|
{ id: 7, image: $r('app.media.playlist2'), title: '播放背景随音乐封面' },
|
|
|
|
|
|
|
|
|
|
|
|
|
];
|
|
];
|
|
|
|
|
+ @State isShowBgLiuGUANG: boolean = true;
|
|
|
@State isShowMoreView: boolean = false;
|
|
@State isShowMoreView: boolean = false;
|
|
|
@State isMusicMemoryPlay: boolean = false //是否启用记忆播放
|
|
@State isMusicMemoryPlay: boolean = false //是否启用记忆播放
|
|
|
@State isShowTimeCloseMore: boolean = false
|
|
@State isShowTimeCloseMore: boolean = false
|
|
@@ -12374,6 +12451,7 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private async play(url: string,startOffset?:number) {
|
|
private async play(url: string,startOffset?:number) {
|
|
|
|
|
+ this.isShowBgLiuGUANG = PreferencesUtil.getBooleanSync('isShowBgLiuGUANG', true)
|
|
|
console.info('onecold this.url 1= '+url)
|
|
console.info('onecold this.url 1= '+url)
|
|
|
if(!url.toLowerCase().startsWith('http')){
|
|
if(!url.toLowerCase().startsWith('http')){
|
|
|
let hasPermission = await PermissionUtil.activatePermission(url)
|
|
let hasPermission = await PermissionUtil.activatePermission(url)
|