SneakyAmp Plug-In Version 2.0
Written By Joe Bott - jbott@wi.rr.com

Short Description:

-SneakyAmp will allow you to control Winamp from within other programs. It watches the keyboard, and acts on commands you type between two control strings.

Requirements:
I've personally tested SneakyAmp on Windows 98SE and XP, it should also work on other versions. Besides that, your computer should be able to run Winamp 2. Also, for best functionality your sound card should support multiple sound streams - as most newer cards do. SneakyAmp *will not* work with Winamp 3, not even with the fancy Winamp 2 plugin loader someone wrote.

How to get started and use the beast:

After installation, SneakyAmp should show up in Winamp's general plug-in list. Double-click SneakyAmp's entry to open the Options dialog for the first time.

If you want to use SneakyAmp, you must enable it using the checkbox in the upper corner of the options window

Also, you'll want to change at least one thing, the "Directory 1" entry. Just enter the path to your .mp3's directory. Also, make note of 2 items in the options Dialog:

"Begin Command"
-This is the string you use to start your input to SneakyAmp. It defaults to "winamp". I prefer using "/", but I left the default as "winamp" to not confuse people who still use defaults.

"End Command"
-This is the string you use to end your input to SneakyAmp. This defaults to double quotes (""). Again, not the best choice, but for past users reading the new docs, this was left as the default.

Then just hit OK, and you should be set. Now, to test things out, hit ctrl-shift-1. If you haven't changed the hotkey settings, and everything is working okay, SneakyAmp will run off and scan your hard drive, and play some songs. If not, double check that your mp3 directory is correct, that you've checked the "Enable SneakyAmp" box, and that you actually have some songs to play.

Now, to actually play songs you want, you would type something like:
(Begin Command) play some song(End Command)
-or, with the defaults
winamp play some song""

With this, SneakyAmp will search your mp3 files for an .mp3 with the words "some" and "song" in it. Basically, it will look for filenames that fit the search key "*some*song*.mp3", and play all of those songs in Winamp.

Hotkeys:

Currently there are 15 different hotkeys defined. The first five are similar to Winamp's defauly keys for the main 5 buttons

Ctrl-Shift-Z - Previous Track

Ctrl-Shift-X - Play

Ctrl-Shift-C - Pause

Ctrl-Shift-V - Stop

Ctrl-Shift-B - Next Track

 

The other 10 hotkeys are defined by clicking to Hotkeys button in the options menu. And example, "play * rand 5" for ctrl-shift-1, is already defined. You use the commands explained in the next section.

 

Commands:

play
-plays the songs it finds (Ex: winamp play super freak""), or just hits the Play button (Ex: winamp play"")

 

list
-Opens a m3u file, and starts playing the songs it lists. (Ex: winamp list goodsongs"" )

add
-adds the songs it finds to the playlist (Ex: winamp add super freak"")

stop
-Stops Winamp (Ex: winamp stop"")

pause
-Pauses/Unpauses Winamp (Ex: winamp pause"")

next
-Skips to the next song in the playlist (Ex: winamp next"")

previous
-Skips to the previous song in the playlist (Ex: winamp prev"")

forward
-Jumps forward within a playing song a default amount (Ex: winamp forward"") or a specified amount in seconds (Ex: winamp forward 20”)

rewind
-Jumps backwards within a playing song a default amount (Ex: winamp rewind"") or a specified amount in seconds (Ex: winamp rewind 20"")

volume
-Sets Winamp’s volume to a value from 0 to 255 (Ex: winamp volume 100"")

balance
-Sets Winamp’s balance to a value from -127 to 127 (Ex: winamp balance 0"")

shuffle
-Manipulates Winamp’s shuffle button. Either toggles it (Ex: winamp shuffle""), turns it on (Ex: winamp shuffle on""), or turns it off (Ex: winamp shuffle off"").

repeat
-Manipulates Winamp’s repeat button. Either toggles it (Ex: winamp repeat""), turns it on (Ex: winamp repeat on""), or turns it off (Ex: winamp repeat off"").

random
-Used in conjunction with the add or play command, picks a specified number of songs to play out of all the matches (Ex: winamp play * rand 10"" (plays any 10 random songs), winamp play jump rand 5"" (plays 5 randomly picked songs that have 'jump' in the filename))

Trickier features:

The Directory prefix
-Used in conjuction with the add and play commands for specifying which directory to search in. For example, to play all the song in the directory ‘Frank’: winamp play * -frank"". Or, to play a random 10 songs in the ‘Big Shoe’ directory with ‘the’ in the filename: winamp play the rand 10 -big -shoe"". Yeah, its tricky, but you’ll get it. :)

The 'Assume MP3 extenstion' checkbox
-All this checkbox in the options does is add .mp3 to your search key when using the add or play command. For example, with the box checked `winamp play bean""will search for *bean*.mp3. Without the box checked it will search for *bean*.* . Not really a tricky feature, but I didn’t know where to put it. :)

The Partial Command Feature
-Wow, thats a bad name for a feature. Anyways, this just means that you dont have to type in the whole command. For example, with the default settings, 'winamp play""', 'winamp pl""', and 'winamp ay""' all do the same thing. This is quite handy for shortening command names once you've got the hang of SneakyAmp...

Miscellaneous:

I have no idea what this program will do on non-English, non-American keyboard. SneakyAmp only tracks the following characters:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()`~-=[]\;',./_+{}|:"?>< and Enter
It also makes some assumptions about the placement of certain characters (Ex: shift 3 = #, not £ like on British keyboards (or so I've been told))

Things to take care of in future versions:

-Fix all the bugs I'm sure people will find
-Probably add more functions. Maybe an Add List function, but I dont know what I'd call it...

-See about adding volume changing hotkeys. Its hard to get Winamp's current volume, so I cant tell winamp to, for example, move the volume up by 10. I may just fake it.

-See about making the hotkeys more customizable, like letting you use alt-F1 instead of ctrl-shift-1. If anyone knows how to use the CHotkey control box in a non-MFC dialog, or how to create a MFC dialog from within a non-MFC DLL, or how to create a Winamp 2 plugin completely in MFC, let me know! Probably not worth the effort. :)

-Clean up options menu some.
-Get the dang snkyamphook.dll out of Winamp’s base directory and into the plugin directory. Still don’t know why that wont work...

-Look into supporting Winamp 3. I'll wait until they actually publish some documentation beyond lists of function names though. But so far I dont even know if I can get Windows Messages from Winamp 3
-Clean up my messy code
-Rewrite the docs to include everything that I'm forgetting...
-Probably more...

Version History:

V2.0beta - Added hotkeys and list command. Cleaned things up a lot

V1.0c - Fixed problem with Windows XP
V1.0 - Got all functions working properly (I hope)
Added ‘About’ dialog
Rewrote command handling routines to make my life easier
Finally rewrote these docs
V 0.7 - Rewrote the whole dang thing, making it a Winamp plug-in
Got basic functions working
Quick PIMPed it and put it on my webspace for someone who was looking for a new version.
V 0.5 - First kinda public release. I only told a handful of people about it, somehow lots more found it. :)


Disclaimer:
I take no responsibilty if this program somehow erases your hard drive, blows up your monitor, makes your sound card smell funny, or otherwise mess up your system in any way. This program is in the beta stages, so use it at your own risk. I've done everything I can to ensure it wont do anything strange, but I'm (still) new to Windows programming and I want to cover my ass.


If you play EQ, stop by Veeshan and say "Hi!" to Nalinie. Thats me. :)