Notifications
Clear all

API for Vixen?

12 Posts
5 Users
0 Reactions
5,350 Views
Posts: 10
Topic starter
(@nofew)
Active Member
Joined: 14 years ago
[#23676]

Is there an API for Vixen to communicate with other programs? I have a series of LED's mounted in my laptop's case that can be animated, but the commands have to be passed through a .dll. I'd like to write a program that listens for Vixen's commands and handles the LED's for it, but I can't find any mention of there being an API in Vixen.

If there's not, is there a page somewhere explaining how to write output plugins? Preferably in C? I can't handle .net. It's big, scary and weird. And scary.

If that won't work, is there some way to make a virtual serial port and have /that/ pass my program Vixen's commands? At least then I could use the generic serial plugin..


11 Replies
LabRat
Posts: 2975
(@labrat)
Famed Member
Joined: 17 years ago

The short answer is "yes there is".

I don't have the links handy, but you could try googling "Vixen Plugin-in Development"


Reply
Posts: 10
Topic starter
(@nofew)
Active Member
Joined: 14 years ago

Got a reply in chat. The page's at http://doityourselfchristmas.com/wiki/index.php?title=Vixen_Plugin_Development . Too bad it has to be written in C#.

Now I just gotta find someone that'll pretty much do all the work for me. I only know C, and C#'s too weird for me to work with. x.x


Reply
LabRat
Posts: 2975
(@labrat)
Famed Member
Joined: 17 years ago

C# isn't *that* far off from C. I had never done C# before, but within a couple of days had my first Vixen plugin running.
Start with the parallel port plugin, and modify to suit your needs.


Reply
Posts: 2167
(@djulien)
Noble Member
Joined: 19 years ago
Nofew wrote:If there's not, is there a page somewhere explaining how to write output plugins? Preferably in C? I can't handle .net. It's big, scary and weird. And scary.

Vixen 2.x is a .NET 2 Windows app. Vixen's plug-in API provides a few hooks so if you write a DLL that implements those particular functions, Vixen can call it during Sequence playback. If you search for "plug-in development" or terms like that you will likely find some info about that.

A better source of documentation is actually the source code for any of the plug-ins. Choose one that is similar to what you want to do, then disassemble it or ask someone to disassemble it for you and then you can look at and/or modify the source code to do what you want.

If you really want to work in C it can be done, but it will be a little awkward. You (or someone else) would need to create a "wrapper" plug-in written in a .NET language that implements the plug-in API functions (so Vixen can call it), and then add a call in that new plug-in to call your C DLL.

OTOH, depending on how your LEDs are wired you might be able to use one of the existing plug-ins. For example, there are generic serial and parallel port plug-ins that can be used to control external devices such as relays or LEDs if they are wired in a compatible way.

LabRat wrote:C# isn't *that* far off from C.

For syntax, that is mostly true. For the run-time behavior, it is *very* different, because .NET is a layer (several, actually) above that and implements a virtual machine similar to Java, etc.

don


Reply
Posts: 2210
Posts: 138
(@jeffro)
Estimable Member
Joined: 16 years ago
Nofew wrote:Got a reply in chat. The page's at http://doityourselfchristmas.com/wiki/index.php?title=Vixen_Plugin_Development . Too bad it has to be written in C#.

Now I just gotta find someone that'll pretty much do all the work for me. I only know C, and C#'s too weird for me to work with. x.x

Actually, dotnet language implementations compile to an intermediate language that allows languages to share libraries. So, a Visual Basic application can use code written in C#, a C# application can use a C++ library, etc. Sort of like cross-language bytecode. C# is just object-oriented syntax that has a bunch of libraries with it and lives in a runtime framework. It's not *that* scary or weird.

If you're wanting to drive your lights through Vixen, it's going to execute in the dotnet runtime framework. You probably don't want to write to an API which runs inside that sort of framework if you want to avoid it in the first place.

If you want to avoid C#, you could use Visual C++ (closest thing to C you'll find in the dotnet stack) and implement the interfaces needed for the Vixen plugins. It should still work as a plugin.


Reply
Posts: 10
Topic starter
(@nofew)
Active Member
Joined: 14 years ago
djulien wrote:
For syntax, that is mostly true. For the run-time behavior, it is *very* different, because .NET is a layer (several, actually) above that and implements a virtual machine similar to Java, etc.

That's the main issue. The way it works behind the scenes is so different that I don't even recognize the syntax. I think really, really low-level. It took me a few weeks to use a simple shift register because I couldn't figure out how it was able to control 12 volts with a 5 volt vcc. I couldn't even read code someone else wrote (and worked fine) until I was reminded transistors exist.

The same thing happens with any language out there. The highest-level language I can work with is C. I've tried quite a few other (C++, C#, .net, D, Ruby, Python, probably missing some..) but nothing else works. I don't usually have a need to learn them anyway -- Normally I'm programming AtTiny's. Can't fit a whole lot in 128 bytes of RAM.

So yeah, pretty much I'm just stuck asking around for someone else to do the plugin for me. Luckily I don't need this anytime soon.


Reply
Posts: 2167
(@djulien)
Noble Member
Joined: 19 years ago
Nofew wrote:So yeah, pretty much I'm just stuck asking around for someone else to do the plugin for me. Luckily I don't need this anytime soon.

If you could post info about how the LEDs are wired, someone could tell you if one of the existing plug-ins could control them without needing to write a new one.

don


Reply
Posts: 10
Topic starter
(@nofew)
Active Member
Joined: 14 years ago

There's four USB ports on the laptop but five headers on the motherboard or something. One of those headers runs to a device inside the laptop that controls the LED's. Controlling it requires the use of a proprietary .dll supplied with the system. There is no information about /how/ the device actually works shipped to customers; all anyone besides Dell employees know is "Call the DLL, magical stuff happens". Apart from that, Windows just registers it as a "human interface device".

In other words, I'm fairly sure no existing plugin is going to work. I'd be happy to be proven wrong, though.


Reply
Page 1 / 2
Share: