Title: Winamp Visualization Tutorial
1Winamp Visualization Tutorial
2Introduction
- MP3 has become quite popular in the past 6 years.
- Good compression
- Winamp The most popular MP3 player for Windows
- Other popular players
- XMMS (Linux)
- iTunes
- Realplayer
- Windows Media Player
3Introduction
- All players have support for sound visualizations
- We will write a visualization plug-in for Winamp
- Free and most popular player
- Compact and user friendly
4Overview
- Plugin format and calling mechanism
- Drawing mechanism
- Conclusions and Results
5Calling Mechanism
Plugin Module
1
6Calling Mechanism
Plugin Module
1
winampVisHeader
7Calling Mechanism
Plugin Module
1
8Calling Mechanism
Plugin Module
1
9Calling Mechanism
Plugin Module
1
2
winampVisHeader
10Calling Mechanism
Plugin Module
1
2
winampVisHeader
winampVisModule
11Calling Mechanism
Plugin Module
1
2
12Calling Mechanism
Plugin Module
1
2
13Calling Mechanism
Plugin Module
1
2
14Drawing Mechanism
- Winamp calls Render every delayMS msecs.
- Data required by Render (e.g. waveformData,
spectrumData) is passed to Render as a pointer to
the current VisModule. - No restrictions on how Render draws onto the
visualization window it can use any hardware
accelerated API (e.g. DirectX or OpenGL) or no
API at all. - We will use OpenGL.
15Render Function (simplified)
16Drawing The Waveform
17Improving Render Function
- A more complicated Render function
- Draw the Background.
- Draw the Foreground waveform and/or any other
object in the scene - Save the frame buffer.
- Add (blend in) the saved image to the background
image. - Distort (transform) the background.
18Improving Render Function
- Problem Processing the background image (e.g.
blending, blurring, etc) is computationally
expensive. - Solution Use the Graphics hardware (through
OpenGL) - Create a 2D grid that covers the entire window
(Offline). - Texture map the background onto the grid
(Online). - Transform the grid (Online).
19Improving Render Function
20Improving Render Function
21Improving Render Function
22Improving Render Function
23Improving Render Function
24Improving Render Function
25Render Function (improved)
26Drawing the Background
Draw the Texture-mapped Grid
Transform the Grid (Rotate, Scale, Translate, etc)
27Results