-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.pas
executable file
·7114 lines (6621 loc) · 171 KB
/
Main.pas
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
Unit Main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, CommCtrl, MPGTOOLs, Menus, IniFiles,
StdCtrls, UPTTreeList, FPTFolderBrowseDlg, FPTOpenDlg, Options, ExtCtrls,
RenmUnit, MMSystem, SrchUnit, Winamp, IO, JPEG;
const
{$IFDEF _DEMO_}
Demo_Count = 25;
appName = 'MP3 NaviGatoR DEMO';
appVer = 'v2.92d';
{$ELSE}
appName = 'MP3 NaviGatoR';
appVer = 'v2.92';
{$ENDIF}
appBuildDate = '19/11/2003'; {DD/MM/YYYY}
INIFileName = 'mp3nav.ini';
PLAFileName = 'mp3nav.nks';
NavigatorSection = 'MP3 NaviGatoR';
PlayListSection = 'PlayList';
PLSSection = 'playlist';
const RegPathAutoRun = '\Software\Microsoft\Windows\CurrentVersion\Run';
RegPath = '\Software\NiKe''Soft\'+appName;
STimerInt = 100;
NTimerInt = 300;
const pmNormal = 0;
pmRandom = 1;
{ pmReverse = 2;}
smNone = 32;
smRandom = 33;
smMask = 34;
SortMode : integer = smNone;
LastSort : integer = smNone;
RevSort : boolean = false;
DefPlayListsMask = '%A% - %T% {%G%}';
DefPlayListMask = '%A% - %T% {%G%}';
DefScrollMask = '%A% - %T% {%G%}';
DefPrecision = 200000;
DefFileNameMask = '%A% - %T%';
DefDelimiter = ' - ';
DefScanPlayTime = 20000;
WM_WA_MPEG_EOF = WM_USER+2; {!!!!!!!!!!!!!!}
const ScrollText : string = appName;
var PlayMode : byte = pmNormal;
ScanPlay : boolean = false;
ScanPlayTime : integer = DefScanPlayTime;
PlayManual : boolean = false;
SaveWinPos : boolean = false;
SaveWinSiz : boolean = false;
FocusDel : boolean = false;
MakeExtM3U : boolean = true;
AutoPlay : boolean = false;
EnableWritePlay : boolean = true;
SaveROINI : boolean = true;
RecursiveDirs : boolean = true;
ConfDiskDel : boolean = true;
ConfClearList : boolean = false;
ConfExit : boolean = false;
{ ConfEdtRO : boolean = false;{}
ConfDelRO : boolean = false;
MinimizeRun : boolean = false;
Fading : boolean = false;
FadedStart : boolean = false;
AskFileMask : boolean = true;
FocusAfterChangeSong : boolean = true;
FadingTime : integer = 0;
FadedStartTime : integer = 0;
DetectPrecision : integer = DefPrecision;
PlayListsMask : string = DefPlayListsMask;
PlayListMask : string = DefPlayListMask;
FileNameMask : string = DefFileNameMask;
ScrollMask : string = DefScrollMask;
LastOpenDir : string = '';
LastFileDir : string = '';
SaveListLastDir : string = '';
LoadListLastDir : string = '';
SkinsPath : string = '';
PlugsPath : string = '';
FirstActivate : boolean = true;
FirstFormShow : boolean = true;
Delimiter : string = DefDelimiter;
DefFormWidth : integer = 240+155 + 25*1;
DefFormHeight : integer = 32+70 + 29*10;
stCustomColors : string = '';
SaveListAfterChange : boolean = true;
ConfGroupNameEdit : boolean = true;
ConfNonExist : boolean = true;
MainPriority : integer = 2;
ThreadPriority : integer = 5;
SecretThreadPriority : integer = 0;
ScrollTimerPriority : integer = 3;
PlayingColor : integer = clLime;
TotalTime : integer = 0;
SnapWindow : boolean = false;
Threshold : Integer = 10;
SecretActivated : boolean = false; // :)
FirstScrollTimer : boolean = true;
PlayTimeSt : string = '';
TimeDec : boolean = true;
Activ1 : boolean = false;
EQVisible : boolean = false;
EQData : TGPFWinAmpInputPluginEQData = (127,127,127,127,127,127,127,127,127,127);
EQPreAmp : integer = 127;
EQisOn : boolean = false;
EQAuto : boolean = false;
eqX : integer = 0;
eqY : integer = 0;
OutPlugName : string = 'out_wave.dll';
VisPlugName : string = '';
CurMPA : tMPEGAudio;
simg : TJPEGImage;
drawimg : tbitmap;
stoppressed : boolean = false;
drawingvis : boolean = false;
obal,ovol : integer;
const stExit = 'Äåéñòâèòåëüíî Õîòèòå Âûéòè?';
stMinimize = 'Íîðìàëèçîâàòü';
stMaximize = 'Ìàêñèìèçèðîâàòü';
type tBtn = record
x,y : integer;
w,h : integer;
sX1,sY1 : integer;
sX2,sY2 : integer;
s : integer;
t : integer;
end;
const nBtns = 15;
aBtns : array [1..nBtns] of tBtn =
((x:012;y:147;w:025;h:021;sX1:111;sY1:113;sX2:111;sY2:134;s:0;t:0), // 01 Add
(x:040;y:147;w:025;h:021;sX1:137;sY1:113;sX2:137;sY2:134;s:0;t:0), // 02 Del
(x:068;y:147;w:025;h:021;sX1:163;sY1:113;sX2:163;sY2:134;s:0;t:0), // 03 Sel
(x:096;y:147;w:025;h:021;sX1:189;sY1:113;sX2:189;sY2:134;s:0;t:0), // 04 Msc
(x:125;y:148;w:021;h:018;sX1:000;sY1:113;sX2:000;sY2:131;s:0;t:0), // 05 Prev
(x:148;y:148;w:021;h:018;sX1:022;sY1:113;sX2:022;sY2:131;s:0;t:0), // 06 Play
(x:171;y:148;w:021;h:018;sX1:044;sY1:113;sX2:044;sY2:131;s:0;t:0), // 07 Pause
(x:194;y:148;w:021;h:018;sX1:066;sY1:113;sX2:066;sY2:131;s:0;t:0), // 08 Stop
(x:217;y:148;w:021;h:018;sX1:088;sY1:113;sX2:088;sY2:131;s:0;t:0), // 09 Next
(x:410;y:146;w:021;h:021;sX1:215;sY1:113;sX2:215;sY2:134;s:0;t:0), // 10 Save
(x:003;y:004;w:021;h:021;sX1:293;sY1:000;sX2:293;sY2:021;s:0;t:0), // 11 Menu
(x:002;y:004;w:021;h:021;sX1:229;sY1:000;sX2:229;sY2:021;s:0;t:0), // 12 Minimize
(x:002;y:004;w:021;h:021;sX1:250;sY1:000;sX2:250;sY2:021;s:0;t:0), // 13 Maximize
(x:002;y:004;w:021;h:021;sX1:271;sY1:000;sX2:271;sY2:021;s:0;t:0), // 14 Close
(x:000;y:000;w:047;h:015;sX1:182;sY1:186;sX2:182;sY2:201;s:0;t:1) // 15 Normal-Shuffle
);
type tUpdateSliderEvent = procedure (var s) of object;
type pMySlider = ^tMySlider;
tMySlider = class(TObject)
private
fLeft,fTop : integer;
fWidth,fHeight : integer;
fMinPos,fMaxPos : integer;
fPosition : integer;
fSliderVisible : boolean;
fUpdateEvent : tUpdateSliderEvent;
fTransparent : boolean;
fTransColor : integer;
fVertical : boolean;
Seeking : boolean;
AutoSeek : boolean;
procedure SetTopPos(x : integer);
procedure SetLeftPos(x : integer);
procedure SetWidth(x : integer);
procedure SetHeight(x : integer);
procedure SetMinPos(x : integer);
procedure SetMaxPos(x : integer);
procedure SetPosition(x : integer);
procedure SetVisible(b : boolean);
public
sx1,sy1,sx2,sy2 : integer;
sw,sh : integer;
constructor Create;
procedure Draw;
procedure OnChangedPosition; virtual;
function IsHitSlider(x,y : integer) : boolean;
procedure SetSliderPos(x : integer; upd : boolean);
published
property UpdateEvent : tUpdateSliderEvent read fUpdateEvent write fUpdateEvent;
property MaxPos : Integer read fMaxPos write SetMaxPos default 1;
property MinPos : Integer read fMinPos write SetMinPos default 0;
property Left : Integer read fLeft write SetLeftPos default 0;
property Top : Integer read fTop write SetTopPos default 0;
property Height : Integer read fHeight write SetHeight default 0;
property Width : Integer read fWidth write SetWidth default 0;
property Position : Integer read fPosition write SetPosition default 0;
property SliderVisible : boolean read fSliderVisible write SetVisible default true;
end;
type
TMainForm = class(TForm)
MySysMenu: TPopupMenu;
N1: TMenuItem;
smiTerminate: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
smiOptions: TMenuItem;
smiSaveListAs: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
N11: TMenuItem;
smiLoadList: TMenuItem;
N13: TMenuItem;
N14: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
N17: TMenuItem;
N18: TMenuItem;
N19: TMenuItem;
TAG1: TMenuItem;
TAG2: TMenuItem;
N20: TMenuItem;
N21: TMenuItem;
smiDeleteNonExisting: TMenuItem;
smiClearList: TMenuItem;
N25: TMenuItem;
smiScanPlay: TMenuItem;
smiNormalMode: TMenuItem;
smiRandomMode: TMenuItem;
smiManualPlay: TMenuItem;
smiEditSelTags: TMenuItem;
smiReReadSel: TMenuItem;
N30: TMenuItem;
N31: TMenuItem;
smiGroupSel: TMenuItem;
smiMoveSelToBegin: TMenuItem;
smiFindInList: TMenuItem;
N36: TMenuItem;
N37: TMenuItem;
N38: TMenuItem;
smiSelSendToWinamp: TMenuItem;
smiSelSendToDir: TMenuItem;
ItemsPopUp: TPopupMenu;
mpPlay: TMenuItem;
N41: TMenuItem;
N42: TMenuItem;
mpDelSelFromDisk: TMenuItem;
mpEditTag: TMenuItem;
mpClearList: TMenuItem;
N48: TMenuItem;
N49: TMenuItem;
mpMoveSelToBegin: TMenuItem;
mpMoveSelToEnd: TMenuItem;
mpMoveSelUp: TMenuItem;
mpMoveSelDown: TMenuItem;
N54: TMenuItem;
N55: TMenuItem;
N56: TMenuItem;
N57: TMenuItem;
N58: TMenuItem;
N59: TMenuItem;
N60: TMenuItem;
N61: TMenuItem;
N62: TMenuItem;
N63: TMenuItem;
mpSelEditTags: TMenuItem;
mpGroupSel: TMenuItem;
mpDelCurFile: TMenuItem;
mpDelSel: TMenuItem;
SaveListDlg: TPTSaveDlg;
OpenFolderDlg: TPTFolderBrowseDlg;
OpenDlg: TPTOpenDlg;
smiSendList: TMenuItem;
Winamp1: TMenuItem;
N2: TMenuItem;
LoadListDlg: TPTOpenDlg;
N7: TMenuItem;
N8: TMenuItem;
N12: TMenuItem;
N22: TMenuItem;
TAG3: TMenuItem;
N23: TMenuItem;
N24: TMenuItem;
N26: TMenuItem;
N27: TMenuItem;
N28: TMenuItem;
N29: TMenuItem;
N32: TMenuItem;
N33: TMenuItem;
N34: TMenuItem;
N35: TMenuItem;
N39: TMenuItem;
N40: TMenuItem;
N43: TMenuItem;
N44: TMenuItem;
AddPopupMenu: TPopupMenu;
N45: TMenuItem;
N46: TMenuItem;
DelPopupMenu: TPopupMenu;
N47: TMenuItem;
N50: TMenuItem;
N51: TMenuItem;
N52: TMenuItem;
N53: TMenuItem;
N64: TMenuItem;
N65: TMenuItem;
SelPopupMenu: TPopupMenu;
N66: TMenuItem;
N67: TMenuItem;
N68: TMenuItem;
MscPopupMenu: TPopupMenu;
TAG4: TMenuItem;
TAG5: TMenuItem;
N69: TMenuItem;
LoadPopupMenu: TPopupMenu;
N70: TMenuItem;
N71: TMenuItem;
N72: TMenuItem;
N73: TMenuItem;
N74: TMenuItem;
N75: TMenuItem;
N76: TMenuItem;
N77: TMenuItem;
N78: TMenuItem;
N79: TMenuItem;
N80: TMenuItem;
N81: TMenuItem;
N82: TMenuItem;
N83: TMenuItem;
N84: TMenuItem;
N85: TMenuItem;
N86: TMenuItem;
N87: TMenuItem;
N88: TMenuItem;
N89: TMenuItem;
N90: TMenuItem;
N91: TMenuItem;
N92: TMenuItem;
N93: TMenuItem;
smiMaxMin: TMenuItem;
N95: TMenuItem;
SecretImg: TImage;
ScrollTimer: TTimer;
SecretEdit: TEdit;
N94: TMenuItem;
N96: TMenuItem;
N97: TMenuItem;
N98: TMenuItem;
N99: TMenuItem;
smiMouseEn: TMenuItem;
smiEQ: TMenuItem;
N100: TMenuItem;
PlayList: TPTListView;
miShowColHeaders: TMenuItem;
N101: TMenuItem;
inmp3dll1: TMenuItem;
N102: TMenuItem;
inmp3dll2: TMenuItem;
FileInfo1: TMenuItem;
N103: TMenuItem;
N104: TMenuItem;
N105: TMenuItem;
// Message Handlers
procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK;
procedure WMRButtonDblClk(var Message: TWMRButtonDblClk); message WM_RBUTTONDBLCLK;
procedure WMActivate(var Message: TWMActivate); message WM_ACTIVATE;
procedure WMWAMPEGEOF(var Message: TMessage); message WM_WA_MPEG_EOF;
// procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHitTest;
procedure WMEraseBkgnd(var m: TWMEraseBkgnd); message WM_ERASEBKGND;
(*
procedure WMPaint(var m: TWMPaint); message WM_PAINT;
procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT;
*)
procedure smiTerminateClick(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormCreate(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N60Click(Sender: TObject);
procedure N61Click(Sender: TObject);
procedure N56Click(Sender: TObject);
procedure N58Click(Sender: TObject);
procedure N57Click(Sender: TObject);
procedure mpPlayClick(Sender: TObject);
procedure mpEditTagClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure PlayListDeletion(Sender: TObject; Item: TListItem);
procedure smiOptionsClick(Sender: TObject);
procedure PlayListKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure PlayListItemContextMenu(aSender: TObject; aItem: TListItem;
var aPos: TPoint; var aMenu: TPopupMenu);
procedure smiEditSelTagsClick(Sender: TObject);
procedure TAG3Click(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure N8Click(Sender: TObject);
procedure PlayListColumnClick(Sender: TObject; Column: TListColumn);
procedure N16Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure PlayListCompare(Sender: TObject; Item1, Item2: TListItem;
Data: Integer; var Compare: Integer);
procedure FormPaint(Sender: TObject);
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure mpSelEditTagsClick(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure mpDelCurFileClick(Sender: TObject);
procedure mpDelSelClick(Sender: TObject);
procedure mpDelSelFromDiskClick(Sender: TObject);
procedure mpGroupSelClick(Sender: TObject);
procedure mpMoveSelToBeginClick(Sender: TObject);
procedure smiNormalModeClick(Sender: TObject);
procedure smiRandomModeClick(Sender: TObject);
procedure smiReReadSelClick(Sender: TObject);
procedure N22Click(Sender: TObject);
procedure smiSaveListAsClick(Sender: TObject);
procedure N23Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure smiDeleteNonExistingClick(Sender: TObject);
procedure smiGroupSelClick(Sender: TObject);
procedure N11Click(Sender: TObject);
procedure N24Click(Sender: TObject);
procedure N26Click(Sender: TObject);
procedure N27Click(Sender: TObject);
procedure N28Click(Sender: TObject);
procedure smiClearListClick(Sender: TObject);
procedure N29Click(Sender: TObject);
procedure N32Click(Sender: TObject);
procedure smiLoadListClick(Sender: TObject);
procedure N33Click(Sender: TObject);
procedure N39Click(Sender: TObject);
procedure N35Click(Sender: TObject);
procedure N40Click(Sender: TObject);
procedure N43Click(Sender: TObject);
procedure SetDefSize;
procedure CenterPos;
procedure N46Click(Sender: TObject);
procedure N45Click(Sender: TObject);
procedure N53Click(Sender: TObject);
procedure N47Click(Sender: TObject);
procedure N51Click(Sender: TObject);
procedure N50Click(Sender: TObject);
procedure N66Click(Sender: TObject);
procedure N67Click(Sender: TObject);
procedure N68Click(Sender: TObject);
procedure N69Click(Sender: TObject);
procedure TAG5Click(Sender: TObject);
procedure TAG4Click(Sender: TObject);
procedure N72Click(Sender: TObject);
procedure N71Click(Sender: TObject);
procedure N70Click(Sender: TObject);
procedure N75Click(Sender: TObject);
procedure N76Click(Sender: TObject);
procedure N78Click(Sender: TObject);
procedure N80Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure N79Click(Sender: TObject);
procedure N82Click(Sender: TObject);
procedure PlayListDblClick(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure FormCanResize(Sender: TObject; var NewWidth,
NewHeight: Integer; var Resize: Boolean);
procedure smiScanPlayClick(Sender: TObject);
procedure smiManualPlayClick(Sender: TObject);
procedure N15Click(Sender: TObject);
procedure N17Click(Sender: TObject);
procedure N20Click(Sender: TObject);
procedure N19Click(Sender: TObject);
procedure TAG1Click(Sender: TObject);
procedure TAG2Click(Sender: TObject);
procedure N21Click(Sender: TObject);
procedure N84Click(Sender: TObject);
procedure N90Click(Sender: TObject);
procedure N91Click(Sender: TObject);
procedure N86Click(Sender: TObject);
procedure N87Click(Sender: TObject);
procedure N88Click(Sender: TObject);
procedure ScrollTimerTimer(Sender: TObject);
procedure smiFindInListClick(Sender: TObject);
procedure N92Click(Sender: TObject);
procedure smiMaxMinClick(Sender: TObject);
procedure N93Click(Sender: TObject);
procedure N95Click(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure SecretEditKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure N94Click(Sender: TObject);
procedure N96Click(Sender: TObject);
procedure N97Click(Sender: TObject);
procedure mpMoveSelToEndClick(Sender: TObject);
procedure mpMoveSelUpClick(Sender: TObject);
procedure mpMoveSelDownClick(Sender: TObject);
procedure PlayListInsert(Sender: TObject; Item: TListItem);
procedure N7Click(Sender: TObject);
procedure mpClearListClick(Sender: TObject);
procedure smiMouseEnClick(Sender: TObject);
procedure PlayListMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure PlayListMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure PlayListMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure smiEQClick(Sender: TObject);
procedure LoadSimgProgr(Sender: TObject; Stage: TProgressStage;
PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: string);
procedure SecretEditKeyPress(Sender: TObject; var Key: Char);
procedure miShowColHeadersClick(Sender: TObject);
procedure N101Click(Sender: TObject);
procedure N102Click(Sender: TObject);
procedure FileInfo1Click(Sender: TObject);
procedure N104Click(Sender: TObject);
procedure PlayListAdvancedCustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
var DefaultDraw: Boolean);
procedure SecretImgClick(Sender: TObject);
private
{ Private declarations }
procedure WMDropFiles(var Msg: TWMDropFiles); message WM_DROPFILES;
public
{ Public declarations }
procedure MainSliderUpdate(var s);
procedure VolSliderUpdate(var s);
procedure BalSliderUpdate(var s);
procedure HorTrackSliderUpdate(var s);
procedure VerTrackSliderUpdate(var s);
procedure DoMinimize;
procedure DoMaximize;
end;
const MaxMyListItems = 70000;
type pMPLItem = ^tMPLItem;
tMPLItem = record
fName : string;
TagTitle : string;
Title : string;
Artist : string;
Album : string;
Year : string;
Comment : string;
Genre : string;
MPA : tMPEGAudio;
nPlayed : integer;
Selected : boolean;
Time,
StartTime,
EndTime : integer;
Flag : boolean;
end;
const MaxMyColumns = 100;
type tMyColumn = record
Caption : string;
Width : integer;
end;
type pMyList = ^tMyList;
tMyList = record
Items : array[1..MaxMyListItems] of tMPLItem;
Count : integer;
TopItem,
PlayItem,
CurItem : integer;
// Colors
NormBG,
iCurBG,
iSelBG,
iNormFG,
iCurFG,
iPlayFG : integer;
posX,posY,
Width,Height : integer;
ItemHeight : integer;
ScrollX : integer;
Columns : array[1..MaxMyColumns] of tMyColumn;
ColumnsHeight : integer;
ViewType : integer;
ListBMP : TBitmap;
end;
const vtWinamp = 1;
vtMP3Nav = 0;
NumVisBuf = 1000;
type tIntVisData = array [0..50000] of byte;
pVisArr = ^tVisArr;
tVisArr = array[0..1,0..575] of byte;
pVisData = ^tVisData;
tVisData = record
a : tVisArr;
ts : integer; // TimeStamp
n : pVisData;
end;
var MainForm : TMainForm;
VisPH,VisPT,VisBH,VisBT : pVisData;
myPlayList : tMyList;
BasePath : string;
Skin,Buf : TBitMap;
FontBmp : TBitMap;
EQSkin : TBitMap;
EQBuf : TBitMap;
StopProc : boolean;
mX,mY : integer;
Dragged,Sizing : boolean;
dnBt,dnBts : integer;
mfw,mfh,mfl,mft : integer;
DoNotFree : boolean = false;
MainSlider,VolSlider,BalSlider,HorTrack,VerTrack : tMySlider;
Creating : boolean = true;
Painting : boolean = false;
LastPlayed : integer = -1;
Dontseek : boolean; {means that slider has to be updated}
MovingItems : boolean = false;
IsPlaying : boolean = false;
Sct : integer = 0;
OldMaxX,OldMaxY,OldMaxW,OldMaxH : integer;
IsMaximized : boolean = false;
IsActive : boolean = false;
Captured : boolean = false;
hOutDLL,hInDLL,hVisDLL : HINST;
getinfunc : winampGetInModule2func;
getoufunc : winampGetOutModulefunc;
getvifunc : winampVisGetHeaderfunc;
p : pointer;
StopAfterCur : boolean = false;
Stopping : boolean = false;
MouseEn : boolean = true;
ScrollingItems : boolean = false;
osX,osY : integer;
IntVisData : tIntVisData;
IntVisBPS : integer = 8;
IntVisNCH : integer = 2;
VisStamp : integer = 0;
SecretShowVis : boolean = false;
FadingStopping : boolean = false;
FadingCounter : integer = 0;
FirstSecret1Activate : boolean = true;
visPut : integer = 0;
exited : boolean = false;
exiting : boolean = false;
const StampTime = 5;
{$IFDEF _DEMO_}
procedure ShowDemoMsg;
{$ENDIF}
function AddSlash(Path : string) : string;
function AddDir(Path : string; ps : integer) : integer;
procedure AddDirs;
function AddFile(FileName : string; ft,ps : integer) : integer;
procedure AddFiles;
function SavePLSList (FileName : string; RelativePath,SelectedOnly : Boolean) : integer;
function SaveM3UList (FileName : string; RelativePath,SelectedOnly : Boolean) : integer;
function SaveNKSList (FileName : string; RelativePath,SelectedOnly : Boolean) : integer;
function LoadPLSList (FileName : string) : integer;
function LoadM3UList (FileName : string) : integer;
function LoadNKSList (FileName : string) : integer;
procedure SavePlayList;
procedure SaveList(FileName : string; ft : integer; seOnly : boolean);
procedure SaveListAs(seOnly : boolean);
procedure LoadList(clr : boolean);
procedure SetEQVisible(v : boolean);
procedure ClearList;
procedure RenameSelected;
procedure DelNonExisting;
procedure DelSelFromList;
procedure DelSelFromDisk;
procedure DelCurFromList;
procedure DelCurFromDisk;
procedure GroupSelected;
procedure MoveSelToCur;
procedure EditCurTAG;
procedure EditSelTags;
function RefreshItem(it : tListItem) : integer;
procedure RefreshItems(sel : boolean);
procedure MoveItem(j,n : integer);
procedure MoveSel(n : integer);
procedure MoveSelHome;
procedure MoveSelEnd;
procedure SelectZero;
procedure SelectAll;
procedure SelectInvert;
procedure RandomizeList;
procedure SortBy(sm : integer);
procedure PlayListAutoFit;
procedure DoPlayTimeSt;
procedure ToggleHeaders;
procedure SetHeaders(v : boolean);
procedure PaintSkin;
procedure AppExit;
procedure CheckItem(li : tListItem);
function DecodeTimeSt(ts : string) : integer;
procedure SetSizes(w,h : integer);
procedure GetBuildInfo(var V1, V2, V3, V4: Word);
function CorFormHeight(x : integer) : integer;
function CorFormWidth(x : integer) : integer;
function nHitBtn(hx,hy : integer) : integer;
procedure PushBtn(b : integer; var s : integer; Button: TMouseButton; Shift: TShiftState; x,y : integer);
procedure PlayListOnChange;
procedure SetPriority;
procedure DefinePriority(m,t : integer);
procedure SetPlayMode(pm : integer);
procedure PlayItem(i : integer);
procedure TogglePause;
procedure OnStopPlaying;
procedure PlayCurrent;
procedure PlayStop;
procedure PlayFadedStop;
procedure PlayPause;
procedure PlayUnPause;
procedure PlayNext;
procedure PlayPrev;
procedure PlayWind(t : integer);
procedure PlayFFWD5s;
procedure PlayReWind5s;
procedure PlayFile(s : string);
function GetWaveVolume: DWord;
procedure SetWaveVolume(const AVolume: DWord);
procedure mySetBal;
procedure mySetVol;
procedure mySetVolume;
procedure SetCurSizes;
procedure SetTopItem(it : integer);
function ValidLP(lp : integer) : boolean;
procedure WriteMySt(s : string; x,y,maxl : integer);
procedure DelDupes;
procedure UpdateScrollTxt;
procedure GetTagFromName(Name : string; var Band,Title,Album,Year : string; var Track : integer);
function InitSoundSystem : boolean;
procedure SetMouseEn(s : boolean);
procedure SetManualPlay(s : boolean);
procedure SetScanPlay(s : boolean);
procedure SetTimeDec(s : boolean);
procedure VolumeUp;
procedure VolumeDown;
function ReMax(v,OldMax,NewMax : integer) : integer;
procedure InitMatrixWorms;
procedure LoadJPEGFromRes(jname : string);
function ItemFileExists(i : integer) : boolean;
procedure InitMyPlayList;
procedure SetMyListFont(fontname : string; size : integer);
procedure RecalcMyListH;
procedure SetMyListFnt(const Fnt : tFont);
procedure DrawMyItem(i,x,y : integer);
procedure DrawMyList;
function AddMyListItem(si : integer) : integer;
function TrySkinPath(s : string) : boolean;
procedure DoReqLyr;
var OutPlug : pGPFWinAmpOutputPurposePlugin;
InPlug : pGPFWinAmpInputPurposePlugin;
VisPlug : pGPFWinAmpInputPurposePlugin;
function MakeSQLStr(s : string) : string;
Implementation uses About,edUnit,GEdUnit,StatUnit,MaskAsk,ShellApi,uProgres,Quotes,
EQUnit, ReqLyrUnit, demo;
{$R *.DFM}
{$R SIMG.RES}
var pHDC : HDC;{}
hTaskBar : HWND;
hBar : HWND;
hStart : HWND;
hTray : HWND;
hClock : HWND;
secOldX,secOldY,secOldW,secOldH : integer;
MatrixW,MatrixH : integer;
TimeTicks : integer;
Dropping : boolean = false;
const skinchars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ"@ '+
'0123456789_ :()-''!_+\/[]^&%.=$#'+
' ? ';
WAVE_MAPPER = $FFFF{UINT(-1)};
const MaxMatrixWormTail = 512;
type tMatrixWormTail = array [1..MaxMatrixWormTail] of integer;
tMatrixWorm = record
x,y : integer;
Spd : integer;
Tail : tMatrixWormTail;
Dir : integer;
TailLen : integer;
Alive : boolean;
end;
tMatrixDot = record
x,y : integer;
Spd : integer;
dot : integer;
st : integer;
Dir : integer;
end;
tMatrixMovingImg = record
x,y : integer;
spd : integer;
dir : integer;
sh,sw : integer;
sx,sy : integer;
mx,my : integer;
end;
const MaxMatrixWorms = 200;
MaxMatrixMovingImg = 5;
var mWorms : array [1..MaxMatrixWorms] of tMatrixWorm;
mDots : array [1..MaxMatrixWorms] of tMatrixDot;
mMoveImg : array[1..MaxMatrixMovingImg] of tMatrixMovingImg;
nWorms,nMoveImg : integer;
{$IFDEF _DEMO_}
procedure ShowDemoMsg;
begin
DMGForm.ShowModal;
// MessageDlg('Ó Âàñ Äåìî-âåðñèÿ ïðîãðàììû, ñîõðàíåíèå íàñòðîåê è äðóãèå ïîëåçíûå ôóíêöèè äîñòóïíû òîëüêî â ïîëíîé çàðåãèñòðèðîâàííîé âåðñèè, êîòîðóþ âû ìîæåòå ïðèîáðåñòè ïî àäðåñó '#13#13'http://www.NiKeSoft.ru',mtWarning,[mbok],0);
end;
{$ENDIF}
procedure GetTagFromName(Name : string; var Band,Title,Album,Year : string; var Track : integer);
var ts,s : string;
DelimiterPos,k,i,j,trklen : integer;
begin
s := ExtractFileName(Name);
j := length(s);
while (j > 0)and(s[j] <> '.') do dec(j);
if j > 0 then s := Trim(copy(s,1,j-1));
for i := 1 to length(s) do if s[i] = '_' then s[i] := ' ';
Band := '';
Title := s;
// Title := '';
Album := '';
Year := '';
Track := 0;
if length(s) < 3 then
begin
// 13.mp3
// Title := s;
val(s,i,j);
if (j = 0)and(i > 0) then Track := i;
end else
if s[1] = '(' then
begin
// ? (Bonus).mp3
i := pos(')-',s);
if i > 0 then
begin
// (Era-Infinity(98)-05_Flovers_of_the_sea.mp3
//? (A-Ha-Garage_Days_Re-Visited(98)-05_Flovers_of_the_sea.mp3
ts := copy(s,2,i-1);
j := length(ts);
while (j > 0)and(ts[j] in ['0'..'9']) do dec(j);
Year := trim(copy(ts,j+1,4));
ts := copy(ts,1,j);
val(s,j,k);
if (k = 0)and(j > 0) then
begin
if j < 30 then Year := '20'+lz(j,2,'0') else Year := '19'+lz(j,2,'0')
end;
ts := copy(s,i+2,length(s));
k := pos('-',ts);
if k > 0 then
begin
Band := trim(copy(ts,1,k-1));
Album := trim(copy(ts,k+1,length(ts)));
end;
j := 1;
while (j <= length(ts))and(ts[j] in ['0'..'9']) do inc(j);
Title := trim(copy(ts,j,length(ts)));
ts := copy(ts,1,j-1);
val(ts,i,j);
if j = 0 then
begin
Track := i;
end;
end else Title := s;
end else
begin
// 01. Track01Name.mp3
// 02 - Track02Name.mp3
// 01TrackName.mp3
// Track04.mp3
// Artist - Title.mp3
trklen := 0;
if (length(s) > 3)and(s[1] in ['0'..'9'])and(s[2] in ['0'..'9']) then
begin
if copy(s,3,2) = '. ' then trklen := 4 else
if copy(s,3,3) = ' - ' then trklen := 5;
end;
if trklen > 0 then
begin
Track := (ord(s[1])-ord('0'))*10;
Track := Track+ord(s[2])-ord('0');
system.delete(s,1,trklen);
s := TrimLeft(s);
for DelimiterPos := Length (s) downto 1 do if s[DelimiterPos] = '.' then
begin
s := Copy (s, 1, DelimiterPos - 1);
break;
end;
Title := s;
end else
begin
DelimiterPos := Pos (Delimiter, s);
If DelimiterPos > 0 then
s := Trim (Copy (s, 1, DelimiterPos - 1))
else s := '';
Band := s;
s := ExtractFileName(Name);
DelimiterPos := Pos (Delimiter, s);
if DelimiterPos > 0 then
s := Trim (Copy (s, DelimiterPos + length(Delimiter), Length (s)))
else s := '';
for DelimiterPos := Length (s) downto 1 do
if s[DelimiterPos] = '.' then
begin
s := Copy (s, 1, DelimiterPos - 1);
Break;
end;
Title := s;
end;
end;
end;
procedure DoReqLyr;
var li : tListItem;
begin
with MainForm do
begin
li := PlayList.ItemFocused;
if li <> nil then
begin
CheckItem(li);
RequestLyrics(li.caption,li.SubItems[1],li.SubItems[0]);
end else
begin
RequestLyrics('','','');
end;
end;
end;
function MakeSQLStr(s : string) : string;
var i : integer;
begin
i := 1;
while (i <= length(s))do
begin
if s[i]='''' then
begin
insert('''',s,i);
inc(i);
end;
inc(i);
end;
Result := s;
end;