Controlling VLC ActiveX using Delphi

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
jessi
New Cone
New Cone
Posts: 6
Joined: 15 Nov 2005 17:15

Controlling VLC ActiveX using Delphi

Postby jessi » 15 Nov 2005 17:24

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

jessi
New Cone
New Cone
Posts: 6
Joined: 15 Nov 2005 17:15

Postby jessi » 15 Nov 2005 19:13

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);

mokdevel
Blank Cone
Blank Cone
Posts: 36
Joined: 21 Apr 2005 13:53
Contact:

Postby mokdevel » 16 Nov 2005 08:42

Here is the answer:
// Constants for enum VLCPlaylistMode
Any chance you could post a copy/paste example for the other struggling Delphi coders?

jessi
New Cone
New Cone
Posts: 6
Joined: 15 Nov 2005 17:15

Postby jessi » 17 Nov 2005 12:10

The Delphi-example is right right on top of your message. I posted it in my answer statement.

mokdevel
Blank Cone
Blank Cone
Posts: 36
Joined: 21 Apr 2005 13:53
Contact:

Postby mokdevel » 17 Nov 2005 13:29

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!

Hogi

Postby Hogi » 18 Jan 2006 11:52

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 :)

Themasteratdelphi
New Cone
New Cone
Posts: 6
Joined: 16 Apr 2008 06:11

Re: Controlling VLC ActiveX using Delphi

Postby Themasteratdelphi » 16 Apr 2008 07:05

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!


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 1 guest