Sexy Attached Analyzers v1.61

Copyright (c) 1998 Mike Lynch

I'm looking for work programming in C or C++, preferably Windows 32bit

web page: http://web.ionsys.com/~hawk/winamp/
email: hawk@ionsys.com

The next best thing to listening to music is watching it.

This plugin is free for everyone not working for Geffen Records.

NOTE TO AUTHORS OF WINAMP SKINS
Please ask me berfore just bundling my plugin with your skin.  If you do
bundle my analyzer with a skin you must include this text file.  Also,
would it be too much to ask if you gave me some credit for making the
most configurable spectrum analyzer?

Currently the only mods are "classic" fully configurable spectrum analyzers.
(so I guess it's not really a classic analyzer since it can be coloured and
styled in approximately an infinite number of ways :))

Features to come?
- any trippy effects I can dream up
- check the web page for an up to date suggested feature list and feel free
  to share your ideas with me.

Notes:
- Need at least a High Colour (16 bit) display, preferably higher
  (though it does work on 8 bit displays, all colouring is 24 bit)
- With the high CPU usage modules you may have to experiment with the Plugin
  Priority settings (try setting all of them to normal)
- 2 files are used to save the settings and profiles, a .INI & .DAT file
  (I found out the hard way too much data was being jammed into the INI files)
- The Current Settings are saved under a profile called Current Settings :)
- Try setting the Plugin Priority to Normal (or higher) for better performance
- The Reflection Waves effect is not compatible with the grid background styles
  when the horizontal spacing is greater than 0 (so yeah, you can't really
  have a background grid if you want the waves)
- The word Sexy might be misleading :)

Usage Notes:

Right Click on the Analyzer to pop up a pop-up menu. :)

If you choose to attach to nothing then the width of the window can be changed
by dragging the left and right sides of the window.  If you are having a hard
time because your mouse pointer tends to disappear, then stop the music from
playing to make the adjustment.

Don't bother reading anymore unless you really can't figure something out.
Just start playing and you'll see how everything works.
Or maybe you want to jump to the Advanced Notes to learn a little more about
the plugin and the files it generates.

I'm only going to explain what I think might need explaining.

Current Settings:
As mentioned above, the Current Settings profile holds your 'current' or
default settings that get loaded when the plugin starts.  You are not allowed
to delete the Current Settings (it'll just come back, if you really believed
that it left in the first place).  The Current Settings gets saved when
you click OK or move to or from the Profiles tab.  The Current Settings are
fetched when you click Cancel.

Leveling Functions:
The values are stored as integers, so you'll notice rounding errors when going
nuts with adding and averaging functions.  Click Set to set the curve to the
selected function.  Add will add the selected function to the current curve.
Average will average the selected function with the curve.
The level base option selects how the base value for each bar is calculated.
(yeah, I know, like that helped you understand anything)  Average averages
all the frequency values that the bar is representing.  Union finds the
highest value and uses it (resulting in a more responsive display).

Style:
The Solid Colour background uses colour 0 of the Background Flash colour ramp.
Hit the Random button to assign random styles.  The random bar style is not
really a style.  It simply randomly assigns the existing styles.  If Flash
Grid is used for a background style, the Background Flash colour ramp is used
to draw the grid, there's no actual flashing.  The Background Grid styles
won't actually look like grids unless vertical and horizontal spacing is at
least 1 pixel.

Colour Factory:
Select the Set of colours you want to modify (Bars, Peak Indicators or
Background Flash).  Set the right and left sliders to different positions and
set the colours at both positions to different colours (or use the same colour
if you want to be boring) and click Fade for an instant colour ramp.

Idea: If you're having trouble creating nice colours, try clicking Total Random
and use Fade to fade over top of the colours you don't like.

With the border colours you can click Guess Colours to try and match the
border colours of WinAmp (or your WinAmp-plugin-compatible player).  Keep
clicking to keep guessing.


Advanced Notes:

If you insist on text editing the INI file do not delete or renumber the
profile index ordering.  The DAT file is simply kept in order according to the
profile index.  Likewise do not change the Number of Profiles entry.

The DAT file holds the function tables and colour tables.  All other values are
stored in the INI file.

If you're interested in building your own editor for functions and/or colours,
contact me for the DAT file format.

It's theoretically possible to make up your own custom colouring styles for the
bars and peak indicators.  I just can't think up a way of making a simple to
use editor, so only the built in styles can be used for now.  If anyone is
interested in taking this plugin to this next step of customizability(?) then
let me know.  If you simply have an idea for a colouring style, let me know
and I can try and add it in.  All the above is true for the peak indicator
motion as well.


Credits and whatever:

Thanks to Erik Briggs (and his roomate using BackAmp) for testing.
The MP3 Asylum - This site just rocks! Unfortunately it's kinda gone :(
Also thanks to everyone running free (no-ratio) servers. 
Layer3.org - Providing screenshots and a short blurb about each plugin
MP3.com - What does it take to get a 5 smiley rating for a plugin?
Steve Waxman (publicity manager for Warner Music Canada) - you have no clue eh?
All record companies - the technology is here, use it!
Thanks to all the peple who email me saying how much they like the plugin!

12345678901234567890123456789012345678901234567890123456789012345678901234567890

Version History
Sexy Attached Analyzers
1.0 - initial release with Classic Spectrum Analyzer module
1.01 - fixed up problem when saving a profile with the same name only different
       capitalization.  No longer can end up with 2 profiles with same case
       insensitive name.
1.05 - fixed bug in calculating analysis step (was actually doing an int divide)
       making the frequency range analyzed not accurate to the selected range.
1.10 - added selectable top/bottom position relative to WinAmp or Screen
1.11 - fixed bug that would cause WinAmp position to jump if placed near the top
       of the screen when plugin is launched
1.20 - Added Flash Grid Background style
1.30 - Added Classic Stereo Spectrum Analyzer module
     - Fixed crashing bug when you tried to configure when the analyzer window
       wasn't open (outstanding bug that I completely forgot about)
1.31 - Made the properties window disapear when using Pick Colour. (when plugin
       is in 'always on top' mode, Pick Colour would appear behind it)
1.32 - Fixed bug when using the stereo module and a channel was reversed, if the
       low end of the frequency range was anything but 0, the wrong frequency
       range would be analyzed.
1.40 - Setting the Peak Indicator Change Rate to 0 shuts them off
     - Added Drawing Styles: Mirror, Reflection, Reflection Waves, Shadow,
       Double Shadow, and Smoke
1.41 - Wrong bar width was being calculated for the Stereo module
1.42 - Corrected memory allocation (should fix all crashing problems)
     - Peaks weren't really shutting off all the time when set to 0
     - Mirror backgrounds would sometimes have wrong colour at the bottom
1.50 - Peaks in the wavey reflection would sometimes draw 'out of bounds'
       causing Winamp to crash.
     - added peak indicator motion
1.60 - added free positioning (attach to nothing)
     - added Fade Shadow drawing effect
     - fixed Win NT redrawing when editing Properties
1.61 - fixed Position value save bug (strange values sometimes saved)
     - added high CPU usage mods