Rainmeter Workshop - 2

10 min read

Deviation Actions

Rainmeter's avatar
By
Published:
25.8K Views
I'm very pleased with the encouragement that the first Rainmeter Workshop got. I'm even happier with people's questions and requests. Last time I was asked to do a Winamp skin, talk more about String meters, and elaborate on measures. If you want me to cover a topic, just ask in the comments. Without further ado:

Winamp Skin Tutorial




I'll skip the introduction and the basics this time since I covered them pretty well last time. This skin demonstrates using Plugins, drawing circles, using Calc measures. I'll also talk more in depth about using measures and String meters. This is a much more complicated skin than last time. Every Winamp skin that displays time has a heavy emphasis on Calc measures; this one is no different.

[Rainmeter]
-Nothing has changed from last time.

[Rainmeter]
Author=Varelse
Update=1000


[Variables]
-SOLIDCOLOR defines the background color, in this case black, and COLOR defines the Text color and the progress bar color. HEIGHT defines the FontSize and NAME defines the FontFace.

[Variables]
SOLIDCOLOR=0,0,0
COLOR=255,255,255
HEIGHT=10
NAME=Trebuchet MS


Onto the Measures.

[MeasureAlways1]
-This measure does nothing more than return 1. The only reason it is used is because Roundline Meters have to be bound to a measure.

[MeasureAlways1]
Measure=Calc
Formula=1


The next several measures get information from Winamp using the WindowMessagePlugin. You'll notice that Measures read or manipulate data.

[MeasureCommand]
-Allows Rainmeter to interact with Winamp. You'll see how Rainmeter does this further down. It also returns the Artist and Title of the current track. I have mine set up a little different so it also shows the Album name. This can be changed in Winamp.

[MeasureCommand]
Measure= Plugin
Plugin= PluginsWindowMessagePlugin.dll
WindowClass=Winamp v1.x
Substitute="[Paused]":""," - Winamp":"","[Stopped]":""


[MeasureProgressFull]
-This measure returns the total time of the Track in seconds. You'll notice that all these measures are pretty much the same, just that the WindowMessage is different.

[MeasureProgressFull]
Measure= Plugin
Plugin= PluginsWindowMessagePlugin.dll
WindowClass=Winamp v1.x
WindowMessage=1024 1 105


[MeasureProgressCurrent]
-Returns the current position of the Track in milliseconds.

[MeasureProgressCurrent]
Measure= Plugin
Plugin= PluginsWindowMessagePlugin.dll
WindowClass=Winamp v1.x
WindowMessage=1024 0 105


Now for the fun calc measures.

These Calc Measures take the current position of the song and transform the milliseconds into minutes.

[MeasureTMinute]
-Finds the minutes of the current position. Suppose that the current song has been playing for 1:35 minutes. Winamp would tell Rainmeter that the song has been playing for 95000 milliseconds. The formula returns the number of minutes. It takes the current position (i.e. 95000) and divides that by 1000 giving 95 seconds. It then subtracts anything above a minute off of the total time. It then returns the number of minutes the song has been playing. In this case 1 minute. If it had been playing for 128000 milliseconds, the Calc Measure would return 2.

[MeasureTMinute]
Measure=Calc
Formula= ((MeasureProgressCurrent / 1000) - ((MeasureProgressCurrent / 1000) % 60)) /60


[MeasureTSecond]
- Finds the number of seconds that have elapsed between minutes. This is an example of how Rainmeter does If/Then statements. It's basically saying 'If the remainder of [MeasureProgressCurrent] in seconds is equal to 60, then [MeasureTSecond] equals 0. If [MeasureProgressCurrent] in seconds is not 60, then return the remainder of [MeasureProgressCurrent] divided by 60. Using 95000 again, the measure would return 35 seconds.

[MeasureTSecond]
Measure=Calc
Formula= (MeasureProgressCurrent / 1000) % 60 = 60 ? 0 : (MeasureProgressCurrent / 1000) % 60


[MeasureTZero]
-Corrects the way that the elapsed time would be displayed. Since [MeasureTSecond] returns the number of seconds in a minute (0-59), the string meter that will eventually read these measures will show 9:9 for 9:09. It just adds a 0 before the numbers less than 10.

[MeasureTZero]
Measure=Calc
Formula= (((MeasureProgressCurrent) / 1000) % 60) < 10 ? 0 : 1
Substitute="1":""


These measure find the total time that the song playing has left.

[TimeLeft]
-Finds the time left in seconds. I only used DynamicVariables because it wouldn't work otherwise. If you use DynamicVariables the measure's name has to be in brackets and DynamicVariables=1 has to be added to the measure or meter, but that's a discussion for another time.

[TimeLeft]
Measure=Calc
Formula=[MeasureProgressFull]-([MeasureProgressCurrent]/1000)
DynamicVariables=1


[MeasureTMinute2]
,
[MeasureTSecond2]
, and
[MeasureTZero2]
are basically identical to the other measures and transform the time remaining into minutes and seconds.

[MeasureTMinute2]
Measure=Calc
Formula= ([TimeLeft] - ([TimeLeft] % 60)) /60
DynamicVariables=1


[MeasureTSecond2]
Measure=Calc
Formula=[TimeLeft] % 60 = 60 ? 0 : [TimeLeft] % 60
DynamicVariables=1


[MeasureTZero2]
Measure=Calc
Formula=[TimeLeft] % 60 < 10 ? 0 : 1
Substitute="1":""
DynamicVariables=1


That's it for the measures and math. Now onto Meter Styles.

[Webding]
-Since this skin doesn't use any images, the Webdings font is used for the controllor buttons( Play, Pause, etc.). This Style defines how the Webdings will be displayed. They have the same color as the background, and a FontSize big enough to be easily clicked on.

[Webding]
StringStyle=Bold
StringAlign=Left
FontColor=#SOLIDCOLOR#
FontSize=12
FontFace=Webdings


[Text]
-This style defines how the Track and Artist will be displayed. Both of these styles section define a string. Some of the keys are self explanatory, like FontColor, but some aren't so simple. Clipstring cuts off a string at the Height and Width specified. AntiAlias will keep the text from looking pixilized. StringStyle has four different options- Normal, Bold, Italic, or BoldItalic. StringAlign defines from what side of the Meter the text will be displayed. The options are Center, Left, or Right. You'll have to play around with the X position using different StringAligns.

[Text]
StringStyle=Bold
StringAlign=Left
FontColor=#COLOR#
FontSize=#HEIGHT#
FontFace=#NAME#
AntiAlias=1
ClipString=1


Now onto displaying all this stuff.

[DurationBG]
-This is the circular background for the progress bar. Several different keys have to be defined for Roundlines. H and W are the height and width, obviously. The MeasureName, this one's tied to [MeasureAlways1]. StartAngle defines where the circle will begin. Rotation Angle defines where the Circle will stop. The angles are in radians. LineStart defines the inner radius and LineLength defines the outer radius.

[DurationBG]
Meter=Roundline
MeasureName=MeasureAlways1
W=60
H=60
StartAngle=0
RotationAngle=6.28
LineLength=30
LineStart=25
AntiAlias=1
LineColor=#SOLIDCOLOR#


[DurationBar]
-This shows the current progress of the song. It is tied to MeasureProgress. As you can see the Start and Rotation angle are different from DurationBG as well as the inner and outer radius.

[DurationBar]
Meter=Roundline
MeasureName=MeasureProgress
MeterStyle= DurationBG
StartAngle=0.3
RotationAngle=5.7
LineLength=29
LineStart=26
LineColor=#COLOR#


[TitleBar]
-Just a solid black bar that serves as a background for the song title and artist.

[TitleBar]
Meter=Image
X=25
Y=23
H=14
W=300
SolidColor=#SOLIDCOLOR#


[Track]
-A string meter that displays the song title and artist. It's tied to MeasureCommand. It uses the style Text for it's attributes.

[Track]
Meter=STRING
MeasureName=MeasureCommand
X=5r
Y=-1r
H=14
W=295
MeterStyle=Text


The next three meters are for the player controls.

[Back]
-The previous track button. It's meter style is Webding. The mouse action tells Winamp to go to the previous song.

[Back]
Meter=String
MeterStyle=Webding
Text=7
X=130
Y=R
LeftMouseDownAction=!RainmeterPluginBang "MeasureCommand SendMessage 273 40044 0"


[Play]
-This is actually kind of cheating. It show both the play and pause button, but what it really does is toggle play/pause.

[Play]
Meter=STRING
X=-2R
Y=r
MeterStyle=Webding
Text=";4"
LeftMouseDownAction=!RainmeterPluginBang "MeasureCommand SendMessage 273 40046 0"


[Next]
-Skips to the next track. It's just like the other two meters, just with a different mouse command.

[Next]
Meter=STRING
X=-2R
Y=r
MeterStyle=Webding
Text="8"
LeftMouseDownAction=!RainmeterPluginBang "MeasureCommand SendMessage 273 40048 0"


These two meter show the time elapsed and time left.

[Time]
-Displays the elapsed time. It's tied to the 3 measures that transform the time in milliseconds to minutes and seconds. The information from the measures is displayed using Text=%1:%2%3. This means the it displays the minutes, a colon, then checks if the seconds is less than 10, and displays the seconds. Since the FontColor is different than the referenced style, I overrode the style settings using FontColor=#SOLIDCOLOR#. And I don't want the time to be cut off so I set Clipstring to 0.

[Time]
Meter=STRING
MeasureName=MeasureTMinute
MeasureName2=MeasureTZero
MeasureName3=MeasureTSecond
X=65
Y=37
FontColor=#SOLIDCOLOR#
MeterStyle=Text
Text="%1:%2%3"
ClipString=0


[Time2]
-The same as [Time], but displays the time left.

[Time2]
Meter=String
MeasureName=MeasureTMinute2
MeasureName2=MeasureTZero2
MeasureName3=MeasureTSecond2
MeterStyle=Text
FontColor=#SOLIDCOLOR#
ClipString=0
X=150R
Y=r
Text="%1:%2%3"


There you have it, a completed Winamp skin. Check out the Manual for more information about Meters and Measures. And for more information on radians go to here.

:iconvarelse42:
Varelse42 reports
CSS originally by alder-sketch
modified by bendenfield
visit the Rainmeter homepage
© 2010 - 2024 Rainmeter
Comments17
Join the community to add your comment. Already a deviant? Log In
biggx01's avatar
Nice Tute!

is there a way to put music visuals in/on the player skin? I use Aeon from sound spectrum in WMP and RP.
deviantART muro drawing Comment Drawing