It is currently May 3rd, 2024, 12:22 am

Dynamic Window Size / Rolling Text

Get help with creating, editing & fixing problems with skins
zeekaran
Posts: 9
Joined: November 29th, 2011, 12:06 am

Re: Dynamic Window Size / Rolling Text

Post by zeekaran »

smurfier wrote:You need to install this plugin in foobar. Also, the playertype to set under [NowPlaying] is foobar2000.
That plugin helps. Thank you. The code below is modified slightly: update cycle raised (buttons felt too laggy, and 300 is also the speed I like for Lua), colors changed to fit my skin (white and blue: 49, 188, 251), and Lua code sitting there waiting to be useful.

Is the button supposed to change when I click on it? The pause/skip buttons change when I mouse over/click. In my modified version of Uroloki's, I turned that half-circle button into two images, a blue and a white, the white being the highlighted one. This also solved the problem of not letting me move it over to the right all the way.

I have Lua "kind of" working. I don't know how to properly combine the artist and track into one string for Lua to roll.

Code: Select all

[Rainmeter]
Author=Kriogen, modified by Uruloki Burning
Update=300

[Metadata]
Name=
Description=
Instructions=
Version=
License=

[Variables]
;  ColorActive
ColorA=255, 255, 255
;  ColorPassive
ColorP=49, 188, 251

FontFace=Slider

;MEASURES_________________________________________

;winamp__________________________________________________________________
[NowPlaying]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=foobar2000
PlayerType=Title

[Artist]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=[NowPlaying]
PlayerType=Artist

[Progress]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=[NowPlaying]
PlayerType=Progress

[State]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=[NowPlaying]
PlayerType=State
Substitute="0":"4","1":";","2":"4"

[MeasureProgress1]
Measure=Calc
Formula=Progress
MinValue=30
MaxValue=100

[MeasureProgress2]
Measure=Calc
Formula=Progress
MinValue=25
MaxValue=100

[MeasureRing]
Measure=Calc
Formula=Progress<25 ? Progress : 25
MaxValue=100

[MeasureRing1]
Measure=Calc
Formula=(Progress-30)/7000*15

[MeasureRing2]
Measure=Calc
Formula=0.25

[MeasureRing3]
Measure=Calc
Formula=0.50

[MeasureRing4]
Measure=Calc
Formula=0.15

;METERS_________________________________________

[MeterBackGround]
Meter=IMAGE
X=0
Y=0
W=318
H=120
SolidColor=10,10,10, 1

[MeterLine]
Meter=IMAGE
X=0
Y=61
W=279
H=2
SolidColor=#ColorP#, 100

[MeterLine2]
Meter=IMAGE
X=20
Y=56
W=3
H=2
SolidColor=#ColorP#, 100

[MeterLine3]
Meter=IMAGE
X=25
Y=53
W=2
H=5
SolidColor=#ColorP#, 100

[MeterLine4]
Meter=IMAGE
X=27
Y=56
W=46
H=2
SolidColor=#ColorP#, 100

[MeterLine6]
Meter=IMAGE
X=4
Y=63
W=275
H=3
SolidColor=#ColorP#, 100

;iTunesInfo_______

[Lua]
Measure=Script
ScriptFile=#SKINSPATH#Mass Effect 2\Marquee.lua
MeasureName=NowPlaying
;MeasureName2=Artist
Width=25

[MeterTrack]
Meter=STRING
MeasureName=Lua
MeasureName2=Artist
Text="%1 - %2"
X=75
Y=46
W=205
H=13
FontColor=#ColorA#
StringStyle=Bold
FontSize=9
StringAlign=Left
FontFace=#FontFace#
ToolTipText=%1
AntiAlias=1
ClipString=1

;RING BACK
[MeterRoundline]
Meter=ROUNDLINE
MeasureName=MeasureRing2
X=318
Y=65
LineWidth=5.0
LineLength=40
LineStart=34
StartAngle=300.00
RotationAngle=-6.28
AntiAlias=1
LineColor=#ColorP#, 100
Solid=1

;RING BACK 2
[MeterRoundline2]
Meter=ROUNDLINE
MeasureName=MeasureRing3
X=318
Y=65
LineWidth=5.0
LineLength=30
LineStart=22
StartAngle=300.00
RotationAngle=-6.28
AntiAlias=1
LineColor=#ColorP#, 50
Solid=1

;RING BACK 3
[MeterRoundline3]
Meter=ROUNDLINE
MeasureName=MeasureRing4
X=318
Y=65
LineWidth=5.0
LineLength=40
LineStart=34
StartAngle=9.20
RotationAngle=-6.28
AntiAlias=1
LineColor=#ColorP#, 100
Solid=1

[MeterProgressRing1]
Meter=ROUNDLINE
MeasureName=MeasureRing
X=318
Y=65
LineWidth=3.0
LineLength=38
LineStart=34
StartAngle=300.00
RotationAngle=-6.28
AntiAlias=1
LineColor=#ColorA#
Solid=1

[MeterProgressRing2]
Meter=ROUNDLINE
MeasureName=MeasureRing1
X=318
Y=65
LineWidth=5.0
LineLength=38
LineStart=34
StartAngle=9.20
RotationAngle=-6.28
AntiAlias=1
LineColor=#ColorA#
Solid=1

[MeterProgressBar]
MeasureName=MeasureProgress2
Meter=BAR
X=4
Y=63
W=277
H=3
BarOrientation=HORIZONTAL
BarColor=#ColorA#
Flip=1

;Buttons______________________________________
[Buttons]
X=R
Y=r
MouseOverAction=!Execute [!SetOption #CURRENTSECTION# FontColor "#ColorA#"][!Redraw]
MouseLeaveAction=!Execute [!SetOption #CURRENTSECTION# FontColor "#ColorP#, 100"][!Redraw]
FontColor=#ColorP#, 100
StringStyle=BOLD
FontSize=15
StringAlign=LEFT
FontFace=Webdings
AntiAlias=1

[MeterPrev]
Meter=STRING
MeterStyle=Buttons
X=195
Y=68
Text="7"
LeftMouseUpAction=!CommandMeasure "NowPlaying" "Previous"

[MeterPlayPause]
Meter=STRING
MeterStyle=Buttons
MeasureName=State
LeftMouseUpAction=!CommandMeasure "NowPlaying" "PlayPause"

[MeterNext]
Meter=STRING
MeterStyle=Buttons
Text="8"
LeftMouseUpAction=!CommandMeasure "NowPlaying" "Next"

;Show Winamp Button______________________________________
[MeterROUNDLINEp]
Meter=ROUNDLINE
MeasureName=MeasureRing3
X=303
Y=51
W=30
H=30
LineLength=15
LineColor=#ColorP#,100
AntiAlias=1
StartAngle=4.7124
RotationAngle=-6.2832
solid=1
LeftMouseUpAction=!CommandMeasure "NowPlaying" "OpenPlayer"
MouseOverAction=!Execute [!SetOption #CURRENTSECTION# LineColor #ColorA#,128][!Redraw]
MouseLeaveAction=!Execute [!SetOption #CURRENTSECTION# LineColor #ColorP#,100][!Redraw]
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Dynamic Window Size / Rolling Text

Post by smurfier »

I made a couple more tweaks to the code to remove unnecessary stuff and inserted Lua. You will most likely need to make the same changes as before.

Code: Select all

[Rainmeter]
Author=Kriogen, modified by Uruloki Burning
Update=1000
BackgroundMode=2
SolidColor=10,10,10,1

[Metadata]
Name=
Description=
Instructions=
Version=
License=

[Variables]
;  ColorActive
ColorA=170,255,113
;  ColorPassive
ColorP=200,120,20

FontFace=Slider

;MEASURES_________________________________________

;winamp__________________________________________________________________
[NowPlaying]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=Winamp
PlayerType=Status
IfBelowValue=1
IfBelowAction=!HideMeter MeterTrack
IfAboveValue=0
IfAboveAction=!ShowMeter MeterTrack

[Marquee1]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=[NowPlaying]
PlayerType=Artist

[Marquee2]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=Winamp
PlayerType=Title

[Lua]
Measure=Script
ScriptFile=#SKINSPATH#Mass Effect 2\Marquee.lua
MeasureName=Marquee
NumOfMeasures=2
Width=25

[Progress]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=[NowPlaying]
PlayerType=Progress

[State]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=[NowPlaying]
PlayerType=State
Substitute="0":"4","1":";","2":"4"

[MeasureProgress1]
Measure=Calc
Formula=Progress
MinValue=30
MaxValue=100

[MeasureProgress2]
Measure=Calc
Formula=Progress
MinValue=25
MaxValue=100

[MeasureRing]
Measure=Calc
Formula=Progress<25 ? Progress : 25
MaxValue=100

[MeasureRing1]
Measure=Calc
Formula=(Progress-30)/7000*15

[cWhole]
Measure=Calc
Formula=1

;METERS_________________________________________

[MeterLine]
Meter=IMAGE
Y=61
W=279
H=2
SolidColor=#ColorP#,50

[MeterLine2]
Meter=IMAGE
X=20
Y=56
W=3
H=2
SolidColor=#ColorP#,50

[MeterLine3]
Meter=IMAGE
X=25
Y=53
W=2
H=5
SolidColor=#ColorP#,50

[MeterLine4]
Meter=IMAGE
X=27
Y=56
W=46
H=2
SolidColor=#ColorP#,50

[MeterLine6]
Meter=IMAGE
X=4
Y=63
W=275
H=3
SolidColor=#ColorP#,50

;iTunesInfo_______

[MeterTrack]
Meter=STRING
MeasureName=Lua
X=75
Y=46
W=205
H=13
FontColor=#ColorA#, 230
StringStyle=Bold
FontSize=9
FontFace=#FontFace#
ToolTipText=%1
AntiAlias=1
ClipString=1

[MeterProgressRing1]
Meter=ROUNDLINE
MeasureName=MeasureRing
X=280
Y=27
H=76
W=76
LineLength=38
LineStart=34
StartAngle=-1.57
RotationAngle=-6.28
AntiAlias=1
LineColor=#ColorP#, 100
Solid=1

[MeterProgressRing2]
Meter=ROUNDLINE
MeasureName=MeasureRing1
X=280
Y=27
H=76
W=76
LineLength=38
LineStart=34
StartAngle=2.92
RotationAngle=-6.28
AntiAlias=1
LineColor=#ColorP#, 100
Solid=1

;RING BACK
[MeterRoundline]
Meter=ROUNDLINE
;MeasureName=MeasureRing2
MeasureName=cWhole
X=278
Y=25
H=80
W=80
LineLength=40
LineStart=34
StartAngle=-1.57
RotationAngle=-1.57
AntiAlias=1
LineColor=#ColorP#,50
Solid=1

;RING BACK 2
[MeterRoundline2]
Meter=ROUNDLINE
;MeasureName=MeasureRing3
MeasureName=cWhole
X=288
Y=35
H=60
W=60
LineLength=30
LineStart=22
StartAngle=1.57
RotationAngle=3.14
AntiAlias=1
LineColor=#ColorP#, 50
Solid=1

;RING BACK 3
[MeterRoundline3]
Meter=ROUNDLINE
;MeasureName=MeasureRing4
MeasureName=cWhole
X=278
Y=25
H=80
W=80
LineLength=40
LineStart=34
StartAngle=2.92
RotationAngle=-0.942
AntiAlias=1
LineColor=#ColorP#, 50
Solid=1

[MeterProgressBar]
MeasureName=MeasureProgress2
Meter=BAR
X=4
Y=63
W=277
H=3
BarOrientation=HORIZONTAL
BarColor=#ColorP#,100
Flip=1

;Buttons______________________________________
[Buttons]
X=R
Y=r
MouseOverAction=!Execute [!SetOption #CURRENTSECTION# FontColor "#ColorA#,128"][!Redraw]
MouseLeaveAction=!Execute [!SetOption #CURRENTSECTION# FontColor "#ColorP#,50"][!Redraw]
FontColor=#ColorP#,50
StringStyle=BOLD
FontSize=15
FontFace=Webdings
AntiAlias=1

[MeterPrev]
Meter=STRING
MeterStyle=Buttons
X=195
Y=68
Text="7"
LeftMouseUpAction=!CommandMeasure "NowPlaying" "Previous"

[MeterPlayPause]
Meter=STRING
MeterStyle=Buttons
MeasureName=State
LeftMouseUpAction=!CommandMeasure "NowPlaying" "PlayPause"

[MeterNext]
Meter=STRING
MeterStyle=Buttons
Text="8"
LeftMouseUpAction=!CommandMeasure "NowPlaying" "Next"

;Show Winamp Button______________________________________
[MeterROUNDLINEp]
Meter=ROUNDLINE
;MeasureName=MeasureRing3
MeasureName=cWhole
X=303
Y=51
W=30
H=30
LineLength=15
LineColor=#ColorP#,100
AntiAlias=1
StartAngle=1.57
RotationAngle=3.14
solid=1
LeftMouseUpAction=!CommandMeasure "NowPlaying" "OpenPlayer"
MouseOverAction=!Execute [!SetOption #CURRENTSECTION# LineColor #ColorA#,128][!Redraw]
MouseLeaveAction=!Execute [!SetOption #CURRENTSECTION# LineColor #ColorP#,100][!Redraw]
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: Dynamic Window Size / Rolling Text

Post by Seahorse »

zeekaran wrote:I have Lua "kind of" working. I don't know how to properly combine the artist and track into one string for Lua to roll.
The Compact media player skin in Cobalt already does this, go examine that... :sly:
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

zeekaran
Posts: 9
Joined: November 29th, 2011, 12:06 am

Re: Dynamic Window Size / Rolling Text

Post by zeekaran »

Seahorse wrote: The Compact media player skin in Cobalt already does this, go examine that... :sly:
smurfier appears to have done it for me.

Thanks again smurfier. Clean code, no redundant play/pause button, and the text prints and rolls properly. There's still the spacing problem though. I can only move it so far to the right. There's a buffer of exactly 42 pixels. I assume it's coming from the negative area of the round lines?

Finally, I'm a bit embarrassed to ask this many questions, but how does one insert a hyphen between the artist and track title?

Thanks, both of you.


And here's what I currently have:

Code: Select all

[Rainmeter]
Author=Kriogen, modified by Uruloki Burning
Update=200
BackgroundMode=2
SolidColor=10,10,10,1

[Metadata]
Name=
Description=
Instructions=
Version=
License=

[Variables]
;  ColorActive
ColorA=255,255,255
;  ColorPassive
ColorP=49,188,251

FontFace=Slider

;MEASURES_________________________________________

;winamp__________________________________________________________________
[NowPlaying]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=foobar2000
PlayerType=Status
IfBelowValue=1
IfBelowAction=!HideMeter MeterTrack
IfAboveValue=0
IfAboveAction=!ShowMeter MeterTrack

[Marquee1]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=[NowPlaying]
PlayerType=Artist

[Marquee2]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=[NowPlaying]
PlayerType=Title

[Lua]
Measure=Script
ScriptFile=#SKINSPATH#Mass Effect 2\Marquee.lua
MeasureName=Marquee
NumOfMeasures=2
Width=30

[Progress]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=[NowPlaying]
PlayerType=Progress

[State]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=[NowPlaying]
PlayerType=State
Substitute="0":"4","1":";","2":"4"

[MeasureProgress1]
Measure=Calc
Formula=Progress
MinValue=30
MaxValue=100

[MeasureProgress2]
Measure=Calc
Formula=Progress
MinValue=25
MaxValue=100

[MeasureRing]
Measure=Calc
Formula=Progress<25 ? Progress : 25
MaxValue=100

[MeasureRing1]
Measure=Calc
Formula=(Progress-30)/7000*15

[cWhole]
Measure=Calc
Formula=1

;METERS_________________________________________

[MeterLine]
Meter=IMAGE
Y=60
W=278
H=2
SolidColor=#ColorP#,100

[MeterLine2]
Meter=IMAGE
X=20
Y=55
W=3
H=2
SolidColor=#ColorP#,100

[MeterLine3]
Meter=IMAGE
X=25
Y=52
W=2
H=5
SolidColor=#ColorP#,100

[MeterLine4]
Meter=IMAGE
X=27
Y=55
W=46
H=2
SolidColor=#ColorP#,100

[MeterLine6]
Meter=IMAGE
X=3
Y=62
W=275
H=3
SolidColor=#ColorP#,100

;iTunesInfo_______

[MeterTrack]
Meter=STRING
MeasureName=Lua
X=75
Y=46
W=205
H=13
FontColor=#ColorA#
StringStyle=Bold
FontSize=9
FontFace=#FontFace#
ToolTipText=%1
AntiAlias=1
ClipString=1

;RING BACK
[MeterRoundline]
Meter=ROUNDLINE
;MeasureName=MeasureRing2
MeasureName=cWhole
X=278
Y=25
H=80
W=80
LineLength=40
LineStart=34
StartAngle=-1.57
RotationAngle=-1.57
AntiAlias=1
LineColor=#ColorP#,100
Solid=1

;RING BACK 2
[MeterRoundline2]
Meter=ROUNDLINE
;MeasureName=MeasureRing3
MeasureName=cWhole
X=288
Y=35
H=60
W=60
LineLength=30
LineStart=22
StartAngle=1.57
RotationAngle=3.14
AntiAlias=1
LineColor=#ColorP#, 50
Solid=1

;RING BACK 3
[MeterRoundline3]
Meter=ROUNDLINE
;MeasureName=MeasureRing4
MeasureName=cWhole
X=278
Y=25
H=80
W=80
LineLength=40
LineStart=34
StartAngle=2.92
RotationAngle=-0.942
AntiAlias=1
LineColor=#ColorP#, 100
Solid=1

[MeterProgressRing1]
Meter=ROUNDLINE
MeasureName=MeasureRing
X=280
Y=27
H=76
W=76
LineLength=38
LineStart=34
StartAngle=-1.57
RotationAngle=-6.28
AntiAlias=1
LineColor=#ColorA#
Solid=1

[MeterProgressRing2]
Meter=ROUNDLINE
MeasureName=MeasureRing1
X=280
Y=27
H=76
W=76
LineLength=38
LineStart=34
StartAngle=2.92
RotationAngle=-6.28
AntiAlias=1
LineColor=#ColorA#
Solid=1

[MeterProgressBar]
MeasureName=MeasureProgress2
Meter=BAR
X=4
Y=62
W=277
H=3
BarOrientation=HORIZONTAL
BarColor=#ColorA#
Flip=1

;Buttons______________________________________
[Buttons]
X=R
Y=r
MouseOverAction=!Execute [!SetOption #CURRENTSECTION# FontColor "#ColorA#"][!Redraw]
MouseLeaveAction=!Execute [!SetOption #CURRENTSECTION# FontColor "#ColorP#,100"][!Redraw]
FontColor=#ColorP#,100
StringStyle=BOLD
FontSize=15
FontFace=Webdings
AntiAlias=1

[MeterPrev]
Meter=STRING
MeterStyle=Buttons
X=195
Y=68
Text="7"
LeftMouseUpAction=!CommandMeasure "NowPlaying" "Previous"

[MeterPlayPause]
Meter=STRING
MeterStyle=Buttons
MeasureName=State
LeftMouseUpAction=!CommandMeasure "NowPlaying" "PlayPause"

[MeterNext]
Meter=STRING
MeterStyle=Buttons
Text="8"
LeftMouseUpAction=!CommandMeasure "NowPlaying" "Next"

;Show Winamp Button______________________________________
[MeterROUNDLINEp]
Meter=ROUNDLINE
;MeasureName=MeasureRing3
MeasureName=cWhole
X=303
Y=51
W=30
H=30
LineLength=15
LineColor=#ColorP#,100
AntiAlias=1
StartAngle=1.57
RotationAngle=3.14
solid=1
LeftMouseUpAction=!CommandMeasure "NowPlaying" "OpenPlayer"
MouseOverAction=!Execute [!SetOption #CURRENTSECTION# LineColor #ColorA#][!Redraw]
MouseLeaveAction=!Execute [!SetOption #CURRENTSECTION# LineColor #ColorP#,100][!Redraw]
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Dynamic Window Size / Rolling Text

Post by MerlinTheRed »

You'll have to do this in the Lua script. You have to get both values (artist and track name) by using GetMeasure() and GetVariable(). I assume the script you are using already does this in some way. Then you can concatenate strings by putting two dots between them:

artistAndTrack=artistName .. " - " .. trackName
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Dynamic Window Size / Rolling Text

Post by smurfier »

On the lua measure add Delimiter=' - '
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Dynamic Window Size / Rolling Text

Post by MerlinTheRed »

Huh. Is that new? I can't find anything about this in the doc page for Lua scripts.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Dynamic Window Size / Rolling Text

Post by smurfier »

Ummm.... It's a feature of the LuaMarquee script that I wrote.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
zeekaran
Posts: 9
Joined: November 29th, 2011, 12:06 am

Re: Dynamic Window Size / Rolling Text

Post by zeekaran »

smurfier wrote:On the lua measure add Delimiter=' - '
That did the trick, thanks. And I just learned what "Keep on screen" does, and that fixed my other problem.

I think I'm done besides asking about Lua. I currently have a artist-track combination that is one character too big, and so it uses Lua. But when it's being redrawn, it doesn't start on the far right. It starts about in the middle and prints new characters to the right as it moves to the left. Is this intended?
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Dynamic Window Size / Rolling Text

Post by smurfier »

It just does that every once in a while. I've yet to figure out why, especially since it does not always happen.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .