-
Notifications
You must be signed in to change notification settings - Fork 0
/
Unit1.pas
103 lines (88 loc) · 1.92 KB
/
Unit1.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
unit Unit1;
interface
uses
Sysutils, Classes, Forms, player, StdCtrls, Controls, ExtCtrls,
ComCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
r1: TRadioGroup;
r2: TRadioGroup;
r3: TRadioGroup;
tb: TTrackBar;
Label1: TLabel;
le: TLabeledEdit;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure tbChange(Sender: TObject);
procedure r1Click(Sender: TObject);
procedure r3Click(Sender: TObject);
procedure r2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure syntax;
end;
var
Form1: TForm1;
nota, alt, okt, syn:string;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Organ:TMusicPlayer;
d:integer;
begin
Organ:=TMusicPlayer.Create;
nota:=r1.Items[r1.ItemIndex];
alt:=r2.Items[r2.ItemIndex];
okt:=r3.Items[r3.ItemIndex];
for d:=1 to tb.Position do
begin
Organ.Play(nota+alt+okt+',<');
end;
Organ.Free;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
procedure TForm1.syntax;
begin
syn:=r1.Items[r1.ItemIndex]
+r2.Items[r2.ItemIndex]
+r3.Items[r3.ItemIndex]
+' x'
+inttostr(tb.Position);
end;
procedure TForm1.tbChange(Sender: TObject);
begin
label1.Caption:='Êîëè÷åñòâî ïîâòîðîâ: '+inttostr(tb.Position)+' ðàç';
syntax;
le.Text:=syn;
end;
procedure TForm1.r1Click(Sender: TObject);
begin
syntax;
le.Text:=syn;
end;
procedure TForm1.r3Click(Sender: TObject);
begin
syntax;
le.Text:=syn;
end;
procedure TForm1.r2Click(Sender: TObject);
begin
syntax;
le.Text:=syn;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
syntax;
le.Text:=syn;
end;
end.