Page 1 of 1

Spectrum Analyzer & Joystick Buttons Plugin

Posted: February 16th, 2009, 7:41 pm
by LeoL
I've written a custom hardware driver for my USB LCD and works a treat. Now I'm looking at adding additional functionality.

My LCD is working great with a winamp spectrum analyzer plugin I downloaded off this site, but I'm looking for one that would work directly off Windows audio output. Has anyone made such a plugin?

Since my USB device appears as a standard joystick in windows, I would like to add joystick button controls on my LCD panel for controlling volume, play, pause, etc. Before I attempt to make my own, can LCDSmartie be made to read joystick buttons or is there already a plugin that can do so? I did notice the "Action" tab but it only seems to read keyboard keys.

I welcome any suggestions on the best way to add the option to read joystick buttons and perform actions.

Posted: February 17th, 2009, 12:00 am
by caesar
The usual way to pass buttons is through the display plugin itself.

What language did you code your display plugin in?

Posted: February 18th, 2009, 1:17 am
by LeoL
I'm using C++ in MS VS6.

I've done a little more research wrt reading buttons and found the function DISPLAYDLL_ReadKey in the display driver framework.

I can put my routine in here to read the button inputs, but I can only pass a keyboard key, not commands such as WAPlay, WAStop etc. I'd like to avoid using keyboard mappings since they need to be hardcoded in the display driver and won't work if they are changed in the actions tab in the main app.

Perhaps a SendCommand type function would be a nice addition to the display driver framework.

Posted: February 18th, 2009, 9:34 am
by caesar
Actions are based on keypresses. So assigning characters to keys is vital to know what you have pressed. You can look at it as a byte that corresponds to a letter ;)

You can do an ini file to keep the assignments if you don't want to hardcode them.

Posted: February 18th, 2009, 11:22 am
by mattcro
The idea with buttons on a display module is that the buttons send basic "key codes" to the display control software (LCD Smartie in our case), which decides what to do with the key codes.

On a typical button-equipped LCD, the buttons simply send the ASCII codes for the letters A, B, C, D, etc. Then these are used in LCD Smartie actions to control things like media playback. The actions in Smartie translate the generic "button codes" into meaningful commands like WANextTrack or Exec[c:\shutdown.bat]. The button codes are never used directly by Windows, unlike hotkeys on a multimedia keyboard.

Posted: February 18th, 2009, 10:15 pm
by LeoL
The button codes are never used directly by Windows, unlike hotkeys on a multimedia keyboard.
Ok, that's what I wasn't clear on.
You can look at it as a byte that corresponds to a letter.
I tried a few tests and and I now understand the process better. Yeah, essentially its just a byte command that is sent to the main app and not a key that is injected into the windows keyboard queue.

So I'll be using this solution for the buttons.

Thank you for all the responses.