Стартовый пул
This commit is contained in:
111
PasLibVlc/Lazarus/DemoPasLibVlc/DemoPasLibVlc.lpi
Normal file
111
PasLibVlc/Lazarus/DemoPasLibVlc/DemoPasLibVlc.lpi
Normal file
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="DemoPasLibVlc"/>
|
||||
<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="DemoPasLibVlc" InternalName="DemoPasLibVlc" LegalCopyright="Robert Jędrzejczyk" LegalTrademarks="Robert Jędrzejczyk" OriginalFilename="DemoPasLibVlc" ProductName="DemoPasLibVlc" ProductVersion="DemoPasLibVlc"/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="PasLibVlcPlayer"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="DemoPasLibVlc.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="MainFormUnit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="MainForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="DemoPasLibVlc"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<SyntaxMode Value="Delphi"/>
|
||||
<UseAnsiStrings Value="False"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<RelocatableUnit Value="True"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="4"/>
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<UseHeaptrc Value="True"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<Verbosity>
|
||||
<ShoLineNum Value="True"/>
|
||||
</Verbosity>
|
||||
<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>
|
41
PasLibVlc/Lazarus/DemoPasLibVlc/DemoPasLibVlc.lpr
Normal file
41
PasLibVlc/Lazarus/DemoPasLibVlc/DemoPasLibVlc.lpr
Normal file
@@ -0,0 +1,41 @@
|
||||
(*
|
||||
* 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 DemoPasLibVlc;
|
||||
|
||||
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.
|
32
PasLibVlc/Lazarus/DemoPasLibVlc/MainFormUnit.lfm
Normal file
32
PasLibVlc/Lazarus/DemoPasLibVlc/MainFormUnit.lfm
Normal file
@@ -0,0 +1,32 @@
|
||||
object MainForm: TMainForm
|
||||
Left = 270
|
||||
Height = 367
|
||||
Top = 122
|
||||
Width = 515
|
||||
Caption = 'DemoPasLibVlc'
|
||||
Menu = MainMenu
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
LCLVersion = '1.8.4.0'
|
||||
object OpenDialog: TOpenDialog
|
||||
left = 16
|
||||
top = 16
|
||||
end
|
||||
object MainMenu: TMainMenu
|
||||
left = 16
|
||||
top = 72
|
||||
object FileMenuItem: TMenuItem
|
||||
Caption = 'File'
|
||||
object OpenMenuItem: TMenuItem
|
||||
Caption = 'Open'
|
||||
ShortCut = 16463
|
||||
OnClick = MenuFileOpenClick
|
||||
end
|
||||
object QuitMenuItem: TMenuItem
|
||||
Caption = 'Quit'
|
||||
ShortCut = 49233
|
||||
OnClick = MenuFileQuitClick
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
208
PasLibVlc/Lazarus/DemoPasLibVlc/MainFormUnit.pas
Normal file
208
PasLibVlc/Lazarus/DemoPasLibVlc/MainFormUnit.pas
Normal file
@@ -0,0 +1,208 @@
|
||||
(*
|
||||
* 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}{$IFNDEF FPC}Windows,{$ENDIF}{$ENDIF}
|
||||
{$IFDEF LCLGTK2}Gtk2, {$IFDEF UNIX}Gdk2x,{$ENDIF}{$ENDIF}
|
||||
{$IFDEF LCLQT}Qt4, QtWidgets, {$ENDIF}
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
|
||||
ExtCtrls, {$IFNDEF FPC}StdCtrls,{$ENDIF} PasLibVlcUnit;
|
||||
|
||||
type
|
||||
|
||||
{ TMainForm }
|
||||
|
||||
TMainForm = class(TForm)
|
||||
FileMenuItem: TMenuItem;
|
||||
OpenDialog: TOpenDialog;
|
||||
MainMenu: TMainMenu;
|
||||
MenuFile: TMenuItem;
|
||||
MenuFileOpen: TMenuItem;
|
||||
MenuFileQuit: TMenuItem;
|
||||
OpenMenuItem: TMenuItem;
|
||||
QuitMenuItem: TMenuItem;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure MenuFileOpenClick(Sender: TObject);
|
||||
procedure MenuFileQuitClick(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
p_li : libvlc_instance_t_ptr;
|
||||
p_mi : libvlc_media_player_t_ptr;
|
||||
procedure PlayerInit();
|
||||
procedure PlayerPlay(fileName: WideString);
|
||||
procedure PlayerStop();
|
||||
procedure PlayerDestroy();
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
MainForm: TMainForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TMainForm }
|
||||
|
||||
procedure TMainForm.PlayerInit();
|
||||
begin
|
||||
libvlc_dynamic_dll_init();
|
||||
|
||||
if (libvlc_dynamic_dll_error <> '') then
|
||||
begin
|
||||
MessageDlg(libvlc_dynamic_dll_error, mtError, [mbOK], 0);
|
||||
Application.Terminate();
|
||||
exit;
|
||||
end;
|
||||
|
||||
with TArgcArgs.Create([
|
||||
WideString(libvlc_dynamic_dll_path),
|
||||
'--intf=dummy',
|
||||
'--ignore-config',
|
||||
'--quiet',
|
||||
'--no-video-title-show',
|
||||
'--no-video-on-top'
|
||||
]) do
|
||||
begin
|
||||
p_li := libvlc_new(ARGC, ARGS);
|
||||
Free;
|
||||
end;
|
||||
|
||||
if (p_li <> NIL) then
|
||||
begin
|
||||
p_mi := libvlc_media_player_new(p_li);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerPlay(fileName: WideString);
|
||||
var
|
||||
p_md : libvlc_media_t_ptr;
|
||||
a_st : AnsiString;
|
||||
p_st : PAnsiChar;
|
||||
begin
|
||||
a_st := UTF8Encode(fileName);
|
||||
p_st := PAnsiChar(@a_st[1]);
|
||||
|
||||
if (p_li <> NIL) then
|
||||
begin
|
||||
p_md := libvlc_media_new_path(p_li, p_st);
|
||||
if (p_md <> NIL) then
|
||||
begin
|
||||
if (p_mi <> NIL) then
|
||||
begin
|
||||
//libvlc_video_set_key_input(p_mi, 1);
|
||||
//libvlc_video_set_mouse_input(p_mi, 1);
|
||||
libvlc_media_player_set_display_window(p_mi, SELF.Handle);
|
||||
libvlc_media_player_set_media(p_mi, p_md);
|
||||
libvlc_media_player_play(p_mi);
|
||||
end;
|
||||
libvlc_media_release(p_md);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerStop();
|
||||
begin
|
||||
if (p_mi <> NIL) then
|
||||
begin
|
||||
libvlc_media_player_stop(p_mi);
|
||||
Sleep(50);
|
||||
while (libvlc_media_player_is_playing(p_mi) <> 0) do
|
||||
begin
|
||||
Sleep(50);
|
||||
end;
|
||||
libvlc_media_player_release(p_mi);
|
||||
p_mi := NIL;
|
||||
Sleep(50);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.PlayerDestroy();
|
||||
begin
|
||||
if (p_li <> NIL) then
|
||||
begin
|
||||
PlayerStop();
|
||||
libvlc_release(p_li);
|
||||
p_li := NIL;
|
||||
end;
|
||||
libvlc_dynamic_dll_done();
|
||||
end;
|
||||
|
||||
procedure TMainForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
p_li := NIL;
|
||||
p_mi := NIL;
|
||||
{$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};
|
||||
PlayerInit();
|
||||
if (libvlc_dynamic_dll_vlc_version_str <> '') then
|
||||
begin
|
||||
Caption := Caption + ', libvlc: ' + libvlc_dynamic_dll_vlc_version_str;
|
||||
if (ParamStr(1) <> '') then
|
||||
begin
|
||||
PlayerPlay(ParamStr(1));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
PlayerDestroy();
|
||||
end;
|
||||
|
||||
procedure TMainForm.MenuFileOpenClick(Sender: TObject);
|
||||
begin
|
||||
if OpenDialog.Execute() then
|
||||
begin
|
||||
{$IFDEF MSWINDOWS}
|
||||
PlayerPlay(WideString(StringReplace(OpenDialog.FileName, '/', '\', [rfReplaceAll])));
|
||||
{$ELSE}
|
||||
PlayerPlay(OpenDialog.FileName);
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.MenuFileQuitClick(Sender: TObject);
|
||||
begin
|
||||
Application.Terminate;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
@@ -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.
|
||||
|
||||
|
130
PasLibVlc/Lazarus/DemoPasLibVlcPlayer/DemoPasLibVlcPlayer.lpi
Normal file
130
PasLibVlc/Lazarus/DemoPasLibVlcPlayer/DemoPasLibVlcPlayer.lpi
Normal file
@@ -0,0 +1,130 @@
|
||||
<?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>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="DemoPasLibVlcPlayer"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<UseVersionInfo Value="True"/>
|
||||
<MajorVersionNr Value="1"/>
|
||||
<Language Value="0415"/>
|
||||
<StringTable CompanyName="Robert Jędrzejczyk" FileDescription="DemoPasLibVlcPlayer" InternalName="DemoPasLibVlcPlayer" LegalCopyright="Robert Jędrzejczyk" LegalTrademarks="Robert Jędrzejczyk" OriginalFilename="DemoPasLibVlcPlayer" ProductName="DemoPasLibVlcPlayer"/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<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"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="5">
|
||||
<Unit0>
|
||||
<Filename Value="DemoPasLibVlcPlayer.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="MainFormUnit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="MainForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="FullScreenFormUnit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<HasResources Value="True"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="SetEqualizerPresetFormUnit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="SetEqualizerPresetForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="SelectOutputDeviceFormUnit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="SelectOutputDeviceForm"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit4>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="DemoPasLibVlcPlayer"/>
|
||||
</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="0"/>
|
||||
</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>
|
||||
</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,22 @@
|
||||
{$I ../../source/compiler.inc}
|
||||
|
||||
program DemoPasLibVlcPlayer;
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms,
|
||||
MainFormUnit,
|
||||
FullScreenFormUnit,
|
||||
SetEqualizerPresetFormUnit;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.CreateForm(TSetEqualizerPresetForm, SetEqualizerPresetForm);
|
||||
Application.Run;
|
||||
end.
|
18
PasLibVlc/Lazarus/DemoPasLibVlcPlayer/FullScreenFormUnit.lfm
Normal file
18
PasLibVlc/Lazarus/DemoPasLibVlcPlayer/FullScreenFormUnit.lfm
Normal file
@@ -0,0 +1,18 @@
|
||||
object FullScreenForm: TFullScreenForm
|
||||
Left = 0
|
||||
Height = 436
|
||||
Top = 0
|
||||
Width = 639
|
||||
Align = alClient
|
||||
BorderIcons = []
|
||||
BorderStyle = bsNone
|
||||
Color = clBlack
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
FormStyle = fsStayOnTop
|
||||
KeyPreview = True
|
||||
OnKeyPress = FormKeyPress
|
||||
OnShow = FormShow
|
||||
LCLVersion = '1.2.6.0'
|
||||
end
|
66
PasLibVlc/Lazarus/DemoPasLibVlcPlayer/FullScreenFormUnit.pas
Normal file
66
PasLibVlc/Lazarus/DemoPasLibVlcPlayer/FullScreenFormUnit.pas
Normal file
@@ -0,0 +1,66 @@
|
||||
(*
|
||||
* 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 FullScreenFormUnit;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}Unix,{$ENDIF}
|
||||
{$IFDEF FPC}
|
||||
LCLIntf, LCLType, LMessages,
|
||||
{$ELSE}
|
||||
Messages,
|
||||
{$ENDIF}
|
||||
SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;
|
||||
|
||||
type
|
||||
TFullScreenForm = class(TForm)
|
||||
procedure FormKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure FormShow(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
FullScreenForm: TFullScreenForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
procedure TFullScreenForm.FormKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TFullScreenForm.FormShow(Sender: TObject);
|
||||
begin
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
end.
|
498
PasLibVlc/Lazarus/DemoPasLibVlcPlayer/MainFormUnit.lfm
Normal file
498
PasLibVlc/Lazarus/DemoPasLibVlcPlayer/MainFormUnit.lfm
Normal file
@@ -0,0 +1,498 @@
|
||||
object MainForm: TMainForm
|
||||
Left = 418
|
||||
Height = 521
|
||||
Top = 139
|
||||
Width = 519
|
||||
Caption = 'PasLibVlcPlayerDemo'
|
||||
ClientHeight = 521
|
||||
ClientWidth = 519
|
||||
Color = clBtnFace
|
||||
Constraints.MinHeight = 455
|
||||
Constraints.MinWidth = 435
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnMouseDown = FormMouseDown
|
||||
OnResize = FormResize
|
||||
PopupMenu = PopupMenu
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '2.0.0.4'
|
||||
object MrlLab: TLabel
|
||||
Left = 8
|
||||
Height = 13
|
||||
Top = 4
|
||||
Width = 60
|
||||
Caption = 'MRL to play:'
|
||||
FocusControl = MrlEdit
|
||||
ParentColor = False
|
||||
end
|
||||
object PR: TPanel
|
||||
Left = 340
|
||||
Height = 521
|
||||
Top = 0
|
||||
Width = 179
|
||||
Align = alRight
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 521
|
||||
ClientWidth = 179
|
||||
TabOrder = 0
|
||||
object PlayBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 8
|
||||
Width = 75
|
||||
Caption = 'Play'
|
||||
OnClick = PlayClick
|
||||
TabOrder = 0
|
||||
end
|
||||
object PauseBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 39
|
||||
Width = 75
|
||||
Caption = 'Pause'
|
||||
OnClick = PauseClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object GetWidthBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 97
|
||||
Width = 75
|
||||
Caption = 'Get width'
|
||||
OnClick = GetWidthClick
|
||||
TabOrder = 2
|
||||
end
|
||||
object GetHeightBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 126
|
||||
Width = 75
|
||||
Caption = 'Get height'
|
||||
OnClick = GetHeightBtnClick
|
||||
TabOrder = 3
|
||||
end
|
||||
object GetStateBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 155
|
||||
Width = 75
|
||||
Caption = 'Get state'
|
||||
OnClick = GetStateClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object ResumeBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 68
|
||||
Width = 75
|
||||
Caption = 'Resume'
|
||||
OnClick = ResumeClick
|
||||
TabOrder = 5
|
||||
end
|
||||
object GetPosLenBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 182
|
||||
Width = 75
|
||||
Caption = 'Get pos, len'
|
||||
OnClick = GetPosLenClick
|
||||
TabOrder = 6
|
||||
end
|
||||
object Scale10Btn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 213
|
||||
Width = 75
|
||||
Caption = 'Scale -10%'
|
||||
OnClick = Scale10Click
|
||||
TabOrder = 7
|
||||
end
|
||||
object ScaleFitBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 242
|
||||
Width = 75
|
||||
Caption = 'ScaleFit'
|
||||
OnClick = ScaleFitClick
|
||||
TabOrder = 8
|
||||
end
|
||||
object SnapShotBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 271
|
||||
Width = 75
|
||||
Caption = 'SnapShot'
|
||||
OnClick = SnapShotClick
|
||||
TabOrder = 9
|
||||
end
|
||||
object NextFrameBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 302
|
||||
Width = 75
|
||||
Caption = 'Next Frame'
|
||||
OnClick = NextFrameClick
|
||||
TabOrder = 10
|
||||
end
|
||||
object GetASpectRatioBtn: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 8
|
||||
Width = 75
|
||||
Caption = 'Get Aspect'
|
||||
OnClick = GetASpectRatioClick
|
||||
TabOrder = 11
|
||||
end
|
||||
object SetAsp11Btn: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 39
|
||||
Width = 75
|
||||
Caption = 'Set asp 1:1'
|
||||
OnClick = SetAsp11Click
|
||||
TabOrder = 12
|
||||
end
|
||||
object SetAsp43Btn: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 68
|
||||
Width = 75
|
||||
Caption = 'Set asp 4:3'
|
||||
OnClick = SetAsp43Click
|
||||
TabOrder = 13
|
||||
end
|
||||
object GetVolume: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 97
|
||||
Width = 75
|
||||
Caption = 'Get Volume'
|
||||
OnClick = GetVolumeClick
|
||||
TabOrder = 14
|
||||
end
|
||||
object SetVolumeUp10: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 126
|
||||
Width = 75
|
||||
Caption = 'Volume +10'
|
||||
OnClick = SetVolumeUp10Click
|
||||
TabOrder = 15
|
||||
end
|
||||
object SetVolumeDo10: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 155
|
||||
Width = 75
|
||||
Caption = 'Volume -10'
|
||||
OnClick = SetVolumeDo10Click
|
||||
TabOrder = 16
|
||||
end
|
||||
object GetPlayRateBtn: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 184
|
||||
Width = 75
|
||||
Caption = 'Get Play Rate'
|
||||
OnClick = GetPlayRateBtnClick
|
||||
TabOrder = 17
|
||||
end
|
||||
object SetPlayRate2xBtn: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 213
|
||||
Width = 75
|
||||
Caption = 'Play Rate 2x'
|
||||
OnClick = SetPlayRate2xBtnClick
|
||||
TabOrder = 18
|
||||
end
|
||||
object SetPlayRateHalfBtn: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 242
|
||||
Width = 75
|
||||
Caption = 'Play Rate 1/2'
|
||||
OnClick = SetPlayRateHalfBtnClick
|
||||
TabOrder = 19
|
||||
end
|
||||
object FullScreenYesBtn: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 271
|
||||
Width = 75
|
||||
Caption = 'FullScreen'
|
||||
OnClick = FullScreenYesBtnClick
|
||||
TabOrder = 20
|
||||
end
|
||||
object DeInterlaceBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 333
|
||||
Width = 75
|
||||
Caption = 'DeInterlace'
|
||||
OnClick = DeInterlaceBtnClick
|
||||
TabOrder = 21
|
||||
end
|
||||
object GetAudioChannel: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 302
|
||||
Width = 75
|
||||
Caption = 'Get Audio Ch'
|
||||
OnClick = GetAudioChannelClick
|
||||
TabOrder = 22
|
||||
end
|
||||
object SetAudioChannelLeft: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 333
|
||||
Width = 75
|
||||
Caption = 'Set Audio C L'
|
||||
OnClick = SetAudioChannelLeftClick
|
||||
TabOrder = 23
|
||||
end
|
||||
object SetAudioChannelRight: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 364
|
||||
Width = 75
|
||||
Caption = 'Set Audio C R'
|
||||
OnClick = SetAudioChannelRightClick
|
||||
TabOrder = 24
|
||||
end
|
||||
object SetAudioChannelStereo: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 395
|
||||
Width = 75
|
||||
Caption = 'Set Audio C S'
|
||||
OnClick = SetAudioChannelStereoClick
|
||||
TabOrder = 26
|
||||
end
|
||||
object GetAudioOutListBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 364
|
||||
Width = 75
|
||||
Caption = 'AudioOutList'
|
||||
OnClick = GetAudioOutListBtnClick
|
||||
TabOrder = 25
|
||||
end
|
||||
object GetAudioOutDevEnumBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 395
|
||||
Width = 75
|
||||
Caption = 'AOutDevEnum'
|
||||
OnClick = GetAudioOutDevEnumBtnClick
|
||||
TabOrder = 27
|
||||
end
|
||||
object GetEqPreListBtn: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 456
|
||||
Width = 75
|
||||
Caption = 'EqalizerPreList'
|
||||
OnClick = GetEqPreListBtnClick
|
||||
TabOrder = 28
|
||||
end
|
||||
object SetEqualizerBtn: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 426
|
||||
Width = 75
|
||||
Caption = 'Set Equalizer'
|
||||
OnClick = SetEqualizerBtnClick
|
||||
TabOrder = 29
|
||||
end
|
||||
object ChAudioOut: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 426
|
||||
Width = 75
|
||||
Caption = 'Ch Audio Out'
|
||||
OnClick = ChAudioOutClick
|
||||
TabOrder = 30
|
||||
end
|
||||
object GetAudioTrackListBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 456
|
||||
Width = 75
|
||||
Caption = 'AudioTrackList'
|
||||
OnClick = GetAudioTrackListBtnClick
|
||||
TabOrder = 31
|
||||
end
|
||||
object GetAudioFilterListBtn: TButton
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 488
|
||||
Width = 75
|
||||
Caption = 'AudioFilterList'
|
||||
OnClick = GetAudioFilterListBtnClick
|
||||
TabOrder = 32
|
||||
end
|
||||
object GetVideoFilterListBtn: TButton
|
||||
Left = 94
|
||||
Height = 25
|
||||
Top = 488
|
||||
Width = 75
|
||||
Caption = 'VideoFilterList'
|
||||
OnClick = GetVideoFilterListBtnClick
|
||||
TabOrder = 33
|
||||
end
|
||||
end
|
||||
object LB: TListBox
|
||||
Left = 9
|
||||
Height = 176
|
||||
Top = 309
|
||||
Width = 320
|
||||
ItemHeight = 0
|
||||
PopupMenu = LbPopupMenu
|
||||
TabOrder = 1
|
||||
end
|
||||
object MrlEdit: TEdit
|
||||
Left = 8
|
||||
Height = 21
|
||||
Top = 20
|
||||
Width = 320
|
||||
TabOrder = 2
|
||||
end
|
||||
object PasLibVlcPlayer1: TPasLibVlcPlayer
|
||||
Left = 8
|
||||
Height = 202
|
||||
Top = 45
|
||||
BevelOuter = bvNone
|
||||
ParentColor = False
|
||||
TabOrder = 3
|
||||
OnClick = PasLibVlcPlayer1Click
|
||||
OnDblClick = PasLibVlcPlayer1DblClick
|
||||
OnMouseDown = PasLibVlcPlayer1MouseDown
|
||||
OnMouseEnter = PasLibVlcPlayer1MouseEnter
|
||||
OnMouseLeave = PasLibVlcPlayer1MouseLeave
|
||||
OnMouseMove = PasLibVlcPlayer1MouseMove
|
||||
OnMouseUp = PasLibVlcPlayer1MouseUp
|
||||
SnapShotFmt = 'png'
|
||||
OnMediaPlayerMediaChanged = PasLibVlcPlayer1MediaPlayerMediaChanged
|
||||
OnMediaPlayerNothingSpecial = PasLibVlcPlayer1MediaPlayerNothingSpecial
|
||||
OnMediaPlayerOpening = PasLibVlcPlayer1MediaPlayerOpening
|
||||
OnMediaPlayerBuffering = PasLibVlcPlayer1MediaPlayerBuffering
|
||||
OnMediaPlayerPlaying = PasLibVlcPlayer1MediaPlayerPlaying
|
||||
OnMediaPlayerPaused = PasLibVlcPlayer1MediaPlayerPaused
|
||||
OnMediaPlayerStopped = PasLibVlcPlayer1MediaPlayerStopped
|
||||
OnMediaPlayerForward = PasLibVlcPlayer1MediaPlayerForward
|
||||
OnMediaPlayerBackward = PasLibVlcPlayer1MediaPlayerBackward
|
||||
OnMediaPlayerEndReached = PasLibVlcPlayer1MediaPlayerEndReached
|
||||
OnMediaPlayerEncounteredError = PasLibVlcPlayer1MediaPlayerEncounteredError
|
||||
OnMediaPlayerTimeChanged = PasLibVlcPlayer1MediaPlayerTimeChanged
|
||||
OnMediaPlayerPositionChanged = PasLibVlcPlayer1MediaPlayerPositionChanged
|
||||
OnMediaPlayerSeekableChanged = PasLibVlcPlayer1MediaPlayerSeekableChanged
|
||||
OnMediaPlayerPausableChanged = PasLibVlcPlayer1MediaPlayerPausableChanged
|
||||
OnMediaPlayerTitleChanged = PasLibVlcPlayer1MediaPlayerTitleChanged
|
||||
OnMediaPlayerSnapshotTaken = PasLibVlcPlayer1MediaPlayerSnapshotTaken
|
||||
OnMediaPlayerLengthChanged = PasLibVlcPlayer1MediaPlayerLengthChanged
|
||||
OnMediaPlayerVideoOutChanged = PasLibVlcPlayer1MediaPlayerVideoOutChanged
|
||||
OnMediaPlayerScrambledChanged = PasLibVlcPlayer1MediaPlayerScrambledChanged
|
||||
OnMediaPlayerCorked = PasLibVlcPlayer1MediaPlayerCorked
|
||||
OnMediaPlayerUnCorked = PasLibVlcPlayer1MediaPlayerUnCorked
|
||||
OnMediaPlayerMuted = PasLibVlcPlayer1MediaPlayerMuted
|
||||
OnMediaPlayerUnMuted = PasLibVlcPlayer1MediaPlayerUnMuted
|
||||
OnMediaPlayerAudioVolumeChanged = PasLibVlcPlayer1MediaPlayerAudioVolumeChanged
|
||||
OnMediaPlayerEsAdded = PasLibVlcPlayer1MediaPlayerEsAdded
|
||||
OnMediaPlayerEsDeleted = PasLibVlcPlayer1MediaPlayerEsDeleted
|
||||
OnMediaPlayerEsSelected = PasLibVlcPlayer1MediaPlayerEsSelected
|
||||
OnMediaPlayerAudioDevice = PasLibVlcPlayer1MediaPlayerAudioDevice
|
||||
OnMediaPlayerChapterChanged = PasLibVlcPlayer1MediaPlayerChapterChanged
|
||||
OnRendererDiscoveredItemAdded = PasLibVlcPlayer1RendererDiscoveredItemAdded
|
||||
OnRendererDiscoveredItemDeleted = PasLibVlcPlayer1RendererDiscoveredItemDeleted
|
||||
end
|
||||
object ProgPanel: TPanel
|
||||
Left = 8
|
||||
Height = 46
|
||||
Top = 252
|
||||
Width = 320
|
||||
ClientHeight = 46
|
||||
ClientWidth = 320
|
||||
TabOrder = 4
|
||||
object ProgLabel1: TLabel
|
||||
Left = 1
|
||||
Height = 20
|
||||
Top = 25
|
||||
Width = 44
|
||||
Align = alLeft
|
||||
Caption = '00:00:00'
|
||||
ParentColor = False
|
||||
end
|
||||
object ProgLabel2: TLabel
|
||||
Left = 275
|
||||
Height = 20
|
||||
Top = 25
|
||||
Width = 44
|
||||
Align = alRight
|
||||
Caption = '00:00:00'
|
||||
ParentColor = False
|
||||
end
|
||||
object ProgBar: TTrackBar
|
||||
Left = 1
|
||||
Height = 24
|
||||
Top = 1
|
||||
Width = 318
|
||||
OnChange = ProgBarChange
|
||||
Position = 0
|
||||
TickStyle = tsNone
|
||||
Align = alTop
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object BtnSelect: TButton
|
||||
Left = 280
|
||||
Height = 19
|
||||
Top = 22
|
||||
Width = 46
|
||||
Caption = 'Select'
|
||||
OnClick = BtnSelectClick
|
||||
TabOrder = 5
|
||||
end
|
||||
object PopupMenu: TPopupMenu
|
||||
left = 16
|
||||
top = 56
|
||||
object a1: TMenuItem
|
||||
Caption = 'a'
|
||||
end
|
||||
object b1: TMenuItem
|
||||
Caption = 'b'
|
||||
end
|
||||
object c1: TMenuItem
|
||||
Caption = 'c'
|
||||
end
|
||||
object d1: TMenuItem
|
||||
Caption = 'd'
|
||||
end
|
||||
end
|
||||
object OpenDialog: TOpenDialog
|
||||
Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||
left = 264
|
||||
top = 56
|
||||
end
|
||||
object SaveDialog: TSaveDialog
|
||||
DefaultExt = '.*.txt'
|
||||
FileName = 'PasLibVlcDemo.txt'
|
||||
left = 20
|
||||
top = 316
|
||||
end
|
||||
object LbPopupMenu: TPopupMenu
|
||||
left = 56
|
||||
top = 316
|
||||
object LbPmClear: TMenuItem
|
||||
Caption = 'Clear'
|
||||
OnClick = LbPmClearClick
|
||||
end
|
||||
object LnPmSaveAs: TMenuItem
|
||||
Caption = 'Save as'
|
||||
OnClick = LnPmSaveAsClick
|
||||
end
|
||||
end
|
||||
end
|
1018
PasLibVlc/Lazarus/DemoPasLibVlcPlayer/MainFormUnit.pas
Normal file
1018
PasLibVlc/Lazarus/DemoPasLibVlcPlayer/MainFormUnit.pas
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,51 @@
|
||||
object SelectOutputDeviceForm: TSelectOutputDeviceForm
|
||||
Left = 266
|
||||
Height = 240
|
||||
Top = 112
|
||||
Width = 370
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'Select output device'
|
||||
ClientHeight = 240
|
||||
ClientWidth = 370
|
||||
Position = poMainFormCenter
|
||||
LCLVersion = '1.4.4.0'
|
||||
object OutputDevicesLB: TListBox
|
||||
Left = 8
|
||||
Height = 200
|
||||
Top = 32
|
||||
Width = 264
|
||||
ItemHeight = 0
|
||||
OnDblClick = OutputDevicesLBDblClick
|
||||
OnDrawItem = OutputDevicesLBDrawItem
|
||||
Style = lbOwnerDrawFixed
|
||||
TabOrder = 0
|
||||
end
|
||||
object OkBtn: TButton
|
||||
Left = 280
|
||||
Height = 25
|
||||
Top = 32
|
||||
Width = 75
|
||||
Caption = 'OK'
|
||||
Default = True
|
||||
OnClick = OkBtnClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object OutputDevicesLabel: TLabel
|
||||
Left = 8
|
||||
Height = 13
|
||||
Top = 12
|
||||
Width = 96
|
||||
Caption = 'OutputDevicesLabel'
|
||||
FocusControl = OutputDevicesLB
|
||||
ParentColor = False
|
||||
end
|
||||
object CancelBtn: TButton
|
||||
Left = 280
|
||||
Height = 25
|
||||
Top = 64
|
||||
Width = 75
|
||||
Caption = 'Cancel'
|
||||
ModalResult = 2
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
@@ -0,0 +1,95 @@
|
||||
(*
|
||||
* 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 SelectOutputDeviceFormUnit;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, types;
|
||||
|
||||
type
|
||||
|
||||
{ TSelectOutputDeviceForm }
|
||||
|
||||
TSelectOutputDeviceForm = class(TForm)
|
||||
CancelBtn: TButton;
|
||||
OutputDevicesLabel: TLabel;
|
||||
OkBtn: TButton;
|
||||
OutputDevicesLB: TListBox;
|
||||
procedure OkBtnClick(Sender: TObject);
|
||||
procedure OutputDevicesLBDblClick(Sender: TObject);
|
||||
procedure OutputDevicesLBDrawItem(Control: TWinControl; Index: Integer;
|
||||
ARect: TRect; State: TOwnerDrawState);
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
SelectOutputDeviceForm: TSelectOutputDeviceForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TSelectOutputDeviceForm }
|
||||
|
||||
procedure TSelectOutputDeviceForm.OkBtnClick(Sender: TObject);
|
||||
begin
|
||||
if (OutputDevicesLB.ItemIndex < 0) then
|
||||
begin
|
||||
ModalResult := mrCancel;
|
||||
end
|
||||
else
|
||||
begin
|
||||
ModalResult := mrOK;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSelectOutputDeviceForm.OutputDevicesLBDblClick(Sender: TObject);
|
||||
begin
|
||||
if (OutputDevicesLB.ItemIndex > -1) then
|
||||
begin
|
||||
ModalResult := mrOK;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSelectOutputDeviceForm.OutputDevicesLBDrawItem(Control: TWinControl;
|
||||
Index: Integer; ARect: TRect; State: TOwnerDrawState);
|
||||
var
|
||||
str : string;
|
||||
begin
|
||||
with (Control as TListBox).Canvas do
|
||||
begin
|
||||
FillRect(ARect);
|
||||
str := (Control as TListBox).Items[Index];
|
||||
TextOut(ARect.Left + 2, ARect.Top + 1, Copy(str, Pos('|', str) + 1, MaxInt));
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@@ -0,0 +1,70 @@
|
||||
object SetEqualizerPresetForm: TSetEqualizerPresetForm
|
||||
Left = 243
|
||||
Height = 293
|
||||
Top = 109
|
||||
Width = 468
|
||||
Caption = 'Set Equalizer Preset'
|
||||
ClientHeight = 293
|
||||
ClientWidth = 468
|
||||
Color = clBtnFace
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Position = poMainFormCenter
|
||||
LCLVersion = '1.2.6.0'
|
||||
object PresetListLabel: TLabel
|
||||
Left = 16
|
||||
Height = 13
|
||||
Top = 13
|
||||
Width = 40
|
||||
Caption = 'Presets:'
|
||||
FocusControl = PresetListLB
|
||||
ParentColor = False
|
||||
end
|
||||
object BandInfoLabel: TLabel
|
||||
Left = 140
|
||||
Height = 13
|
||||
Top = 13
|
||||
Width = 83
|
||||
Caption = 'Preset band info:'
|
||||
FocusControl = BandInfoLB
|
||||
ParentColor = False
|
||||
end
|
||||
object PresetListLB: TListBox
|
||||
Left = 16
|
||||
Height = 245
|
||||
Top = 32
|
||||
Width = 105
|
||||
ItemHeight = 0
|
||||
OnClick = PresetListLBClick
|
||||
TabOrder = 0
|
||||
end
|
||||
object OkBtn: TButton
|
||||
Left = 380
|
||||
Height = 25
|
||||
Top = 13
|
||||
Width = 75
|
||||
Caption = 'OK'
|
||||
Default = True
|
||||
ModalResult = 1
|
||||
TabOrder = 1
|
||||
end
|
||||
object CancelBtn: TButton
|
||||
Left = 380
|
||||
Height = 25
|
||||
Top = 44
|
||||
Width = 75
|
||||
Cancel = True
|
||||
Caption = 'Cancel'
|
||||
ModalResult = 2
|
||||
TabOrder = 2
|
||||
end
|
||||
object BandInfoLB: TListBox
|
||||
Left = 140
|
||||
Height = 245
|
||||
Top = 32
|
||||
Width = 221
|
||||
ItemHeight = 0
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
@@ -0,0 +1,92 @@
|
||||
(*
|
||||
* 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 SetEqualizerPresetFormUnit;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}Unix,{$ENDIF}
|
||||
{$IFDEF FPC}
|
||||
LCLIntf, LCLType, LMessages,
|
||||
{$ELSE}
|
||||
Messages,
|
||||
{$ENDIF}
|
||||
SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ExtCtrls, StdCtrls, Menus,
|
||||
PasLibVlcClassUnit;
|
||||
|
||||
type
|
||||
TSetEqualizerPresetForm = class(TForm)
|
||||
PresetListLB: TListBox;
|
||||
OkBtn: TButton;
|
||||
CancelBtn: TButton;
|
||||
PresetListLabel: TLabel;
|
||||
BandInfoLB: TListBox;
|
||||
BandInfoLabel: TLabel;
|
||||
procedure PresetListLBClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
FVLC : TPasLibVlc;
|
||||
end;
|
||||
|
||||
var
|
||||
SetEqualizerPresetForm: TSetEqualizerPresetForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
procedure TSetEqualizerPresetForm.PresetListLBClick(Sender: TObject);
|
||||
var
|
||||
equalizer : TPasLibVlcEqualizer;
|
||||
index : Integer;
|
||||
begin
|
||||
BandInfoLB.Clear;
|
||||
if (PresetListLB.ItemIndex > -1) then
|
||||
begin
|
||||
equalizer := TPasLibVlcEqualizer.Create(
|
||||
FVLC,
|
||||
Word(PresetListLB.Items.Objects[PresetListLB.ItemIndex])
|
||||
);
|
||||
BandInfoLB.AddItem(
|
||||
'PreAmp: ' + IntToStr(Round(equalizer.GetPreAmp())),
|
||||
NIL
|
||||
);
|
||||
for index := 0 to equalizer.GetBandCount() - 1 do
|
||||
begin
|
||||
BandInfoLB.AddItem(
|
||||
'Band no: ' + IntToStr(index+1) +
|
||||
', freq.: ' + IntToStr(Round(equalizer.GetBandFrequency(index))) +
|
||||
'Hz, amp.:' + IntToStr(Round(equalizer.GetAmp(index))),
|
||||
NIL
|
||||
);
|
||||
end;
|
||||
equalizer.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasUsesSectionForAllUnits Value="False"/>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="DemoPasLivVlcPlayerPauseAtStart"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<UseVersionInfo Value="True"/>
|
||||
<MajorVersionNr Value="1"/>
|
||||
<Language Value="0415"/>
|
||||
<StringTable CompanyName="Robert Jędrzejczyk" FileDescription="DemoPasLibVlcPlayerPauseAtStart" InternalName="DemoPasLibVlcPlayerPauseAtStart" LegalCopyright="Robert Jędrzejczyk" LegalTrademarks="Robert Jędrzejczyk" OriginalFilename="DemoPasLibVlcPlayerPauseAtStart" ProductName="DemoPasLibVlcPlayerPauseAtStart"/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="PasLibVlcPlayer"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="DemoPasLivVlcPlayerPauseAtStart.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="MainFormUnit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="MainForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="DemoPasLibVlcPlayerPauseAtStart"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<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>
|
||||
</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 DemoPasLivVlcPlayerPauseAtStart;
|
||||
|
||||
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.
|
@@ -0,0 +1,42 @@
|
||||
object MainForm: TMainForm
|
||||
Left = 367
|
||||
Height = 339
|
||||
Top = 135
|
||||
Width = 414
|
||||
Caption = 'DemoPasLivVlcPlayerPauseAtStart'
|
||||
ClientHeight = 339
|
||||
ClientWidth = 414
|
||||
Color = clBtnFace
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '1.8.0.6'
|
||||
object mrlEdit: TEdit
|
||||
Left = 12
|
||||
Height = 21
|
||||
Top = 12
|
||||
Width = 391
|
||||
TabOrder = 0
|
||||
end
|
||||
object player: TPasLibVlcPlayer
|
||||
Left = 12
|
||||
Top = 44
|
||||
Width = 391
|
||||
BevelOuter = bvNone
|
||||
ParentColor = False
|
||||
TabOrder = 1
|
||||
SnapShotFmt = 'png'
|
||||
OnMediaPlayerTimeChanged = playerMediaPlayerTimeChanged
|
||||
end
|
||||
object playButton: TButton
|
||||
Left = 164
|
||||
Height = 25
|
||||
Top = 300
|
||||
Width = 75
|
||||
Caption = 'Play'
|
||||
OnClick = playButtonClick
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
@@ -0,0 +1,98 @@
|
||||
(*
|
||||
* 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
|
||||
LCLIntf, LCLType, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls, PasLibVlcPlayerUnit;
|
||||
|
||||
type
|
||||
|
||||
{ TMainForm }
|
||||
|
||||
TMainForm = class(TForm)
|
||||
mrlEdit: TEdit;
|
||||
player: TPasLibVlcPlayer;
|
||||
playButton: TButton;
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure playerMediaPlayerTimeChanged(Sender: TObject;
|
||||
time: Int64);
|
||||
procedure playButtonClick(Sender: TObject);
|
||||
private
|
||||
needStop : Boolean;
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
MainForm: TMainForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
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};
|
||||
needStop := TRUE;
|
||||
mrlEdit.Text := '..'+PathDelim+'..'+PathDelim+'_testFiles'+PathDelim+'test.ts';
|
||||
player.Play(WideString(mrlEdit.Text));
|
||||
end;
|
||||
|
||||
procedure TMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
begin
|
||||
player.Stop();
|
||||
end;
|
||||
|
||||
procedure TMainForm.playButtonClick(Sender: TObject);
|
||||
begin
|
||||
player.Resume();
|
||||
end;
|
||||
|
||||
procedure TMainForm.playerMediaPlayerTimeChanged(Sender: TObject;
|
||||
time: Int64);
|
||||
begin
|
||||
if (needStop) and (time > 500) then
|
||||
begin
|
||||
needStop := FALSE;
|
||||
player.Pause();
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
3036
PasLibVlc/Lazarus/Makefile
Normal file
3036
PasLibVlc/Lazarus/Makefile
Normal file
File diff suppressed because it is too large
Load Diff
64
PasLibVlc/Lazarus/Makefile.fpc
Normal file
64
PasLibVlc/Lazarus/Makefile.fpc
Normal file
@@ -0,0 +1,64 @@
|
||||
# File generated automatically by Lazarus Package Manager
|
||||
#
|
||||
# Makefile.fpc for PasLibVlcPlayer 3.0.6
|
||||
#
|
||||
# This file was generated on 24.03.2019
|
||||
|
||||
[package]
|
||||
name=paslibvlcplayer
|
||||
version=3.0.6
|
||||
|
||||
[compiler]
|
||||
unittargetdir=lib/$(CPU_TARGET)-$(OS_TARGET)
|
||||
unitdir=../source ../source.vcl D:/Editors/lazarus/packager/units/$(CPU_TARGET)-$(OS_TARGET) D:/Editors/lazarus/components/lazutils/lib/$(CPU_TARGET)-$(OS_TARGET) D:/Editors/lazarus/lcl/units/$(CPU_TARGET)-$(OS_TARGET) D:/Editors/lazarus/lcl/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) .
|
||||
options= -MDelphi -Scghi -CX -O4 -g -gl -gh -Xg -l -vewnhibq -dLCL -dLCL$(LCL_PLATFORM) $(DBG_OPTIONS)
|
||||
|
||||
[target]
|
||||
units=PasLibVlcPlayer.pas
|
||||
|
||||
[clean]
|
||||
files=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) \
|
||||
$(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) \
|
||||
$(wildcard $(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) \
|
||||
$(wildcard $(COMPILER_UNITTARGETDIR)/*.lfm) \
|
||||
$(wildcard $(COMPILER_UNITTARGETDIR)/*.res) \
|
||||
$(wildcard $(COMPILER_UNITTARGETDIR)/*.compiled) \
|
||||
$(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
|
||||
|
||||
[prerules]
|
||||
# LCL Platform
|
||||
ifndef LCL_PLATFORM
|
||||
ifeq ($(OS_TARGET),win32)
|
||||
LCL_PLATFORM=win32
|
||||
else
|
||||
ifeq ($(OS_TARGET),win64)
|
||||
LCL_PLATFORM=win32
|
||||
else
|
||||
ifeq ($(OS_TARGET),darwin)
|
||||
LCL_PLATFORM=carbon
|
||||
else
|
||||
LCL_PLATFORM=gtk2
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
export LCL_PLATFORM
|
||||
|
||||
DBG_OPTIONS=
|
||||
ifeq ($(OS_TARGET),darwin)
|
||||
DBG_OPTIONS=-gw
|
||||
endif
|
||||
|
||||
[rules]
|
||||
.PHONY: cleartarget compiled all
|
||||
|
||||
cleartarget:
|
||||
-$(DEL) $(COMPILER_UNITTARGETDIR)/paslibvlcplayer$(PPUEXT)
|
||||
|
||||
compiled:
|
||||
$(CPPROG) -f Makefile.compiled $(COMPILER_UNITTARGETDIR)/PasLibVlcPlayer.compiled
|
||||
|
||||
all: cleartarget $(COMPILER_UNITTARGETDIR) paslibvlcplayer$(PPUEXT) compiled
|
||||
|
||||
distclean: clean
|
||||
${DELTREE} lib/*
|
71
PasLibVlc/Lazarus/PasLibVlcPlayer.lpk
Normal file
71
PasLibVlc/Lazarus/PasLibVlcPlayer.lpk
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<Package Version="4">
|
||||
<PathDelim Value="\"/>
|
||||
<Name Value="PasLibVlcPlayer"/>
|
||||
<Type Value="RunAndDesignTime"/>
|
||||
<AddToProjectUsesSection Value="True"/>
|
||||
<Author Value="Robert Jędrzejczyk"/>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<SearchPaths>
|
||||
<OtherUnitFiles Value="..\source;..\source.vcl"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<SyntaxMode Value="Delphi"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<RelocatableUnit Value="True"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="4"/>
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<UseHeaptrc Value="True"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CreateMakefileOnBuild Value="True"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Description Value="VideoLAN libvlc library interface and components."/>
|
||||
<Version Major="3" Release="6"/>
|
||||
<Files Count="2">
|
||||
<Item1>
|
||||
<Filename Value="..\source\PasLibVlcUnit.pas"/>
|
||||
<UnitName Value="PasLibVlcUnit"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Filename Value="..\source.vcl\PasLibVlcPlayerUnit.pas"/>
|
||||
<HasRegisterProc Value="True"/>
|
||||
<UnitName Value="PasLibVlcPlayerUnit"/>
|
||||
</Item2>
|
||||
</Files>
|
||||
<RequiredPkgs Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
<MinVersion Major="1" Valid="True"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="FCL"/>
|
||||
<MinVersion Major="1" Valid="True"/>
|
||||
</Item2>
|
||||
</RequiredPkgs>
|
||||
<UsageOptions>
|
||||
<UnitPath Value="$(PkgOutDir)"/>
|
||||
</UsageOptions>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<CustomOptions Items="ExternHelp" Version="2">
|
||||
<_ExternHelp Items="Count"/>
|
||||
</CustomOptions>
|
||||
</Package>
|
||||
</CONFIG>
|
21
PasLibVlc/Lazarus/PasLibVlcPlayer.pas
Normal file
21
PasLibVlc/Lazarus/PasLibVlcPlayer.pas
Normal file
@@ -0,0 +1,21 @@
|
||||
{ This file was automatically created by Lazarus. Do not edit!
|
||||
This source is only used to compile and install the package.
|
||||
}
|
||||
|
||||
unit PasLibVlcPlayer;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
PasLibVlcUnit, PasLibVlcPlayerUnit, LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
RegisterUnit('PasLibVlcPlayerUnit', @PasLibVlcPlayerUnit.Register);
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterPackage('PasLibVlcPlayer', @Register);
|
||||
end.
|
67
PasLibVlc/Lazarus/fpmake.pp
Normal file
67
PasLibVlc/Lazarus/fpmake.pp
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
File generated automatically by Lazarus Package Manager
|
||||
|
||||
fpmake.pp for PasLibVlcPlayer 3.0.6
|
||||
|
||||
This file was generated on 27.04.2019
|
||||
}
|
||||
|
||||
{$ifndef ALLPACKAGES}
|
||||
{$mode objfpc}{$H+}
|
||||
program fpmake;
|
||||
|
||||
uses fpmkunit;
|
||||
{$endif ALLPACKAGES}
|
||||
|
||||
procedure add_PasLibVlcPlayer(const ADirectory: string);
|
||||
|
||||
var
|
||||
P : TPackage;
|
||||
T : TTarget;
|
||||
|
||||
begin
|
||||
with Installer do
|
||||
begin
|
||||
P:=AddPackage('paslibvlcplayer');
|
||||
P.Version:='3.0.6';
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
|
||||
P.Flags.Add('LazarusDsgnPkg');
|
||||
|
||||
P.Dependencies.Add('lcl');
|
||||
P.Dependencies.Add('fcl');
|
||||
P.Options.Add('-MDelphi');
|
||||
P.Options.Add('-Scghi');
|
||||
P.Options.Add('-CX');
|
||||
P.Options.Add('-O4');
|
||||
P.Options.Add('-g');
|
||||
P.Options.Add('-gl');
|
||||
P.Options.Add('-gh');
|
||||
P.Options.Add('-Xg');
|
||||
P.Options.Add('-l');
|
||||
P.Options.Add('-vewnhibq');
|
||||
P.Options.Add('-dLCL');
|
||||
P.Options.Add('-dLCL$(LCLWidgetType)');
|
||||
P.UnitPath.Add('../source');
|
||||
P.UnitPath.Add('../source.vcl');
|
||||
P.UnitPath.Add('.');
|
||||
T:=P.Targets.AddUnit('PasLibVlcPlayer.pas');
|
||||
t.Dependencies.AddUnit('PasLibVlcUnit');
|
||||
t.Dependencies.AddUnit('PasLibVlcPlayerUnit');
|
||||
|
||||
T:=P.Targets.AddUnit('..\source\PasLibVlcUnit.pas');
|
||||
T:=P.Targets.AddUnit('..\source.vcl\PasLibVlcPlayerUnit.pas');
|
||||
|
||||
// copy the compiled file, so the IDE knows how the package was compiled
|
||||
P.InstallFiles.Add('PasLibVlcPlayer.compiled',AllOSes,'$(unitinstalldir)');
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
{$ifndef ALLPACKAGES}
|
||||
begin
|
||||
add_PasLibVlcPlayer('');
|
||||
Installer.Run;
|
||||
end.
|
||||
{$endif ALLPACKAGES}
|
Reference in New Issue
Block a user