What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] VLC API

[?] VLC API
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. [?] VLC API
There are 2 DLLs that come with VLC (one optional) that cotain it's own (fairly limited) API. I don't seem to be able to use either as I don't know if it's a mistake I'm making in the code or if it's just not possible in JScript. I know it's possible by embedding VLC into a HTML page(using JavaScript to control it), but this isn't really any good for what I want.

Can anybody offer any advice on a way of getting it working? (if possible, I've seen loads of Delphi, Python and C tutorials that just go straight over my head)
<Eljay> "Problems encountered: shit blew up" :zippy:
12-25-2006 01:27 AM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: [?] VLC API
quote:
Originally posted by SpunkyLoveMuff
Can anybody offer any advice on a way of getting it working? (if possible, I've seen loads of Delphi, Python and C tutorials that just go straight over my head)
link to any of them?, and ill help you do it
[Image: dt2.0v2.png]      Happy Birthday, WDZ
12-25-2006 02:11 AM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] VLC API
What exactly are you trying to do?
12-25-2006 02:11 AM
Profile E-Mail PM Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: [?] VLC API
quote:
Originally posted by SpunkyLoveMuff
C tutorials that just go straight over my head)

Translating C is not easy, but I think it should be possible in a lot of cases. For example all windows api calls (as normal functions in C) can be done in JScript, and using structs can be done in JScript, etc... What part troubles you?
12-25-2006 12:11 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. RE: [?] VLC API
Example written in C

Thanks for offering to help guys

@Matty: At the moment, I'm just seeing what is possible, but I do have a few ideas.
<Eljay> "Problems encountered: shit blew up" :zippy:
12-25-2006 01:13 PM
Profile PM Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: [?] VLC API
That's C# and not C! Ok, it's of course no coincidence that the language was named C#, but it actually is different;).

As far as I can see it will not be very hard to translate this. I have not tested this, but it should be something like:

code:
var DllPath = "libvlc.dll"; // the full path to your dll

function VLC_Create() {
   return Interop.Call(DllPath, "VLC_Create"); // Interop expects an int
}

function VLC_TimeSet(/*int*/ iVLC, /*int*/ Seconds, /*bool*/ Relative) {
   return Interop.Call(DllPath, "VLC_TimeSet", iVLC, Seconds, (Relative?1:0));
}

// [...]



This way you should be able to create wrapper functions for all functions in the dll. Some points to notice:
ints (or Numbers in JScript) can be passed directly through interop.call
ref ints can be passed by assigning a 4 bytes databloc, use WriteDWORD to write the number on position 0 and then pass the datablocs pointer. After the function returns, you can read the int again.
bool's should be casted to 0 (=false) or 1 (=true)
strings can be passed directly, plus automatically passes the pointer
I'm not sure about the string array, maybe you can pass it directly, else you will have to use a databloc of size (total characters in the array strings) + (number of strings * 2).
Error, Mode and Pos can be seen as an int, just use the values described in their enums.
The structure will be the only hard part, use a databloc for that. Add the sizes and write the types to the right part of the bloc. I don't know the sizes of the types by heart, so can't give you those now, maybe I can help with that later, or maybe (I hope so) you can figure it out yourself. Int32 means 32 bits = 4 bytes, so Int64 = 8 bytes, not sure about the rest:P

Anybody correct me if I am wrong here, this is it in a nuttshell, I am doing this all right out of my head (I am not sure if that is correct english, but at least the dutchies will get what I say there :P) so there might be some mistakes. It should at least point you in the right direction!

This post was edited on 12-25-2006 at 11:48 PM by J-Thread.
12-25-2006 11:47 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. RE: [?] VLC API
Thanks J-Thread, I'll give it a try first thing tomorrow and let you know :p
<Eljay> "Problems encountered: shit blew up" :zippy:
12-26-2006 02:22 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On