Стартовый пул
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
(*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Any non-GPL usage of this software or parts of this software is strictly
|
||||
* forbidden.
|
||||
*
|
||||
* The "appropriate copyright message" mentioned in section 2c of the GPLv2
|
||||
* must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
|
||||
*
|
||||
*)
|
||||
|
||||
{$I ..\..\source\compiler.inc}
|
||||
|
||||
program DemoPasLibVlcMediaListPlayer;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
PasLibVlcUnit in '..\..\source\PasLibVlcUnit.pas',
|
||||
PasLibVlcClassUnit in '..\..\source\PasLibVlcClassUnit.pas',
|
||||
PasLibVlcPlayerUnit in '..\..\source.vcl\PasLibVlcPlayerUnit.pas',
|
||||
MainFormUnit in 'MainFormUnit.pas' {MainForm};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
{$IFDEF DELPHI2007_UP}
|
||||
ReportMemoryLeaksOnShutdown := TRUE;
|
||||
{$ENDIF}
|
||||
|
||||
Application.Initialize;
|
||||
{$IFDEF DELPHI2007_UP}
|
||||
Application.MainFormOnTaskbar := True;
|
||||
{$ENDIF}
|
||||
Application.Title := 'DemoPasLibVlcMediaListPlayer' + ' - ' + {$IFDEF CPUX64}'64'{$ELSE}'32'{$ENDIF} + ' bit';
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.Run;
|
||||
end.
|
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{6620e656-9ddf-49af-83a6-380377f8fd73}</ProjectGuid>
|
||||
<MainSource>DemoPasLibVlcMediaListPlayer.dpr</MainSource>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
|
||||
<DCC_DependencyCheckOutputName>DemoPasLibVlcMediaListPlayer.exe</DCC_DependencyCheckOutputName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<Version>7.0</Version>
|
||||
<DCC_DebugInformation>False</DCC_DebugInformation>
|
||||
<DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols>
|
||||
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||
<DCC_Define>RELEASE</DCC_Define>
|
||||
<DCC_UnitSearchPath>.\..\..\source\;.\..\..\source.vcl\</DCC_UnitSearchPath>
|
||||
<DCC_ResourcePath>.\..\..\source\;.\..\..\source.vcl\</DCC_ResourcePath>
|
||||
<DCC_ObjPath>.\..\..\source\;.\..\..\source.vcl\</DCC_ObjPath>
|
||||
<DCC_IncludePath>.\..\..\source\;.\..\..\source.vcl\</DCC_IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<Version>7.0</Version>
|
||||
<DCC_Define>DEBUG</DCC_Define>
|
||||
<DCC_UnitSearchPath>.\..\..\source\;.\..\..\source.vcl\</DCC_UnitSearchPath>
|
||||
<DCC_ResourcePath>.\..\..\source\;.\..\..\source.vcl\</DCC_ResourcePath>
|
||||
<DCC_ObjPath>.\..\..\source\;.\..\..\source.vcl\</DCC_ObjPath>
|
||||
<DCC_IncludePath>.\..\..\source\;.\..\..\source.vcl\</DCC_IncludePath>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
<Borland.Personality>Delphi.Personality</Borland.Personality>
|
||||
<Borland.ProjectType>VCLApplication</Borland.ProjectType>
|
||||
<BorlandProject>
|
||||
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1045</VersionInfo><VersionInfo Name="CodePage">1250</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName">Robert Jędrzejczyk</VersionInfoKeys><VersionInfoKeys Name="FileDescription">DemoPasLibVlcMediaListPlayer</VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName">DemoPasLibVlcMediaListPlayer</VersionInfoKeys><VersionInfoKeys Name="LegalCopyright">Robert Jędrzejczyk</VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks">Robert Jędrzejczyk</VersionInfoKeys><VersionInfoKeys Name="OriginalFilename">DemoPasLibVlcMediaListPlayer</VersionInfoKeys><VersionInfoKeys Name="ProductName">DemoPasLibVlcMediaListPlayer</VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments">robert@prog.olsztyn.pl</VersionInfoKeys></VersionInfoKeys><Excluded_Packages>
|
||||
<Excluded_Packages Name="$(BDS)\bin\dcloffice2k100.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
|
||||
<Excluded_Packages Name="$(BDS)\bin\dclofficexp100.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
|
||||
</Excluded_Packages><Source><Source Name="MainSource">DemoPasLibVlcMediaListPlayer.dpr</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
|
||||
<ItemGroup>
|
||||
<DelphiCompile Include="DemoPasLibVlcMediaListPlayer.dpr">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="..\..\source.vc\PasLibVlcPlayerUnit.pas" />
|
||||
<DCCReference Include="..\..\source.v\PasLibVlcPlayerUnit.pas" />
|
||||
<DCCReference Include="..\..\source\PasLibVlcClassUnit.pas" />
|
||||
<DCCReference Include="..\..\source\PasLibVlcPlayerUnit.pas" />
|
||||
<DCCReference Include="..\..\source\PasLibVlcUnit.pas" />
|
||||
<DCCReference Include="MainFormUnit.pas">
|
||||
<Form>MainForm</Form>
|
||||
</DCCReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -0,0 +1,215 @@
|
||||
object MainForm: TMainForm
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'MainForm'
|
||||
ClientHeight = 525
|
||||
ClientWidth = 764
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poDesktopCenter
|
||||
OnCreate = FormCreate
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object BottomPanel: TPanel
|
||||
Left = 0
|
||||
Top = 472
|
||||
Width = 764
|
||||
Height = 53
|
||||
Align = alBottom
|
||||
TabOrder = 0
|
||||
object PlayBtn: TButton
|
||||
Left = 12
|
||||
Top = 16
|
||||
Width = 50
|
||||
Height = 25
|
||||
Caption = 'Play'
|
||||
TabOrder = 0
|
||||
OnClick = PlayBtnClick
|
||||
end
|
||||
object PrevBtn: TButton
|
||||
Left = 140
|
||||
Top = 16
|
||||
Width = 50
|
||||
Height = 25
|
||||
Caption = 'Prev'
|
||||
TabOrder = 1
|
||||
OnClick = PrevBtnClick
|
||||
end
|
||||
object NextBtn: TButton
|
||||
Left = 196
|
||||
Top = 16
|
||||
Width = 50
|
||||
Height = 25
|
||||
Caption = 'Next'
|
||||
TabOrder = 2
|
||||
OnClick = NextBtnClick
|
||||
end
|
||||
object StopBtn: TButton
|
||||
Left = 260
|
||||
Top = 16
|
||||
Width = 50
|
||||
Height = 25
|
||||
Caption = 'Stop'
|
||||
TabOrder = 3
|
||||
OnClick = StopBtnClick
|
||||
end
|
||||
object ClearBtn: TButton
|
||||
Left = 420
|
||||
Top = 16
|
||||
Width = 50
|
||||
Height = 25
|
||||
Caption = 'Clear'
|
||||
TabOrder = 4
|
||||
OnClick = ClearBtnClick
|
||||
end
|
||||
object PlayModeNormalBtn: TButton
|
||||
Left = 492
|
||||
Top = 16
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Play Normal'
|
||||
TabOrder = 5
|
||||
OnClick = PlayModeNormalBtnClick
|
||||
end
|
||||
object PlayModeLoopBtn: TButton
|
||||
Left = 580
|
||||
Top = 16
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'PlayLoop'
|
||||
TabOrder = 6
|
||||
OnClick = PlayModeLoopBtnClick
|
||||
end
|
||||
object PlayModeRepeatBtn: TButton
|
||||
Left = 669
|
||||
Top = 16
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Play Repeat'
|
||||
TabOrder = 7
|
||||
OnClick = PlayModeRepeatBtnClick
|
||||
end
|
||||
object PauseBtn: TButton
|
||||
Left = 76
|
||||
Top = 16
|
||||
Width = 50
|
||||
Height = 25
|
||||
Caption = 'Pause'
|
||||
TabOrder = 8
|
||||
OnClick = PauseBtnClick
|
||||
end
|
||||
end
|
||||
object RightPanel: TPanel
|
||||
Left = 415
|
||||
Top = 0
|
||||
Width = 349
|
||||
Height = 472
|
||||
Align = alRight
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 1
|
||||
object PlayListBox: TListBox
|
||||
AlignWithMargins = True
|
||||
Left = 8
|
||||
Top = 8
|
||||
Width = 333
|
||||
Height = 145
|
||||
Margins.Left = 8
|
||||
Margins.Top = 8
|
||||
Margins.Right = 8
|
||||
Margins.Bottom = 8
|
||||
Align = alTop
|
||||
ItemHeight = 13
|
||||
TabOrder = 0
|
||||
OnClick = PlayListBoxClick
|
||||
end
|
||||
object EventsMemo: TMemo
|
||||
AlignWithMargins = True
|
||||
Left = 8
|
||||
Top = 161
|
||||
Width = 333
|
||||
Height = 303
|
||||
Margins.Left = 8
|
||||
Margins.Top = 0
|
||||
Margins.Right = 8
|
||||
Margins.Bottom = 8
|
||||
Align = alClient
|
||||
BevelInner = bvNone
|
||||
BevelOuter = bvNone
|
||||
BorderStyle = bsNone
|
||||
ScrollBars = ssBoth
|
||||
TabOrder = 1
|
||||
WordWrap = False
|
||||
end
|
||||
end
|
||||
object LeftPanel: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 415
|
||||
Height = 472
|
||||
Align = alClient
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 2
|
||||
object Player: TPasLibVlcPlayer
|
||||
AlignWithMargins = True
|
||||
Left = 8
|
||||
Top = 8
|
||||
Width = 407
|
||||
Height = 396
|
||||
Margins.Left = 8
|
||||
Margins.Top = 8
|
||||
Margins.Right = 0
|
||||
Margins.Bottom = 8
|
||||
Align = alClient
|
||||
VideoOnTop = True
|
||||
UseOverlay = True
|
||||
SnapShotFmt = 'png'
|
||||
OnMediaPlayerEndReached = PlayerMediaPlayerEndReached
|
||||
OnMediaPlayerTimeChanged = PlayerMediaPlayerTimeChanged
|
||||
OnMediaPlayerPositionChanged = PlayerMediaPlayerPositionChanged
|
||||
OnMediaPlayerLengthChanged = PlayerMediaPlayerLengthChanged
|
||||
end
|
||||
object InfoPanel: TPanel
|
||||
Left = 0
|
||||
Top = 412
|
||||
Width = 415
|
||||
Height = 60
|
||||
Align = alBottom
|
||||
BevelOuter = bvNone
|
||||
ParentBackground = False
|
||||
TabOrder = 1
|
||||
object TimePanel: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 415
|
||||
Height = 17
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 0
|
||||
end
|
||||
object TrackBar: TTrackBar
|
||||
Left = 0
|
||||
Top = 17
|
||||
Width = 415
|
||||
Height = 43
|
||||
Align = alClient
|
||||
Max = 100
|
||||
PageSize = 10
|
||||
Frequency = 5
|
||||
TabOrder = 1
|
||||
OnChange = TrackBarChange
|
||||
end
|
||||
end
|
||||
end
|
||||
object PasLibVlcMediaList1: TPasLibVlcMediaList
|
||||
OnItemAdded = PasLibVlcMediaList1ItemAdded
|
||||
OnItemDeleted = PasLibVlcMediaList1ItemDeleted
|
||||
OnNextItemSet = PasLibVlcMediaList1NextItemSet
|
||||
Left = 428
|
||||
Top = 16
|
||||
end
|
||||
end
|
@@ -0,0 +1,240 @@
|
||||
(*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Any non-GPL usage of this software or parts of this software is strictly
|
||||
* forbidden.
|
||||
*
|
||||
* The "appropriate copyright message" mentioned in section 2c of the GPLv2
|
||||
* must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
|
||||
*
|
||||
*)
|
||||
|
||||
{$I ..\..\source\compiler.inc}
|
||||
|
||||
unit MainFormUnit;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}Unix,{$ENDIF}
|
||||
{$IFDEF MSWINDOWS}Windows,{$ENDIF}
|
||||
Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
||||
PasLibVlcUnit, PasLibVlcClassUnit, PasLibVlcPlayerUnit;
|
||||
|
||||
type
|
||||
TMainForm = class(TForm)
|
||||
Player: TPasLibVlcPlayer;
|
||||
PasLibVlcMediaList1: TPasLibVlcMediaList;
|
||||
PlayListBox: TListBox;
|
||||
BottomPanel: TPanel;
|
||||
PlayBtn: TButton;
|
||||
PrevBtn: TButton;
|
||||
NextBtn: TButton;
|
||||
StopBtn: TButton;
|
||||
ClearBtn: TButton;
|
||||
PlayModeNormalBtn: TButton;
|
||||
PlayModeLoopBtn: TButton;
|
||||
PlayModeRepeatBtn: TButton;
|
||||
RightPanel: TPanel;
|
||||
EventsMemo: TMemo;
|
||||
LeftPanel: TPanel;
|
||||
InfoPanel: TPanel;
|
||||
TimePanel: TPanel;
|
||||
TrackBar: TTrackBar;
|
||||
PauseBtn: TButton;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure PlayListBoxClick(Sender: TObject);
|
||||
procedure PasLibVlcMediaList1NextItemSet(Sender: TObject; mrl: WideString;
|
||||
item: Pointer; index: Integer);
|
||||
procedure PasLibVlcMediaList1ItemAdded(Sender: TObject; mrl: WideString;
|
||||
item: Pointer; index: Integer);
|
||||
procedure PasLibVlcMediaList1ItemDeleted(Sender: TObject; mrl: WideString;
|
||||
item: Pointer; index: Integer);
|
||||
procedure PlayBtnClick(Sender: TObject);
|
||||
procedure PrevBtnClick(Sender: TObject);
|
||||
procedure NextBtnClick(Sender: TObject);
|
||||
procedure StopBtnClick(Sender: TObject);
|
||||
procedure ClearBtnClick(Sender: TObject);
|
||||
procedure PlayModeNormalBtnClick(Sender: TObject);
|
||||
procedure PlayModeLoopBtnClick(Sender: TObject);
|
||||
procedure PlayModeRepeatBtnClick(Sender: TObject);
|
||||
procedure PlayerMediaPlayerEndReached(Sender: TObject);
|
||||
procedure PlayerMediaPlayerPositionChanged(Sender: TObject;
|
||||
position: Single);
|
||||
procedure PlayerMediaPlayerLengthChanged(Sender: TObject; time: Int64);
|
||||
procedure PlayerMediaPlayerTimeChanged(Sender: TObject; time: Int64);
|
||||
procedure PauseBtnClick(Sender: TObject);
|
||||
procedure TrackBarChange(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
MainForm: TMainForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TMainForm.PlayModeLoopBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.SetPlayModeLoop();
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayModeNormalBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.SetPlayModeNormal();
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayModeRepeatBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.SetPlayModeRepeat();
|
||||
end;
|
||||
|
||||
procedure TMainForm.ClearBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Clear();
|
||||
end;
|
||||
|
||||
procedure TMainForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
// set custom path to libvlc
|
||||
// Player.VLC.Path := 'C:\Program Files\VideoLAN\VLC';
|
||||
// connect Player to MediaList
|
||||
PasLibVlcMediaList1.Player := Player;
|
||||
// not work in wersion 1.1.11
|
||||
PasLibVlcMediaList1.Add('http://www.youtube.com/watch?v=Bh_sV058aLU');
|
||||
PasLibVlcMediaList1.Add('http://www.youtube.com/watch?v=GJbo6ynoxEk');
|
||||
PasLibVlcMediaList1.Add('..'+PathDelim+'..'+PathDelim+'_testFiles'+PathDelim+'Maximize.mp4');
|
||||
PasLibVlcMediaList1.Add('..'+PathDelim+'..'+PathDelim+'_testFiles'+PathDelim+'test.ts');
|
||||
PasLibVlcMediaList1.Add('http://www.miastomuzyki.pl/odbior/rmf_aacp.pls');
|
||||
PasLibVlcMediaList1.Add('http://www.radio-canada.ca/util/endirect/premiere.asx');
|
||||
PasLibVlcMediaList1.Add('https://youtu.be/FS31XSBUhlM');
|
||||
// PasLibVlcMediaList1.Add('http://79.252.173.254:16453/1:0:1:7034:41B:1:C00000:0:0:0:');
|
||||
Caption := Caption + ' - ' + {$IFDEF CPUX64}'64'{$ELSE}'32'{$ENDIF} + ' bit';
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayListBoxClick(Sender: TObject);
|
||||
var
|
||||
idx: Integer;
|
||||
item: TObject;
|
||||
begin
|
||||
if (PlayListBox.ItemIndex < 0) then exit;
|
||||
if (PlayListBox.ItemIndex >= PlayListBox.Count) then exit;
|
||||
|
||||
// check for item stil exists in play list
|
||||
item := PlayListBox.Items.Objects[PlayListBox.ItemIndex];
|
||||
idx := PasLibVlcMediaList1.IndexOfItem(item);
|
||||
|
||||
// if exists then play it
|
||||
if (idx > -1) then
|
||||
begin
|
||||
PasLibVlcMediaList1.PlayItem(item);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.NextBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Next();
|
||||
end;
|
||||
|
||||
procedure TMainForm.PasLibVlcMediaList1ItemAdded(Sender: TObject;
|
||||
mrl: WideString; item: Pointer; index: Integer);
|
||||
begin
|
||||
PlayListBox.Items.AddObject(mrl, item);
|
||||
end;
|
||||
|
||||
procedure TMainForm.PasLibVlcMediaList1ItemDeleted(Sender: TObject;
|
||||
mrl: WideString; item: Pointer; index: Integer);
|
||||
begin
|
||||
PlayListBox.Items.Delete(index);
|
||||
end;
|
||||
|
||||
procedure TMainForm.PasLibVlcMediaList1NextItemSet(Sender: TObject;
|
||||
mrl: WideString; item: Pointer; index: Integer);
|
||||
begin
|
||||
if (index < PlayListBox.Count) then
|
||||
begin
|
||||
PlayListBox.ItemIndex := index;
|
||||
end;
|
||||
|
||||
EventsMemo.Lines.Add('Play ' + mrl);
|
||||
end;
|
||||
|
||||
procedure TMainForm.PauseBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Pause();
|
||||
if (PauseBtn.Caption = 'Pause') then PauseBtn.Caption := 'Resume'
|
||||
else PauseBtn.Caption := 'Pause';
|
||||
TrackBar.OnChange := TrackBarChange;
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Play();
|
||||
TrackBar.OnChange := NIL;
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerMediaPlayerEndReached(Sender: TObject);
|
||||
begin
|
||||
TrackBar.Position := 0;
|
||||
TimePanel.Caption := '';
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerMediaPlayerLengthChanged(Sender: TObject;
|
||||
time: Int64);
|
||||
begin
|
||||
// TrackBar.Max := MaxInt;
|
||||
TrackBar.Max := time;
|
||||
TimePanel.Caption := time2str(TrackBar.Position) + ' / ' + time2str(TrackBar.Max);
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerMediaPlayerPositionChanged(Sender: TObject;
|
||||
position: Single);
|
||||
begin
|
||||
// TrackBar.Position := Round(MaxInt * position);
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerMediaPlayerTimeChanged(Sender: TObject; time: Int64);
|
||||
begin
|
||||
TrackBar.Position := time;
|
||||
TimePanel.Caption := time2str(TrackBar.Position) + ' / ' + time2str(TrackBar.Max);
|
||||
end;
|
||||
|
||||
procedure TMainForm.PrevBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Prev();
|
||||
end;
|
||||
|
||||
procedure TMainForm.StopBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Stop();
|
||||
end;
|
||||
|
||||
procedure TMainForm.TrackBarChange(Sender: TObject);
|
||||
begin
|
||||
if Player.CanSeek() then
|
||||
begin
|
||||
Player.SetVideoPosInMs(TrackBar.Position);
|
||||
PlayerMediaPlayerTimeChanged(SELF, TrackBar.Position);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
Reference in New Issue
Block a user