View Full Version : Documentation for plugin authors?
NogginBoink
11-05-2007, 03:11 PM
I know I saw this (at least, I think I did) but can't find it.
If I want to write a plug in for the "Help the newbie" thread here, where's the documentation for the API?
NogginBoink
11-05-2007, 03:32 PM
Never mind. Found it. http://www.vixenlights.com/files/, click on the Programmer's Guide.
NogginBoink
11-05-2007, 03:52 PM
Hm.... the documentation for the HardwareMap class doesn't seem to match the code.
What should I return for the hardware map for a device on a USB bus? There could be multiple instances of this hardware on the bus as well.
flowblok
11-06-2007, 12:32 AM
Unless I'm wrong, that's the documentation for Vixen 1.1.
If you use the SharpDevelop IDE, it lets you autogenerate code for things like Hardware map. I think that MS Visual Studio also has that feature somewhere.
Hardware map is an array of type HardwareMap, so you need to return a new HardwareMap[], containing all the hardware that you use.
Since Vixen 2.0 (I think), the HardwareMap class takes a string and an integer as it's arguments. The string in your case would be "USB", and the number would be some specific number indicating which usb device you are using. It's not actually used for anything other than showing conflicts to the user. If you are low on time, you could just return an empty array.
Your code would look like this:
public Vixen.HardwareMap[] HardwareMap {
get {
// Where this.usbDeviceNum is a unique identifier for the usb device. NB the semi-colon positions.
return new Vixen.HardwareMap[] {
new Vixen.HardwareMap("USB", this.usbDeviceNum)
};
}
}
I think it could also be done in a one-liner.
teberle
11-06-2007, 08:37 AM
I haven't worked much with USB devices and I am curious on the enumeration of the device. I had heard in the past that this was hard to deal with since they could change.
NogginBoink
11-06-2007, 09:24 AM
teberle,
Enumeration of USB devices can indeed be a strange beast. AFAIK, they won't change unless the device is unplugged and plugged back in, however.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.