Page 1 of 1

Controlling VLC ActiveX using Delphi

Posted: 15 Nov 2005 17:24
by jessi
Hi there!

The VLC ActiveX can now be used within Delphi (Design- & Runtime)

I figured AddTarget is used to add media to the VLC playlist.

E.g. (C#):
axVLCPlugin1.addTarget("C:\\test.avi", null, AXVLC.VLCPlaylistMode.VLCPlayListInsert, 0);

The problem is the "AXVLC.VLCPlaylistMode.VLCPlayListInsert".

This switch is called "Mode" (Type is OleEnum)

Can anyone tell me how to typecast/replace this segment of the comand so I can add stuff to my playlist?

(VLC-ActiveX-Designtime-Object does not have a "VLCPlaylistMode" in the object's functions/methods/variables list)


Thank you so much!!

-Jessi

Posted: 15 Nov 2005 19:13
by jessi
Here is the answer:

// Constants for enum VLCPlaylistMode
type
VLCPlaylistMode = TOleEnum;
const
VLCPlayListInsert = $00000001;
VLCPlayListReplace = $00000002;
VLCPlayListAppend = $00000004;
VLCPlayListGo = $00000008;
VLCPlayListCheckInsert = $00000010;


var ovOptions: OleVariant;

// From VB example
ovOptions:=VarArrayOf([':snapshot-path=c:\snapshots', ':input-repeat=1']);
VLCPlugin1.addTarget('c:\myvideos\video.mpg', ovOptions, VLCPlayListAppend or VLCPlayListgo, -666);

Posted: 16 Nov 2005 08:42
by mokdevel
Here is the answer:
// Constants for enum VLCPlaylistMode
Any chance you could post a copy/paste example for the other struggling Delphi coders?

Posted: 17 Nov 2005 12:10
by jessi
The Delphi-example is right right on top of your message. I posted it in my answer statement.

Posted: 17 Nov 2005 13:29
by mokdevel
The Delphi-example is right right on top of your message. I posted it in my answer statement.
Yes, you're correct. I can manage myself with the information there. For the ones starting their strugg... umm.. coding a nice zip with a working project and such would be great.

Thanks anyway for sharing the lines up there!

Posted: 18 Jan 2006 11:52
by Hogi

Code: Select all

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, AXVLC_TLB; type TForm1 = class(TForm) Button1: TButton; vlc: TVLCPlugin; procedure Button1Click(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end; type VLCPlaylistMode = TOleEnum; const VLCPlayListInsert = $00000001; VLCPlayListReplace = $00000002; VLCPlayListAppend = $00000004; VLCPlayListGo = $00000008; VLCPlayListCheckInsert = $00000010; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin vlc.addTarget('C:\video.mpg', null, VLCPlayListInsert, 0); vlc.play; end;
Works fine :)

Re: Controlling VLC ActiveX using Delphi

Posted: 16 Apr 2008 07:05
by Themasteratdelphi
The 'Flags' as they are called are pre-declared within one of the units for the vlcplugin. To see these simply press ctrl + left click on the flag you already have in playlist mode, think you have VLCPlaylistInsertAndGo but i cant see it. anyway this will take you to the correct unit and line where this flag is delcared along with the others it looks like this:

Code: Select all

type VLCPlaylistMode = TOleEnum; const VLCPlayListInsert = $00000001; VLCPlayListInsertAndGo = $00000009; VLCPlayListReplace = $00000002; VLCPlayListReplaceAndGo = $0000000A; VLCPlayListAppend = $00000004; VLCPlayListAppendAndGo = $0000000C; VLCPlayListCheckInsert = $00000010;


these are pre-declared so all you have to do is type there names and the plugin will recieve the correct flag. These can be used as flags in the usual way, ie with logical operators to do more than one thing or definatly not something. For more information on delphi and indeed flags which are used often in programming i recommend reading http://www.delphi.about.com this will show you all the basics of delphi and all the advanced stuff right up to opengl.

note: by pre-declared i mean you dont have to retype what is above at the start of the unit, just use the them, it will work i promise

hope this helps!