-
Notifications
You must be signed in to change notification settings - Fork 0
/
Music.au3
2586 lines (2488 loc) · 101 KB
/
Music.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Icon=mu.ico
#AutoIt3Wrapper_UseUPX=n
#AutoIt3Wrapper_Res_FileVersion=2.0.0.0
#AutoIt3Wrapper_Run_Tidy=y
#Autoit3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters= /SF /SV /OM
#Obfuscator_On
#endregion ;**** 参数创建于 ACNWrapper_GUI ****
;ver 0.0.0.4
#include 'MyConstants.au3'
#include 'desklrc.au3'
#include 'lyric.au3'
#include 'lrcPrase.au3'
#include "DoDragDrop.au3"
#include "GUICtrlMenuEx.au3"
Opt("GUIOnEventMode", 1)
Opt("TrayOnEventMode", 1)
Opt("GUIResizeMode", 802)
Opt("MouseCoordMode", 0)
Opt("TrayMenuMode", 1)
;~ Opt("TrayIconDebug", 1)
OnAutoItExitRegister("_OnAutoItExit")
HotKeySet('+!i', 'ID') ;hotkey for showing ID3 tags
$FilesDir = @ScriptDir & '\ICON'
Global $cover_put = @ScriptDir & "\ICON\music-default.jpg"
DirCreate($FilesDir)
FileInstall('music-default.jpg', $FilesDir & '\music-default.jpg')
FileInstall('test.png', $FilesDir & '\test.png')
_BASS_STARTUP("BASS.dll");打开BASS.DLL,开放可调用函数
_Bass_PluginLoad("bassflac.dll")
_Bass_PluginLoad("bass_ape.dll")
_Bass_PluginLoad("basswma.dll")
_Bass_PluginLoad('bass_aac.dll')
_BASS_Init(0, -1, 44100, 0, "");函数初始化
If @error Then
MsgBox(0, "Error Code: " & @error, "无法使用音频播放功能,请检查设备是否正常!", 4)
;~ Exit
EndIf
Global $IDragSourceHelper = _ObjCoCreateInstance($CLSID_DragDropHelper, $IID_IDragSourceHelper, $IDragSourceHelper_vTable)
;~ Global Const $CDDS_SUBITEMPREPAINT = BitOR($CDDS_ITEM, $CDDS_SUBITEM, $CDDS_PREPAINT)
Global $Font1 = _WinAPI_CreateFont(14, 0, 0, 0, $FW_BOLD)
;~ Global $Font2 = _WinAPI_CreateFont(17, 0, 0, 0, $FW_NORMAL, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, _
;~ $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'Arial')
;~ Global $skins = @ScriptDir & "\Mecca.msstyles"
;~ Global $Dll_ = DllOpen(@ScriptDir & "\USkin.dll")
;~ DllCall($Dll_, "int", "USkinInit", "str", "Null", "str", "NULL", "str", $skins) ;loading skin dll.
;~ DllCall($Dll_, "int", "USkinLoadSkin", "str", $skins) ; initialize skin
;~ tray begin
TraySetIcon(@ScriptDir & '\icon.dll', 14)
$play_control = TrayCreateMenu("播放控制")
$tray_play = TrayCreateItem("播放/暂停", $play_control)
TrayItemSetOnEvent(-1, "tray")
$tray_stop = TrayCreateItem("停止", $play_control)
TrayItemSetOnEvent(-1, "tray")
TrayCreateItem("")
$exit = TrayCreateItem("退出")
TrayItemSetOnEvent(-1, '_Exit')
TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "SpecialEvent")
TraySetClick(8)
TraySetState()
Func SpecialEvent()
GUISetState(@SW_SHOW, $hGUI)
EndFunc ;==>SpecialEvent
;~ tray end
$hGUI = GUICreate("音乐管理器 v2.0", 781, 562, -1, -1, 0x94CE0000, 0x00000010)
$hNewWinProc = DllCallbackRegister("NewWindowProc", "int", "hwnd;uint;wparam;lparam")
;~ $hOldWinProc = _WinAPI_SetWindowLong($hGUI, $GWL_WNDPROC, DllCallbackGetPtr($hNewWinProc))
$col_def = GUIGetBkColor($hGUI)
GUISetOnEvent($GUI_EVENT_CLOSE, "gui")
GUISetOnEvent($GUI_EVENT_RESTORE, "gui")
GUISetOnEvent($GUI_EVENT_RESIZED, "gui")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "gui")
$hcontextmenu = GUICtrlCreateContextMenu()
$hColor = GUICtrlCreateMenu("界面颜色", $hcontextmenu)
$col_1 = GUICtrlCreateMenuItem("系统默认", $hColor)
GUICtrlSetOnEvent(-1, "guicolor")
$col_2 = GUICtrlCreateMenuItem("粉红", $hColor)
GUICtrlSetOnEvent(-1, "guicolor")
$col_3 = GUICtrlCreateMenuItem("鸭黄", $hColor)
GUICtrlSetOnEvent(-1, "guicolor")
$col_4 = GUICtrlCreateMenuItem("水绿", $hColor)
GUICtrlSetOnEvent(-1, "guicolor")
$col_5 = GUICtrlCreateMenuItem("纯白", $hColor)
GUICtrlSetOnEvent(-1, "guicolor")
$col_6 = GUICtrlCreateMenuItem("纯黑", $hColor)
GUICtrlSetOnEvent(-1, "guicolor")
$hListView = GUICtrlCreateListView(" 文件名 |歌名 |歌手 | 专辑 | 位速 | 大小 | 时长 |文件夹", _
8, 92, 764, _Iif($onlylist = 2, 437, 214), BitOR($LVS_EDITLABELS, $LVS_REPORT, $LVS_SHOWSELALWAYS))
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP, $LVS_EX_DOUBLEBUFFER))
GUICtrlSetResizing(-1, 102)
$hHeader = HWnd(_GUICtrlListView_GetHeader($hListView))
_WinAPI_SetFont($hHeader, $Font1, True)
_GUICtrlListView_SetColumnWidth($hListView, 0, 250)
_GUICtrlListView_SetUnicodeFormat($hListView, True)
_WinAPI_SetWindowTheme(GUICtrlGetHandle($hListView), 'Explorer')
_GUICtrlListView_SetImageList($hListView, _GUIImageList_GetSystemImageList(), 1)
$l_btn_header = GUICtrlCreateButton('载入LRC文件', 8, 321, _Iif($onlylist = 1, 764, 500), 25)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetResizing(-1, 582)
GUICtrlSetOnEvent(-1, "gui")
;~ $Lrc_List = _GUICtrlListView_Create($hGUI, "歌词", 8, 321, 500, 214, BitOR($LVS_EDITLABELS, $LVS_REPORT))
$Lrc_List = GUICtrlCreateListView('lyrics', 8, 346, _Iif($onlylist = 1, 764, 500), 190, BitOR($LVS_REPORT, $LVS_EDITLABELS, $LVS_NOCOLUMNHEADER))
_GUICtrlListView_SetExtendedListViewStyle(-1, BitOR($LVS_EX_FULLROWSELECT, $WS_EX_CLIENTEDGE, $LVS_EX_DOUBLEBUFFER))
GUICtrlSetResizing(-1, 582)
$hWndListView = GUICtrlGetHandle($hListView)
$lWndListView = GUICtrlGetHandle($Lrc_List)
_GUICtrlListView_SetColumnWidth(-1, 0, $LVSCW_AUTOSIZE_USEHEADER)
_GUICtrlListView_SetUnicodeFormat(-1, True)
_GUICtrlListView_JustifyColumn(-1, 0, $list_align)
;~ _WinAPI_SetFont($Lrc_List, $Font2, True) ;;Conflict with _GUICtrlListView_SetUnicodeFormat
GUICtrlSetFont(-1, $list_size, $list_xing, $list_var, $list_name)
GUICtrlSetColor(-1, $lrc_text_back_color)
GUICtrlSetBkColor(-1, $list_bk_color)
_GUICtrlListView_SetItemCount(-1, 6)
For $i = 0 To 5
GUICtrlCreateListViewItem($L[$i], $Lrc_List)
Next
GUICtrlCreateGroup("播放控制", 535, 8, 235, 80)
;~ GUICtrlSetColor(-1, 0xff0000)
$Sound_Flag = GUICtrlCreateButton("=", 545, 48, 30, 25, $BS_FLAT)
GUICtrlSetFont(-1, 14, 800, 0, "Webdings")
;~ GUICtrlSetBkColor(-1, 0xD4D0C8) ;control will disappear
;~ GUICtrlSetColor(-1, 0x000000)
GUICtrlSetOnEvent(-1, "gui")
$Sound_Play = GUICtrlCreateButton("4", 575, 48, 30, 25, $BS_FLAT)
GUICtrlSetFont(-1, 14, 800, 0, "Webdings")
GUICtrlSetOnEvent(-1, "gui")
$Sound_Stop = GUICtrlCreateButton("<", 605, 48, 30, 25, $BS_FLAT)
GUICtrlSetFont(-1, 14, 800, 0, "Webdings")
GUICtrlSetOnEvent(-1, "gui")
GUICtrlSetState(-1, $GUI_DISABLE)
$Sound_Desk = GUICtrlCreateButton("显示", 640, 48, 40, 25, $BS_FLAT)
GUICtrlSetOnEvent(-1, "gui")
$current_time = GUICtrlCreateLabel('00:00:00', 687, 50, 65, 25)
GUICtrlSetFont(-1, 12, 400, 0, 'Arial')
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$slider = GUICtrlCreateSlider(540, 20, 220, 21, $TBS_NOTICKS)
GUICtrlSetData(-1, 0)
GUICtrlSetLimit(-1, 100, 1)
GUICtrlSetTip(-1, "播放进度")
;~ $filter = _GUICtrlComboBox_Create($hGUI, "", 45, 69, 125, 21)
$filter = GUICtrlCreateCombo("", 45, 69, 125, 21)
GUICtrlSetData(-1, "<\.mp3(?# 仅mp3文件)>|<^[\w\s\']+\.[\w]{2,4}(?# 仅英文文件名)>|<林俊杰(?# 指定歌手)>|<.*?(?# 所有歌曲)>", "")
$artist = GUICtrlCreateInput("", 180, 69, 82, 19)
GUICtrlSetTip(-1, '歌手')
$title = GUICtrlCreateInput("", 281, 69, 146, 19)
GUICtrlSetTip(-1, '歌名')
;~ GUICtrlSetOnEvent($title, "gui")
$Search_Button = GUICtrlCreateButton("搜索", 430, 67, 49, 23)
_GUICtrlButton_SetImageList($Search_Button, _GetImageListHandle("icon.dll", 11), 0)
GUICtrlSetOnEvent(-1, "gui")
$SearchDummy = GUICtrlCreateDummy()
$context_button = GUICtrlCreateContextMenu($SearchDummy)
$sogou_srh = GUICtrlCreateMenuItem("搜狗音乐", $context_button)
GUICtrlSetOnEvent($sogou_srh, "gui")
$google_srh = GUICtrlCreateMenuItem("谷歌音乐", $context_button)
GUICtrlSetOnEvent($google_srh, "gui")
$baidu_srh = GUICtrlCreateMenuItem("百度音乐", $context_button)
GUICtrlSetOnEvent($baidu_srh, "gui")
$bar = GUICtrlCreateButton("q", 262, 69, 19, 18, $BS_FLAT)
GUICtrlSetFont(-1, 12, 600, 0, "Webdings")
GUICtrlSetOnEvent($bar, 'gui')
$Search_Label1 = GUICtrlCreateLabel("过滤", 12, 73, 30, 17)
_ToolBar()
$cover_group = GUICtrlCreateGroup("专辑封面", 535, 321, 220, 216)
;~ GUICtrlSetColor(-1, 0xff0000)
GUICtrlSetResizing(-1, 836)
$cover = GUICtrlCreatePic($cover_put, 553, 340, 182, 182) ;$WS_EX_CLIENTEDGE will cause dislocation while update pic control
GUICtrlSetResizing(-1, 836)
$context_cover = GUICtrlCreateContextMenu($cover)
$save_cover = GUICtrlCreateMenuItem("封面另存为", $context_cover)
GUICtrlSetOnEvent($save_cover, "gui")
GUICtrlCreateMenuItem('', $context_cover)
$download_cover = GUICtrlCreateMenuItem('下载封面', $context_cover)
GUICtrlSetOnEvent($download_cover, "gui")
Switch $onlylist
Case 2
GUICtrlSetState($Lrc_List, $GUI_HIDE)
GUICtrlSetState($l_btn_header, $GUI_HIDE)
GUICtrlSetState($cover, $GUI_HIDE)
GUICtrlSetState($cover_group, $GUI_HIDE)
Case 1
GUICtrlSetState($cover, $GUI_HIDE)
GUICtrlSetState($cover_group, $GUI_HIDE)
EndSwitch
$ListMenu = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_ListMenu_Click")
$Tbar = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_ToolBar_Click")
$TbarMenu = GUICtrlCreateDummy()
GUICtrlSendToDummy(-1, 2000)
GUICtrlSetOnEvent(-1, "_ToolBarMenu")
$LyrMenu = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_LyrMenu_Click")
$FileChange = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_FileChange")
_CoProcReciver("Reciver")
$load_Pro = _CoProc("_load_")
;=====================for obfuscated
;~ Reciver()
;~ _load_()
;~ _loadReciver()
;~ __CoProcReciverHandler($hWnd, $iMsg, $WParam, $LParam)
;~ __CoProcDummy()
;~ move_list($hWnd, $iMsg, $WParam, $LParam)
;=====================
$StatusBar = _GUICtrlStatusBar_Create($hGUI, -1, "", $SBARS_TOOLTIPS)
_GUICtrlStatusBar_SetMinHeight($StatusBar, 20)
_GUICtrlStatusBar_SetParts($StatusBar, $StatusBar_PartsWidth)
$hIcons[0] = _WinAPI_LoadShell32Icon(-14)
$hIcons[1] = _WinAPI_LoadShell32Icon(-28)
$hIcons[18] = _WinAPI_LoadShell32Icon(-55)
_GUICtrlStatusBar_SetIcon($StatusBar, 0, $hIcons[0])
_GUICtrlStatusBar_SetText($StatusBar, "欢迎使用!", 1)
_GUICtrlStatusBar_SetTipText($StatusBar, 0, "测试网络中。。。")
$L_process = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_MARQUEE)
_GUICtrlStatusBar_EmbedControl($StatusBar, 3, GUICtrlGetHandle($L_process))
;~ ----------选择歌词----------------
$Lrc_Choose = GUICreate("选择歌词", 350, 210, 10, 100, -1, -1, $hGUI)
GUISetOnEvent($GUI_EVENT_CLOSE, "gui")
$sub_list = GUICtrlCreateListView(' 1 | 2 | 3 | 4 | 5 | 6 ', 10, 10, 330, 170, Default, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER))
_GUICtrlListView_SetUnicodeFormat($sub_list, True)
_WinAPI_SetWindowTheme(GUICtrlGetHandle($sub_list), 'Explorer')
$sub_OK = GUICtrlCreateButton('下载', 9, 185, 330, 20)
GUICtrlSetOnEvent(-1, "gui")
GUICtrlSetState(-1, $GUI_FOCUS + $GUI_DEFBUTTON)
GUISetState(@SW_HIDE, $Lrc_Choose)
GUISwitch($hGUI)
guicolor($GUI_color)
GUISetState(@SW_SHOW, $hGUI)
;~ $cNewWinProc = DllCallbackRegister("NewWindowProc", "int", "hwnd;uint;wparam;lparam")
;~ $cOldWinProc = _WinAPI_SetWindowLong($hGUI, $GWL_WNDPROC, DllCallbackGetPtr($cNewWinProc))
GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY")
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
GUIRegisterMsg(0x233, "WM_DROPFILES") ;WM_DROPFILES
GUIRegisterMsg($WM_HSCROLL, "MY_WM_HSCROLL")
GUIRegisterMsg($WM_EXITSIZEMOVE, "WM_EXITSIZEMOVE")
GUIRegisterMsg($WM_SYSCOMMAND, "On_WM_SYSCOMMAND")
GUIRegisterMsg($WM_MOUSEWHEEL, "WM_MOUSEWHEEL")
;~ GUIRegisterMsg($WM_DI_GETDRAGIMAGE, "MY_GETDRAGIMAGE")
;~ GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") ;cause GDI+ working not perfect
;~ GUIRegisterMsg($WM_PAINT, "MY_PAINT") ; TOO MUCH FLICKERING!!
;~ GUIRegisterMsg($WM_SIZE, "WM_SIZE")
;~ WinMove($hGUI,"",0,0)
_GUICtrlMenuEx_Startup(Default)
For $x = 7 To 22
$hIcons[$x - 5] = _WinAPI_ShellExtractIcons("icon.dll", $x, 16, 16)
Next
$SubsubMenu1 = _GUICtrlMenu_CreateMenu()
_GUICtrlMenuEx_AddMenuItem($SubsubMenu1, "编辑ID3标签", $id3_item, $hIcons[10])
_GUICtrlMenuEx_AddMenuItem($SubsubMenu1, "删除ID3标签", $del_id3_item, $hIcons[9])
$SubsubMenu2 = _GUICtrlMenu_CreateMenu()
_GUICtrlMenuEx_AddMenuItem($SubsubMenu2, "读取内嵌歌词(ID3v2)", $copy_lyr_item, $hIcons[12])
_GUICtrlMenuEx_AddMenuItem($SubsubMenu2, "读取内嵌歌词(Lyricv3)", $copy_qq_item, $hIcons[11])
$SubsubMenu3 = _GUICtrlMenu_CreateMenu()
_GUICtrlMenuEx_AddMenuItem($SubsubMenu3, "+1秒", $yh1)
_GUICtrlMenuEx_AddMenuItem($SubsubMenu3, "+500毫秒", $yh2)
_GUICtrlMenuEx_AddMenuItem($SubsubMenu3, "-500毫秒", $tq1)
_GUICtrlMenuEx_AddMenuItem($SubsubMenu3, "-1秒", $tq2)
$SubMenu = _GUICtrlMenu_CreatePopup()
_GUICtrlMenuEx_AddMenuItem($SubMenu, "重命名", $rn_item)
_GUICtrlMenuEx_AddMenuItem($SubMenu, "复制", $copy_item, $hIcons[2])
_GUICtrlMenuEx_AddMenuItem($SubMenu, "重新载入", $reload_item, $hIcons[5])
_GUICtrlMenuEx_AddMenuItem($SubMenu, "编辑属性", $edit_item, $hIcons[4])
_GUICtrlMenuEx_AddMenuItem($SubMenu, "下载封面", $load_cover, $hIcons[3])
_GUICtrlMenuEx_AddMenuItem($SubMenu, "放入回收站", $rm_item, $hIcons[16])
_GUICtrlMenuEx_AddMenuBar($SubMenu)
_GUICtrlMenuEx_AddMenuItem($SubMenu, "ID3标签", 0, $hIcons[1], $SubsubMenu1)
_GUICtrlMenuEx_AddMenuItem($SubMenu, "内嵌歌词", 0, $hIcons[7], $SubsubMenu2)
;~ _GUICtrlMenuEx_AddMenuItem($SubMenu, "more... ", $shell_item, $hIcons[14])
$SubMenu2 = _GUICtrlMenu_CreatePopup()
_GUICtrlMenuEx_AddMenuItem($SubMenu2, "提前200毫秒", $tq, $hIcons[14])
_GUICtrlMenuEx_AddMenuItem($SubMenu2, "延后200毫秒", $yh, $hIcons[13])
_GUICtrlMenuEx_AddMenuItem($SubMenu2, "更多调整", 0, $hIcons[18], $SubsubMenu3)
_GUICtrlMenuEx_AddMenuBar($SubMenu2)
_GUICtrlMenuEx_AddMenuItem($SubMenu2, "修改文件头", $hd, $hIcons[15])
_GUICtrlMenuEx_AddMenuItem($SubMenu2, "删除选中行", $sc, $hIcons[16])
_GUICtrlMenuEx_AddMenuItem($SubMenu2, "插入新的一行", $cr, $hIcons[17])
While 1
Sleep(200)
WEnd
Func gui()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Switch @GUI_WinHandle
Case $hGUI
_exit()
Case $Lrc_Choose
$coverStartIndex = 0
GUISetState(@SW_ENABLE, $hGUI)
ContinueCase
Case Else
GUISetState(@SW_HIDE, @GUI_WinHandle)
EndSwitch
Case $GUI_EVENT_RESTORE, $GUI_EVENT_RESIZED
If @GUI_WinHandle = $hGUI Then
_loadpic()
_GUICtrlStatusBar_EmbedControl($StatusBar, 3, GUICtrlGetHandle($L_process))
EndIf
Case $GUI_EVENT_MINIMIZE
_ReduceMemory(@AutoItPID)
Case $Sound_Desk
If GUICtrlRead($Sound_Desk) = '显示' Then
GUICtrlSetData($Sound_Desk, '隐藏')
Show_desk()
Else
GUICtrlSetData($Sound_Desk, '显示')
Hide_desk()
EndIf
Case $Sound_Play
_Play()
Case $Sound_Stop
_StopPlay()
Case $Sound_Flag
If GUICtrlRead($Sound_Flag) = '`' Then
GUICtrlSetData($Sound_Flag, '=')
$s_flag = False
Else
GUICtrlSetData($Sound_Flag, '`')
$s_flag = True
EndIf
Case $sub_OK
GUICtrlSetState($sub_OK, $GUI_DISABLE)
Dim $lrc_Format
Local $Index = _GUICtrlListView_GetItemTextString($sub_list)
Dim $pre_get = StringSplit($Index, '|', 2)
If $pre_get[0] And UBound($pre_get) = 6 Then
$load_flag = 0
If $mode = 1 Then
If _CoProcSend($load_Pro, _LrcDownLoad_qianqian($pre_get[0], $pre_get[1], $pre_get[2], $isCnc)) Then
_ShowLoading()
Else
_ToolTip('错误', "Worker not Responding (" & @error & ")", 3, 3)
EndIf
ElseIf $mode = 2 Then
If _CoProcSend($load_Pro, 'viewlyrics.com' & '|' & StringTrimLeft($pre_get[0], 21) & '|2' & '||||') Then
_ShowLoading()
Else
_ToolTip('错误', "Worker not Responding (" & @error & ")", 3, 3)
EndIf
ElseIf $mode = 3 Then
$host = 'newlyric.koowo.com'
$url = '/newlyric.lrc?' & _encode(_UrlToHex(StringFormat('user=377471152,LYRIC_1.2.1.5,KwLyric(1).exe,' & _
'wmp&requester=localhost&type=full&req=3&songname=%s&artist=%s&path=%s&FileName=&zipsig=', _
$pre_get[2], $pre_get[1], $pre_get[0]), 1, 'ansi'))
If _CoProcSend($load_Pro, $host & '|' & $url & '|2' & '||||') Then
_ShowLoading()
Else
_ToolTip('错误', "Worker not Responding (" & @error & ")", 3, 3)
EndIf
ElseIf $mode = 4 Then
If _CoProcSend($load_Pro, 'www.5ilrc.com|/downlrc.asp|0||POST|gm_down=%31&id_gc=' & _
StringTrimLeft(StringTrimRight($pre_get[0], 4), 6)&'|http://www.5ilrc.com|Content-Type: application/x-www-form-urlencoded') Then
_ShowLoading()
Else
_ToolTip('错误', "Worker not Responding (" & @error & ")", 3, 3)
EndIf
ElseIf $mode = 9 Then
If _CoProcSend($load_Pro, 'music.qq.com|/miniportal/static/lyric/' & _
StringRight($pre_get[0], 2) & '/' & $pre_get[0] & '.xml|0||||') Then
_ShowLoading()
Else
_ToolTip('错误', "Worker not Responding (" & @error & ")", 3, 3)
EndIf
ElseIf $mode = 6 Then
$load_flag = 1
Local $currentSel
$currentSel = Number(_GUICtrlListView_GetSelectedIndices($sub_list))
If $douban2[$currentSel][0] = '<<' Then
$coverStartIndex -= 30
$cover_key_input = $douban2[$currentSel][1]
GUICtrlSendToDummy($ListMenu, $load_cover)
ElseIf $douban2[$currentSel][0] = '>>' Then
$coverStartIndex += 30
$cover_key_input = $douban2[$currentSel][1]
GUICtrlSendToDummy($ListMenu, $load_cover)
Else
$mode = 7
Local $cov = StringSplit($douban2[$currentSel][1], '|', 2)
If $isBig Then $cov[1] = StringReplace($cov[1], 'spic', 'lpic')
$send = $cov[0] & '|' & $cov[1] & '|2||||'
If _CoProcSend($load_Pro, $send) Then
_ShowLoading()
$cover_put = @TempDir & '\cover.' & StringRegExpReplace($cov[1], '.*\.', '')
Else
_ToolTip('错误', "Worker not Responding (" & @error & ")", 3, 3)
EndIf
EndIf
EndIf
Else
_ToolTip('错误', '请先选择一项', 3)
EndIf
GUICtrlSetState($sub_OK, $GUI_ENABLE)
Case $l_btn_header
$lrc_text = FileRead($root_folder & '\' & $bLVItems[$iSelected][7] & _
StringRegExpReplace($bLVItems[$iSelected][0], '\.(\w+)$', '') & '.lrc')
If @error Then Return
$lrc_Format = _lrc_Prase($lrc_text)
If UBound($lrc_Format, 0) = 2 Then
Update_L()
EndIf
Case $save_cover
Local $cover_name = StringRegExp($cover_put, '^.*\\(.*?)\.(\w+)$', 3, 1)
If @error Or $cover_put = @ScriptDir & "\ICON\music-default.jpg" Then Return
Local $Save_cover_Dir = FileSaveDialog('保存图片', $root_folder, _
'图像文件(*.' & $cover_name[1] & ')|所有文件(*.*)', 16, $cover_name[0] & '.' & $cover_name[1], $hGUI)
If Not @error Then
FileCopy($cover_put, $Save_cover_Dir, 9)
If Not @error Then _ToolTip('', '保存成功', 5, 1)
EndIf
Case $download_cover
GUICtrlSendToDummy($ListMenu, $load_cover)
Case $Search_Button
Local $arPos, $x, $y
Local $hMenu = GUICtrlGetHandle($context_button)
$arPos = ControlGetPos($hGUI, "", $Search_Button)
$x = $arPos[0]
$y = $arPos[1] + $arPos[3]
ClientToScreen($hGUI, $x, $y)
DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hGUI, "ptr", 0)
Case $sogou_srh, $baidu_srh
Local $s_url
If Not GUICtrlRead($title) Then Return
Switch @GUI_CtrlId
Case $sogou_srh
$s_url = 'http://mp3.sogou.com/music.so?query='
Case $baidu_srh
$s_url = 'http://mp3.baidu.com/m?word='
EndSwitch
If GUICtrlRead($artist) Then
Return ShellExecute($s_url & _UrlToHex(GUICtrlRead($title), 1, 'ansi') & '+' & _
_UrlToHex(GUICtrlRead($artist), 1, 'ansi'))
Else
Return ShellExecute($s_url & _UrlToHex(GUICtrlRead($title), 1, 'ansi'))
EndIf
Case $google_srh
If Not GUICtrlRead($title) Then Return
Return ShellExecute('http://www.google.cn/music/search?q=' & _UrlToHex(GUICtrlRead($title), 1, 'unicode'))
Case $head_OK
DllStructSetData($l_head, "title", GUICtrlRead($h[0]))
DllStructSetData($l_head, "artist", GUICtrlRead($h[1]))
DllStructSetData($l_head, "album", GUICtrlRead($h[2]))
DllStructSetData($l_head, "editor", GUICtrlRead($h[3]))
GUIDelete($lGUI)
Case $bar
Local $tmp_input = GUICtrlRead($artist)
GUICtrlSetData($artist, GUICtrlRead($title))
GUICtrlSetData($title, $tmp_input)
$reg_order = BitXOR(1, $reg_order)
EndSwitch
EndFunc ;==>gui
Func guicolor($id = 1)
If IsDeclared("id") Then
$id = Eval("col_" & $id)
Else
Local $id = @GUI_CtrlId
EndIf
Switch $id
Case $col_1
GUISetBkColor($col_def, $hGUI)
GUICtrlSetBkColor($slider, $col_def)
menuCheck(1)
Case $col_6
GUISetBkColor(0x000000, $hGUI)
GUICtrlSetBkColor($slider, 0x000000)
GUICtrlSetColor($current_time, 0xffffff)
Return menuCheck(6)
Case $col_4
GUISetBkColor(0x33CCCC, $hGUI)
GUICtrlSetBkColor($slider, 0x33CCCC)
menuCheck(4)
Case $col_2
GUISetBkColor(0xf9906f, $hGUI)
GUICtrlSetBkColor($slider, 0xf9906f)
menuCheck(2)
Case $col_5
GUISetBkColor(0xffffff, $hGUI)
GUICtrlSetBkColor($slider, 0xffffff)
menuCheck(5)
Case $col_3
GUISetBkColor(0xfaff72, $hGUI)
GUICtrlSetBkColor($slider, 0xfaff72)
menuCheck(3)
EndSwitch
GUICtrlSetColor($current_time, 0x000000)
EndFunc ;==>guicolor
Func tray()
Switch @TRAY_ID
Case $tray_play
_Play()
Case $tray_stop
_StopPlay()
EndSwitch
EndFunc ;==>tray
Func Reciver($vParameter)
Switch BinaryMid($vParameter, 1, 1)
Case 0x21
If BinaryMid($vParameter, 2) = 0x30 Then
If _GUICtrlToolbar_GetButtonState($hToolbar, $idDat) Then
_GUICtrlToolbar_EnableButton($hToolbar, $idDat, False)
GUICtrlSetState($hGIF, $GUI_DISABLE)
_GUICtrlStatusBar_SetIcon($StatusBar, 0, $hIcons[1])
_GUICtrlStatusBar_SetTipText($StatusBar, 0, "网络不畅")
AdlibRegister('_chk_net', 3000)
EndIf
Else
AdlibUnRegister('_chk_net')
_GUICtrlToolbar_EnableButton($hToolbar, $idDat, True)
GUICtrlSetState($hGIF, $GUI_ENABLE)
_GUICtrlStatusBar_SetIcon($StatusBar, 0, $hIcons[0])
_GUICtrlStatusBar_SetTipText($StatusBar, 0, "网络通畅")
EndIf
Case 0x22
_GUICtrlStatusBar_SetText($StatusBar, BinaryToString(BinaryMid($vParameter, 2)), 2)
Case 0x23
$vParameter = BinaryMid($vParameter, 2)
Local $Ping = StringSplit(BinaryToString($vParameter), '|', 2)
_Chek_net($NetState[0], Number($Ping[0]))
_Chek_net($NetState[1], _Iif(($Ping[1] = -1) Or ($Ping[2] = -1), 0, (Number($Ping[1]) + Number($Ping[2])) / 2))
_Chek_net($NetState[2], _Iif(($Ping[3] = -1) Or ($Ping[4] = -1), 0, (Number($Ping[3]) + Number($Ping[4])) / 2))
_Chek_net($NetState[3], Number($Ping[5]))
_Chek_net($NetState[4], Number($Ping[6]))
_Chek_net($NetState[5], Number($Ping[7]))
_ExitLoading()
Case 0x24
_ToolTip("抱歉", "可能由于网络问题,导致无法获取数据", 3, 1)
Return _ExitLoading()
Case 0x25
BinaryToString(BinaryMid($vParameter, 2)) ;联网进程
Case Else
Switch $load_flag
Case 0
If $mode = 3 Then
$lrc_text = _LrcDownLoad_kuwo($vParameter)
ElseIf $mode = 2 Then
If BinaryMid($vParameter, 1, 2) = '0xFFFE' Then
$lrc_text = BinaryToString(BinaryMid($vParameter, 3), 2)
ElseIf BinaryMid($vParameter, 1, 2) = '0xFEFF' Then
$lrc_text = BinaryToString(BinaryMid($vParameter, 3), 3)
ElseIf BinaryMid($vParameter, 1, 3) = '0xEFBBBF' Then
$lrc_text = BinaryToString(BinaryMid($vParameter, 4), 4)
Else
$lrc_text = BinaryToString($vParameter, 1)
EndIf
ElseIf $mode = 9 Then
Local $lrc_qq_temp = StringRegExp(BinaryToString($vParameter), '(?s)\[CDATA\[(.*?)\]\]', 3, 1)
If @error Then Return
$lrc_text = $lrc_qq_temp[0]
Else
$lrc_text = BinaryToString($vParameter)
EndIf
$lrc_Format = _lrc_Prase($lrc_text)
If IsArray($lrc_Format) Then
Update_L()
Else
_GUICtrlListView_BeginUpdate($Lrc_List)
_GUICtrlListView_DeleteAllItems($Lrc_List)
Dim $lrc_Show = ''
_txt_Prase($lrc_text, $lrc_Format)
If @error Then
For $i = 0 To 5
GUICtrlCreateListViewItem($L[$i], $Lrc_List)
Next
Dim $lrc_Format = ''
Else
For $i = 0 To UBound($lrc_Format) - 1
GUICtrlCreateListViewItem($lrc_Format[$i], $Lrc_List)
Next
_GUICtrlListView_SetColumnWidth($Lrc_List, 0, $LVSCW_AUTOSIZE_USEHEADER)
EndIf
_GUICtrlListView_EndUpdate($Lrc_List)
EndIf
If _BASS_ChannelIsActive($MusicHandle) = 0 Then $current_song = ''
Case 1
Local $re
If $mode <> 7 And $mode <> 2 Then $vParameter = BinaryToString($vParameter)
Switch $mode
Case 1
$re = _LrcList_qianqian(0, 0, 0, $vParameter)
If IsArray($re) Then
_GUICtrlListView_AddArray($sub_list, $re)
_GUICtrlListView_SetColumn($sub_list, 0, "ID", 0, 0)
_GUICtrlListView_SetColumn($sub_list, 1, "歌手", 132, 2)
_GUICtrlListView_SetColumn($sub_list, 2, "歌曲", 180, 2)
_GUICtrlListView_HideColumn($sub_list, 3)
_GUICtrlListView_HideColumn($sub_list, 4)
_GUICtrlListView_HideColumn($sub_list, 5)
GUISetState(@SW_SHOW, $Lrc_Choose)
EndIf
WinSetTitle($Lrc_Choose, '', '选择歌词 - 千千静听')
Case 2
$re = _LrcList_mini(0, 0, $vParameter)
If IsArray($re) Then
_GUICtrlListView_AddArray($sub_list, $re)
_GUICtrlListView_SetColumn($sub_list, 0, "URL", 0, 0)
_GUICtrlListView_SetColumn($sub_list, 1, "歌手", 70, 2)
_GUICtrlListView_SetColumn($sub_list, 2, "歌曲", 91, 2)
_GUICtrlListView_SetColumn($sub_list, 3, "专辑", 80, 2)
_GUICtrlListView_SetColumn($sub_list, 4, "得分", 35, 2)
_GUICtrlListView_SetColumn($sub_list, 5, "票数", 35, 2)
GUISetState(@SW_SHOW, $Lrc_Choose)
EndIf
WinSetTitle($Lrc_Choose, '', '选择歌词 - MiniLyrics')
Case 3
$re = _LrcList_kuwo(0, 0, $vParameter)
If IsArray($re) Then
_GUICtrlListView_AddArray($sub_list, $re)
_GUICtrlListView_SetColumn($sub_list, 0, "PATH", 0, 0)
_GUICtrlListView_SetColumn($sub_list, 1, "歌手", 135, 2)
_GUICtrlListView_SetColumn($sub_list, 2, "歌曲", 176, 2)
_GUICtrlListView_HideColumn($sub_list, 3)
_GUICtrlListView_HideColumn($sub_list, 4)
_GUICtrlListView_HideColumn($sub_list, 5)
GUISetState(@SW_SHOW, $Lrc_Choose)
EndIf
WinSetTitle($Lrc_Choose, '', '选择歌词 - 酷我音乐')
Case 4
$re = _LrcList_ilrc(0, 1, $vParameter)
If IsArray($re) Then
_GUICtrlListView_AddArray($sub_list, $re)
_GUICtrlListView_SetColumn($sub_list, 0, "URL", 0, 0)
_GUICtrlListView_SetColumn($sub_list, 1, "歌手", 80, 2)
_GUICtrlListView_SetColumn($sub_list, 2, "歌曲", 136, 2)
_GUICtrlListView_SetColumn($sub_list, 3, "专辑", 95, 2)
_GUICtrlListView_HideColumn($sub_list, 4)
_GUICtrlListView_HideColumn($sub_list, 5)
GUISetState(@SW_SHOW, $Lrc_Choose)
EndIf
WinSetTitle($Lrc_Choose, '', '选择歌词 - 5ilrc')
Case 5
Return _LrcDownLoad_baidu(0, 0, $vParameter)
Case 6
$re = _get_cover($vParameter)
If @error Then
GUICtrlSetImage($cover, @ScriptDir & "\icon\music-default.jpg")
_ToolTip('很遗憾', "没有找到相关专辑", 3)
$coverStartIndex = 0
Return _ExitLoading()
EndIf
Case 7
$cover_Dir = $cover_put
$f_jpg = FileOpen($cover_Dir, 26)
FileWrite($f_jpg, $vParameter)
FileClose($f_jpg)
_loadpic()
$mode = 6
Case 8
$Ping = StringSplit($vParameter, '|', 2)
_Chek_net($NetState[0], Number($Ping[0]))
_Chek_net($NetState[1], _Iif(($Ping[1] = -1) Or ($Ping[2] = -1), 0, (Number($Ping[1]) + Number($Ping[2])) / 2))
_Chek_net($NetState[2], _Iif(($Ping[3] = -1) Or ($Ping[4] = -1), 0, (Number($Ping[3]) + Number($Ping[4])) / 2))
_Chek_net($NetState[3], Number($Ping[5]))
_Chek_net($NetState[4], Number($Ping[6]))
_Chek_net($NetState[5], Number($Ping[7]))
Case 9
$re = _LrcList_qq(0, 0, $vParameter)
If IsArray($re) Then
_GUICtrlListView_AddArray($sub_list, $re)
_GUICtrlListView_SetColumn($sub_list, 0, "ID", 0, 0)
_GUICtrlListView_SetColumn($sub_list, 1, "歌手", 145, 2)
_GUICtrlListView_SetColumn($sub_list, 2, "歌曲", 180, 2)
_GUICtrlListView_HideColumn($sub_list, 3)
_GUICtrlListView_HideColumn($sub_list, 4)
_GUICtrlListView_HideColumn($sub_list, 5)
GUISetState(@SW_SHOW, $Lrc_Choose)
EndIf
WinSetTitle($Lrc_Choose, '', '选择歌词 - QQ音乐')
EndSwitch
If IsArray($re) Then _GUICtrlListView_SetItemSelected($sub_list, 0)
EndSwitch
_ExitLoading()
EndSwitch
EndFunc ;==>Reciver
Func set()
Switch @GUI_CtrlId
Case $Fonts[0]
Local $font_a = __ChooseFont($font_name, $font_size, '', $font_xing, BitAND($font_var, 2), BitAND($font_var, 4), BitAND($font_var, 8), $Setting)
If @error Then Return
$font_var = $font_a[1]
$font_name = $font_a[2]
$font_size = $font_a[3]
$font_xing = $font_a[4]
If $font_xing >= 700 Then $font_var += 1
ChangeStyle($font_name, $font_size, $font_var, $font_color, $d_trans)
Case $Fonts[1]
Local $Ch = _ChooseColor(2, $font_color, 1)
If $Ch = -1 Then Return
GUICtrlSetBkColor($Fonts[1], $Ch)
$font_color = $Ch
ChangeStyle($font_name, $font_size, $font_var, $font_color, $d_trans)
Case $Fonts[2]
Local $Ch = _ChooseColor(2, $lrc_text_front_color, 1)
If $Ch = -1 Then Return
$lrc_text_front_color = $Ch
GUICtrlSetBkColor($Fonts[2], $Ch)
Case $Fonts[3]
Local $Ch = _ChooseColor(2, $lrc_text_back_color, 1)
If $Ch = -1 Then Return
$lrc_text_back_color = $Ch
GUICtrlSetBkColor($Fonts[3], $Ch)
;~ Local $tItem = DllStructCreate($tagLVITEM)
;~ DllStructSetData($tItem, "Mask", $LVIF_PARAM)
;~ DllStructSetData($tItem, "Item", 3)
;~ Local $pItem = DllStructGetPtr($tItem)
;~ GUICtrlSendMsg($Lrc_List, $LVM_GETITEMW, 0, $pItem)
;~ GUICtrlSetColor(DllStructGetData($tItem, "Param"), 0xff0000)
If UBound($lrc_Format, 0) <> 2 Then
GUICtrlSetColor($Lrc_List, $Ch)
;~ _GUICtrlListView_RedrawItems($Lrc_List, 0, _GUICtrlListView_GetItemCount($Lrc_List) - 1)
Else
Update_L($Ch)
EndIf
Case $Fonts[4]
Local $Ch = _ChooseColor(2, 0xEEEEEE, 1)
If $Ch = -1 Then Return
$list_bk_color = $Ch
GUICtrlSetBkColor($Fonts[4], $Ch)
GUICtrlSetBkColor($Lrc_List, $Ch)
Case $Fonts[5]
Local $font_b = __ChooseFont($list_name, $list_size, '', $list_xing, BitAND($list_var, 2), BitAND($list_var, 4), BitAND($list_var, 8), $Setting)
If @error Then Return
GUICtrlSetFont($Lrc_List, $font_b[3], $font_b[4], $font_b[1], $font_b[2])
$list_var = $font_b[1]
$list_name = $font_b[2]
$list_size = $font_b[3]
$list_xing = $font_b[4]
Case $Button1
Local $ini_dir = @ScriptDir & '\config.ini'
IniWrite($ini_dir, "lyrics", "font_name", $font_name)
IniWrite($ini_dir, "lyrics", "font_var", $font_var)
IniWrite($ini_dir, "lyrics", "font_size", $font_size)
IniWrite($ini_dir, "lyrics", "font_xing", $font_xing)
IniWrite($ini_dir, "lyrics", "font_color", $font_color)
IniWrite($ini_dir, "lyrics", "list_name", $list_name)
IniWrite($ini_dir, "lyrics", "list_var", $list_var)
IniWrite($ini_dir, "lyrics", "list_size", $list_size)
IniWrite($ini_dir, "lyrics", "list_xing", $list_xing)
IniWrite($ini_dir, "lyrics", "list_bk_color", $list_bk_color)
IniWrite($ini_dir, "lyrics", "lrc_text_back_color", $lrc_text_back_color)
IniWrite($ini_dir, "lyrics", "lrc_text_front_color", $lrc_text_front_color)
IniWrite($ini_dir, "lyrics", "transparency", $d_trans)
IniWrite($ini_dir, "lyrics", "desk_top", $desk_top)
IniWrite($ini_dir, "lyrics", "desk_fade", BitAND(GUICtrlRead($Fade_set), $GUI_CHECKED))
IniWrite($ini_dir, "lyrics", "onlylist", $onlylist)
IniWrite($ini_dir, "lyrics", "align", $list_align)
IniWrite($ini_dir, "server", "cnc", $isCnc)
IniWrite($ini_dir, "server", "cover_size", $isBig)
IniWrite($ini_dir, "server", "proxy", _Iif(BitAND(GUICtrlRead($ProxyCheck), $GUI_CHECKED), GUICtrlRead($ProxyIP) & ':' & GUICtrlRead($port_input), ""))
IniWrite($ini_dir, "others", "save_only_txt", $save_only_txt)
IniWrite($ini_dir, "others", "save_always_ask", $save_always_ask)
IniWrite($ini_dir, "others", "copy_with_lrc", $copy_with_lrc)
IniWrite($ini_dir, "others", "force_ti_format", $force_ti_format)
IniWrite($ini_dir, "others", "only_file_without_lrc", $only_file_without_lrc)
IniWrite($ini_dir, "others", "dir_depth", GUICtrlRead($SubSel_Deep))
IniWrite($ini_dir, "others", "work_dir", $root_folder)
IniWrite($ini_dir, "others", "color", $GUI_color)
Case $Button2
GUISetState(@SW_HIDE, @GUI_WinHandle)
Case $Top_set
Local $s = GUICtrlRead($Top_set)
If $s <> 1 Then $s = 0
WinSetOnTop($dGUI, "", $s)
$desk_top = $s
Case $Slider1
$d_trans = 255 - GUICtrlRead($Slider1)
ChangeStyle($font_name, $font_size, $font_var, $font_color, $d_trans)
Case $Fade_set
Local $s = GUICtrlRead($Fade_set)
If $s = 1 Then
$FadeOut = 25
Else
$FadeOut = $d_trans
EndIf
Case $layOut0
Local $hListView_height = _WinAPI_GetWindowHeight(GUICtrlGetHandle($hListView))
Local $cu_width = _WinAPI_GetWindowWidth(GUICtrlGetHandle($hListView))
Local $lrc_height = _WinAPI_GetWindowHeight(GUICtrlGetHandle($Lrc_List))
If $onlylist = 2 Then
$hListView_height = $hListView_height - 33 - $lrc_height
GUICtrlSetPos($hListView, 8, 92, $cu_width, $hListView_height)
GUICtrlSetState($Lrc_List, $GUI_SHOW)
GUICtrlSetState($l_btn_header, $GUI_SHOW)
Else
GUICtrlSetPos($hListView, 8, 92, $cu_width, $hListView_height)
EndIf
GUICtrlSetState($cover, $GUI_SHOW)
GUICtrlSetState($cover_group, $GUI_SHOW)
GUICtrlSetPos($l_btn_header, 8, $hListView_height + 107, $cu_width - 263, 25)
GUICtrlSetPos($Lrc_List, 8, $hListView_height + 132, $cu_width - 263, $lrc_height)
_GUICtrlListView_SetColumnWidth($Lrc_List, 0, $LVSCW_AUTOSIZE_USEHEADER)
$onlylist = 0
Case $layOut1
Local $hListView_height = _WinAPI_GetWindowHeight(GUICtrlGetHandle($hListView))
Local $cu_width = _WinAPI_GetWindowWidth(GUICtrlGetHandle($hListView))
Local $lrc_height = _WinAPI_GetWindowHeight(GUICtrlGetHandle($Lrc_List))
If $onlylist = 2 Then
$hListView_height -= (33 + $lrc_height)
GUICtrlSetPos($hListView, 8, 92, $cu_width, $hListView_height)
GUICtrlSetState($Lrc_List, $GUI_SHOW)
GUICtrlSetState($l_btn_header, $GUI_SHOW)
Else
GUICtrlSetPos($hListView, 8, 92, $cu_width, $hListView_height)
EndIf
GUICtrlSetState($cover, $GUI_HIDE)
GUICtrlSetState($cover_group, $GUI_HIDE)
GUICtrlSetPos($l_btn_header, 8, $hListView_height + 107, $cu_width, 25)
GUICtrlSetPos($Lrc_List, 8, $hListView_height + 132, $cu_width, $lrc_height)
_GUICtrlListView_SetColumnWidth($Lrc_List, 0, $LVSCW_AUTOSIZE_USEHEADER)
$onlylist = 1
Case $layOut2
If $onlylist = 2 Then Return
Local $hListView_height = _WinAPI_GetWindowHeight(GUICtrlGetHandle($hListView))
Local $cu_width = _WinAPI_GetWindowWidth(GUICtrlGetHandle($hListView))
Local $lrc_height = _WinAPI_GetWindowHeight(GUICtrlGetHandle($Lrc_List))
GUICtrlSetState($l_btn_header, $GUI_HIDE)
GUICtrlSetState($Lrc_List, $GUI_HIDE)
If Not $onlylist Then
GUICtrlSetState($cover, $GUI_HIDE)
GUICtrlSetState($cover_group, $GUI_HIDE)
EndIf
GUICtrlSetPos($hListView, 8, 92, $cu_width, $hListView_height + $lrc_height + 33)
$onlylist = 2
Case $align_check
If GUICtrlRead($align_check) = 1 Then
_GUICtrlListView_JustifyColumn($Lrc_List, 0, 2)
$list_align = 2
Else
_GUICtrlListView_JustifyColumn($Lrc_List, 0, 0)
$list_align = 0
EndIf
_GUICtrlListView_RedrawItems($Lrc_List, 0, _GUICtrlListView_GetItemCount($Lrc_List) - 1)
Case $big, $small
$isBig = BitAND(GUICtrlRead($big), $GUI_CHECKED)
Case $cnc, $ct
$isCnc = BitAND(GUICtrlRead($cnc), $GUI_CHECKED)
Case $ProxyCheck
Local $ip
If BitAND(GUICtrlRead($ProxyCheck), $GUI_CHECKED) = $GUI_CHECKED Then
$ip = GUICtrlRead($ProxyIP) & ':' & GUICtrlRead($port_input)
StringRegExp($ip, '^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\:\d+$', 3, 1)
If Not @error Then
GUICtrlSetState($ProxyIP, $GUI_DISABLE)
GUICtrlSetState($port_input, $GUI_DISABLE)
If _CoProcSend($load_Pro, 'proxy|' & $ip) Then
Else
_ToolTip('错误', "Worker not Responding (" & @error & ")", 3, 3)
EndIf
Else
GUICtrlSetState($ProxyCheck, $GUI_UNCHECKED)
MsgBox(48, '提示', '格式或其他错误!', 2)
EndIf
Else
GUICtrlSetState($ProxyIP, $GUI_ENABLE)
GUICtrlSetState($port_input, $GUI_ENABLE)
If _CoProcSend($load_Pro, 'proxy|') Then
Else
_ToolTip('错误', "Worker not Responding (" & @error & ")", 3, 3)
EndIf
EndIf
Case $Save_Checkbox
If $save_only_txt Then
$save_only_txt = 0
Else
$save_only_txt = 1
EndIf
Case $Save_Auto
If $save_always_ask Then
$save_always_ask = 0
Else
$save_always_ask = 1
EndIf
Case $Copy_Checkbox
If $copy_with_lrc Then
$copy_with_lrc = 0
Else
$copy_with_lrc = 1
EndIf
Case $Reg_Checkbox
If $force_ti_format Then
$force_ti_format = 0
Else
$force_ti_format = 1
EndIf
Case $Lrc_Checkbox
If $only_file_without_lrc Then
$only_file_without_lrc = 0
Else
$only_file_without_lrc = 1
EndIf
Case $shell_bt
If $shell_item Then
$shell_item = False
GUICtrlSetData($shell_bt, "安装右键增强")
Else
$shell_item = True
GUICtrlSetData($shell_bt, "卸载右键增强")
EndIf
EndSwitch
EndFunc ;==>set
Func _Play()
Local $lrc_exist
If $iSelected = -1 Then Return _ToolTip('错误', '请选择一首歌曲', 3)
If _BASS_ChannelIsActive($MusicHandle) = 0 Then
$MusicHandle = _BASS_StreamCreateFile(False, $root_folder & '\' & $bLVItems[$iSelected][7] & $bLVItems[$iSelected][0], 0, 0, 0)
If @error Then Return _ToolTip('错误', '未选中或其他错误' & @LF & '错误代码:' & @error, 3)
$length = _BASS_ChannelGetLength($MusicHandle, $BASS_POS_BYTE)
_BASS_ChannelPlay($MusicHandle, 1)
If (Not UBound($lrc_Format, 0) = 2) Or ($current_song And $current_song <> $bLVItems[$iSelected][0]) Then
$current_song = $bLVItems[$iSelected][0]
$lrc_exist = FileOpen($root_folder & '\' & $bLVItems[$iSelected][7] & StringRegExpReplace($bLVItems[$iSelected][0], '\.(\w+)$', '') & '.lrc')
If $lrc_exist = -1 Then
_ToolTip('提示', '未找到歌词文件,请先搜索', 3, 1)
$move_timer = _Timer_SetTimer($hGUI, 50, 'move_list', $move_timer)
_GUICtrlListView_BeginUpdate($Lrc_List)
_GUICtrlListView_DeleteAllItems($Lrc_List)
For $i = 0 To 5
GUICtrlCreateListViewItem($L[$i], $Lrc_List)
Next
_GUICtrlListView_SetColumnWidth($Lrc_List, 0, $LVSCW_AUTOSIZE_USEHEADER)
_GUICtrlListView_EndUpdate($Lrc_List)
Dim $lrc_Show = ''
Dim $lrc_Format = ''
Else
$lrc_text = FileRead($lrc_exist)
FileClose($lrc_text)
$lrc_Format = _lrc_Prase($lrc_text)
If UBound($lrc_Format, 0) = 2 Then
Update_L()
$n = 0
Else
$move_timer = _Timer_SetTimer($hGUI, 50, 'move_list', $move_timer)
_ToolTip('错误', '无法解析歌词文件!', 3, 3)
EndIf
EndIf
ElseIf UBound($lrc_Format, 0) = 2 Then ; may unnecessary
Dim $lrc_Show = $lrc_Format
ReDim $lrc_Show[UBound($lrc_Format, 1) + 1][3]
$lrc_Show[UBound($lrc_Format, 1)][0] = Round(_BASS_ChannelBytes2Seconds($MusicHandle, $length) * 1000, 0)
$lrc_Show[UBound($lrc_Format, 1) - 1][2] = $lrc_Show[UBound($lrc_Format, 1)][0] - $lrc_Show[UBound($lrc_Format, 1) - 1][0]
$move_timer = _Timer_SetTimer($hGUI, 50, 'move_list', $move_timer)
EndIf
If $bLVItems[$iSelected][1] And $bLVItems[$iSelected][2] Then
Local $SongString = $bLVItems[$iSelected][1] & ' - ' & $bLVItems[$iSelected][2]
WinSetTitle($hGUI, '', $SongString)
Else
Local $SongString = StringRegExpReplace($bLVItems[$iSelected][0], '\.(\w+)$', '')
WinSetTitle($hGUI, '', '正在播放 ' & $SongString)
EndIf
$vol = _BASS_ChannelGetAttribute($MusicHandle, $BASS_ATTRIB_VOL)
GUICtrlSetState($Sound_Stop, $GUI_ENABLE)
GUICtrlSetData($Sound_Play, ';')
ElseIf _BASS_ChannelIsActive($MusicHandle) = 1 Then
_BASS_ChannelPause($MusicHandle)
GUICtrlSetData($Sound_Play, '4')
ElseIf _BASS_ChannelIsActive($MusicHandle) = 3 Then
_BASS_ChannelPlay($MusicHandle, 0)
GUICtrlSetData($Sound_Play, ';')
GUICtrlSetState($Sound_Stop, $GUI_ENABLE)
$move_timer = _Timer_SetTimer($hGUI, 50, 'move_list', $move_timer)
EndIf
EndFunc ;==>_Play
Func _StopPlay()
_Stop()
GUICtrlSetData($current_time, '00:00:00')
WinSetTitle($hGUI, '', '音乐管理器 v2.0')
EndFunc ;==>_StopPlay
Func _ToolBar()