It is currently March 28th, 2024, 9:13 am

Music player infinite text flow

Get help with creating, editing & fixing problems with skins
Kaizenitsune
Posts: 33
Joined: December 9th, 2022, 3:25 am

Music player infinite text flow

Post by Kaizenitsune »

Hello,
I have recently started to create my own suite from various suites/skins and now I have a problem with my music player, if the name of the song or the artist is too long again the rest is simply cut off. I had already looked on the Internet and in the forum for solutions but I have only found the following code in the forum.

Code: Select all

[Rainmeter]
MiddleMouseUpAction=[!Refresh]
OnRefreshAction=[!CommandMeasure MeasureActionTimer "Execute 1"][!CommandMeasure MeasureActionTimer "Execute 2"][!CommandMeasure MeasureActionTimer "Execute 3"]
AccurateText=1

[Variables]
; Text settings
text1=This is a long text testy
text2=This is an even loooooooooonger text testy
text3=Too short testy!
; Marquee settings
animationSpeed=32
marqueeBeginWait=1500
marqueeEndWait=1500
; Dynamic variables - do not change
marquee1=0
marquee2=0
marquee3=0

[StyleText]
FontFace=Calibri
FontColor=230,230,230
FontSize=15
FontWeight=600
X=0
Y=1R
Antialias=1
Container=MeterTextContainer
DynamicVariables=1

[MeasureMarquee1Offset]
Measure=Calc
Formula=max(0,([MeterText1:W] - [MeterTextContainer:W]))
DynamicVariables=1

[MeasureMarquee2Offset]
Measure=Calc
Formula=max(0,([MeterText2:W] - [MeterTextContainer:W]))
DynamicVariables=1

[MeasureMarquee3Offset]
Measure=Calc
Formula=max(0,([MeterText3:W] - [MeterTextContainer:W]))
DynamicVariables=1

[MeasureActionTimer]
Measure=Plugin
Plugin=ActionTimer
; Marquee 1
ActionList1=Repeat Move1,#animationSpeed#,[MeasureMarquee1Offset:] | Wait #marqueeEndWait# | Reset1 | Wait #marqueeBeginWait# | DoOver1
Reset1=[!SetVariable marquee1 0][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText1][!Redraw]
Move1=[!SetVariable marquee1 "(#marquee1# - 1)"][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText1][!Redraw]
DoOver1=[!CommandMeasure MeasureActionTimer "Execute 1"]
; Marquee 2
ActionList2=Repeat Move2,#animationSpeed#,[MeasureMarquee2Offset:] | Wait #marqueeEndWait# | Reset2 | Wait #marqueeBeginWait# | DoOver2
Reset2=[!SetVariable marquee2 0][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText2][!Redraw]
Move2=[!SetVariable marquee2 "(#marquee2# - 1)"][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText2][!Redraw]
DoOver2=[!CommandMeasure MeasureActionTimer "Execute 2"]
; Marquee 3
ActionList3=Repeat Move3,#animationSpeed#,[MeasureMarquee3Offset:] | Wait #marqueeEndWait# | Reset3 | Wait #marqueeBeginWait# | DoOver3
Reset3=[!SetVariable marquee3 0][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText3][!Redraw]
Move3=[!SetVariable marquee3 "(#marquee3# - 1)"][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText3][!Redraw]
DoOver3=[!CommandMeasure MeasureActionTimer "Execute 3"]
DynamicVariables=1

[MeterBackground]
Meter=Shape
Shape=Rectangle 1,1,180,106,6 | StrokeWidth 2 | Stroke Color 50,50,50 | Fill Color 15,15,15

[MeterTextContainer]
Meter=Image
SolidColor=255,255,255,255
X=16
Y=16
W=150
H=76

[MeterText1]
Meter=String
MeterStyle=StyleText
X=#marquee1#
Y=1
Text=#text1#

[MeterText2]
Meter=String
MeterStyle=StyleText
X=#marquee2#
Text=#text2#

[MeterText3]
Meter=String
MeterStyle=StyleText
X=#marquee3#
Text=#text3#
That is also almost the solution, however, I would like that e.g. the title does not jump back to the beginning but simply starts again from the beginning and there I had hoped to find here maybe help with the problem.
The code of the music player looks like this.

Code: Select all

[Rainmeter]
Update=200
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh]
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 1 ? 1 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 1 ? 1 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]
MouseActionCursorName=Hand

[Variables]
ScrollMouseIncrement=0.1
Player=Spotify
Scale=3.1
DarkBlue=27,63,107,255
MediumBlue=92,135,209,255
AlmostBlack=40,40,40,255
AlmostWhite=211,40,56

;-------------------------------------------------------------

[MeasureAlbumArt]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=COVER

[MeterAlbumArt]
Meter=Image
MeasureName=MeasureAlbumArt
Meter=String
MeasureName=MeasureTitle
StringAlign=Left
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(8*#Scale#)
X=(0*#Scale#)
Y=(0*#Scale#)
W=(100*#Scale#)
Text="%1"
ClipString=1
AntiAlias=1
MaskImageName=#@#Images\Mask.png

;-------------------------------------------------------------

[MeasureTitle]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=TITLE
Substitue="":""

[MeterTitle]
Meter=String
MeasureName=MeasureTitle
StringAlign=Left
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(8*#Scale#)
X=(100*#Scale#)
Y=(5*#Scale#)
W=(130*#Scale#)
Text="%1"
ClipString=1
AntiAlias=1

;-------------------------------------------------------------
[MeasureArtist]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=ARTIST
Substitue="":""

[MeterArtist]
Meter=String
MeasureName=MeasureArtist
StringAlign=Left
StringCase=Upper
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(7*#Scale#)
X=(100*#Scale#)
Y=(18*#Scale#)
W=(130*#Scale#)
Text="%1"
ClipString=1
AntiAlias=1

;-------------------------------------------------------------

[MeasureAlbum]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=ALBUM
Substitue="":""

[MeterAlbum]
Meter=String
MeterStyle=SpotifyStyleAlbum
MeasureName=MeasureAlbum
StringAlign=Left
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(6*#Scale#)
X=(100*#Scale#)
Y=(30*#Scale#)
W=(130*#Scale#)
Text="%1"
ClipString=1
AntiAlias=1

;-------------------------------------------------------------

[MeasureProgress]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=PROGRESS

;-------------------------------------------------------------

[MeasureDuration]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=DURATION

[MeterDuration]
Meter=String
MeasureName=MeasureDuration
StringAlign=Center
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(5*#Scale#)
X=(107*#Scale#)
Y=(45*#Scale#)
Text="%1"
AntiAlias=1

[MeterDuration2]
Meter=String
MeasureName=MeasureMinutesRemaining
MeasureName2=MeasureSecondsRemaining
StringAlign=Center
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(5*#Scale#)
X=(221*#Scale#)
Y=(45*#Scale#)
Text="%1:%2"
AntiAlias=1

;-------------------------------------------------------------

[MeasurePosition]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Position
UpdateDivider = 5
Substitute="":"N/A"

;-------------------------------------------------------------

[MeasureStateButton]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=STATE
Substitute="0":"#@#Images\Play.png","1":"#@#Images\Pause.png","2":"#@#Images\Play.png"

[MeasureMinutesRemaining]
Measure=Calc
Formula=Trunc((MeasureDuration - MeasurePosition)/60)
RegExpSubstitute=1
Substitute="^(.)$":"0\1"

[MeasureSecondsRemaining]
Measure=Calc
Formula=((MeasureDuration - MeasurePosition) % 60)
RegExpSubstitute=1
Substitute="^(.)$":"0\1"


[MeasureRating]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Rating

[MeasureHeartRaw]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Rating
IfCondition=MeasureHeartRaw = 0
IfTrueAction=[!SetOption MeterHeart ImageTint "#MediumBlue#"]
IfCondition2=MeasureHeartRaw = 5
IfTrueAction2=[!SetOption MeterHeart ImageTint "#AlmostWhite#"]

;-------------------------------------------------------------

[MeasureHeart]
Measure=Calc
Formula=(MeasureHeartRaw=5 ? 0 : 5)

[MeterHeart]
Meter=Image
ImageName=#@#images\heart.png
ImageTint=#AlmostWhite#
X=(135*#Scale#)
Y=(65*#Scale#)
W=(17*#Scale#)
H=(17*#Scale#)
LeftMouseUpAction=[!CommandMeasure MeasureHeartRaw "SetRating [&MeasureHeart]"]
AntiAlias=1

;-------------------------------------------------------------

[MeasureShuffle]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Shuffle
IfCondition=MeasureShuffle = 0
IfTrueAction=[!SetOption MeterShuffle ImageTint "#MediumBlue#"]
IfCondition2=MeasureShuffle = 1
IfTrueAction2=[!SetOption MeterShuffle ImageTint "#AlmostWhite#"]

[MeterShuffle]
Meter=Image
ImageName=#@#Images\shuffle.png
ImageTint=#AlmostWhite#
X=(155*#Scale#)
Y=(65*#Scale#)
W=(17*#Scale#)
H=(17*#Scale#)
Group=DynamicColors
LeftMouseUpAction=[!CommandMeasure MeasureShuffle "Shuffle"]
AntiAlias=1

;-------------------------------------------------------------

[MeasureRepeat]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Repeat
IfCondition=MeasureRepeat = 0
IfTrueAction=[!SetOption MeterRepeat ImageTint "#MediumBlue#"][!SetOption MeterRepeat ImageName "#@#Images\repeat.png"]
IfCondition2=MeasureRepeat = 1
IfTrueAction2=[!SetOption MeterRepeat ImageTint "#AlmostWhite#"][!SetOption MeterRepeat ImageName "#@#Images\repeat.png"]
IfCondition3=MeasureRepeat = 2
IfTrueAction3=[!SetOption MeterRepeat ImageTint "#AlmostWhite#"][!SetOption MeterRepeat ImageName "#@#Images\repeat1.png"]

[MeterRepeat]
Meter=Image
ImageName=#@#Images\shuffle.png
ImageTint=#AlmostWhite#
X=(175*#Scale#)
Y=(65*#Scale#)
W=(17*#Scale#)
H=(17*#Scale#)
Group=DynamicColors
LeftMouseUpAction=[!CommandMeasure MeasureRepeat "Repeat"]
AntiAlias=1

;-------------------------------------------------------------

[MeasureVolume]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Volume
MinValue=0
MaxValue=100
IfCondition=MeasureVolume = 0
IfTrueAction=[!SetOption MeterVolumeIcon ImageName "#@#Images\volMute.png"]
IfCondition2=(MeasureVolume >= 1) && (MeasureVolume <= 32)
IfTrueAction2=[!SetOption MeterVolumeIcon ImageName "#@#Images\volLow.png"]
IfCondition3=(MeasureVolume >= 33) && (MeasureVolume <= 65)
IfTrueAction3=[!SetOption MeterVolumeIcon ImageName "#@#Images\volMed.png"]
IfCondition4=MeasureVolume >= 66
IfTrueAction4=[!SetOption MeterVolumeIcon ImageName "#@#Images\volHigh.png"]

[MeterVolumeIcon]
Meter=Image
ImageName=#@#Images\volMute.png
ImageTint=#AlmostWhite#
X=(100*#Scale#)
Y=(80*#Scale#)
W=(17*#Scale#)
H=(17*#Scale#)
LeftMouseUpAction=[!CommandMeasure MeasureVolume "SetVolume 0"]
AntiAlias=1

[MeterVolumeBar]
Meter=Bar
MeasureName=MeasureVolume
BarOrientation=Horizontal
BarColor=#AlmostWhite#
SolidColor=#DarkBlue#
X=(117*#Scale#)
Y=(88*#Scale#)
W=(95*#Scale#)
H=(1.5*#Scale#)
LeftMouseUpAction=[!CommandMeasure MeasureVolume "SetVolume $MouseX:%$"]

;-------------------------------------------------------------

[MeasureVolumePercentage]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Volume
Substitute="":"N/A"

[MeterVolume]
Meter=String
StringAlign=Center
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(5*#Scale#)
X=(221*#Scale#)
Y=(86*#Scale#)
Text=%1%
MeasureName=MeasureVolumePercentage
AntiAlias=1

;-------------------------------------------------------------

[MeterBar]
Meter=Shape
X=(100*#Scale#)
Y=(40*#Scale#)
Shape=Rectangle 0,0,(130*#Scale#),(1.5*#Scale#),0 | Fill Color 255,255,255,30 | StrokeWidth 0
Shape2=Rectangle 0,0,([MeasureProgress]*1.2*#Scale#),(1.5*#Scale#),0 | Fill Color 211,40,56 | StrokeWidth 0
Shape3=Ellipse ([MeasureProgress]*1.2*#Scale#),(0.8*#Scale#),(1.5*#Scale#) |Fill Color 255,255,255 | StrokeWidth 0
Shape4=Rectangle 0,(-1*#Scale#),(120*#Scale#),(3*#Scale#),0 | Fill Color 255,255,255,1 | StrokeWidth 0
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure "MeasureProgress" "SetPosition $MouseX:%$"]

[MeterPrevious]
Meter=Image
ImageName=#@#Images\Previous.png
X=(140*#Scale#)
Y=(47*#Scale#)
W=(10*#Scale#)
AntiAlias=1
SolidColor=255,255,255,1
LeftMouseUpAction=[!PluginBang "MeasureStateButton Previous"]

[MeterPlayPause]
Meter=Image
ImageName=[MeasureStateButton]
X=(155*#Scale#)
Y=(45*#Scale#)
W=(15*#Scale#)
AntiAlias=1
SolidColor=255,255,255,1
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure "MeasureStateButton" "PlayPause"]

[MeterNext]
Meter=Image
ImageName=#@#Images\Next.png
X=(175*#Scale#)
Y=(47*#Scale#)
W=(10*#Scale#)
AntiAlias=1
SolidColor=255,255,255,1
LeftMouseUpAction=[!PluginBang "MeasureStateButton Next"]
In advance many thanks for the help.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Music player infinite text flow

Post by balala »

Kaizenitsune wrote: December 9th, 2022, 9:28 am I would like that e.g. the title does not jump back to the beginning but simply starts again from the beginning and there I had hoped to find here maybe help with the problem.
Not sure I can fallow. These two are the same: when the title ends, it jumps back to the beginning, which means it starts again from its beginning. So, not sure what and how would you like to get it. Please give us (me) some details on what you would like to achieve.
Kaizenitsune
Posts: 33
Joined: December 9th, 2022, 3:25 am

Re: Music player infinite text flow

Post by Kaizenitsune »

balala wrote: December 9th, 2022, 1:15 pm Not sure I can fallow. These two are the same: when the title ends, it jumps back to the beginning, which means it starts again from its beginning. So, not sure what and how would you like to get it. Please give us (me) some details on what you would like to achieve.
I have attached a skin that shows how I imagined it should look, but the skin is quite jerky and runs over a LUA file.

The following code actually already shows pretty much how I imagined it, but the effect only takes effect when you go over it with the mouse, it would be optimal if it does the same when you don't go over it with the mouse, unfortunately I'm still pretty new to the whole Rainmeter topic and haven't managed to figure out how to get it to work without going over it with the mouse.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
SkinWidth=#Width#

[Metadata]
Name=Bla bla
Author=Bla bla
Information=Bla bla 
Version=Bla bla

[Variables]
Width=500
XValue=0
Repeat=0

;=== MEASURES ===

[MeasureRepeat]
Measure=Calc
Formula=(#Width#+[MeterText1:W])
IfCondition=1
IfTrueAction=[!SetVariable Repeat "[MeasureRepeat]"][!Update]
DynamicVariables=1

[MeasureX1]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Action1 , 25 , #Repeat#
ActionList2=| Wait 3000 | Action2 | Repeat Action1 , 25 , #Repeat#
Action1=[!SetVariable XValue "(Clamp(#XValue#-2,(-#Width#),#Width#))"][!Update]
Action2=[!SetVariable XValue "0"][!Update]
DynamicVariables=1

[MeasureWait]
Measure=Calc
Formula=-[MeterText1:W]
IfCondition= (#XValue#=-#Width#)
IfTrueAction=[!CommandMeasure MeasureX1 "Stop 1"][!CommandMeasure MeasureX1 "Stop 2"][!CommandMeasure MeasureX1 "Execute 2"]
DynamicVariables=1

;==== METERS ====				

[MeterText1]
Meter=String
Text=Something
FontSize=50
X=#XValue#
Y=0
AntiAlias=1
DynamicVariables=1

[MeterText1Mirror]
Meter=String
Text=Something
FontSize=50
X=(#XValue#+#Width#)
Y=0
AntiAlias=1
DynamicVariables=1

[MeterBackground1]
Meter=Image
SolidColor=0,0,0,1
MouseOverAction=[!CommandMeasure MeasureX1 "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureX1 "Stop 1"][!CommandMeasure MeasureX1 "Stop 2"][!SetVariable XValue "0"][!Update]
W=#Width#
H=([MeterText1:H])
DynamicVariables=1

I hope this is a little more helpful as a description
In any case, that would take me a whole step further.
Attachments
LuaMarquee_6.2(1).rmskin
(23.98 KiB) Downloaded 12 times
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Music player infinite text flow

Post by balala »

Kaizenitsune wrote: December 9th, 2022, 2:17 pm I hope this is a little more helpful as a description
Yep, it definitely is. Here is what have you to do:
  • Add (copy) the needed / wanted measures to the LuaMarquee\Example.ini skin (I copied for instance the following measures: [MeasureTitle], [MeasureArtist] and [MeasureAlbum]).
  • Replace the names of measures set up in the MeasureName option of the [Lua] measure with the names of these measures: MeasureName=MeasureTitle|MeasureArtist|MeasureAlbum. As you see, you can add so many measures as you want, just make sure to use the proper delimitator (|) between them.
Kaizenitsune
Posts: 33
Joined: December 9th, 2022, 3:25 am

Re: Music player infinite text flow

Post by Kaizenitsune »

balala wrote: December 9th, 2022, 4:25 pm Yep, it definitely is. Here is what have you to do:
  • Add (copy) the needed / wanted measures to the LuaMarquee\Example.ini skin (I copied for instance the following measures: [MeasureTitle], [MeasureArtist] and [MeasureAlbum]).
  • Replace the names of measures set up in the MeasureName option of the [Lua] measure with the names of these measures: MeasureName=MeasureTitle|MeasureArtist|MeasureAlbum. As you see, you can add so many measures as you want, just make sure to use the proper delimitator (|) between them.
Would it also be possible that I insert the script into my existing code ?
I think that would be a little easier, because the basic framework is there, only this one point is missing or would that also be feasible with the following code ?

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
SkinWidth=#Width#

[Metadata]
Name=Bla bla
Author=Bla bla
Information=Bla bla 
Version=Bla bla

[Variables]
Width=500
XValue=0
Repeat=0

;=== MEASURES ===

[MeasureRepeat]
Measure=Calc
Formula=(#Width#+[MeterText1:W])
IfCondition=1
IfTrueAction=[!SetVariable Repeat "[MeasureRepeat]"][!Update]
DynamicVariables=1

[MeasureX1]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Action1 , 25 , #Repeat#
ActionList2=| Wait 3000 | Action2 | Repeat Action1 , 25 , #Repeat#
Action1=[!SetVariable XValue "(Clamp(#XValue#-2,(-#Width#),#Width#))"][!Update]
Action2=[!SetVariable XValue "0"][!Update]
DynamicVariables=1

[MeasureWait]
Measure=Calc
Formula=-[MeterText1:W]
IfCondition= (#XValue#=-#Width#)
IfTrueAction=[!CommandMeasure MeasureX1 "Stop 1"][!CommandMeasure MeasureX1 "Stop 2"][!CommandMeasure MeasureX1 "Execute 2"]
DynamicVariables=1

;==== METERS ====				

[MeterText1]
Meter=String
Text=Something
FontSize=50
X=#XValue#
Y=0
AntiAlias=1
DynamicVariables=1

[MeterText1Mirror]
Meter=String
Text=Something
FontSize=50
X=(#XValue#+#Width#)
Y=0
AntiAlias=1
DynamicVariables=1

[MeterBackground1]
Meter=Image
SolidColor=0,0,0,1
MouseOverAction=[!CommandMeasure MeasureX1 "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureX1 "Stop 1"][!CommandMeasure MeasureX1 "Stop 2"][!SetVariable XValue "0"][!Update]
W=#Width#
H=([MeterText1:H])
DynamicVariables=1
That would be the same result but you would have to somehow take out the point that the text only flows when the mouse is over it.

Otherwise I would try it right now with the script to include in my existing code and would then report again when I have tried it out.
Kaizenitsune
Posts: 33
Joined: December 9th, 2022, 3:25 am

Re: Music player infinite text flow

Post by Kaizenitsune »

balala wrote: December 9th, 2022, 4:25 pm Yep, it definitely is. Here is what have you to do:
  • Add (copy) the needed / wanted measures to the LuaMarquee\Example.ini skin (I copied for instance the following measures: [MeasureTitle], [MeasureArtist] and [MeasureAlbum]).
  • Replace the names of measures set up in the MeasureName option of the [Lua] measure with the names of these measures: MeasureName=MeasureTitle|MeasureArtist|MeasureAlbum. As you see, you can add so many measures as you want, just make sure to use the proper delimitator (|) between them.
I tried it and it works, but I can't get it formatted like my music player, because the reason I thought of putting this floating text in my code and keeping the formatting of the text, in this Screenshot would be the formatting of my music player
1.PNG
and in this Screenshot the formatting of the script.
2.PNG
Another question I would like to ask is, which program languages would I have to learn in order to understand all this better?
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Music player infinite text flow

Post by balala »

Kaizenitsune wrote: December 9th, 2022, 4:48 pm Would it also be possible that I insert the script into my existing code ?
I think that would be a little easier, because the basic framework is there, only this one point is missing or would that also be feasible with the following code ?
Yep, definitely possible, however a few things have to be taken into account - see below.
Kaizenitsune wrote: December 9th, 2022, 4:48 pm That would be the same result but you would have to somehow take out the point that the text only flows when the mouse is over it.
In your code the text flow is done using an ActionTimer plugin measure (namely [MeasureX1]), while in the linked skin (LuaMarquee) the same thing is achieved with a lua Script measure (the [Lua] measure, using the @Resources\Marquee.lua script file). These approaches are completely different.
To use the lua approach, you can add the appropriate measure ([Lua]) to your skin (just note that in such a case the Marquee.lua file also has to be added to the @Resources folder of your config) to your skin. Further you have to configure the String measure which shows the flowing text ([MeterText1] as well as [MeterText1Mirror] in your code - but recommend using one single string meter), to use the value returned by the [Lua] measure (so, the String meter has to have a MeasureName=Lua option).
Kaizenitsune wrote: December 9th, 2022, 5:54 pm I tried it and it works, but I can't get it formatted like my music player, because the reason I thought of putting this floating text in my code and keeping the formatting of the text, in this Screenshot would be the formatting of my music player
How your code looks like? Post it, please.
Kaizenitsune wrote: December 9th, 2022, 5:54 pm Another question I would like to ask is, which program languages would I have to learn in order to understand all this better?
Basic Rainmeter codes as you probably have figured this out use Rainmeter's "language". This is in fact the same format as any .ini file uses.
The Marquee.lua file on the other hand is written in Lua, which is a real programming language. Some more details here.
Kaizenitsune
Posts: 33
Joined: December 9th, 2022, 3:25 am

Re: Music player infinite text flow

Post by Kaizenitsune »

balala wrote: December 9th, 2022, 7:02 pm How your code looks like? Post it, please.
Thats my Code or what you can call my code, actually I just mixed different skins together to get the skin I use now

Code: Select all

[Rainmeter]
Update=200
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh]
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 1 ? 1 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 1 ? 1 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]
MouseActionCursorName=Hand

[Variables]
ScrollMouseIncrement=0.1
Player=Spotify
Scale=3.1
DarkBlue=27,63,107,255
MediumBlue=92,135,209,255
AlmostBlack=40,40,40,255
AlmostWhite=211,40,56

;-------------------------------------------------------------

[MeasureAlbumArt]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=COVER

[MeterAlbumArt]
Meter=Image
MeasureName=MeasureAlbumArt
Meter=String
MeasureName=MeasureTitle
StringAlign=Left
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(8*#Scale#)
X=(0*#Scale#)
Y=(0*#Scale#)
W=(100*#Scale#)
Text="%1"
ClipString=1
AntiAlias=1
MaskImageName=#@#Images\Mask.png

;-------------------------------------------------------------

[MeasureTitle]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=TITLE
Substitue="":""

[MeterTitle]
Meter=String
MeasureName=MeasureTitle
StringAlign=Left
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(8*#Scale#)
X=(100*#Scale#)
Y=(5*#Scale#)
W=(130*#Scale#)
Text="%1"
ClipString=1
AntiAlias=1

;-------------------------------------------------------------
[MeasureArtist]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=ARTIST
Substitue="":""

[MeterArtist]
Meter=String
MeasureName=MeasureArtist
StringAlign=Left
StringCase=Upper
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(7*#Scale#)
X=(100*#Scale#)
Y=(18*#Scale#)
W=(130*#Scale#)
Text="%1"
ClipString=1
AntiAlias=1

;-------------------------------------------------------------

[MeasureAlbum]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=ALBUM
Substitue="":""

[MeterAlbum]
Meter=String
MeterStyle=SpotifyStyleAlbum
MeasureName=MeasureAlbum
StringAlign=Left
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(6*#Scale#)
X=(100*#Scale#)
Y=(30*#Scale#)
W=(130*#Scale#)
Text="%1"
ClipString=1
AntiAlias=1

;-------------------------------------------------------------

[MeasureProgress]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=PROGRESS

;-------------------------------------------------------------

[MeasureDuration]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=DURATION

[MeterDuration]
Meter=String
MeasureName=MeasureDuration
StringAlign=Center
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(5*#Scale#)
X=(107*#Scale#)
Y=(45*#Scale#)
Text="%1"
AntiAlias=1

[MeterDuration2]
Meter=String
MeasureName=MeasureMinutesRemaining
MeasureName2=MeasureSecondsRemaining
StringAlign=Center
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(5*#Scale#)
X=(221*#Scale#)
Y=(45*#Scale#)
Text="%1:%2"
AntiAlias=1

;-------------------------------------------------------------

[MeasurePosition]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Position
UpdateDivider = 5
Substitute="":"N/A"

;-------------------------------------------------------------

[MeasureStateButton]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=STATE
Substitute="0":"#@#Images\Play.png","1":"#@#Images\Pause.png","2":"#@#Images\Play.png"

[MeasureMinutesRemaining]
Measure=Calc
Formula=Trunc((MeasureDuration - MeasurePosition)/60)
RegExpSubstitute=1
Substitute="^(.)$":"0\1"

[MeasureSecondsRemaining]
Measure=Calc
Formula=((MeasureDuration - MeasurePosition) % 60)
RegExpSubstitute=1
Substitute="^(.)$":"0\1"


[MeasureRating]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Rating

[MeasureHeartRaw]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Rating
IfCondition=MeasureHeartRaw = 0
IfTrueAction=[!SetOption MeterHeart ImageTint "#MediumBlue#"]
IfCondition2=MeasureHeartRaw = 5
IfTrueAction2=[!SetOption MeterHeart ImageTint "#AlmostWhite#"]

;-------------------------------------------------------------

[MeasureHeart]
Measure=Calc
Formula=(MeasureHeartRaw=5 ? 0 : 5)

[MeterHeart]
Meter=Image
ImageName=#@#images\heart.png
ImageTint=#AlmostWhite#
X=(135*#Scale#)
Y=(65*#Scale#)
W=(17*#Scale#)
H=(17*#Scale#)
LeftMouseUpAction=[!CommandMeasure MeasureHeartRaw "SetRating [&MeasureHeart]"]
AntiAlias=1

;-------------------------------------------------------------

[MeasureShuffle]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Shuffle
IfCondition=MeasureShuffle = 0
IfTrueAction=[!SetOption MeterShuffle ImageTint "#MediumBlue#"]
IfCondition2=MeasureShuffle = 1
IfTrueAction2=[!SetOption MeterShuffle ImageTint "#AlmostWhite#"]

[MeterShuffle]
Meter=Image
ImageName=#@#Images\shuffle.png
ImageTint=#AlmostWhite#
X=(155*#Scale#)
Y=(65*#Scale#)
W=(17*#Scale#)
H=(17*#Scale#)
Group=DynamicColors
LeftMouseUpAction=[!CommandMeasure MeasureShuffle "Shuffle"]
AntiAlias=1

;-------------------------------------------------------------

[MeasureRepeat]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Repeat
IfCondition=MeasureRepeat = 0
IfTrueAction=[!SetOption MeterRepeat ImageTint "#MediumBlue#"][!SetOption MeterRepeat ImageName "#@#Images\repeat.png"]
IfCondition2=MeasureRepeat = 1
IfTrueAction2=[!SetOption MeterRepeat ImageTint "#AlmostWhite#"][!SetOption MeterRepeat ImageName "#@#Images\repeat.png"]
IfCondition3=MeasureRepeat = 2
IfTrueAction3=[!SetOption MeterRepeat ImageTint "#AlmostWhite#"][!SetOption MeterRepeat ImageName "#@#Images\repeat1.png"]

[MeterRepeat]
Meter=Image
ImageName=#@#Images\shuffle.png
ImageTint=#AlmostWhite#
X=(175*#Scale#)
Y=(65*#Scale#)
W=(17*#Scale#)
H=(17*#Scale#)
Group=DynamicColors
LeftMouseUpAction=[!CommandMeasure MeasureRepeat "Repeat"]
AntiAlias=1

;-------------------------------------------------------------

[MeasureVolume]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Volume
MinValue=0
MaxValue=100
IfCondition=MeasureVolume = 0
IfTrueAction=[!SetOption MeterVolumeIcon ImageName "#@#Images\volMute.png"]
IfCondition2=(MeasureVolume >= 1) && (MeasureVolume <= 32)
IfTrueAction2=[!SetOption MeterVolumeIcon ImageName "#@#Images\volLow.png"]
IfCondition3=(MeasureVolume >= 33) && (MeasureVolume <= 65)
IfTrueAction3=[!SetOption MeterVolumeIcon ImageName "#@#Images\volMed.png"]
IfCondition4=MeasureVolume >= 66
IfTrueAction4=[!SetOption MeterVolumeIcon ImageName "#@#Images\volHigh.png"]

[MeterVolumeIcon]
Meter=Image
ImageName=#@#Images\volMute.png
ImageTint=#AlmostWhite#
X=(100*#Scale#)
Y=(80*#Scale#)
W=(17*#Scale#)
H=(17*#Scale#)
LeftMouseUpAction=[!CommandMeasure MeasureVolume "SetVolume 0"]
AntiAlias=1

[MeterVolumeBar]
Meter=Bar
MeasureName=MeasureVolume
BarOrientation=Horizontal
BarColor=#AlmostWhite#
SolidColor=#DarkBlue#
X=(117*#Scale#)
Y=(88*#Scale#)
W=(95*#Scale#)
H=(1.5*#Scale#)
LeftMouseUpAction=[!CommandMeasure MeasureVolume "SetVolume $MouseX:%$"]

;-------------------------------------------------------------

[MeasureVolumePercentage]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Volume
Substitute="":"N/A"

[MeterVolume]
Meter=String
StringAlign=Center
FontFace=b Bath Towel
FontColor=211,40,56
FontSize=(5*#Scale#)
X=(221*#Scale#)
Y=(86*#Scale#)
Text=%1%
MeasureName=MeasureVolumePercentage
AntiAlias=1

;-------------------------------------------------------------

[MeterBar]
Meter=Shape
X=(100*#Scale#)
Y=(40*#Scale#)
Shape=Rectangle 0,0,(130*#Scale#),(1.5*#Scale#),0 | Fill Color 255,255,255,30 | StrokeWidth 0
Shape2=Rectangle 0,0,([MeasureProgress]*1.2*#Scale#),(1.5*#Scale#),0 | Fill Color 211,40,56 | StrokeWidth 0
Shape3=Ellipse ([MeasureProgress]*1.2*#Scale#),(0.8*#Scale#),(1.5*#Scale#) |Fill Color 255,255,255 | StrokeWidth 0
Shape4=Rectangle 0,(-1*#Scale#),(120*#Scale#),(3*#Scale#),0 | Fill Color 255,255,255,1 | StrokeWidth 0
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure "MeasureProgress" "SetPosition $MouseX:%$"]

[MeterPrevious]
Meter=Image
ImageName=#@#Images\Previous.png
X=(140*#Scale#)
Y=(47*#Scale#)
W=(10*#Scale#)
AntiAlias=1
SolidColor=255,255,255,1
LeftMouseUpAction=[!PluginBang "MeasureStateButton Previous"]

[MeterPlayPause]
Meter=Image
ImageName=[MeasureStateButton]
X=(155*#Scale#)
Y=(45*#Scale#)
W=(15*#Scale#)
AntiAlias=1
SolidColor=255,255,255,1
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure "MeasureStateButton" "PlayPause"]

[MeterNext]
Meter=Image
ImageName=#@#Images\Next.png
X=(175*#Scale#)
Y=(47*#Scale#)
W=(10*#Scale#)
AntiAlias=1
SolidColor=255,255,255,1
LeftMouseUpAction=[!PluginBang "MeasureStateButton Next"]
balala wrote: December 9th, 2022, 7:02 pm In your code the text flow is done using an ActionTimer plugin measure (namely [MeasureX1]), while in the linked skin (LuaMarquee) the same thing is achieved with a lua Script measure (the [Lua] measure, using the @Resources\Marquee.lua script file). These approaches are completely different.
To use the lua approach, you can add the appropriate measure ([Lua]) to your skin (just note that in such a case the Marquee.lua file also has to be added to the @Resources folder of your config) to your skin. Further you have to configure the String measure which shows the flowing text ([MeterText1] as well as [MeterText1Mirror] in your code - but recommend using one single string meter), to use the value returned by the [Lua] measure (so, the String meter has to have a MeasureName=Lua option)
I have tried again and am at least now so far that the basic formatting is there, ie Font, Font Size & Font Color, which would look like this:

Code: Select all

[Rainmeter]
 MouseOverAction=!CommandMeasure Lua Pause=0
 MouseLeaveAction=!CommandMeasure Lua Pause=1

[Metadata]
 Author=Smurfier
 Name=LuaMarquee
 Version=6.2
 Information=An example skin for the LuaMarquee script.
 License=Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

[MeasureTitle]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=TITLE
Substitue="":""

[LuaTitle]
 Measure=Script
 ScriptFile=#@#Marquee.lua
 MeasureName=MeasureTitle

[StringTitle]
 Meter=String
 MeasureName=LuaTitle
 FontFace=b bath Towel
 FontColor=211,40,56
 FontSize=20
 X=100
 Y=100
 H=20
 W=1
 
[MeasureArtist]
Measure=Plugin
Plugin=WebNowPlaying
PlayerName=#Player#
PlayerType=ARTIST
Substitue="":""

[LuaArtist]
 Measure=Script
 ScriptFile=#@#Marquee.lua
 MeasureName=MeasureArtist
 
 [StringArtist]
 Meter=String
 MeasureName=LuaArtist
 FontFace=b bath Towel
 FontColor=211,40,56
 FontSize=20
 X=100
 Y=120
 H=20
 W=1000
Since I can change the size with the mouse wheel in my code, I can't use exactly fixed sizes there, which makes it difficult again.

If I get the problem solved somehow I am already at the goal
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Music player infinite text flow

Post by balala »

Kaizenitsune wrote: December 10th, 2022, 9:06 am Thats my Code or what you can call my code, actually I just mixed different skins together to get the skin I use now
No, this is practically your code, if it's the code you have worked with. And don't worry, we all mixing, using and working with lot of codes available out there. Excepting some extremely rare cases, which are ignored by most of us, skins usually are distributed under Creative Commons Attribution-Non-Commercial-Share Alike 3.0 licence, so you can use and modify them, at least as far as you don't sell them.
Kaizenitsune wrote: December 10th, 2022, 9:06 am I have tried again and am at least now so far that the basic formatting is there, ie Font, Font Size & Font Color, which would look like this:
Try the followings:
  • First add the following two Script measures to your code:

    Code: Select all

    [LuaTitle]
    Measure=Script
    ScriptFile=#@#Marquee.lua
    Text=""
    Variable=MeasureName
    MeasureName=MeasureTitle
    Delimiter=" | "
    Width=(9*#Scale#)
    
    [LuaArtist]
    Measure=Script
    ScriptFile=#@#Marquee.lua
    Text=""
    Variable=MeasureName
    MeasureName=MeasureArtist
    Delimiter=" | "
    Width=(9*#Scale#)
    As I hope you figured this out, [LuaTitle] is moving the title, while [LuaArtist] the artist.
  • Modify the [MeterTitle] and [MeterArtist] meters to the followings:

    Code: Select all

    [MeterTitle]
    Meter=String
    MeasureName=LuaTitle
    StringAlign=Left
    FontFace=b Bath Towel
    FontColor=211,40,56
    FontSize=(8*#Scale#)
    X=(100*#Scale#)
    Y=(5*#Scale#)
    W=(130*#Scale#)
    Text="%1"
    ;ClipString=1
    AntiAlias=1
    
    ...
    
    [MeterArtist]
    Meter=String
    MeasureName=LuaArtist
    StringAlign=Left
    StringCase=Upper
    FontFace=b Bath Towel
    FontColor=211,40,56
    FontSize=(7*#Scale#)
    X=(100*#Scale#)
    Y=(18*#Scale#)
    W=(130*#Scale#)
    Text="%1"
    ;ClipString=1
    AntiAlias=1
    See that the Clipstring options have been commented out.
Please try the above solution and let me know if there are problems.
Kaizenitsune
Posts: 33
Joined: December 9th, 2022, 3:25 am

Re: Music player infinite text flow

Post by Kaizenitsune »

balala wrote: December 10th, 2022, 8:45 pm No, this is practically your code, if it's the code you have worked with. And don't worry, we all mixing, using and working with lot of codes available out there. Excepting some extremely rare cases, which are ignored by most of us, skins usually are distributed under Creative Commons Attribution-Non-Commercial-Share Alike 3.0 licence, so you can use and modify them, at least as far as you don't sell them.
I'm reassured to hear that and no I would never sell anything that is not 100% my intellectual property.
balala wrote: December 10th, 2022, 8:45 pm Try the followings:
  • First add the following two Script measures to your code:

    Code: Select all

    [LuaTitle]
    Measure=Script
    ScriptFile=#@#Marquee.lua
    Text=""
    Variable=MeasureName
    MeasureName=MeasureTitle
    Delimiter=" | "
    Width=(9*#Scale#)
    
    [LuaArtist]
    Measure=Script
    ScriptFile=#@#Marquee.lua
    Text=""
    Variable=MeasureName
    MeasureName=MeasureArtist
    Delimiter=" | "
    Width=(9*#Scale#)
    As I hope you figured this out, [LuaTitle] is moving the title, while [LuaArtist] the artist.
  • Modify the [MeterTitle] and [MeterArtist] meters to the followings:

    Code: Select all

    [MeterTitle]
    Meter=String
    MeasureName=LuaTitle
    StringAlign=Left
    FontFace=b Bath Towel
    FontColor=211,40,56
    FontSize=(8*#Scale#)
    X=(100*#Scale#)
    Y=(5*#Scale#)
    W=(130*#Scale#)
    Text="%1"
    ;ClipString=1
    AntiAlias=1
    
    ...
    
    [MeterArtist]
    Meter=String
    MeasureName=LuaArtist
    StringAlign=Left
    StringCase=Upper
    FontFace=b Bath Towel
    FontColor=211,40,56
    FontSize=(7*#Scale#)
    X=(100*#Scale#)
    Y=(18*#Scale#)
    W=(130*#Scale#)
    Text="%1"
    ;ClipString=1
    AntiAlias=1
    See that the Clipstring options have been commented out.
Please try the above solution and let me know if there are problems.
I tried that and the output disappeared, I just thought about doing some kind of workaround for now and write the display so that it doesn't scale when you mouse over it and scroll, because that's a nice feature, but the floating text feature is a bit more important to me, which doesn't mean I'm giving up, but currently that's the only problem that's causing this to fail.

I have now tried to implement my code there and tried it without the scaling, however I now no longer see the bar which indicates how far the song has already progressed, so that was unfortunately only so a semi success.

I have unfortunately so far only a little in C++, HTML & CSS things written and real information about the Rainmeter coding I have unfortunately also not found.

Therefore, I am a complete beginner as far as everything is concerned.
Post Reply