|
@@ -8,7 +8,7 @@ import { changeMusicCover, findLocalCoverImage, getApiLyric, repairAudioMetadata
|
|
|
searchCover,
|
|
searchCover,
|
|
|
syncLyricToDB} from '../common/util/MusicTagUtils';
|
|
syncLyricToDB} from '../common/util/MusicTagUtils';
|
|
|
import { util } from '@kit.ArkTS';
|
|
import { util } from '@kit.ArkTS';
|
|
|
-import { FFMpegTags } from '../common/util/Utility';
|
|
|
|
|
|
|
+import { AudioQuality, FFMpegTags } from '../common/util/Utility';
|
|
|
import MediaTable from '../common/util/MediaTable';
|
|
import MediaTable from '../common/util/MediaTable';
|
|
|
import { McPieChart, Options } from '@mcui/mccharts'
|
|
import { McPieChart, Options } from '@mcui/mccharts'
|
|
|
|
|
|
|
@@ -26,6 +26,12 @@ export struct ChartsCount {
|
|
|
@State mediaKuCount: number = 0;
|
|
@State mediaKuCount: number = 0;
|
|
|
@State albumCount: number = 0;
|
|
@State albumCount: number = 0;
|
|
|
@State artistCount: number = 0;
|
|
@State artistCount: number = 0;
|
|
|
|
|
+
|
|
|
|
|
+ @State lqCount: number = 0;
|
|
|
|
|
+ @State sqCount: number = 0;
|
|
|
|
|
+ @State hqCount: number = 0;
|
|
|
|
|
+ @State losslessCount: number = 0;
|
|
|
|
|
+ @State hrCount: number = 0;
|
|
|
@State isDarkMode: boolean = false
|
|
@State isDarkMode: boolean = false
|
|
|
@StorageProp('currentColorMode') @Watch('onColorModeChange') currentMode: number =
|
|
@StorageProp('currentColorMode') @Watch('onColorModeChange') currentMode: number =
|
|
|
ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT;
|
|
ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT;
|
|
@@ -51,6 +57,26 @@ export struct ChartsCount {
|
|
|
]
|
|
]
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ @State HrOption: Options = new Options({
|
|
|
|
|
+ title: {
|
|
|
|
|
+ show: true,
|
|
|
|
|
+ text: '音质统计',
|
|
|
|
|
+ left: 40,
|
|
|
|
|
+ top: 20
|
|
|
|
|
+ },
|
|
|
|
|
+ series:[
|
|
|
|
|
+ {
|
|
|
|
|
+ data:[
|
|
|
|
|
+ {value:this.lqCount, name:'LQ'},
|
|
|
|
|
+ {value:this.sqCount, name:'SQ'},
|
|
|
|
|
+ {value:this.hqCount, name:'HQ'},
|
|
|
|
|
+ {value:this.losslessCount, name:'Lossless'},
|
|
|
|
|
+ {value:this.hrCount, name:'Hi-Res'},
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
|
|
|
onColorModeChange() {
|
|
onColorModeChange() {
|
|
|
this.isDarkMode = this.currentMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK
|
|
this.isDarkMode = this.currentMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK
|
|
@@ -75,6 +101,32 @@ export struct ChartsCount {
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ this.table.countSongsByQualityOptimized(async (result:Record<AudioQuality, number>) => {
|
|
|
|
|
+ this.lqCount = result.LQ
|
|
|
|
|
+ this.hqCount = result.HQ
|
|
|
|
|
+ this.hrCount = result.HR
|
|
|
|
|
+ this.sqCount = result.SQ
|
|
|
|
|
+ this.losslessCount = result.Lossless
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ // 使用Option实例对象的setVal方法来实现,修改什么属性就传什么
|
|
|
|
|
+ this.HrOption.setVal({
|
|
|
|
|
+ animation:true,
|
|
|
|
|
+ series:[
|
|
|
|
|
+ {
|
|
|
|
|
+ data:[
|
|
|
|
|
+ {value:this.lqCount, name:'LQ'},
|
|
|
|
|
+ {value:this.sqCount, name:'SQ'},
|
|
|
|
|
+ {value:this.hqCount, name:'HQ'},
|
|
|
|
|
+ {value:this.losslessCount, name:'Lossless'},
|
|
|
|
|
+ {value:this.hrCount, name:'Hi-Res'},
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ })
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
centerChart(){
|
|
centerChart(){
|
|
@@ -84,6 +136,7 @@ export struct ChartsCount {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
// 使用Option实例对象的setVal方法来实现,修改什么属性就传什么
|
|
// 使用Option实例对象的setVal方法来实现,修改什么属性就传什么
|
|
|
this.defOption.setVal({
|
|
this.defOption.setVal({
|
|
|
|
|
+ animation:true,
|
|
|
series: [
|
|
series: [
|
|
|
{
|
|
{
|
|
|
data:[
|
|
data:[
|
|
@@ -114,9 +167,15 @@ export struct ChartsCount {
|
|
|
@Builder
|
|
@Builder
|
|
|
centerCharts() {
|
|
centerCharts() {
|
|
|
Row() {
|
|
Row() {
|
|
|
- McPieChart({
|
|
|
|
|
- options: this.defOption
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ Swiper() {
|
|
|
|
|
+ McPieChart({
|
|
|
|
|
+ options: this.defOption
|
|
|
|
|
+ })
|
|
|
|
|
+ McPieChart({
|
|
|
|
|
+ options: this.HrOption
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
.borderRadius(14)
|
|
.borderRadius(14)
|
|
|
.backgroundColor($r('app.color.start_window_background'))
|
|
.backgroundColor($r('app.color.start_window_background'))
|