* Improved Winamp Visualizer by @x2nie
This contains work started by @x2nie and continued by me.
There's a lot that's either broken and/or unfinished.
The main goal of this PR is to improve the visualizer of Webamp, bringing improvements to the Oscilloscope and Spectrum analyzer rendering.
Improving the Oscilloscope was achieved by taking the rendering code from the Equalizer and implanting it into the small visualizer box done by x2nie, improving the Spectrum Analyzer involved ditching the Web Audio API in favor of FFTNullsoft, providing a much more accurate representation of the audio.
The spectrum analyzer code (at least for the thicker bands) was redone that makes use of reverse engineered code from Winamp 2.65, more specifically how the bar chunking is achieved as well as how the peaks are calculated (this is broken).
* Fixed analyzer responding to data immediately
Various code comments explaining the purpose behind the new implementation
Peaks are no longer visible at the bottom
* Added support for windowshade mode (colors are broken)
Replaced old Visualizer in the Playlist Editor in favor of the new Visualizer
* Fixed analyzer exceeding bounds in unwindowshaded mode
* Removed paintFrameThin() since it's now no longer needed (processing happens in paintFrameWide())
Also removed paintWavSolid() since that too is now processed in paintWavLine
Removed variables no longer in use
Adjusted how the FFT data is first processed in Vis.tsx and how that affects the thin and wide modes (they should now be consistent in volume)
* Add proper windowshade mode visualizer support (adapts correctly to doublesize too!)
Proper color handling for the Spectrum Analyzer if in windowshade and double size mode
Removed comemnts/functions no longer in use
* Visualizer is now pushed down by 2 pixels if not in double size mode
Fixed "doubled" not being able to be used outside of Vis.tsx
Set up base for eventual additional parameters that can be passed to the visualizer
Consolidate paintWavDot into paintWavLine
Remove dispose()
* Fixed accidentally setting oscStyle to "dots" for testing (oops)
* New (non-working) parameter: "sa", dictates vis mode
Allowed "mode" to be modifiable
Adjusted frequency scaling of the FFT
* Maybe fix deploy issues?
* Replace rangeByAmplitude with a colorIndex function
Attempt at addressing a few comments from the PR review
* Missed a few variables that weren't in camelCase
Finetuned the data going into timeToFrequencyDomain
* Move FFT stuff into VisPainter.ts
Attempt at addressing more of the PR review
* Moved the FFT to be part of BarPaintHandler, instead of being global
Added checking for the state of the Main Window so that the Playlist Editor visualizer no longer bugs out like it did (incorrectly showing the small visualizer, or showing the full capacity of it)
Changed the global variable `i` to be `chunk` to avoid potential issues
Ensure `y` is scaled down (in the y axis) correctly when in windowshade mode
Skip rendering of the Oscilloscope in the windowshade mode to avoid it drawing out of bounds
Missed a few variables that werent in camelCase (again)
* Missed implementing the solid mode drawing a pixel instead of a filled line if x is 0 and if visualizer is small
* Readded drawing the visualizer background
Prevent saPeaks from going "out of bounds" when the main window is in windowshade mode
* Missed accounting for the Playlist Editor Visualizer w.r.t to the background if Main Window was not visible, in windowshade mode and not in double size
* Addressing comments of the recent review
Fixes FFT being corrupted when multiple instances of Webamp exist and are playing at the same time
Fixes multiple Webamp instances fighting over what the current state of the Main Window really is
Moved a lot of global mutable variables to instead be owned by BarPaintHandler and PaintWavHandler
Renamed visualizer functions since they now handle a lot of things
* Make canvas required
* Ensure bars are split only in "wide" bandwidth
* Some small FFTNullsoft cleanup
* Call ``painter.prepare()`` only when doublesize is engaged/disengaged
* Confirmed order of Visualization modes
VisPaintHandler is an abstract class (is that how you do it?)
Instead of logging to console about paintBarLine reusing code from "Fire mode", it's been replaced with a code comment
* move ``processFFT()`` out of ``Painter.prepare()``
It never had a place there anyway