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
|
unit Main;
interface
{$IFDEF UNIX}
{$DEFINE CLX}
{$ELSE}
{$DEFINE VCL}
{$ENDIF}
uses
SysUtils,
Classes,
{$IFDEF CLX}
Types,
QGraphics,
QControls,
QForms,
QDialogs,
QExtCtrls,
QStdCtrls,
{$ENDIF}
{$IFDEF VCL}
Forms,
Graphics,
Dialogs,
StdCtrls,
Controls,
ExtCtrls,
{$ENDIF}
sdlmpegpanel;
type
TForm1 = class( TForm )
Panel1 : TPanel;
Panel2 : TPanel;
Button1 : TButton;
Button2 : TButton;
Button3 : TButton;
Panel3 : TPanel;
CheckBox1 : TCheckBox;
OpenDialog: TOpenDialog;
SDLMPEGPanel: TSDLMPEGPanel;
procedure Button1Click( Sender : TObject );
procedure Button2Click( Sender : TObject );
procedure Button3Click( Sender : TObject );
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1 : TForm1;
implementation
{$IFDEF WIN32}
{$R *.dfm}
{$ENDIF}
{$IFDEF UNIX}
{$R *.xfm}
{$ENDIF}
procedure TForm1.Button1Click( Sender : TObject );
begin
with OpenDialog do
begin
if Execute then
begin
SDLMPEGPanel.MPEGFile := FileName;
SDLMPEGPanel.Sound := CheckBox1.Checked;
SDLMPEGPanel.Play;
end;
end;
end;
procedure TForm1.Button2Click( Sender : TObject );
begin
SDLMPEGPanel.Pause;
end;
procedure TForm1.Button3Click( Sender : TObject );
begin
SDLMPEGPanel.Stop;
end;
end.
|