Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Spectrum Analyzer & Joystick Buttons Plugin

Discussing issues that occur during plugin development.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
LeoL
Posts: 5
Joined: December 6th, 2007, 11:13 pm

Spectrum Analyzer & Joystick Buttons Plugin

Post 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.

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Post by caesar »

The usual way to pass buttons is through the display plugin itself.

What language did you code your display plugin in?

LeoL
Posts: 5
Joined: December 6th, 2007, 11:13 pm

Post 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.

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Post 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.

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post 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.

LeoL
Posts: 5
Joined: December 6th, 2007, 11:13 pm

Post 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.

Post Reply