SetSyncTime.pas
1.87 KB
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
unit SetSyncTime;
interface
{$DEFINE MULTI_LANGUAGE}
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, slider, StdCtrls {$IFDEF MULTI_LANGUAGE}, gnugettext{$ENDIF};
type
TSetSyncShiftTimeForm = class(TForm)
btnCLose: TButton;
GroupBox1: TGroupBox;
Label10: TLabel;
Label12: TLabel;
Label13: TLabel;
Label15: TLabel;
Label18: TLabel;
Label4: TLabel;
lbl_ShiftAll: TLabel;
Label1: TLabel;
SliderMIDI_DS: TSlider;
procedure btnCLoseClick(Sender: TObject);
procedure SliderMIDI_DSChange(Sender: TObject);
procedure SliderMIDI_DSStopTracking(Sender: TObject);
procedure SliderMIDI_DSStartTracking(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
SetSyncShiftTimeForm: TSetSyncShiftTimeForm;
implementation
{$R *.dfm}
uses ReadMIDILyrics, ShowMIDILyrics;
var
NowTracking : boolean = false;
NowTracking2 : boolean = false;
procedure TSetSyncShiftTimeForm.btnCLoseClick(Sender: TObject);
begin
Close;
end;
procedure TSetSyncShiftTimeForm.FormCreate(Sender: TObject);
begin
{$IFDEF MULTI_LANGUAGE}
TranslateComponent(self);
{$ENDIF}
SetMIDITimeOffset(- SliderMIDI_DS.Value * 50);
end;
procedure TSetSyncShiftTimeForm.SliderMIDI_DSChange(Sender: TObject);
begin
if not NowTracking2 then
exit;
if SliderMIDI_DS.Value >= 0 then
lbl_ShiftAll.Caption := '+' + FormatFloat('#0.00', SliderMIDI_DS.Value / 20.0)
else
lbl_ShiftAll.Caption := FormatFloat('#0.00', SliderMIDI_DS.Value / 20.0);
end;
procedure TSetSyncShiftTimeForm.SliderMIDI_DSStartTracking(Sender: TObject);
begin
NowTracking2 := true;
end;
procedure TSetSyncShiftTimeForm.SliderMIDI_DSStopTracking(Sender: TObject);
begin
SetMIDITimeOffset(- SliderMIDI_DS.Value * 50);
NowTracking2 := false;
end;
end.