You've already forked lazarus-ccr
vlc: new, moved from Lazarus trunk/components
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6103 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
18
components/vlc/README.txt
Normal file
18
components/vlc/README.txt
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
This component is a video player based on the VLC libraries.
|
||||
You need the VLC library headers in FPC, so this will only compile with FPC
|
||||
2.7.1 and higher.
|
||||
|
||||
The component works on Windows and Linux with GTK2.
|
||||
It should work with QT, but this is untested.
|
||||
|
||||
The test directory contains a sample project that shows minimal use of the
|
||||
component.
|
||||
|
||||
There are actually 2 components:
|
||||
TLCLVLCPLayer
|
||||
and
|
||||
TVLCMediaListPlayer
|
||||
The former plays 1 video file. The second can be used to create a playlist
|
||||
and uses a TLCLVLCPLayer to play the media.
|
||||
|
60
components/vlc/lazvlc.lpk
Normal file
60
components/vlc/lazvlc.lpk
Normal file
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<Package Version="4">
|
||||
<Name Value="lazvlc"/>
|
||||
<Author Value="Michael Van Canneyt"/>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<SearchPaths>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Other>
|
||||
<CompilerMessages>
|
||||
<MsgFileName Value=""/>
|
||||
</CompilerMessages>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Description Value="VLC Player component. Needs at least version 2 of the VideoLan player and at least fpc 2.7.1."/>
|
||||
<License Value="Modified LGPL"/>
|
||||
<Version Major="1"/>
|
||||
<Files Count="5">
|
||||
<Item1>
|
||||
<Filename Value="reglazvlc.pas"/>
|
||||
<HasRegisterProc Value="True"/>
|
||||
<UnitName Value="reglazvlc"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Filename Value="lazvlc.res"/>
|
||||
<Type Value="Text"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Filename Value="lclvlc.pp"/>
|
||||
<UnitName Value="lclvlc"/>
|
||||
</Item3>
|
||||
<Item4>
|
||||
<Filename Value="vlcgtk2.inc"/>
|
||||
<Type Value="Include"/>
|
||||
</Item4>
|
||||
<Item5>
|
||||
<Filename Value="vlcqt.inc"/>
|
||||
<Type Value="Include"/>
|
||||
</Item5>
|
||||
</Files>
|
||||
<Type Value="RunAndDesignTime"/>
|
||||
<RequiredPkgs Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="FCL"/>
|
||||
</Item2>
|
||||
</RequiredPkgs>
|
||||
<UsageOptions>
|
||||
<UnitPath Value="$(PkgOutDir)"/>
|
||||
</UsageOptions>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
</Package>
|
||||
</CONFIG>
|
22
components/vlc/lazvlc.pas
Normal file
22
components/vlc/lazvlc.pas
Normal file
@ -0,0 +1,22 @@
|
||||
{ This file was automatically created by Lazarus. Do not edit!
|
||||
This source is only used to compile and install the package.
|
||||
}
|
||||
|
||||
unit lazvlc;
|
||||
|
||||
{$warn 5023 off : no warning about unused units}
|
||||
interface
|
||||
|
||||
uses
|
||||
reglazvlc, lclvlc, LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
RegisterUnit('reglazvlc', @reglazvlc.Register);
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterPackage('lazvlc', @Register);
|
||||
end.
|
113
components/vlc/lazvlc.res
Normal file
113
components/vlc/lazvlc.res
Normal file
@ -0,0 +1,113 @@
|
||||
LazarusResources.Add('tlclvlcplayer','PNG',[
|
||||
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#2#0#0#0'o'#21#170#175
|
||||
+#0#0#0#6'bKGD'#0#255#0#255#0#255#160#189#167#147#0#0#0#9'pHYs'#0#0#0'H'#0#0#0
|
||||
+'H'#0'F'#201'k>'#0#0#4#210'IDAT8'#203']'#145']o\W'#21#134#159#181#247'>_sf<c'
|
||||
+'{'#226#175'4'#182#27#197'4M'#133'h'#171#18#181#252#2#164'^'#240#139#224'''p'
|
||||
+#197#5#183#220#150';'#4'EBH'#8#137#27#2')'#165'md'#26#199'&'#137'k'#199#246
|
||||
+#140#231'{'#230#156'9'#251#236#189#185#8#13#164#235'v'#173#247']'#239#179#150
|
||||
+#9#190'Bj'#135#173'!'#16#9'I'#28#148'8'#240'3B'#191#247#247#223#190'8?'#217
|
||||
+#221'{'#167#243#230#7'4'#238'Q)Z'#26#227#9#158#215#203#16'4'#2'8'#129#128#2
|
||||
+#16#16#143'T'#12'./'#251'gqC'#190'x'#244#224#163#213#173#168#181'G'#182#130
|
||||
+'x'#0'Q'#223#241'2x'#133'(%>'#224#3#8#30'@-'#145#197#201#201#195#133#235'G'
|
||||
+#170':~q'#152#30#182#238#223#254#30'8T'#19#146#255#238'{'#221#8'@L"xA'#169
|
||||
+#151#3#1#156#27#12#6#219'7w./O'#214'n'#172'=>9'#188'?'#235#177#210'@'#26#223
|
||||
+'j'#21#0#158#160#16'op'#16'@@)'#253#178#233#193#167#229#213#188#221#218#217
|
||||
+#222#200'p'#186#217#216'='#252#215#243#193#233#245#218#221#3#180#10#175'eQ"'
|
||||
+#4#148'A'#129'&'#128#10#0#18#160#6#231'N'#190'>yccG'#251#242#214#230#193#139
|
||||
+#243#171#253#141#232#233#163'''k'#7'?B'#20#250'5'#168#240#18#205#197#255#11
|
||||
+'*'#1#2'x'#143'/'#134'W'#231#247'v'#239#2'8r'#155#174#169#214#243#147#11#6'c'
|
||||
+'n4'#229'['#241#255'_'#219'8y'#133#235#193#195#18#22#132'Y'#158','#136'+'#218
|
||||
+'M'#158#156#173'djV'#244#155'a'#196#244#140'n'#23'"A'#189'T'#189#242'25'#19
|
||||
+#203'2#'#169']'#145'j'#133')`t'#248#151#223#175#228'S&_1'#15#245#240#244#250
|
||||
+#236'l'#214#235#173#16#158#252#233'Wwn'#253#12#147#17#28'J'#7#143'R'#202'C'
|
||||
+#185#172#205#156'R'#3#168'X'#25'X'#226'KT9'#155#158#174'o'#230#193'_'#187#209
|
||||
+#232#252#236#241#245#233#211'b'#216'O'#196'i_ sBE'#237'QZ'#137#169#150#206
|
||||
+#196#153's'#214#164'lhP'#1#169#18#244#18'<'#197#213#168'w'#253#222#219'7%'#14
|
||||
+'RNt'#164#162'Tll'#241'S'#231'{'#244#158#179#189#137'6'#4#135'H'#28#27#196
|
||||
+#183#26#153')'#10#218#25#198'C'#25'a'#20#243#222#139#227#227#173#157'=/'#153
|
||||
+'].'#6'c'#127'=gV'#197'uHb)'#180#210'G_'#252#227'`'#253#29#226#132#202#145'4'
|
||||
+#177#150'('#19#133'YK'#9'K'#8'PB'#174#201#183#198#195'z'#127#239#7'q'#30#151
|
||||
+#139#233#204#135#145'/+'#19#211#200#227'h'#150#174#222#156'O'#166#168#26'/D'
|
||||
+#134'P!'#26'o'#241#222#152'W'#15#204#160#134#197#200'Z'#219#236#172#178#146
|
||||
+#165#173#238'v|'#171#209'}'#203#142#7#179#254'3;{f'#210'ti]'#248#230#169't'
|
||||
+#214#201'Z$'#10'm'#16'!x3'#155'|'#222'lobsb'#245#187'_'#254#226#252#252#232
|
||||
+#221#15#223#148#181#187'uY'#232#180#173';'#235#173't'#187'jN'#166#181#158#150
|
||||
+'K]W'#139#241#252#143#159#254#134#184#241#253#247#239'o'#221'{'#151#8'"'#29
|
||||
+#172'5'#205#246#26#216#170'w'#20#7#127#252#245#159#237#178#255#254#219#247'Y'
|
||||
+'\'#154#188'C'#168#171#197'l:'#169#203#201'd'#185#180'q'#148#181#179't%'#244
|
||||
+'?'#127#248#215#225#194#29#236'v'#144';hM'#136'$2'#166'f7'#216'q'#188#25#253
|
||||
+#250#231'?m'''#253#221#221#180#186#248'2'#147'm'#150#155#196#171'-'#211'n'
|
||||
+#166'n4'#25'(5'#181#178#136'''W'#179#139#207#238#228#189'y'#163#241#248#193
|
||||
+''''#251'?'#188#11'7Iw'#168#157'1'#1'B'#160#255#239'v4'#218#220#176'[y'#193
|
||||
+#224#171#229#248#136'F'#183#12#249#184#208#227'I1'#31#142#170#249'H'#215#179
|
||||
+#134#31'n7'#166'Y2jk5'#12#227#226#240'A'#246#209'O'#192#18'E'#6#247#13'ax'
|
||||
+#245#229#31':'#245#179'n>'#236'&e'#22#10#136#194#244#162#176':'#204#189#154
|
||||
+'/'#179'e'#145'K'#145'De'#134#237#228#141'F'#220#174#227#142'['#164#143#254
|
||||
+#249#217#7#31'~'#204'tD'#158#24#220#128'0[\'#28#173''''#182#233'g~1 '#26#211
|
||||
+#204#197#234#216#235#166#152'FSL'#211'Ex'#237','#214#185#178'P'#170#5#170#217
|
||||
+#200#175#199's'#134#3#214'o '#24#6'='#226'z'#210#191#220'j'#166#221#184#171
|
||||
+#28#228'B'#28#227'm"'#136'Bim'#140'h'#17'lE'#21'U'#146'T.'#159#204#236'2'#13
|
||||
+#181#151#147#191'='#188#253#227#183#240#181#161#253#6#139#222#194#181'FUHL'
|
||||
+#200#147#216'$'#6'ok'#197#194'S'#212#193'U^'#171#144'H'#29#9'x'#29#226#188'('
|
||||
+#227'qm!'#207#215'n\O'#22#183'1(c'#168#183#166#151#147'k'#217#239#15'N'#143
|
||||
+'/J'#237'|'#150'V'#243#249'<i'#173'VN'#138'*'#212#193'+\'#172'T'#162't$A'#188
|
||||
+'s'#174#178'*O'#210'f'#212#218#200#242'M*'#240#214#144#180'['#7#239'}'#188
|
||||
+#191#135#30#227#175#168#6#164#154#249#4#147'#'#6#149'!'#130'xT'#141#212#4'K]'
|
||||
+#2#152'6'#146'S'#167'$]$'#135#248'?'#160'|'#128'C'#192'l'#166#4#0#0#0'%tEXtd'
|
||||
+'ate:create'#0'2012-11-06T23:17:07+01:00'#183#208'q'#132#0#0#0'%tEXtdate:mod'
|
||||
+'ify'#0'2012-11-06T23:17:07+01:00'#198#141#201'8'#0#0#0#17'tEXtjpeg:colorspa'
|
||||
+'ce'#0'2,uU'#159#0#0#0' tEXtjpeg:sampling-factor'#0'2x2,1x1,1x1I'#250#166#180
|
||||
+#0#0#0#0'IEND'#174'B`'#130
|
||||
]);
|
||||
LazarusResources.Add('tvlcmedialistplayer','PNG',[
|
||||
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
|
||||
+#0#4#136'IDATx'#218'uV[O$E'#24#253'j'#26#230#130#178#172#200#134'e'#24#21#134
|
||||
+#245#178'q'#9#138#152'A'#18'H'#140#151#248#130#25#141'$r'#25#8#4'x3'#27#220
|
||||
+#196#223'@x'#227#18#4'^x'#193' '#129#1#201'Fc'#8#27#17#193#25'w''j'#8#16'0'
|
||||
+#4'%'#187#203'E'#152#9#227#206#165#187#203#175#170#187#135#174#1'+'#169'Tuw'
|
||||
+#213'9U'#231'|'#245'U'#19#208#203#204#216']'#9'()'#222#251'kWRd'#10'@)'#1#130
|
||||
+#133'}$Z'#135'R T'#165'@U}'#18#190'#8'#203'"'#241#22#192#162'@,'#25#163'v'
|
||||
+#155'm'#243#246#157#207'T}'#136'Vf'#191#250#238'Z'#137#243#149#135#137'#'#137
|
||||
+#156'=R'#224#169'|'#137#200'q'#10#10'Vk6'#1'%AA'#178#18'`'#223#140'"'#217#8
|
||||
+#216#158#182#128#213'\se:='#251'M'#214#231'_'#220#142#11#4'?'#204#255#152#159
|
||||
+#19#127#225'adK"'#12'T'#178#2'$'#159'P'#200'@'#16#6#28'?SA'#142#169#16'}'#172
|
||||
+'h+'#199'j'#187'b'#129#172'<'#9#178#158#197#154#151#1#14'l'#29#174#4#13#132
|
||||
+'~'#206#254#228#211#143#163#2#193#202#189'5'#231#203#183'n'#252'-I'#184'g'
|
||||
+#212#2'+'#193'JUU'#229'}`'#10'a'#139#133#234#194#129#197'b'#225#239#177#213
|
||||
+'T'#196'o'#138#162#192#253#224#131'g'#222'}'#255#157#176'@'#16#12#6']n'#183
|
||||
+'{'#143#13'6'#8#16#156#154#201#204#4'z'#229#207#233#4#27#27#27#215#170#170
|
||||
+#170#142#5#130#181#181#181#231#11#157#206#221#227#127#142'Iff&\'#191'^'#0#199
|
||||
+#199'G'#16#137'D8!/T7V3'#222#212#18'`'#155')*v'#3'['#212#206#206'NAEE'#197'c'
|
||||
+#129'`ff'#166#184#186#186#250'O\'#1'GC'#18#146'H$'#168',''S;@'#2#134'ua'#7
|
||||
+#172'o!'#22'bw8'#184#164'[[['#207'y<'#158'}'#129#160#191#191#191#164#169#169
|
||||
+'i'#155'M'#184#204#3#170'm'#131#3#234#145'{'#169#7'l'#252#252#252#188#187#185
|
||||
+#185'yW '#232#235#235'{'#9#9'6'#169#30#228#132'X@Qd'#144'e'#153#31#0'M%*Hc'
|
||||
+#225'fk'#242#176#241#153'V+'#151'srr'#242#197#206#206#206'm'#129'```'#224#166
|
||||
+#215#235']?88'#160'Vk&'#20#22#186#200#209#225#1#13#135#195#28#246#220#1#208
|
||||
+'v'#160#153#145'z'#150#144#197']r'#131#247#167#166#166'n'#182#183#183'o'#10#4
|
||||
+#131#131#131#175'666'#254#161#135#163'9r'#248#184't'#137'R'#7#252'<'#170#136
|
||||
+'!'#239#244#244#244#173#182#182#182'u'#129'`h'#232#203#210#250#250#134#223#12
|
||||
+#2#3#212#220'O!'#232#30#24#160'f2'#214'G'#130#178#214#214#214#223#211#8#134
|
||||
+#202#234#234#234'B'#177'X'#140'k'#234'pdA,'#246#4#226#241'8'#23#129'Bj'#225
|
||||
+#134'<B'#184#18'4:'''#231'*'#247#0'#'#242#245#150#150#150#144'@0<<'#244#154
|
||||
+#215#251#209#131#147#147#19#202#206'A^^'#30#9#159#158#210#179#232#25#240#240
|
||||
+'L'#243'@'#159#201#224#249'W4'#156'8'#11']T'#11#249#217#138#230'f'#223#253'4'
|
||||
+#130#225#242#134#134#134'_'#141'g'#221#135'T?'#189#24#233#194'8'#19'F'#159
|
||||
+#141#245#251#253'obD'#6#5#130#145#145#145'7'#234#235#235#131#169#21#158#27
|
||||
+#155#202'EB'#20#233#137#156'='#155#146':'#159#225#247#207'z'#144' '#16#140
|
||||
+#142#142'V'#212#214#214#6#152','#25'(Qnn.'#137'D'#194'4'#26#213#147'"'#189'\'
|
||||
+'"'#131#128#161#231#231#23#176#235#2#230#252#179#149'>_'#211'/'#2#1'n'#203'S'
|
||||
+'SS'#179#26'E'#205'YF'#205#206#190#2#255'"83'#250#162'@&|r'#254'&'#231'j.('
|
||||
+#178#2#11#11's'#30#159#207''''#18',..VUVV'#254'd>'#7#233'r'#153#195#212#208
|
||||
+#196'P'#16#243'.'#193'S'#207#175#187#133#133'o'#223#194'T'#177'&'#16',//'#215
|
||||
+#148#151#151#223'3@Mw@J'#10'A"'#157#130#173#5#193'q'#229'2'#191'TY'#22#24#31
|
||||
+#31#247'ttt'#136#30#172#174#174#190']VV'#182'h'#142#162#255#139#160#243'1'#0
|
||||
+#10#138#206#242#21'3'#201'n'#183'3IiOOOQww'#247#158'@'#16#8#4#222'+--'#253
|
||||
+#222'$'#129'Y'#142#11';'#192#164#137#224'*'#145#147'I'#202#132'r8'#236#252
|
||||
+#219#202#202#202'zooo'#213#220#220'\D XZZ'#250#0'='#184'{Y'#152#154#9#216#161
|
||||
+#230#224#138#10#201'd'#2'o'#1#160'v'#187#141#239'b{{'#251'QWW'#215#29#167#211
|
||||
+#249'5'#202'D'#5#130#137#137#137'"'#12#201#15'u'#31'U'#163#234#215#166#162
|
||||
+#247#249';'#140'0'#197#229'r'#169'8'#27#165#151#149#163#195#195#216#254#254
|
||||
+#254'i('#20#218#192#249#167'ccc'#198#143#13#252#7'P'#234#197'7'#247#18#190'`'
|
||||
+#0#0#0#0'IEND'#174'B`'#130
|
||||
]);
|
106
components/vlc/lclvlc.pp
Normal file
106
components/vlc/lclvlc.pp
Normal file
@ -0,0 +1,106 @@
|
||||
{ <description>
|
||||
|
||||
Copyright (C) 2012 Michael Van Canneyt (michael@freepascal.org)
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version with the following modification:
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent modules,and
|
||||
to copy and distribute the resulting executable under terms of your choice,
|
||||
provided that you also meet, for each linked independent module, the terms
|
||||
and conditions of the license of that module. An independent module is a
|
||||
module which is not derived from or based on this library. If you modify
|
||||
this library, you may extend this exception to your version of the library,
|
||||
but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your 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 Library General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA.
|
||||
}
|
||||
unit lclvlc;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, libvlc, vlc, controls;
|
||||
|
||||
Type
|
||||
|
||||
{ TLCLVLCPlayer }
|
||||
|
||||
TLCLVLCPlayer = Class(TVLCMediaPlayer)
|
||||
private
|
||||
FParentWindow: TWinControl;
|
||||
procedure SetLCLParentWindow(AValue: TWinControl);
|
||||
Protected
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||
Procedure SetParentWindow; override;
|
||||
Procedure SetParentWindowSize(AWidth,AHeight : Cardinal); override;
|
||||
Published
|
||||
Property ParentWindow : TWinControl Read FParentWindow Write SetLCLParentWindow;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{$ifdef Unix}
|
||||
{$ifdef lclgtk2}
|
||||
{$I vlcgtk2.inc}
|
||||
{$endif}
|
||||
{$ifdef lclqt}
|
||||
{$I vlcqt.inc}
|
||||
{$endif}
|
||||
{$endif}
|
||||
|
||||
{ TLCLVLCPlayer }
|
||||
|
||||
procedure TLCLVLCPlayer.SetLCLParentWindow(AValue: TWinControl);
|
||||
begin
|
||||
if FParentWindow=AValue then Exit;
|
||||
If Assigned(FParentWindow) then
|
||||
FParentWindow.RemoveFreeNotification(Self);
|
||||
FParentWindow:=AValue;
|
||||
If Assigned(FParentWindow) then
|
||||
FParentWindow.FreeNotification(Self);
|
||||
end;
|
||||
|
||||
procedure TLCLVLCPlayer.Notification(AComponent: TComponent;
|
||||
Operation: TOperation);
|
||||
begin
|
||||
inherited Notification(AComponent, Operation);
|
||||
if (Operation=opRemove) and (AComponent=FParentWindow) then
|
||||
FParentWindow:=Nil;
|
||||
end;
|
||||
|
||||
procedure TLCLVLCPlayer.SetParentWindow;
|
||||
begin
|
||||
if Assigned(ParentWindow) then
|
||||
begin
|
||||
{$IFDEF UNIX}
|
||||
libvlc_media_player_set_xwindow(Instance, GetXHandle(ParentWindow));
|
||||
{$else}
|
||||
{$IFDEF MSWINDOWS}
|
||||
libvlc_media_player_set_hwnd(Instance, Pointer(ParentWindow.Handle));
|
||||
{$else}
|
||||
{$ERROR This platform is currently not supported by the VLC player component}
|
||||
{$ENDIF}
|
||||
{$endif}
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TLCLVLCPlayer.SetParentWindowSize(AWidth, AHeight: Cardinal);
|
||||
begin
|
||||
end;
|
||||
|
||||
end.
|
26
components/vlc/reglazvlc.pas
Normal file
26
components/vlc/reglazvlc.pas
Normal file
@ -0,0 +1,26 @@
|
||||
unit reglazvlc;
|
||||
|
||||
{$IF FPC_FULLVERSION<20701}
|
||||
{$ERROR needs at least FPC 2.7.1}
|
||||
{$ENDIF}
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, vlc, lclvlc, lresources;
|
||||
|
||||
Procedure register;
|
||||
|
||||
implementation
|
||||
|
||||
Procedure register;
|
||||
begin
|
||||
RegisterComponents('Multimedia',[TLCLVLCPlayer,TVLCMediaListPlayer]);
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$i lazvlc.res}
|
||||
end.
|
||||
|
82
components/vlc/test/frmmain.lfm
Normal file
82
components/vlc/test/frmmain.lfm
Normal file
@ -0,0 +1,82 @@
|
||||
object Form1: TForm1
|
||||
Left = 479
|
||||
Height = 362
|
||||
Top = 224
|
||||
Width = 546
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 362
|
||||
ClientWidth = 546
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
LCLVersion = '1.0.2.0'
|
||||
object PVideo: TPanel
|
||||
Left = 16
|
||||
Height = 285
|
||||
Top = 40
|
||||
Width = 518
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
TabOrder = 0
|
||||
end
|
||||
object FEVideo: TFileNameEdit
|
||||
Left = 56
|
||||
Height = 23
|
||||
Top = 7
|
||||
Width = 374
|
||||
DialogTitle = 'Select a video file'
|
||||
FilterIndex = 0
|
||||
HideDirectories = False
|
||||
ButtonWidth = 23
|
||||
NumGlyphs = 0
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
MaxLength = 0
|
||||
TabOrder = 1
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 16
|
||||
Height = 16
|
||||
Top = 7
|
||||
Width = 31
|
||||
Caption = 'Video'
|
||||
ParentColor = False
|
||||
end
|
||||
object Bplay: TButton
|
||||
Left = 462
|
||||
Height = 25
|
||||
Top = 8
|
||||
Width = 75
|
||||
Anchors = [akTop, akRight]
|
||||
Caption = '&Play'
|
||||
OnClick = BplayClick
|
||||
TabOrder = 2
|
||||
end
|
||||
object BStop: TButton
|
||||
Left = 17
|
||||
Height = 25
|
||||
Top = 331
|
||||
Width = 75
|
||||
Anchors = [akLeft, akBottom]
|
||||
Caption = '&Stop'
|
||||
OnClick = BStopClick
|
||||
TabOrder = 3
|
||||
end
|
||||
object BPause: TButton
|
||||
Left = 102
|
||||
Height = 25
|
||||
Top = 331
|
||||
Width = 75
|
||||
Anchors = [akLeft, akBottom]
|
||||
Caption = '&Pause'
|
||||
OnClick = BPauseClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object BResume: TButton
|
||||
Left = 190
|
||||
Height = 25
|
||||
Top = 331
|
||||
Width = 75
|
||||
Anchors = [akLeft, akBottom]
|
||||
Caption = '&Resume'
|
||||
OnClick = BResumeClick
|
||||
TabOrder = 5
|
||||
end
|
||||
end
|
77
components/vlc/test/frmmain.pp
Normal file
77
components/vlc/test/frmmain.pp
Normal file
@ -0,0 +1,77 @@
|
||||
unit frmmain;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||
EditBtn, StdCtrls, lclvlc, vlc, libvlc;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
Bplay: TButton;
|
||||
BStop: TButton;
|
||||
BPause: TButton;
|
||||
BResume: TButton;
|
||||
FEVideo: TFileNameEdit;
|
||||
Label1: TLabel;
|
||||
PVideo: TPanel;
|
||||
procedure BPauseClick(Sender: TObject);
|
||||
procedure BplayClick(Sender: TObject);
|
||||
procedure BResumeClick(Sender: TObject);
|
||||
procedure BStopClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
FPlayer : TLCLVlcPlayer;
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FPlayer:=TLCLVLCPlayer.Create(Self);
|
||||
FPlayer.ParentWindow:=PVideo;
|
||||
end;
|
||||
|
||||
procedure TForm1.BplayClick(Sender: TObject);
|
||||
begin
|
||||
Fplayer.PlayFile(FEVideo.FileName);
|
||||
end;
|
||||
|
||||
procedure TForm1.BResumeClick(Sender: TObject);
|
||||
begin
|
||||
FPlayer.Resume;
|
||||
end;
|
||||
|
||||
procedure TForm1.BPauseClick(Sender: TObject);
|
||||
begin
|
||||
FPLayer.Pause;
|
||||
end;
|
||||
|
||||
procedure TForm1.BStopClick(Sender: TObject);
|
||||
begin
|
||||
FPlayer.Stop;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
FreeAndNil(FPlayer);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
BIN
components/vlc/test/testlcl.ico
Normal file
BIN
components/vlc/test/testlcl.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
108
components/vlc/test/testlcl.lpi
Normal file
108
components/vlc/test/testlcl.lpi
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="testlcl"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</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"/>
|
||||
<LaunchingApplication PathPlusParams="\usr\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="5">
|
||||
<Unit0>
|
||||
<Filename Value="testlcl.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="testlcl"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="frmmain.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="frmmain"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="..\..\libvlc\libvlc.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="libvlc"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="..\..\libvlc\vlc.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="vlc"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="..\lclvlc.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="lclvlc"/>
|
||||
</Unit4>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="testlcl"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="..\..\libvlc;.."/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerMessages>
|
||||
<MsgFileName Value=""/>
|
||||
</CompilerMessages>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
21
components/vlc/test/testlcl.lpr
Normal file
21
components/vlc/test/testlcl.lpr
Normal file
@ -0,0 +1,21 @@
|
||||
program testlcl;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}
|
||||
cthreads,
|
||||
{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, frmmain, libvlc, vlc, lclvlc, math;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
setexceptionmask([exInvalidOp, exDenormalized, exZeroDivide,
|
||||
exOverflow, exUnderflow, exPrecision]);
|
||||
RequireDerivedFormResource := True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
BIN
components/vlc/test/testlcl.res
Normal file
BIN
components/vlc/test/testlcl.res
Normal file
Binary file not shown.
BIN
components/vlc/tlclvlcplayer.png
Normal file
BIN
components/vlc/tlclvlcplayer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
components/vlc/tvlcmedialistplayer.png
Normal file
BIN
components/vlc/tvlcmedialistplayer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
16
components/vlc/vlcgtk2.inc
Normal file
16
components/vlc/vlcgtk2.inc
Normal file
@ -0,0 +1,16 @@
|
||||
{%MainUnit lclvlc.pp}
|
||||
|
||||
uses gtk2proc, gtk2extra, ctypes, gtk2;
|
||||
|
||||
Function GetXHandle(AWinControl : TWinControl) : culong;
|
||||
|
||||
var
|
||||
Widget: PGtkWidget;
|
||||
begin
|
||||
Result:=0;
|
||||
if (AWinControl=nil) or (not AWinControl.HandleAllocated) then exit;
|
||||
Widget:={%H-}PGtkWidget(AWinControl.Handle);
|
||||
if Widget^.window = nil then exit;
|
||||
Result := gdk_window_xwindow(Widget^.window);
|
||||
end;
|
||||
|
14
components/vlc/vlcqt.inc
Normal file
14
components/vlc/vlcqt.inc
Normal file
@ -0,0 +1,14 @@
|
||||
{%MainUnit lclvlc.pp}
|
||||
|
||||
uses qt45;
|
||||
|
||||
Function GetXHandle(AWinControl : TWinControl) : culong;
|
||||
|
||||
var
|
||||
Widget: PGtkWidget;
|
||||
begin
|
||||
Result:=0;
|
||||
if (AWinControl=nil) or (not AWinControl.HandleAllocated) then exit;
|
||||
Result:=QWidget_winID(TQtWidget(AWinControl.Handle).Widget);
|
||||
end;
|
||||
|
Reference in New Issue
Block a user