Old 23rd July 2013, 23:35   #1
bjohnso5
Junior Member
 
Join Date: Jul 2013
Posts: 3
Feasibility Check

Hey, I'm a long time Winamp user, and I'm a developer by trade (but I haven't touched C++ in years, and only then in school), but I've not attempted to write a plugin previously.

I'm posting here to get feedback regarding the feasibility of what I'd like to accomplish with a plugin, and I'm hoping someone can point me in the right direction.

I've been experimenting with a Philips Hue LED starter kit, which are programmable LEDs controlled with a basic REST API. I've attempted to get a halfway decent system rigged up to make them change color in reaction to detected beat events in music, with mixed success. I had a basic HTML5 "media player" app set up, doing beat detection in javascript, but the interface is super clunky, and doesn't provide a good "party" vibe since it requires a lot of manual intervention.

I'd like to implement this functionality within winamp, as it already has excellent playlist, shuffle, visualization, etc. support.

What I've not been able to get a good handle on so far is what type of plugin this would be considered. I realize it's not a visualization, per se, but it sort of seems to be that it fits what a visualization does.

Anyways, if anyone out there can give me a few quick tips, it'd be appreciated. I have 5.55 SDK and I'm in the process of dusting off my C++ books to try to make some sense of it.

If you need any more info about what I'm planning, please let me know!
bjohnso5 is offline   Reply With Quote
Old 24th July 2013, 04:42   #2
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,970
Send a message via Skype™ to thinktink
Quote:
Originally Posted by bjohnso5 View Post
...fits what a visualization does...
I would agree. I've never done up a vis plugin but I've taken a cursory look at the API (about a year ago) and it does seem to be the most suitable for this project.
thinktink is offline   Reply With Quote
Old 24th July 2013, 22:49   #3
bjohnso5
Junior Member
 
Join Date: Jul 2013
Posts: 3
Thanks for pointing me in the right direction! Any chance you have any tips about the best place for me to track down the visualization plugin API? The SDK doesn't seem to include any visualization examples (unless I'm just looking in the wrong spot).
bjohnso5 is offline   Reply With Quote
Old 25th July 2013, 17:27   #4
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,970
Send a message via Skype™ to thinktink
Quote:
Originally Posted by bjohnso5 View Post
...track down the visualization plugin API? The SDK doesn't seem to include any visualization examples (unless I'm just looking in the wrong spot).
API: ..\Winamp SDK\Winamp\VIS.H
Example: None

You'll probably have to learn the dynamics of Input plugins to figure out the dynamics although the API seems fairly straight forward. Just take a whack at it and if you have any problems, post back.
thinktink is offline   Reply With Quote
Old 25th July 2013, 17:35   #5
DrO
 
Join Date: Sep 2003
Posts: 27,873
there was a simple vis plug-in in the sdk (unless it was removed since i last looked) otherwise you'd have to look at the milkdrop / avs source code. and api documentation has historically been crap and mainly based on looking at working plug-ins.

though i'd probably go with a general purpose plug-in as that makes it a lot easier to access things compared to the variable loading which a vis plug-in is subject to. plus if you need audio data to process, then the general purpose plug-ins can get a small sample of it (is what the modern skin engine does) which can be found in wa_ipc.h.
DrO is offline   Reply With Quote
Old 25th July 2013, 18:24   #6
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,970
Send a message via Skype™ to thinktink
Quote:
Originally Posted by DrO View Post
there was a simple vis plug-in in the sdk (unless it was removed since i last looked)...
It looks like it has been removed (or accidentally not included.)

Quote:
Originally Posted by DrO View Post
...general purpose plug-ins can get a small sample of it (is what the modern skin engine does) which can be found in wa_ipc.h.
Are you talking about IPC_GETSADATAFUNC and IPC_GETVUDATAFUNC? If so, I thought they were just for VU control and VU data?

For the dynamic loading issue, I conjured a Windows API hack, have the plugin LoadLibrary(W) itself on the first load to increase the loaded library ref count. That way when Winamp calls FreeLibrary the OS doesn't remove the library from Winamp's address space, which then means you can /class windows and retain persistent data. Only problem with this hack is that the library has to remain loaded (even if you don't /class) for the remainder of the Winamp instance life-span since a library unloading itself will cause problems (calling FreeLibrary inside the library code itself will basically "free" the library code before the call to FreeLibrary returns rending the current execution state invalid (very not good.))
thinktink is offline   Reply With Quote
Old 26th July 2013, 18:44   #7
bjohnso5
Junior Member
 
Join Date: Jul 2013
Posts: 3
I think right now my plan will be to bundle bass.dll and bass_fx.dll to do the beat detection and stuff, but I'm really still in the planning / design stages at this point.

I've got a basic visualization plugin loading now, and I can see that it's responding to the init and config events.

My next issue will be getting a library working to send the HTTP requests out to the Hue bridge. Do you guys have any suggestions for a decent library for that? As I mentioned before, I have basically zero C/C++ experience.
bjohnso5 is offline   Reply With Quote
Old 12th August 2013, 21:47   #8
teddywindos
Junior Member
 
Join Date: Aug 2013
Posts: 1
Hello,
I am a user of Philips Hue system and your project light in time with the music greatly interested me.

Unfortunately I do not know programming, but if you need a tester or if your project is completed ... I'm leaving.

Hoping that the project is still valid.

Thank you in advance and good luck
teddywindos is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > Winamp Development

Tags
hue, visualization

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump