summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2015-02-20 15:22:48 +0000
committerGraeme Geldenhuys <graemeg@gmail.com>2015-02-20 15:22:48 +0000
commit88e60d1c664c1f73c1e3855e711c5e5ba0becfa2 (patch)
tree863d95b835a14b6b296eaae9bdf453f7467ba22b
parent58fbaf95ad23b3b3393d172cbee6cc0eea5611d9 (diff)
downloadfpGUI-88e60d1c664c1f73c1e3855e711c5e5ba0becfa2.tar.xz
VLC demo: show time lapse and selection dialog now supports audio files
-rw-r--r--examples/gui/video_vlc/frmvlcplayer.pas28
-rw-r--r--examples/gui/video_vlc/testfpguivlc.lpi7
2 files changed, 27 insertions, 8 deletions
diff --git a/examples/gui/video_vlc/frmvlcplayer.pas b/examples/gui/video_vlc/frmvlcplayer.pas
index aeea3e0c..48429e5b 100644
--- a/examples/gui/video_vlc/frmvlcplayer.pas
+++ b/examples/gui/video_vlc/frmvlcplayer.pas
@@ -23,14 +23,17 @@ type
Button3: TfpgButton;
Button4: TfpgButton;
Memo1: TfpgMemo;
+ lblTimeLapse: TfpgLabel;
{@VFD_HEAD_END: VLCPlayerDemo}
procedure Sync;
+ procedure DoGUIUpdateTimeLapse;
public
P : TFpgVLCPlayer;
FMsg: String;
procedure AfterCreate; override;
Procedure InitPlayer;
Procedure Log(Const Msg : String);
+ Procedure UpdateTimeLapse(const Msg: String);
Procedure DoPlay(sender : TObject);
Procedure DoPause(sender : TObject);
Procedure DoResume(sender : TObject);
@@ -145,6 +148,7 @@ procedure TVLCPlayerDemoForm.DoOnTimeChanged(Sender: TObject;
const time: TDateTime);
begin
Log('Time changed : '+TimeToStr(Time));
+ UpdateTimeLapse(TimeToStr(time));
end;
procedure TVLCPlayerDemoForm.DoOnSnapshot(Sender: TObject;
@@ -167,6 +171,7 @@ begin
SetPosition(424, 319, 813, 574);
WindowTitle := 'VLCPlayerDemo';
Hint := '';
+ IconName := '';
Panel1 := TfpgPanel.Create(self);
with Panel1 do
@@ -187,7 +192,7 @@ begin
Anchors := [anLeft,anRight,anTop];
ExtraHint := '';
FileName := '';
- Filter := 'Video files|*.avi;*.flv;*.mp4';
+ Filter := 'Video files|*.avi;*.flv;*.mp4;*.mkv|Audio files|*.mp3;*.acc;*.flac;*.ogg';
InitialDir := '';
TabOrder := 2;
end;
@@ -269,6 +274,16 @@ begin
TabOrder := 8;
end;
+ lblTimeLapse := TfpgLabel.Create(self);
+ with lblTimeLapse do
+ begin
+ Name := 'lblTimeLapse';
+ SetPosition(30, 510, 105, 15);
+ FontDesc := 'Liberation Sans-12:bold:antialias=true';
+ Hint := '';
+ Text := 'Label';
+ end;
+
{@VFD_BODY_END: VLCPlayerDemo}
{%endregion}
end;
@@ -306,12 +321,23 @@ begin
Memo1.Lines.Add(FMsg);
end;
+procedure TVLCPlayerDemoForm.DoGUIUpdateTimeLapse;
+begin
+ lblTimeLapse.Text := FMsg;
+end;
+
procedure TVLCPlayerDemoForm.Log(const Msg: String);
begin
FMsg:=Msg;
TThread.Synchronize(Nil,@Self.Sync);
end;
+procedure TVLCPlayerDemoForm.UpdateTimeLapse(const Msg: String);
+begin
+ FMsg := Msg;
+ TThread.Synchronize(nil, @self.DoGUIUpdateTimeLapse);
+end;
+
procedure TVLCPlayerDemoForm.DoPlay(sender: TObject);
begin
InitPlayer;
diff --git a/examples/gui/video_vlc/testfpguivlc.lpi b/examples/gui/video_vlc/testfpguivlc.lpi
index 7839f71a..5a13551b 100644
--- a/examples/gui/video_vlc/testfpguivlc.lpi
+++ b/examples/gui/video_vlc/testfpguivlc.lpi
@@ -42,7 +42,6 @@
<Unit0>
<Filename Value="testfpguivlc.lpr"/>
<IsPartOfProject Value="True"/>
- <UnitName Value="testfpguivlc"/>
</Unit0>
<Unit1>
<Filename Value="frmvlcplayer.pas"/>
@@ -76,12 +75,6 @@
<OtherUnitFiles Value="../../../src/3rdparty/libvlc"/>
<UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
- <Other>
- <CompilerMessages>
- <MsgFileName Value=""/>
- </CompilerMessages>
- <CompilerPath Value="$(CompPath)"/>
- </Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">