unit lecteuravi;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, MPlayer, FileCtrl;
type
TForm1 = class(TForm)
fichiers: TFileListBox;
dossiers: TDirectoryListBox;
disques: TDriveComboBox;
MediaPlayer1: TMediaPlayer;
Panel1: TPanel;
Jouer: TButton;
Stop: TButton;
Quitter: TButton;
procedure FormActivate(Sender: TObject);
procedure JouerClick(Sender: TObject);
procedure StopClick(Sender: TObject);
procedure QuitterClick(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormActivate(Sender: TObject);
begin
disques.Drive :='C';
dossiers.Directory :='C:\windows\media';
end;
procedure TForm1.JouerClick(Sender: TObject);
begin
MediaPlayer1.FileName := fichiers.FileName;
MediaPlayer1.Open;
MediaPlayer1.Play;
MediaPlayer1.Display := Panel1;
MessageDlg('Message'+fichiers.FileName
,mtError,mbOKCancel,0);
end;
procedure TForm1.StopClick(Sender: TObject);
begin
MediaPlayer1.Stop;
end;
procedure TForm1.QuitterClick(Sender: TObject);
begin
Application.Terminate;
end;
end.
************************************************************
****
object Form1: TForm1
Left = 175
Top = 207
Width = 544
Height = 375
Caption = 'AVI Player'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnActivate = FormActivate
PixelsPerInch = 96
TextHeight = 13
object fichiers: TFileListBox
Left = 112
Top = 40
Width = 89
Height = 121
ItemHeight = 13
Mask = '*.avi'
TabOrder = 0
end
object dossiers: TDirectoryListBox
Left = 8
Top = 64
Width = 97
Height = 97
FileList = fichiers
ItemHeight = 16
TabOrder = 1
end
object disques: TDriveComboBox
Left = 8
Top = 40
Width = 97
Height = 19
DirList = dossiers
TabOrder = 2
end
object MediaPlayer1: TMediaPlayer
Left = 200
Top = 16
Width = 253
Height = 20
DeviceType = dtAVIVideo
Display = Panel1
Visible = False
TabOrder = 3
end
object Panel1: TPanel
Left = 216
Top = 40
Width = 313
Height = 305
Color = clInactiveCaptionText
TabOrder = 4
end
object Jouer: TButton
Left = 16
Top = 224
Width = 75
Height = 25
Caption = '&Jouer'
TabOrder = 5
OnClick = JouerClick
end
object Stop: TButton
Left = 104
Top = 224
Width = 75
Height = 25
Caption = '&Stop'
TabOrder = 6
OnClick = StopClick
end
object Quitter: TButton
Left = 16
Top = 264
Width = 75
Height = 25
Caption = '&Quitter'
TabOrder = 7
OnClick = QuitterClick
end
end