It is currently April 16th, 2024, 8:08 am

My Now Playing skin with switcher buttons

Media controls, music players, video and animated visualizers
User avatar
FuzzyLizard530
Posts: 75
Joined: August 5th, 2014, 2:09 am

My Now Playing skin with switcher buttons

Post by FuzzyLizard530 »

I like a lot of the "Now Playing" skins, but didn't want to have to edit code just to switch between players, so I came up with this:

Code: Select all

[Rainmeter]
BackgroundMode=0
Update=1000
AccurateText=1
DynamicWindowSize=0

[Metadata]
Author=FuzzyLizard530 [a.k.a. David Dwight II ]
Name=Now PLaying with easy switch buttons
Information=Seconds-per-day counter, 4 Core CPU Mon, Battery and Wifi Meters, With Some Power State Buttons
Version=0.0.1
License=Creative Commons BY-NC-SA 3.0

;Data Mining :)

[Variables]
IconSize=32
HiLite=5
BGAlpha=128
Player=Foobar
Foolite=1
Spotlite=0
WAlite=0
AIMPlite=0
PlayerType=CAD

[TxtStyle]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=Border
FontEffectColor=0,0,0,255
FontColor=255,255,255,255
FontFace=Linux Biolinum G
FontSize=18
AntiAlias=1

[mTitle]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerType#
PlayerType=TITLE
PlayerPath=
DisableLeadingZero=1

[mArtist]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mTitle]
PlayerType=ARTIST

[mAlbum]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mTitle]
PlayerType=ALBUM

[mPosition]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mTitle]
PlayerType=POSITION

[mDuration]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mTitle]
PlayerType=DURATION

[mProgress]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mTitle]
PlayerType=PROGRESS

[mStateButton]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mTitle]
PlayerType=STATE
Substitute="0":"Play.png","1":"Pause.png","2":"Play.png"
IfEqualValue=0
IfEqualAction=[!SetOption ProgressFrame ImageTint #colorText3#][!SetOption ProgressBitmap ImageTint #colorText3#][!SetOption CoverFrame ImageTint #colorText3#][!ShowMeter NoMusic]
IfAboveValue=0
IfAboveAction=[!SetOption ProgressFrame ImageTint #colorText#][!SetOption ProgressBitmap ImageTint #colorText#][!SetOption CoverFrame ImageTint #colorText#][!HideMeter NoMusic]

[Background]
Meter=Image
H=((#IconSize#)*4)+((#HiLite#)*8)
W=#SCREENAREAWIDTH#
SolidColor=0,0,0,128
X=0
Y=0

[FoobarHiLite]
Meter=Image
H=((#IconSize#)+(#HiLite#)*2)
W=((#IconSize#)+(#HiLite#)*2)
SolidColor=255,255,255,(255*#Foolite#)
X=0
Y=0

[SpotHiLite]
Meter=Image
H=((#IconSize#)+(#HiLite#)*2)
W=((#IconSize#)+(#HiLite#)*2)
SolidColor=255,255,255,(255*#Spotlite#)
X=0
Y=((#IconSize#)+(#HiLite#))r

[WAHiLite]
Meter=Image
H=((#IconSize#)+(#HiLite#)*2)
W=((#IconSize#)+(#HiLite#)*2)
SolidColor=255,255,255,(255*#WALite#)
X=0
Y=((#IconSize#)+(#HiLite#))r

[AIMPHiLite]
Meter=Image
H=((#IconSize#)+(#HiLite#)*2)
W=((#IconSize#)+(#HiLite#)*2)
SolidColor=255,255,255,(255*#AIMPlite#)
X=0
Y=((#IconSize#)+(#HiLite#))r

[FooBarSwitch]
Meter=Image
ImageName=#@#Icon\Foobar.png
X=#HiLite#
Y=#HiLite#
W=#IconSize#
H=#IconSize#
LeftMouseDownAction=!Execute [!WriteKeyValue Variables Player "Foobar"][!WriteKeyValue Variables PlayerType "CAD"][!WriteKeyValue Variables Foolite "1"][!WriteKeyValue Variables Spotlite "0"][!WriteKeyValue Variables WAlite "0"][!WriteKeyValue Variables AIMPlite "0"][!Refresh]

[SpotifySwitch]
Meter=Image
ImageName=#@#Icon\Spotify.png
X=#HiLite#
Y=((#HiLite#)+(#IconSize#))r
W=#IconSize#
H=#IconSize#
LeftMouseDownAction=!Execute [!WriteKeyValue Variables Player "Spotify"][!WriteKeyValue Variables PlayerType "Spotify"][!WriteKeyValue Variables Foolite "0"][!WriteKeyValue Variables Spotlite "1"][!WriteKeyValue Variables WAlite "0"][!WriteKeyValue Variables AIMPlite "0"][!Refresh]

[WinAmpSwitch]
Meter=Image
ImageName=#@#Icon\Winamp.png
X=#HiLite#
Y=((#HiLite#)+(#IconSize#))r
W=#IconSize#
H=#IconSize#
LeftMouseDownAction=!Execute [!WriteKeyValue Variables Player "Winamp"][!WriteKeyValue Variables PlayerType "Winamp"][!WriteKeyValue Variables Foolite "0"][!WriteKeyValue Variables Spotlite "0"][!WriteKeyValue Variables WAlite "1"][!WriteKeyValue Variables AIMPlite "0"][!Refresh]

[AimpSwitch]
Meter=Image
ImageName=#@#Icon\Aimp.png
X=#HiLite#
Y=((#HiLite#)+(#IconSize#))r
W=#IconSize#
H=#IconSize#
LeftMouseDownAction=!Execute [!WriteKeyValue Variables Player "Aimp"][!WriteKeyValue Variables PlayerType "Aimp"][!WriteKeyValue Variables Foolite "0"][!WriteKeyValue Variables Spotlite "0"][!WriteKeyValue Variables WAlite "0"][!WriteKeyValue Variables AIMPlite "1"][!Refresh]

[CoverGet]
Measure=Plugin
Plugin=NowPlaying
PlayerType=Cover
PlayerName=#PlayerType#

[NoCover]
Meter=Image
ImageName=#@#Icon\#Player#.PNG
X=((#HiLite#)+(#IconSize#))r
Y=#HiLite#
W=(((#IconSize#)*4)+((#HiLite#)*3))
H=(((#IconSize#)*4)+((#HiLite#)*3))
DynamicVariables=1

[CoverArt]
Meter=Image
MeasureName=CoverGet
X=r
Y=r
W=(((#IconSize#)*4)+((#HiLite#)*3))
H=(((#IconSize#)*4)+((#HiLite#)*3))
DynamicVariables=1

[TITLE]
Meter=String
MeasureName=mTitle
MeasureName2=mArtist
MeasureName3=mAlbum
MeasureName4=mPosition
MeasureName5=mDuration
X=(((#IconSize#)*5)+((#HiLite#)*6))
Y=((#HiLite#)*2)+((#IconSize#)*1)
Text=%2#CRLF#%1#CRLF#%3#CRLF#%5	%4
MeterStyle=TxtStyle

[SeekBarBG]
Meter=Bar
MeterStyle=styleBar
X=#HiLite#
Y=(((#IconSize#)*4)+(#HiLite#)*5)
W=((#SCREENAREAWIDTH#)-((#HiLite#)*2))
H=(2*(#HiLite#))
SolidColor=0,0,0,255

[SeekBar]
Meter=Bar
MeasureName=mProgress
BarOrientation=HORIZONTAL
X=r
Y=r
W=((#SCREENAREAWIDTH#)-((#HiLite#)*2))
H=(2*(#HiLite#))
Feel free to remix, and edit to your heart's content! All I ask is that you add a link to your version here! I may use it in place of what I've got here!

Sidenote: I do realize that it needs control buttons, but I'll get round to it soon!
I may or may not have a signature in this, very location...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: My Now Playing skin with switcher buttons

Post by eclectic-tech »

NOW PLAYING w/BI-DIRECTIONAL MOUSE-SCROLL INTERFACE SELECTION

When mouse scrolling was added to Rainmeter, I wrote this code to scroll select any of the 10 available player interfaces... based on Kaelri's examples of swapping variables values using the !WriteKeyValue prior to refreshing the skin.

It is simply 1 meter that when scrolled over changes the variable used in the main nowplaying measure. (No buttons, No clicks, just Scrolling needed)

You should be able to add the variables and main player measure and player meter sections to almost any skin to achieve a list that can scroll select multiple interfaces.

Code: Select all

[Variables]
Player0=foobar2000
Player0interface=CAD
Player1=iTunes
Player1interface=iTunes
Player2=J.River
Player2interface=CAD
Player3=Jukebox
Player3interface=CAD
Player4=MediaMonkey
Player4interface=MediaMonkey
Player5=MusicBee
Player5interface=CAD
Player6=VLC
Player6interface=CAD
Player7=WinAmp
Player7interface=WinAmp
Player8=WMP
Player8interface=WMP
Player9=AIMP
Player9interface=AIMP
;foobar2000 Uses CAD... foo_cad plugin needed
;J.River Uses CAD... intcad plugin needed
;Jukebox Uses CAD... intcad plugin needed
;MusicBee Uses CAD... version 1.2 or higher
;VLC Uses CAD... libcad plugin needed

[mPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#Player0interface#
PlayerType=TITLE
DynamicVariables=1

[PlayerText]
Meter=STRING
H=16
W=70
StringAlign=Left
SolidColor=0,0,0,1
AntiAlias=1
ClipString=1
Text=#Player0#
LeftMouseUpAction=[!CommandMeasure "mPlayer" "OpenPlayer"]
MouseScrollUpAction=[!WriteKeyValue Variables Player0 #Player9#][!WriteKeyValue Variables Player1 #Player0#][!WriteKeyValue Variables Player2 #Player1#][!WriteKeyValue Variables Player3 #Player2#][!WriteKeyValue Variables Player4 #Player3#][!WriteKeyValue Variables Player5 #Player4#][!WriteKeyValue Variables Player6 #Player5#][!WriteKeyValue Variables Player7 #Player6#][!WriteKeyValue Variables Player8 #Player7#][!WriteKeyValue Variables Player9 #Player8#][!WriteKeyValue Variables Player0interface #Player9interface#][!WriteKeyValue Variables Player1interface #Player0interface#][!WriteKeyValue Variables Player2interface #Player1interface#][!WriteKeyValue Variables Player3interface #Player2interface#][!WriteKeyValue Variables Player4interface #Player3interface#][!WriteKeyValue Variables Player5interface #Player4interface#][!WriteKeyValue Variables Player6interface #Player5interface#][!WriteKeyValue Variables Player7interface #Player6interface#][!WriteKeyValue Variables Player8interface #Player7interface#][!WriteKeyValue Variables Player9interface #Player8interface#][!Refresh]
MouseScrollDownAction=[!WriteKeyValue Variables Player0 #Player1#][!WriteKeyValue Variables Player1 #Player2#][!WriteKeyValue Variables Player2 #Player3#][!WriteKeyValue Variables Player3 #Player4#][!WriteKeyValue Variables Player4 #Player5#][!WriteKeyValue Variables Player5 #Player6#][!WriteKeyValue Variables Player6 #Player7#][!WriteKeyValue Variables Player7 #Player8#][!WriteKeyValue Variables Player8 #Player9#][!WriteKeyValue Variables Player9 #Player0#][!WriteKeyValue Variables Player0interface #Player1interface#][!WriteKeyValue Variables Player1interface #Player2interface#][!WriteKeyValue Variables Player2interface #Player3interface#][!WriteKeyValue Variables Player3interface #Player4interface#][!WriteKeyValue Variables Player4interface #Player5interface#][!WriteKeyValue Variables Player5interface #Player6interface#][!WriteKeyValue Variables Player6interface #Player7interface#][!WriteKeyValue Variables Player7interface #Player8interface#][!WriteKeyValue Variables Player8interface #Player9interface#][!WriteKeyValue Variables Player9interface #Player0interface#][!Refresh]
DynamicVariables=1
ToolTipText=Left-click to open Player#CRLF# Scroll to Select Player
Someone may have a better code to step through the 10 interfaces, but this has worked well for me... :)

EDIT: Removed 'PLAY...' command from the MouseScroll actions...
User avatar
FuzzyLizard530
Posts: 75
Joined: August 5th, 2014, 2:09 am

Re: My Now Playing skin with switcher buttons

Post by FuzzyLizard530 »

All that code makes my head and eyes hurt! LOL! Your idea is great, but it could cause me trouble when trying to use my touch pad (It doesn't always recognize 2-finger scrolling).

I did manage to get it to look how I wanted it to, though when asian characters appear, it bumps everything down a bit. Not sure if I'll fix that or not yet. I used the icons from http://dakirby309.deviantart.com/art/Metro-UI-Icon-Set-725-Icons-280724102.

Here's my code:

Code: Select all

[Rainmeter]
BackgroundMode=0
Update=1000
AccurateText=1
DynamicWindowSize=0

[Metadata]
Author=FuzzyLizard530 [a.k.a. David Dwight II ]
Name=Now PLaying with easy switch buttons
Information=Seconds-per-day counter, 4 Core CPU Mon, Battery and Wifi Meters, With Some Power State Buttons
Version=0.0.1
License=Creative Commons BY-NC-SA 3.0

;Data Mining :)

[Variables]
IconSize=32
HiLite=5
BGAlpha=128
Player=Foobar
Foolite=1
Spotlite=0
WAlite=0
AIMPlite=0
PlayerType=CAD

[TxtStyle]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=Border
FontEffectColor=0,0,0,255
FontColor=255,255,255,255
FontFace=Linux Biolinum G
FontSize=18
AntiAlias=1

[MeasureAudio]
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=100
RMSDecay=300
RMSGain=2.5
PeakAttack=15
PeakDecay=2700
PeakGain=1.0

[MeasureL]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=L
Type=RMS

[MeasureR]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=R
Type=RMS

[mTitle]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerType#
PlayerType=TITLE
DisableLeadingZero=1

[mArtist]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerType#
PlayerType=ARTIST

[mAlbum]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerType#
PlayerType=ALBUM

[mYear]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerType#
PlayerType=YEAR
Format=<[mYear]>

[mPosition]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerType#
PlayerType=POSITION

[mDuration]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerType#
PlayerType=DURATION

[mProgress]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerType#
PlayerType=PROGRESS

[mStateButton]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerType#
PlayerType=STATE
Substitute="0":"Play","1":"Pause","2":"Play"
IfEqualValue=0
IfEqualAction=[!SetOption ProgressFrame ImageTint #colorText3#][!SetOption ProgressBitmap ImageTint #colorText3#][!SetOption CoverFrame ImageTint #colorText3#][!ShowMeter NoMusic]
IfAboveValue=0
IfAboveAction=[!SetOption ProgressFrame ImageTint #colorText#][!SetOption ProgressBitmap ImageTint #colorText#][!SetOption CoverFrame ImageTint #colorText#][!HideMeter NoMusic]

[Background]
Meter=Image
H=((#IconSize#)*4)+((#HiLite#)*8)
W=#SCREENAREAWIDTH#
SolidColor=0,0,0,128
X=0
Y=0

[FoobarHiLite]
Meter=Image
H=((#IconSize#)+(#HiLite#)*2)
W=((#IconSize#)+(#HiLite#)*2)
SolidColor=255,255,255,(255*#Foolite#)
X=0
Y=0

[SpotHiLite]
Meter=Image
H=((#IconSize#)+(#HiLite#)*2)
W=((#IconSize#)+(#HiLite#)*2)
SolidColor=255,255,255,(255*#Spotlite#)
X=0
Y=((#IconSize#)+(#HiLite#))r

[WAHiLite]
Meter=Image
H=((#IconSize#)+(#HiLite#)*2)
W=((#IconSize#)+(#HiLite#)*2)
SolidColor=255,255,255,(255*#WALite#)
X=0
Y=((#IconSize#)+(#HiLite#))r

[AIMPHiLite]
Meter=Image
H=((#IconSize#)+(#HiLite#)*2)
W=((#IconSize#)+(#HiLite#)*2)
SolidColor=255,255,255,(255*#AIMPlite#)
X=0
Y=((#IconSize#)+(#HiLite#))r

[FooBarSwitch]
Meter=Image
ImageName=#@#Icon\Prog\Foobar.png
X=#HiLite#
Y=#HiLite#
W=#IconSize#
H=#IconSize#
LeftMouseDownAction=!Execute [!WriteKeyValue Variables Player "Foobar"][!WriteKeyValue Variables PlayerType "CAD"][!WriteKeyValue Variables Foolite "1"][!WriteKeyValue Variables Spotlite "0"][!WriteKeyValue Variables WAlite "0"][!WriteKeyValue Variables AIMPlite "0"][!Refresh]

[SpotifySwitch]
Meter=Image
ImageName=#@#Icon\Prog\Spotify.png
X=#HiLite#
Y=((#HiLite#)+(#IconSize#))r
W=#IconSize#
H=#IconSize#
LeftMouseDownAction=!Execute [!WriteKeyValue Variables Player "Spotify"][!WriteKeyValue Variables PlayerType "Spotify"][!WriteKeyValue Variables Foolite "0"][!WriteKeyValue Variables Spotlite "1"][!WriteKeyValue Variables WAlite "0"][!WriteKeyValue Variables AIMPlite "0"][!Refresh]

[WinAmpSwitch]
Meter=Image
ImageName=#@#Icon\Prog\Winamp.png
X=#HiLite#
Y=((#HiLite#)+(#IconSize#))r
W=#IconSize#
H=#IconSize#
LeftMouseDownAction=!Execute [!WriteKeyValue Variables Player "Winamp"][!WriteKeyValue Variables PlayerType "Winamp"][!WriteKeyValue Variables Foolite "0"][!WriteKeyValue Variables Spotlite "0"][!WriteKeyValue Variables WAlite "1"][!WriteKeyValue Variables AIMPlite "0"][!Refresh]

[AimpSwitch]
Meter=Image
ImageName=#@#Icon\Prog\Aimp.png
X=#HiLite#
Y=((#HiLite#)+(#IconSize#))r
W=#IconSize#
H=#IconSize#
LeftMouseDownAction=!Execute [!WriteKeyValue Variables Player "Aimp"][!WriteKeyValue Variables PlayerType "Aimp"][!WriteKeyValue Variables Foolite "0"][!WriteKeyValue Variables Spotlite "0"][!WriteKeyValue Variables WAlite "0"][!WriteKeyValue Variables AIMPlite "1"][!Refresh]

[CoverGet]
Measure=Plugin
Plugin=NowPlaying
PlayerType=Cover
PlayerName=#PlayerType#

[NoCover]
Meter=Image
ImageName=#@#Icon\Prog\#Player#.PNG
X=((#HiLite#)+(#IconSize#))r
Y=#HiLite#
W=(((#IconSize#)*4)+((#HiLite#)*3))
H=(((#IconSize#)*4)+((#HiLite#)*3))
DynamicVariables=1

[CoverArt]
Meter=Image
MeasureName=CoverGet
X=r
Y=r
W=(((#IconSize#)*4)+((#HiLite#)*3))
H=(((#IconSize#)*4)+((#HiLite#)*3))
DynamicVariables=1
PreserveAspectRatio=1
ToolTipText=Open #Player#
LeftMouseUpAction=[!CommandMeasure "CoverGet" "OpenPlayer"]
MouseActionCursor=0

[mVolume]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerType#
PlayerType=VOLUME

[Volumebar]
Meter=bar
Measurename=mVolume
x=r
y=r
H=(((#IconSize#)*4)+((#HiLite#)*3))
W=(((#IconSize#)*4)+((#HiLite#)*3))
SolidColor=0,0,0,0
BarColor=255,255,255,32
BarOrientation=Vertical
MouseScrollUpAction=[!CommandMeasure mVolume "SetVolume +10"]
MouseScrollDownAction=[!CommandMeasure mVolume "SetVolume -10"]

[Previous]
Meter=Image
ImageName=#@#Icon\MControl\Previous.png
X=((#IconSize#*5)+(#HiLite#*6))
Y=r
W=#IconSize#
H=#IconSize#
ToolTipText=Previous Track
LeftMouseUpAction=[!CommandMeasure mProgress "Previous"]
MouseActionCursor=0

[Play]
Meter=Image
ImageName=#@#Icon\MControl\[mStateButton].png
X=(#IconSize#+#HiLite#)r
Y=r
W=#IconSize#
H=#IconSize#
ToolTipText=Play/Pause
LeftMouseUpAction=[!CommandMeasure mProgress "PlayPause"]
DynamicVariables=1
MouseActionCursor=0

[Next]
Meter=Image
ImageName=#@#Icon\MControl\Next.png
X=(#IconSize#+#HiLite#)r
Y=r
W=#IconSize#
H=#IconSize#
ToolTipText=Next
LeftMouseUpAction=[!CommandMeasure mProgress "Next"]
MouseActionCursor=0

[Stop]
Meter=Image
ImageName=#@#Icon\MControl\Stop.png
X=(#IconSize#+#HiLite#)r
Y=r
W=#IconSize#
H=#IconSize#
ToolTipText=Stop
LeftMouseUpAction=[!CommandMeasure mProgress "Stop"]
MouseActionCursor=0

; [MeterL]
; Meter=Bar
; MeasureName=MeasureL
; X=(((#IconSize#)*5)+((#HiLite#)*6))
; Y=#HiLite#
; W=#HiLite#
; H=

; [MeterR]
; Meter=Bar
; MeasureName=MeasureR
; X=5
; Y=5

[TITLE]
Meter=String
MeasureName=mTitle
MeasureName2=mArtist
MeasureName3=mAlbum
MeasureName4=mPosition
MeasureName5=mDuration
MeasureName6=mYear
X=(((#IconSize#)*5)+((#HiLite#)*6))
Y=((#HiLite#)*2)+((#IconSize#)*1)
Text=%1#CRLF#%2#CRLF#%3 <%6>#CRLF#%5	%4
MeterStyle=TxtStyle

[SeekBarBG]
Meter=Bar
MeterStyle=styleBar
X=#HiLite#
Y=(((#IconSize#)*4)+(#HiLite#)*5)
W=((#SCREENAREAWIDTH#)-((#HiLite#)*2))
H=(2*(#HiLite#))
SolidColor=0,0,0,255

[SeekBar]
Meter=Bar
MeasureName=mProgress
BarOrientation=HORIZONTAL
X=r
Y=r
W=((#SCREENAREAWIDTH#)-((#HiLite#)*2))
H=(2*(#HiLite#))
and an animated screen shot. (This has a couple of other skins displaying with it...)
You do not have the required permissions to view the files attached to this post.
I may or may not have a signature in this, very location...