Стартовый пул
This commit is contained in:
@@ -0,0 +1,303 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasUsesSectionForAllUnits Value="False"/>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
</Flags>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="DemoPasLibVlcMediaListPlayer"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<UseVersionInfo Value="True"/>
|
||||
<MajorVersionNr Value="1"/>
|
||||
<Language Value="0415"/>
|
||||
<StringTable CompanyName="Robert Jędrzejczyk" FileDescription="DemoPasLibVlcMediaListPlayer" InternalName="DemoPasLibVlcMediaListPlayer" LegalCopyright="Robert Jędrzejczyk" LegalTrademarks="Robert Jędrzejczyk" OriginalFilename="DemoPasLibVlcMediaListPlayer" ProductName="DemoPasLibVlcMediaListPlayer"/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1" Active="Default">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="1">
|
||||
<Mode0 Name="default"/>
|
||||
</Modes>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="PasLibVlcPlayer"/>
|
||||
<MinVersion Valid="True"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="25">
|
||||
<Unit0>
|
||||
<Filename Value="DemoPasLibVlcMediaListPlayer.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<CursorPos X="53" Y="6"/>
|
||||
<UsageCount Value="30"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="MainFormUnit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="MainForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="205"/>
|
||||
<CursorPos X="3" Y="211"/>
|
||||
<UsageCount Value="30"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="..\..\source\PasLibVlcPlayerUnit.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="3982"/>
|
||||
<CursorPos X="57" Y="3985"/>
|
||||
<UsageCount Value="20"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="C:\lazarus\lcl\controls.pp"/>
|
||||
<UnitName Value="Controls"/>
|
||||
<TopLine Value="1816"/>
|
||||
<CursorPos X="47" Y="1839"/>
|
||||
<UsageCount Value="13"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="C:\lazarus\lcl\lcltype.pp"/>
|
||||
<UnitName Value="LCLType"/>
|
||||
<TopLine Value="2532"/>
|
||||
<CursorPos X="3" Y="2555"/>
|
||||
<UsageCount Value="13"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32object.inc"/>
|
||||
<TopLine Value="381"/>
|
||||
<CursorPos X="88" Y="385"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="C:\lazarus\lcl\include\interfacebase.inc"/>
|
||||
<TopLine Value="31"/>
|
||||
<CursorPos Y="49"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="C:\lazarus\lcl\include\control.inc"/>
|
||||
<TopLine Value="3619"/>
|
||||
<CursorPos Y="3640"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="C:\lazarus\lcl\include\customlistbox.inc"/>
|
||||
<TopLine Value="270"/>
|
||||
<CursorPos Y="276"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="C:\lazarus\lcl\include\wincontrol.inc"/>
|
||||
<TopLine Value="5226"/>
|
||||
<CursorPos Y="5242"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit9>
|
||||
<Unit10>
|
||||
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32listsl.inc"/>
|
||||
<TopLine Value="222"/>
|
||||
<CursorPos Y="239"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit10>
|
||||
<Unit11>
|
||||
<Filename Value="C:\lazarus\lcl\lclmessageglue.pas"/>
|
||||
<UnitName Value="LCLMessageGlue"/>
|
||||
<TopLine Value="101"/>
|
||||
<CursorPos Y="121"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32callback.inc"/>
|
||||
<TopLine Value="2428"/>
|
||||
<CursorPos X="59" Y="2432"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="..\..\source\PasLibVlcUnit.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="10985"/>
|
||||
<CursorPos X="35" Y="10970"/>
|
||||
<UsageCount Value="20"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit13>
|
||||
<Unit14>
|
||||
<Filename Value="..\..\source\compiler.inc"/>
|
||||
<CursorPos X="16" Y="5"/>
|
||||
<UsageCount Value="10"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit14>
|
||||
<Unit15>
|
||||
<Filename Value="C:\lazarus\fpc\2.4.2\source\rtl\win\wininc\ascdef.inc"/>
|
||||
<TopLine Value="359"/>
|
||||
<CursorPos X="6" Y="262"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit15>
|
||||
<Unit16>
|
||||
<Filename Value="..\..\source\PasLibVlcClassUnit.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="28"/>
|
||||
<CursorPos X="25" Y="42"/>
|
||||
<UsageCount Value="20"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit16>
|
||||
<Unit17>
|
||||
<Filename Value="C:\lazarus\fpc\2.4.2\source\rtl\objpas\classes\classesh.inc"/>
|
||||
<TopLine Value="1574"/>
|
||||
<CursorPos X="15" Y="1590"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit17>
|
||||
<Unit18>
|
||||
<Filename Value="C:\lazarus\components\lazutils\lazfileutils.pas"/>
|
||||
<UnitName Value="LazFileUtils"/>
|
||||
<TopLine Value="1105"/>
|
||||
<CursorPos X="45" Y="1134"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit18>
|
||||
<Unit19>
|
||||
<Filename Value="C:\lazarus\components\lazutils\fileutil.pas"/>
|
||||
<UnitName Value="FileUtil"/>
|
||||
<TopLine Value="43"/>
|
||||
<CursorPos X="23" Y="64"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit19>
|
||||
<Unit20>
|
||||
<Filename Value="C:\lazarus\components\lazutils\winfileutil.inc"/>
|
||||
<TopLine Value="179"/>
|
||||
<CursorPos X="62" Y="200"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit20>
|
||||
<Unit21>
|
||||
<Filename Value="C:\lazarus\fpc\2.6.0\source\rtl\objpas\sysutils\sysutilh.inc"/>
|
||||
<TopLine Value="236"/>
|
||||
<CursorPos X="12" Y="249"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit21>
|
||||
<Unit22>
|
||||
<Filename Value="..\PasLibVlcPlayer.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="-1"/>
|
||||
<CursorPos X="18" Y="10"/>
|
||||
<UsageCount Value="10"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit22>
|
||||
<Unit23>
|
||||
<Filename Value="C:\lazarus\packager\registration\fcllaz.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit23>
|
||||
<Unit24>
|
||||
<Filename Value="..\..\source.vcl\PasLibVlcPlayerUnit.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="2156"/>
|
||||
<CursorPos X="25" Y="2161"/>
|
||||
<UsageCount Value="20"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit24>
|
||||
</Units>
|
||||
<JumpHistory Count="5" HistoryIndex="4">
|
||||
<Position1>
|
||||
<Filename Value="MainFormUnit.pas"/>
|
||||
<Caret Line="139" TopLine="103"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="MainFormUnit.pas"/>
|
||||
<Caret Line="136" Column="3" TopLine="103"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="MainFormUnit.pas"/>
|
||||
<Caret Line="207" TopLine="205"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="MainFormUnit.pas"/>
|
||||
<Caret Line="219" Column="3" TopLine="205"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="MainFormUnit.pas"/>
|
||||
<Caret Line="225" Column="3" TopLine="205"/>
|
||||
</Position5>
|
||||
</JumpHistory>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="DemoPasLibVlcMediaListPlayer"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
<SrcPath Value="..\..\source"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<SyntaxMode Value="Delphi"/>
|
||||
<UseAnsiStrings Value="False"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<RelocatableUnit Value="True"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="4"/>
|
||||
<VariablesInRegisters Value="True"/>
|
||||
<UncertainOptimizations Value="True"/>
|
||||
</Optimizations>
|
||||
<SmallerCode Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<UseHeaptrc Value="True"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<WriteFPCLogo Value="False"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
@@ -0,0 +1,42 @@
|
||||
(*
|
||||
* 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
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms,
|
||||
MainFormUnit;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.Run;
|
||||
end.
|
216
PasLibVlc/Lazarus/DemoPasLibVlcMediaListPlayer/MainFormUnit.lfm
Normal file
216
PasLibVlc/Lazarus/DemoPasLibVlcMediaListPlayer/MainFormUnit.lfm
Normal file
@@ -0,0 +1,216 @@
|
||||
object MainForm: TMainForm
|
||||
Left = 370
|
||||
Height = 460
|
||||
Top = 130
|
||||
Width = 767
|
||||
Caption = 'DemoPasLibVlcMediaListPlayer'
|
||||
ClientHeight = 460
|
||||
ClientWidth = 767
|
||||
Color = clBtnFace
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
OnCreate = FormCreate
|
||||
OnMouseDown = FormMouseDown
|
||||
Position = poDesktopCenter
|
||||
LCLVersion = '2.0.0.4'
|
||||
object BottomPanel: TPanel
|
||||
Left = 0
|
||||
Height = 53
|
||||
Top = 407
|
||||
Width = 767
|
||||
Align = alBottom
|
||||
ClientHeight = 53
|
||||
ClientWidth = 767
|
||||
TabOrder = 0
|
||||
object PlayBtn: TButton
|
||||
Left = 10
|
||||
Height = 25
|
||||
Top = 14
|
||||
Width = 50
|
||||
Caption = 'Play'
|
||||
OnClick = PlayBtnClick
|
||||
TabOrder = 0
|
||||
end
|
||||
object PrevBtn: TButton
|
||||
Left = 168
|
||||
Height = 25
|
||||
Top = 14
|
||||
Width = 50
|
||||
Caption = 'Prev'
|
||||
OnClick = PrevBtnClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object NextBtn: TButton
|
||||
Left = 226
|
||||
Height = 25
|
||||
Top = 14
|
||||
Width = 50
|
||||
Caption = 'Next'
|
||||
OnClick = NextBtnClick
|
||||
TabOrder = 2
|
||||
end
|
||||
object StopBtn: TButton
|
||||
Left = 288
|
||||
Height = 25
|
||||
Top = 14
|
||||
Width = 50
|
||||
Caption = 'Stop'
|
||||
OnClick = StopBtnClick
|
||||
TabOrder = 3
|
||||
end
|
||||
object ClearBtn: TButton
|
||||
Left = 408
|
||||
Height = 25
|
||||
Top = 14
|
||||
Width = 75
|
||||
Caption = 'Clear'
|
||||
OnClick = ClearBtnClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object PlayModeDefaultBtn: TButton
|
||||
Left = 496
|
||||
Height = 25
|
||||
Top = 14
|
||||
Width = 75
|
||||
Caption = 'Play Default'
|
||||
OnClick = PlayModeDefaultBtnClick
|
||||
TabOrder = 5
|
||||
end
|
||||
object PlayModeLoopBtn: TButton
|
||||
Left = 584
|
||||
Height = 25
|
||||
Top = 14
|
||||
Width = 75
|
||||
Caption = 'Play Loop'
|
||||
OnClick = PlayModeLoopBtnClick
|
||||
TabOrder = 6
|
||||
end
|
||||
object PlayModeRepeatBtn: TButton
|
||||
Left = 672
|
||||
Height = 25
|
||||
Top = 14
|
||||
Width = 75
|
||||
Caption = 'Play Repeat'
|
||||
OnClick = PlayModeRepeatBtnClick
|
||||
TabOrder = 7
|
||||
end
|
||||
object PauseBtn: TButton
|
||||
Left = 88
|
||||
Height = 25
|
||||
Top = 14
|
||||
Width = 50
|
||||
Caption = 'Pause'
|
||||
OnClick = PauseBtnClick
|
||||
TabOrder = 8
|
||||
end
|
||||
end
|
||||
object RightPanel: TPanel
|
||||
Left = 429
|
||||
Height = 407
|
||||
Top = 0
|
||||
Width = 338
|
||||
Align = alRight
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 407
|
||||
ClientWidth = 338
|
||||
TabOrder = 1
|
||||
object PlayListBox: TListBox
|
||||
Left = 8
|
||||
Height = 207
|
||||
Top = 8
|
||||
Width = 322
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 8
|
||||
ItemHeight = 0
|
||||
OnClick = PlayListBoxClick
|
||||
ScrollWidth = 318
|
||||
TabOrder = 0
|
||||
end
|
||||
object EventsMemo: TMemo
|
||||
Left = 8
|
||||
Height = 176
|
||||
Top = 223
|
||||
Width = 322
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 8
|
||||
ScrollBars = ssBoth
|
||||
TabOrder = 1
|
||||
WordWrap = False
|
||||
end
|
||||
end
|
||||
object LeftPanel: TPanel
|
||||
Left = 0
|
||||
Height = 407
|
||||
Top = 0
|
||||
Width = 429
|
||||
Align = alClient
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 407
|
||||
ClientWidth = 429
|
||||
TabOrder = 2
|
||||
object Player: TPasLibVlcPlayer
|
||||
Left = 8
|
||||
Height = 337
|
||||
Top = 8
|
||||
Width = 413
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 8
|
||||
BevelOuter = bvNone
|
||||
ParentColor = False
|
||||
TabOrder = 0
|
||||
OnMouseDown = PlayerMouseDown
|
||||
VideoOnTop = True
|
||||
UseOverlay = True
|
||||
SnapShotFmt = 'png'
|
||||
OnMediaPlayerMediaChanged = PlayerMediaPlayerMediaChanged
|
||||
OnMediaPlayerEndReached = PlayerMediaPlayerEndReached
|
||||
OnMediaPlayerTimeChanged = PlayerMediaPlayerTimeChanged
|
||||
OnMediaPlayerPositionChanged = PlayerMediaPlayerPositionChanged
|
||||
OnMediaPlayerLengthChanged = PlayerMediaPlayerLengthChanged
|
||||
MouseEventsHandler = mehComponent
|
||||
end
|
||||
object InfoPanel: TPanel
|
||||
Left = 8
|
||||
Height = 46
|
||||
Top = 353
|
||||
Width = 413
|
||||
Align = alBottom
|
||||
BorderSpacing.Around = 8
|
||||
ClientHeight = 46
|
||||
ClientWidth = 413
|
||||
TabOrder = 1
|
||||
object InfoTrackBar: TTrackBar
|
||||
Left = 1
|
||||
Height = 22
|
||||
Top = 23
|
||||
Width = 411
|
||||
Frequency = 5
|
||||
Max = 100
|
||||
OnChange = InfoTrackBarChange
|
||||
PageSize = 10
|
||||
Position = 0
|
||||
ShowSelRange = False
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
end
|
||||
object TimePanel: TPanel
|
||||
Left = 1
|
||||
Height = 22
|
||||
Top = 1
|
||||
Width = 411
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
object PasLibVlcMediaList1: TPasLibVlcMediaList
|
||||
Player = Player
|
||||
OnItemAdded = PasLibVlcMediaList1ItemAdded
|
||||
OnItemDeleted = PasLibVlcMediaList1ItemDeleted
|
||||
OnNextItemSet = PasLibVlcMediaList1NextItemSet
|
||||
left = 520
|
||||
top = 24
|
||||
end
|
||||
end
|
285
PasLibVlc/Lazarus/DemoPasLibVlcMediaListPlayer/MainFormUnit.pas
Normal file
285
PasLibVlc/Lazarus/DemoPasLibVlcMediaListPlayer/MainFormUnit.pas
Normal file
@@ -0,0 +1,285 @@
|
||||
(*
|
||||
* 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
|
||||
SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, PasLibVlcPlayerUnit, ExtCtrls, ComCtrls;
|
||||
|
||||
type
|
||||
|
||||
{ TMainForm }
|
||||
|
||||
TMainForm = class(TForm)
|
||||
EventsMemo: TMemo;
|
||||
LeftPanel: TPanel;
|
||||
InfoPanel: TPanel;
|
||||
PauseBtn: TButton;
|
||||
TimePanel: TPanel;
|
||||
RightPanel: TPanel;
|
||||
PlayModeDefaultBtn: TButton;
|
||||
PasLibVlcMediaList1: TPasLibVlcMediaList;
|
||||
PlayListBox: TListBox;
|
||||
BottomPanel: TPanel;
|
||||
Player: TPasLibVlcPlayer;
|
||||
PlayBtn: TButton;
|
||||
PlayModeLoopBtn: TButton;
|
||||
PlayModeRepeatBtn: TButton;
|
||||
PrevBtn: TButton;
|
||||
NextBtn: TButton;
|
||||
StopBtn: TButton;
|
||||
ClearBtn: TButton;
|
||||
InfoTrackBar: TTrackBar;
|
||||
procedure ClearBtnClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure InfoTrackBarChange(Sender: TObject);
|
||||
procedure PasLibVlcMediaList1MediaListItemAdded(Sender: TObject;
|
||||
mrl: WideString; item: Pointer; index: Integer);
|
||||
procedure PauseBtnClick(Sender: TObject);
|
||||
procedure PlayerMediaPlayerEndReached(Sender: TObject);
|
||||
procedure PlayerMediaPlayerLengthChanged(Sender: TObject; time: Int64);
|
||||
procedure PlayerMediaPlayerMediaChanged(Sender: TObject; mrl: string);
|
||||
procedure PlayerMediaPlayerPositionChanged(Sender: TObject; position: Single
|
||||
);
|
||||
procedure PlayerMediaPlayerTimeChanged(Sender: TObject; time: Int64);
|
||||
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 PlayerMouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure PlayBtnClick(Sender: TObject);
|
||||
procedure PlayModeDefaultBtnClick(Sender: TObject);
|
||||
procedure PlayModeLoopBtnClick(Sender: TObject);
|
||||
procedure PlayModeRepeatBtnClick(Sender: TObject);
|
||||
procedure PrevBtnClick(Sender: TObject);
|
||||
procedure NextBtnClick(Sender: TObject);
|
||||
procedure StopBtnClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
MainForm: TMainForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
uses
|
||||
PasLibVlcUnit;
|
||||
|
||||
procedure TMainForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
|
||||
{$IFDEF LCLGTK2}
|
||||
Caption := Caption + ' LCL GTK2';
|
||||
{$ELSE}
|
||||
{$IFDEF LCLQT}
|
||||
Caption := Caption + ' LCL QT';
|
||||
{$ELSE}
|
||||
Caption := Caption + ' LCL WIN';
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
Caption := Caption + ' x' + {$IFDEF CPUX32}'32'{$ELSE}'64'{$ENDIF};
|
||||
|
||||
PasLibVlcMediaList1.Add('https://www.youtube.com/watch?v=8JnfIa84TnU');
|
||||
//
|
||||
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');
|
||||
end;
|
||||
|
||||
procedure TMainForm.ClearBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Clear();
|
||||
end;
|
||||
|
||||
procedure TMainForm.FormMouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
EventsMemo.Lines.Add('From MouseDown at ' + IntToStr(x) + ',' + IntToStr(y));
|
||||
end;
|
||||
|
||||
procedure TMainForm.InfoTrackBarChange(Sender: TObject);
|
||||
begin
|
||||
if Player.CanSeek() then
|
||||
begin
|
||||
Player.SetVideoPosInMs(InfoTrackBar.Position);
|
||||
TimePanel.Caption := time2str(InfoTrackBar.Position) + '/' + time2str(InfoTrackBar.Max);
|
||||
end;
|
||||
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(string(mrl), item);
|
||||
end;
|
||||
|
||||
procedure TMainForm.PasLibVlcMediaList1ItemDeleted(Sender: TObject;
|
||||
mrl: WideString; item: Pointer; index: Integer);
|
||||
begin
|
||||
PlayListBox.Items.Delete(index);
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerMouseDown(Sender: TObject;
|
||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
EventsMemo.Lines.Add('Player MouseDown at ' + IntToStr(x) + ',' + IntToStr(y));
|
||||
end;
|
||||
|
||||
procedure TMainForm.PasLibVlcMediaList1MediaListItemAdded(Sender: TObject;
|
||||
mrl: WideString; item: Pointer; index: Integer);
|
||||
begin
|
||||
PlayListBox.Items.AddObject(string(mrl), item);
|
||||
end;
|
||||
|
||||
procedure TMainForm.PauseBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Pause();
|
||||
if (PauseBtn.Caption = 'Pause') then PauseBtn.Caption := 'Resume'
|
||||
else PauseBtn.Caption := 'Pause';
|
||||
InfoTrackBar.OnChange := InfoTrackBarChange;
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerMediaPlayerEndReached(Sender: TObject);
|
||||
begin
|
||||
TimePanel.Caption := '';
|
||||
InfoTrackBar.Position := 0;
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerMediaPlayerLengthChanged(Sender: TObject; time: Int64
|
||||
);
|
||||
var
|
||||
oldOnChange : TNotifyEvent;
|
||||
begin
|
||||
TimePanel.Caption := time2str(InfoTrackBar.Position) + '/' + time2str(InfoTrackBar.Max);
|
||||
oldOnChange := InfoTrackBar.OnChange;
|
||||
InfoTrackBar.OnChange := NIL;
|
||||
InfoTrackBar.Max := time;
|
||||
InfoTrackBar.OnChange := oldOnChange;
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerMediaPlayerMediaChanged(Sender: TObject; mrl: string);
|
||||
begin
|
||||
Caption := mrl;
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerMediaPlayerPositionChanged(Sender: TObject;
|
||||
position: Single);
|
||||
begin
|
||||
//InfoTrackBar.Position := Round(MaxInt * position);
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerMediaPlayerTimeChanged(Sender: TObject; time: Int64);
|
||||
var
|
||||
oldOnChange : TNotifyEvent;
|
||||
begin
|
||||
TimePanel.Caption := time2str(InfoTrackBar.Position) + '/' + time2str(InfoTrackBar.Max);
|
||||
oldOnChange := InfoTrackBar.OnChange;
|
||||
InfoTrackBar.OnChange := NIL;
|
||||
InfoTrackBar.Position := time;
|
||||
InfoTrackBar.OnChange := oldOnChange;
|
||||
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 ' + string(mrl));
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Play();
|
||||
InfoTrackBar.OnChange := NIL;
|
||||
PauseBtn.Caption := 'Pause';
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayModeDefaultBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.SetPlayModeNormal();
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayModeLoopBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.SetPlayModeLoop();
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayModeRepeatBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.SetPlayModeRepeat();
|
||||
end;
|
||||
|
||||
procedure TMainForm.PrevBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Prev();
|
||||
end;
|
||||
|
||||
procedure TMainForm.StopBtnClick(Sender: TObject);
|
||||
begin
|
||||
PasLibVlcMediaList1.Stop();
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
Reference in New Issue
Block a user