It is currently October 3rd, 2023, 5:34 pm

Simple Text Marquee

Tips and Tricks from the Rainmeter Community
User avatar
Yincognito
Rainmeter Sage
Posts: 6073
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Simple Text Marquee

Post by Yincognito »

RoseRain wrote: June 19th, 2023, 6:03 am I was wondering if anyone knows how to use this marquee method as a spotify player.
By the way, the process should be similar for the WebNowPlaying plugin you are trying to make it work in the other thread, so once you have it working, this issue can be solved as well like I described above. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
RoseRain
Posts: 36
Joined: June 30th, 2022, 1:39 pm

Re: Simple Text Marquee

Post by RoseRain »

Yincognito wrote: June 20th, 2023, 3:43 pm By the way, the process should be similar for the WebNowPlaying plugin you are trying to make it work in the other thread, so once you have it working, this issue can be solved as well like I described above. ;-)
Hello. I have a few other player skins, so I have been looking at the code there and adding things to the marquee code from there as a guide, to include the artist, and song titles. Still working on it. Not quite there yet.

Yes, I have been using Rainmeter for a long time. Coding and techincal stuff doesn't come easy to me. I have taken long breaks from Rainmeter, forgetting a lot in the process lol. I apologise if it seemed like I was expecting someone to do it all for me. I certainly don't expect anything, and am very grateful for any replies, or advice.

Thanks for your reply. I appreciate it a lot.
User avatar
Yincognito
Rainmeter Sage
Posts: 6073
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Simple Text Marquee

Post by Yincognito »

RoseRain wrote: June 21st, 2023, 1:11 am Hello. I have a few other player skins, so I have been looking at the code there and adding things to the marquee code from there as a guide, to include the artist, and song titles. Still working on it. Not quite there yet.
Alright, no need to apologize, just wanted to make sure that at least you tried. There's no problem if you didn't succeed yet, but this was so simple that you shouldn't have had any issues in making it work, even if it's not your thing, apart from some expected "glitches" when the track changes.

Here's the NowPlaying code, it works as expected - you should have no problem in replacing the NowPlaying measures with the corresponding WebNowPlaying ones and use them instead in the meters, when you'll set the WebNowPlaying system properly based on the replies from the other thread:

Code: Select all

[Variables]
Player=Winamp
AnimationSpeed=32
Wait=1500
ArtistX=0
TitleX=0

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
OnRefreshAction=[!CommandMeasure Marquee "Stop 1"][!CommandMeasure Marquee "Stop 2"][!CommandMeasure Marquee "Execute 1"][!CommandMeasure Marquee "Execute 2"]
MiddleMouseUpAction=[!Refresh]

---Measures---

[ArtistTextOffset]
Group=Marquee
Measure=Calc
Formula=(Max(0,([ArtistText:W]-[Container:W])))
DynamicVariables=1

[TitleTextOffset]
Group=Marquee
Measure=Calc
Formula=(Max(0,([TitleText:W]-[Container:W])))
DynamicVariables=1

[Marquee]
Group=Marquee
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat MoveArtist,#AnimationSpeed#,[ArtistTextOffset:] | Wait #Wait# | ResetArtist | Wait #Wait# | DoOverArtist | Wait #Wait#
ResetArtist=[!SetVariable ArtistX 0][!UpdateMeasure Marquee][!UpdateMeter ArtistText][!Redraw]
MoveArtist=[!SetVariable ArtistX (#ArtistX#-1)][!UpdateMeasure Marquee][!UpdateMeter ArtistText][!Redraw]
DoOverArtist=[!CommandMeasure Marquee "Stop 1"][!CommandMeasure Marquee "Execute 1"]
ActionList2=Repeat MoveTitle,#AnimationSpeed#,[TitleTextOffset:] | Wait #Wait# | ResetTitle | Wait #Wait# | DoOverTitle | Wait #Wait#
ResetTitle=[!SetVariable TitleX 0][!UpdateMeasure Marquee][!UpdateMeter TitleText][!Redraw]
MoveTitle=[!SetVariable TitleX (#TitleX#-1)][!UpdateMeasure Marquee][!UpdateMeter TitleText][!Redraw]
DoOverTitle=[!CommandMeasure Marquee "Stop 2"][!CommandMeasure Marquee "Execute 2"]
DynamicVariables=1

[Artist]
Measure=NowPlaying
PlayerName=#Player#
PlayerType=Artist
OnChangeAction=[!SetVariable ArtistX 0][!SetVariable TitleX 0][!UpdateMeterGroup Marquee][!Redraw][!UpdateMeasureGroup Marquee][!CommandMeasure Marquee "Stop 1"][!CommandMeasure Marquee "Stop 2"][!CommandMeasure Marquee "Execute 1"][!CommandMeasure Marquee "Execute 2"]
DynamicVariables=1

[Title]
Measure=NowPlaying
PlayerName=[Artist]
PlayerType=Title
OnChangeAction=[!SetVariable ArtistX 0][!SetVariable TitleX 0][!UpdateMeterGroup Marquee][!Redraw][!UpdateMeasureGroup Marquee][!CommandMeasure Marquee "Stop 1"][!CommandMeasure Marquee "Stop 2"][!CommandMeasure Marquee "Execute 1"][!CommandMeasure Marquee "Execute 2"]
DynamicVariables=1

---Styles---

[Text]
FontFace=Calibri
FontColor=230,230,230
FontSize=15
FontWeight=600
X=0r
Y=0R
AntiAlias=1
DynamicVariables=1

---Meters---

[Background]
Meter=Shape
Shape=Rectangle 1,1,246,84,6 | StrokeWidth 2 | Stroke Color 50,50,50 | Fill Color 15,15,15

[ArtistLabel]
Meter=String
MeterStyle=Text
X=16
Y=16
Text=Artist

[TitleLabel]
Meter=String
MeterStyle=Text
Text=Title

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

[ArtistText]
Group=Marquee
Container=Container
Meter=String
MeterStyle=Text
X=#ArtistX#
Y=0r
MeasureName=Artist
Text=%1

[TitleText]
Group=Marquee
Container=Container
Meter=String
MeterStyle=Text
X=#TitleX#
MeasureName=Title
Text=%1
Just like in the original code, the artist and title are both in the same container meter, so repositioning the container will reposition the playing info accordingly. As you can see, the code is very similar to the one from the original sample.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
RoseRain
Posts: 36
Joined: June 30th, 2022, 1:39 pm

Re: Simple Text Marquee

Post by RoseRain »

Yincognito wrote: June 21st, 2023, 10:09 am Just like in the original code, the artist and title are both in the same container meter, so repositioning the container will reposition the playing info accordingly. As you can see, the code is very similar to the one from the original sample.
Thank you very much for this. I like things minimal, so I was able to customise it the way I like, change the style and add the timer as well. I made it transparent on my deskop and made player control buttons too and a small Spotify launcher. Your code really helped me. Thank you! and thank you to keifufu who helped make the timer work.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 6073
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Simple Text Marquee

Post by Yincognito »

RoseRain wrote: June 22nd, 2023, 5:48 am Thank you very much for this. I like things minimal, so I was able to customise it the way I like, change the style and add the timer as well. I made it transparent on my deskop and made player control buttons too and a small Spotify launcher. Your code really helped me. Thank you! and thank you to keifufu who helped make the timer work.
Excellent! Glad you finally achieved what you wanted! :great:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth