It is currently August 9th, 2022, 10:31 pm

WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

Plugins and Addons popular with the Community
Doggo_[無限]
Posts: 3
Joined: January 23rd, 2022, 8:13 am

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

Post by Doggo_[無限] »

sorry about that, here it is

Code: Select all

[Rainmeter]
Update=200
Author=doggo
BackgroundMode=1
SolidColor=0,0,0,1
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]
@include=#@#Variables.inc
Scale=2.2

[MeasureAudioOutput]
Measure=Plugin
Plugin=AudioLevel
Port=Output
FFTSize=4096
FFTOverlap=2048
FFTAttack=0
FFTDecay=150
FreqMin=50
FreqMax=16500
Sensitivity=35
Bands=7
____________________________________________________________
[MeterStyle]
BarOrientation=Vertical
X=(3*#Scale#)r
Y=(33*#Scale#)
W=(1.5*#Scale#)
H=(6*#Scale#)
Flip=1
BarColor=0,0,0

[MeasureStatus]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Status

[MeasureTitle]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Title
UpdateDivider = 5
Substitute="":"N/A"

[MeasureArtist]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Artist
UpdateDivider = 5
Substitute="":"N/A"

[MeasureAlbum]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Album
UpdateDivider = 5
Substitute="":"N/A"

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

[MeasureDuration]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Duration
UpdateDivider = 5
Substitute="":"N/A"

[MeasureProgress]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Progress
Substitute="":"N/A"

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

;The play state of the player
;0 is no song is selected, this will almost never happen as the plugin retains the last known song in the future I may change it so it clears when the websocket closes but I dont think I want to do that in the event the websocket closes unexpectedly you may want it to keep old data
;1 is playing
;2 is paused
[MeasurePlayPause]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=State
Substitute="0":"pause.png","1":"pause.png","2":"pause.png","3":"replay.png"
____________________________________________________________
[MeasurePositionX]
Measure=Calc
Formula=(63*#Scale#) + (27*#Scale#) * cos(PI/2 - (MeasureProgress/100) * 2 * PI)
DynamicVariables=1

[MeasurePositionY]
Measure=Calc
Formula=(65*#Scale#) - (27*#Scale#) * sin(PI/2 - (MeasureProgress/100) * 2 * PI)
DynamicVariables=1
____________________________________________________________
[MeasureMinutesRemaining]
Measure=Calc
Formula=Trunc((MeasurePosition)/60)
RegExpSubstitute=1
Substitute="^(.)$":"0\1"

[MeasureSecondsRemaining]
Measure=Calc
Formula=((MeasurePosition) % 60)
RegExpSubstitute=1
Substitute="^(.)$":"0\1"
____________________________________________________________
[MeterBackground]
Meter=Image
ImageName=#@#Background.png
X=(0*#Scale#)
Y=(20*#Scale#)
W=(226*#Scale#)
ImageAlpha=0
AntiAlias=1
UpdateDivider=-1

[MeterBackground2]
Meter=Image
ImageName=#@#Background2.png
X=(38*#Scale#)
Y=(40*#Scale#)
W=(50*#Scale#)
AntiAlias=1
UpdateDivider=-1
____________________________________________________________
[MeterRoundBar]
Meter=Shape
X=(0*#Scale#)
Y=(0*#Scale#)
Shape=Ellipse (63*#Scale#),(65*#Scale#),(27*#Scale#) | StrokeWidth (2*#Scale#) | Fill Color 255,255,255,0 | StrokeColor 255,255,255,255
Shape2=Arc [MeasurePositionX],[MeasurePositionY], ((63*#Scale#)+1),((65*#Scale#)-(27*#Scale#)),(27*#Scale#),(27*#Scale#),0,1,(Round([MeasureProgress]/100)),0 | StrokeWidth (2*#Scale#) | Stroke Color 100,100,100
DynamicVariables=1
____________________________________________________________
[MeterAlbumArt]
Meter=Image
MeasureName=MeasureCover
X=(38*#Scale#)
Y=(40*#Scale#)
W=(50*#Scale#)
MaskImageName=#@#mask.png
____________________________________________________________
[MeterArtist]
Meter=String
MeasureName=MeasureArtist
StringAlign=Center
StringCase=Upper
FontFace=Quicksand Bold
FontColor=255,255,255
FontSize=(7*#Scale#)
X=(63*#Scale#)
Y=(94*#Scale#)
W=(120*#Scale#)
Text="%1"
ClipString=1
AntiAlias=1

[MeterTitle]
Meter=String
MeasureName=MeasureTitle
StringAlign=Center
FontFace=Quicksand
FontColor=255,255,255
FontSize=(5*#Scale#)
X=(0*#Scale#)r
Y=(15*#Scale#)r
W=(120*#Scale#)
Text="%1"
ClipString=1
AntiAlias=1

[MeterPosition]
Meter=String
MeasureName=MeasurePosition
StringAlign=
FontFace=Quicksand
FontColor=255,255,255
FontSize=(6*#Scale#)
X=(1*#Scale#)
Y=(119*#Scale#)
Text=""
AntiAlias=1

[MeterTotalPosition]
Meter=String
MeasureName=MeasureDuration
StringAlign=
FontFace=Quicksand
FontColor=255,255,255
FontSize=(6*#Scale#)
X=(109*#Scale#)
Y=(119*#Scale#)
Text=""
AntiAlias=1
____________________________________________________________
[MeterBar]
Meter=Shape
X=(25*#Scale#)
Y=(122*#Scale#)
Shape=Rectangle 0,0,(76*#Scale#),(1*#Scale#),0 | Fill Color 255,255,255,255 | StrokeWidth 0
Shape2=Rectangle 0,0,([MeasureProgress]*0.75*#Scale#),(1*#Scale#),0 | Fill Color 100,100,100 | StrokeWidth 0
Shape3=Ellipse ([MeasureProgress]*0.75*#Scale#),(0.8*#Scale#),(4*#Scale#) |Fill Color 100,100,100 | StrokeWidth 0
Shape4=Rectangle 0,(-1*#Scale#),(76*#Scale#),(3*#Scale#),0 | Fill Color 100,100,100,100| StrokeWidth 0
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure "MeasureProgress" "SetPosition $MouseX:%$"]
____________________________________________________________
[MeterPrevious]
Meter=Image
ImageName=#@#Previous.png
X=(43*#Scale#)
Y=(130*#Scale#)
W=(10*#Scale#)
Group=DynamicColors
;Example of the previous bang
;Note this will go to the begin of the song then go to the previous song
LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Previous"]
AntiAlias=1

[MeterPlayPause]
Meter=Image
ImageName=#@#play.png
ImageTint=#Color#
X=(58*#Scale#)
Y=(130*#Scale#)
W=(10*#Scale#)
Group=DynamicColors
LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "PlayPause"]
DynamicVariables=1

[MeterNext]
Meter=Image
ImageName=#@#Next.png
X=(73*#Scale#)
Y=(130*#Scale#)
W=(10*#Scale#)
Group=DynamicColors
;Example of the next bang, this skips to the next song
LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Next"]
___________________
User avatar
balala
Rainmeter Sage
Posts: 14448
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

Post by balala »

Doggo_[無限] wrote: January 23rd, 2022, 12:59 pm sorry about that, here it is
What you want to achieve is related to the [MeasurePlayPause] measure. But as far as I can tell the substitution added to this measure is a little bit wrong, because it returns pause(.png) for all three values from 0 to 2 and replay(.png) (I suppose this is the image of "play" status) only for value 3. I didn't try your code (would be fine to have the involved images), but only looking to the code I'd try the following:
  • Remove the above mentioned Substitute option of the [MeasurePlayPause] measure.
  • Add to the same [MeasurePlayPause] measure the following options:

    Code: Select all

    [MeasurePlayPause]
    ...
    IfCondition=(#CURRENTSECTION#=1)
    IfTrueAction=[!SetOption MeterPlayPause ImageName "#@#Pause.png"][!UpdateMeter "MeterPlayPause"][!Redraw]
    IfFalseAction=[!SetOption MeterPlayPause ImageName "#@#Play.png"][!UpdateMeter "MeterPlayPause"][!Redraw]
    (I assumed here, perhaps by mistake, that the images used for the buttons are Play.png and Pause.png - if they have any other names, please replace the names in the !SetOption bangs).
  • If you added the above IfCondition, feel free to remove the ImageName=#@#play.png option of the [MeterPlayPause] meter, because this option is set now through the added IfCondition (however removing it is not mandatory).
Doggo_[無限]
Posts: 3
Joined: January 23rd, 2022, 8:13 am

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

Post by Doggo_[無限] »

balala wrote: January 23rd, 2022, 2:35 pm What you want to achieve is related to the [MeasurePlayPause] measure. But as far as I can tell the substitution added to this measure is a little bit wrong, because it returns pause(.png) for all three values from 0 to 2 and replay(.png) (I suppose this is the image of "play" status) only for value 3. I didn't try your code (would be fine to have the involved images), but only looking to the code I'd try the following:
  • Remove the above mentioned Substitute option of the [MeasurePlayPause] measure.
  • Add to the same [MeasurePlayPause] measure the following options:

    Code: Select all

    [MeasurePlayPause]
    ...
    IfCondition=(#CURRENTSECTION#=1)
    IfTrueAction=[!SetOption MeterPlayPause ImageName "#@#Pause.png"][!UpdateMeter "MeterPlayPause"][!Redraw]
    IfFalseAction=[!SetOption MeterPlayPause ImageName "#@#Play.png"][!UpdateMeter "MeterPlayPause"][!Redraw]
    (I assumed here, perhaps by mistake, that the images used for the buttons are Play.png and Pause.png - if they have any other names, please replace the names in the !SetOption bangs).
  • If you added the above IfCondition, feel free to remove the ImageName=#@#play.png option of the [MeterPlayPause] meter, because this option is set now through the added IfCondition (however removing it is not mandatory).
Image

omg thx it works
User avatar
balala
Rainmeter Sage
Posts: 14448
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

Post by balala »

Doggo_[無限] wrote: January 23rd, 2022, 3:07 pm omg thx it works
Great! :thumbup: