You've already forked lazarus-ccr
applications
bindings
components
Comba_Animation
aboutcomponent
acs
beepfp
callite
chelper
chemtext
cmdline
cmdlinecfg
colorpalette
cryptini
csvdocument
epiktimer
everettrandom
examplecomponent
extrasyn
fpexif
fpsound
fpspreadsheet
fractions
freetypepascal
geckoport
gradcontrols
grid_semaphor
industrialstuff
iosdesigner
iphonelazext
jujiboutils
jvcllaz
kcontrols
lazautoupdate
lazbarcodes
lazmapviewer
lclextensions
longtimer
manualdock
mbColorLib
mplayer
examples
FullFeatured
Simple
project1.ico
project1.lpi
project1.lpr
project1.res
unit1.lfm
unit1.pas
README.txt
mplayercontrollaz.lpk
mplayercontrollaz.pas
mplayerctrl.lrs
mplayerctrl.pas
tmplayercontrol.xpm
multithreadprocs
nvidia-widgets
onguard
orpheus
playsoundpackage
poweredby
powerpdf
rgbgraphics
richmemo
richview
rtfview
rx
scrolltext
smnetgradient
spktoolbar
splashabout
svn
systools
tdi
thtmlport
tparadoxdataset
tvplanit
xdev_toolkit
zlibar
zmsql
examples
image_sources
lclbindings
wst
90 lines
2.2 KiB
ObjectPascal
90 lines
2.2 KiB
ObjectPascal
![]() |
unit Unit1;
|
||
|
|
||
|
{$mode objfpc}{$H+}
|
||
|
|
||
|
interface
|
||
|
|
||
|
uses
|
||
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||
|
Buttons, ComCtrls, ExtCtrls, MPlayerCtrl;
|
||
|
|
||
|
type
|
||
|
|
||
|
{ TForm1 }
|
||
|
|
||
|
TForm1 = class(TForm)
|
||
|
MPlayerControl1: TMPlayerControl;
|
||
|
OpenDialog1: TOpenDialog;
|
||
|
Panel1: TPanel;
|
||
|
PlaySpeedButton: TSpeedButton;
|
||
|
PauseSpeedButton: TSpeedButton;
|
||
|
OpenSpeedButton: TSpeedButton;
|
||
|
StatusBar1: TStatusBar;
|
||
|
StopSpeedButton: TSpeedButton;
|
||
|
procedure FormCreate(Sender: TObject);
|
||
|
procedure OpenSpeedButtonClick(Sender: TObject);
|
||
|
procedure PauseSpeedButtonClick(Sender: TObject);
|
||
|
procedure PlaySpeedButtonClick(Sender: TObject);
|
||
|
procedure StopSpeedButtonClick(Sender: TObject);
|
||
|
private
|
||
|
public
|
||
|
end;
|
||
|
|
||
|
var
|
||
|
Form1: TForm1;
|
||
|
|
||
|
implementation
|
||
|
|
||
|
{$R *.lfm}
|
||
|
|
||
|
{ TForm1 }
|
||
|
|
||
|
procedure TForm1.PlaySpeedButtonClick(Sender: TObject);
|
||
|
begin
|
||
|
if not FileExistsUTF8(MPlayerControl1.Filename) then begin
|
||
|
MessageDlg('File not found',
|
||
|
'Please choose a file before playing',mtError,[mbCancel],0);
|
||
|
exit;
|
||
|
end;
|
||
|
MPlayerControl1.Play;
|
||
|
end;
|
||
|
|
||
|
procedure TForm1.StopSpeedButtonClick(Sender: TObject);
|
||
|
begin
|
||
|
MPlayerControl1.Stop;
|
||
|
end;
|
||
|
|
||
|
procedure TForm1.PauseSpeedButtonClick(Sender: TObject);
|
||
|
begin
|
||
|
MPlayerControl1.Paused:=not MPlayerControl1.Paused;
|
||
|
end;
|
||
|
|
||
|
procedure TForm1.OpenSpeedButtonClick(Sender: TObject);
|
||
|
begin
|
||
|
if not OpenDialog1.Execute then exit;
|
||
|
MPlayerControl1.Stop;
|
||
|
MPlayerControl1.Filename:=OpenDialog1.FileName;
|
||
|
StatusBar1.SimpleText:=CleanAndExpandFilename(MPlayerControl1.Filename);
|
||
|
MPlayerControl1.Play;
|
||
|
end;
|
||
|
|
||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||
|
begin
|
||
|
if Paramcount>0 then begin
|
||
|
MPlayerControl1.Filename:=CleanAndExpandFilename(ParamStrUTF8(1));
|
||
|
StatusBar1.SimpleText:=MPlayerControl1.Filename;
|
||
|
end;
|
||
|
{$IFDEF Linux}
|
||
|
MPlayerControl1.MPlayerPath:='';
|
||
|
MPlayerControl1.StartParam:='-vo x11 -zoom -fs';
|
||
|
{$else $IFDEF Windows}
|
||
|
// Download MPlayer generic for Windows and save under Programm Folder Directory
|
||
|
// http://sourceforge.net/projects/mplayer-win32/
|
||
|
MPlayerControl1.MPlayerPath:=extractfilepath(application.exename)+'MPlayer\mplayer.exe' ;
|
||
|
//MPlayerControl1.StartParam:='-zoom -fs';
|
||
|
{$endif}
|
||
|
end;
|
||
|
|
||
|
end.
|
||
|
|