home *** CD-ROM | disk | FTP | other *** search
- unit Unit1;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, ExtCtrls, Gauges, FileCtrl, StdCtrls, MPlayer;
-
- type
- TForm1 = class(TForm)
- MediaPlayer1: TMediaPlayer;
- CheckBox1: TCheckBox;
- FileListBox1: TFileListBox;
- DirectoryListBox1: TDirectoryListBox;
- DriveComboBox1: TDriveComboBox;
- FilterComboBox1: TFilterComboBox;
- Panel1: TPanel;
- Gauge1: TGauge;
- Timer1: TTimer;
- procedure FileListBox1DblClick(Sender: TObject);
- procedure Timer1Timer(Sender: TObject);
- procedure CheckBox1Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.FileListBox1DblClick(Sender: TObject);
- begin
- with MediaPlayer1 do begin
- Close;
- Panel1.Refresh;
- FileName:=FileListBox1.FileName;
- Open;
- Play;
- end;
- end;
-
- procedure TForm1.Timer1Timer(Sender: TObject);
- begin
- with MediaPlayer1 do
- if FileName<>'' then
- Gauge1.Progress:=Round(100*Position/Length);
- end;
-
- procedure TForm1.CheckBox1Click(Sender: TObject);
- var
- Start_From : Longint;
- begin
- with MediaPlayer1 do begin
- if FileName='' then Exit;
- Start_From:=Position;
- Close;
- Panel1.Refresh;
-
- if CheckBox1.Checked then
- Display:=Panel1
- else
- Display:=NIL;
-
- Open;
- Position:=Start_From;
- Play;
- end;
- end;
-
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- if FileListBox1.FileName='' then Exit;
- with MediaPlayer1 do begin
- Close;
- Panel1.Refresh;
- FileName:=FileListBox1.FileName;
- Open;
- end;
-
- end;
-
- end.
-