Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.

Commit

Permalink
Rating and Cover url support
Browse files Browse the repository at this point in the history
Also now includes an example skin that has almost full coverage (No
volume and position support yet).
Also includes artwork for the various web stores.
  • Loading branch information
Trevor Hamilton committed Jun 19, 2017
1 parent ebdebc9 commit d7b5fc3
Show file tree
Hide file tree
Showing 30 changed files with 393 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,4 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
obj/x64/Debug/DesignTimeResolveAssemblyReferencesInput.cache
obj/x64/Release/DesignTimeResolveAssemblyReferencesInput.cache
Binary file added ExampleSkin/@resources/images/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/next.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/nocover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/previous.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/repeat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/repeatOne.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/replay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/rewind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/shuffle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/thumbsDown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/thumbsUp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/volumeDown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleSkin/@resources/images/volumeUp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
335 changes: 335 additions & 0 deletions ExampleSkin/Example.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,335 @@
[Rainmeter]
Update=100
BackgroundMode=2

[Metadata]
Name=WebNowPlaying Music Plugin Examples
Author=tjhrulz
Information="Various basic examples of how to use the WebNowPlaying"
Version=0.1.0
License=CC BY-NC-SA 4.0
;This is an example of how to use every info type and bang from version 1.0 or the WebNowPlaying
;Currently I have not setup support to get the rating of the current song this is planned for the next version
;After that if there is demand I may add the ability to get the upcoming songs info and/or the lyrics of the current song

[Variables]
Background=255,255,255
Color=0,0,0
Highlight=222,79,44

;Example of how to get the title of the current song, if GPMDP has no song selected or it is closed it will be a blank string.
[MeasureTitle]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Title
UpdateDivider = 5
Substitute="":"N/A"

;Example of how to get the artist of the current song, if GPMDP has no song selected or it is closed it will be a blank string.
[MeasureArtist]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Artist
UpdateDivider = 5
Substitute="":"N/A"

;Example of how to get the album of the current song, if GPMDP has no song selected or it is closed it will be a blank string.
[MeasureAlbum]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Album
UpdateDivider = 5
Substitute="":"N/A"

;Example of how to get the album art of the current song, if GPMDP has no song selected or it is closed it will be a blank string.
;Note: You should not put and onChange event on this measure as it will change twice for each song instead use CoverWebAddress
[MeasureAlbumArt]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Cover
;This will be displayed when the album art is downloading, in this example I have downloaded from GPM the placeholder image but it could be any image
DefaultPath=#@#Images\nocover.png
;This is where the album art will be downloaded to, note if the album does not have album art set it will still download the GPM placeholder album art to here
CoverPath=#@#Images\cover.png
UpdateDivider = 5

;The URL of the currently displayed image
;Note this is updated once a PlayerType=Cover has updated so it is safe to assume that the image has been updated
;Note I am pretty sure if you have more than one PlayerType=Cover it will update when the first one is done, in the future I will try to have this accept a cover plugin and update once that cover plugin is done.
[MeasureAlbumArtAddress]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=CoverWebAddress
UpdateDivider = 5

;This gets how far into the song you are formated in MM:SS
[MeasurePosition]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Position
UpdateDivider = 5
Substitute="":"N/A"

;This gets how long the song is formated in MM:SS
[MeasureDuration]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Duration
UpdateDivider = 5
Substitute="":"N/A"

;This is what percent of the way through the song you are
[MeasureProgress]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Progress
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":"Play","1":"Pause","2":"Play","3":"Replay"

;The repeat state of the player
;0 repeat is off
;1 repeat is on repeat only one song
;2 repeat all songs
[MeasureRepeat]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Repeat
;An example of how to change and color the icon based on the repeat state
IfCondition=MeasureRepeat = 0
IfTrueAction=[!SetOption MeterRepeat ImageTint "#Color#"][!SetOption MeterRepeat ImageName "#@#Images\repeat.png"]
IfCondition2=MeasureRepeat = 1
IfTrueAction2=[!SetOption MeterRepeat ImageTint "#Highlight#"][!SetOption MeterRepeat ImageName "#@#Images\repeatOne.png"]
IfCondition3=MeasureRepeat = 2
IfTrueAction3=[!SetOption MeterRepeat ImageTint "#Highlight#"][!SetOption MeterRepeat ImageName "#@#Images\repeat.png"]

;The shuffle state of the player
;0 shuffle is off
;1 shuffle is on
[MeasureShuffle]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Shuffle
;An example of how to color the shuffle icon based on the shuffle state
IfCondition=MeasureShuffle = 0
IfTrueAction=[!SetOption MeterShuffle ImageTint "#Color#"]
IfCondition2=MeasureShuffle = 1
IfTrueAction2=[!SetOption MeterShuffle ImageTint "#Highlight#"]

;The rating of the current song
;-1 is thumbs down
;0 is no rating
;1 is thumbs up
[MeasureRating]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Rating
;An example of how to color two rating icons based on the rating
IfCondition=(MeasureRating < 3) && (MeasureRating > 0)
IfTrueAction=[!SetOption MeterThumbsUp ImageTint "#Color#"][!SetOption MeterThumbsDown ImageTint "#Highlight#"]
IfCondition2=MeasureRating > 3
IfTrueAction2=[!SetOption MeterThumbsUp ImageTint "#Highlight#"][!SetOption MeterThumbsDown ImageTint "#Color#"]
IfCondition3=(MeasureRating = 0) || (MeasureRating = 3)
IfTrueAction3=[!SetOption MeterThumbsUp ImageTint "#Color#"][!SetOption MeterThumbsDown ImageTint "#Color#"]

[MeterBG]
Meter=Image
SolidColor=#CurrBG#
h=525
w=250
Group=DynamicColors

[MeterAlbumArt]
Meter=Image
h=250
w=250
MeasureName=MeasureAlbumArt
;Example of how the bangs work, in this example clicking the album art will set the song to halfway through the song, the number after SetPosition is the percent through the song you want
;Note: the percent internally is an integer so it does not support decimals, same with the standard NowPlaying plugin. If people want it to I could make SetPosition support decimals however.
LeftMouseUpAction=[!CommandMeasure MeasureArtist "SetPosition 50"]

[MeterHeaderCurrent]
Meter=String
Text="Current Song:"
y=R
FontColor=#Color#,255
Group=DynamicColors

[MeterSongInfo]
Meter=String
y=R
h=15
w=250
FontColor=#Color#,255
Group=DynamicColors
MeasureName=MeasureTitle
ClipString=2

[MeterArtistInfo]
Meter=String
y=R
h=15
w=250
FontColor=#Color#,255
Group=DynamicColors
MeasureName=MeasureArtist
ClipString=2

[MeterAlbumInfo]
Meter=String
y=R
h=15
w=250
FontColor=#Color#,255
Group=DynamicColors
MeasureName=MeasureAlbum
ClipString=2

[MeterPrevious]
Meter=Image
ImageName=#@#Images\previous.png
ImageTint=#Color#
X=0
Y=R
W=48
H=48
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=#@#images\[MeasurePlayPause].png
ImageTint=#Color#
X=R
Y=r
W=48
H=48
Group=DynamicColors
;Example of the playpause bang
;Note the plugin does not have support for a bang that only plays or only pauses and the standard GPMDP API, in the future if there is demand for them I can extra checks so that they can work
LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "PlayPause"]
DynamicVariables=1

[MeterNext]
Meter=Image
ImageName=#@#Images\Next.png
ImageTint=#Color#
X=R
Y=r
W=48
H=48
Group=DynamicColors
;Example of the next bang, this skips to the next song
LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Next"]
AntiAlias=1

[MeterRepeat]
Meter=Image
ImageTint=#Color#
X=0
Y=R
W=48
H=48
Group=DynamicColors
;Example of the repeat bang, this toggles the repeat in the order of off -> on -> repeat one
LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Repeat"]
AntiAlias=1

[MeterShuffle]
Meter=Image
ImageName=#@#Images\shuffle.png
ImageTint=#Color#
X=R
Y=r
W=48
H=48
Group=DynamicColors
;Example of the repeat bang, this toggles the shuffle between off and on
LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Shuffle"]
AntiAlias=1

[MeterThumbsUp]
Meter=Image
ImageName=#@#Images\thumbsUp.png
ImageTint=#Color#
X=R
Y=r
W=48
H=48
Group=DynamicColors
;Example of the thumbs up bang, this toggles the thumbs up status of the song
LeftMouseDownAction=[!CommandMeasure MeasurePlayPause "ToggleThumbsUp"]
AntiAlias=1

[MeterThumbsDown]
Meter=Image
ImageName=#@#Images\thumbsDown.png
ImageTint=#Color#
X=R
Y=r
W=48
H=48
Group=DynamicColors
;Example of the thumbs down bang, this toggles the thumbs down status of the song
LeftMouseDownAction=[!CommandMeasure MeasurePlayPause "ToggleThumbsDown"]
AntiAlias=1

[MeterVolumeDown]
Meter=Image
ImageName=#@#Images\VolumeDown.png
ImageTint=#Color#
X=0
Y=R
W=48
H=48
Group=DynamicColors
;Example of the volume bang, this decreases the volume by 5%
LeftMouseDownAction=[!CommandMeasure MeasurePlayPause "SetVolume -5"]
AntiAlias=1

[MeterVolumeUp]
Meter=Image
ImageName=#@#Images\VolumeUp.png
ImageTint=#Color#
X=R
Y=r
W=48
H=48
Group=DynamicColors
;Example of the volume bang, this increases the volume by 5%
LeftMouseDownAction=[!CommandMeasure MeasurePlayPause "SetVolume +5"]
AntiAlias=1

[MeterPositionInfo]
Meter=String
y=R
FontColor=#Color#,255
Group=DynamicColors
MeasureName=MeasurePosition

[MeterDurationInfo]
Meter=String
x=R
y=r
FontColor=#Color#,255
Group=DynamicColors
MeasureName=MeasureDuration

[MeterConnectionProgress]
Meter=String
y=R
Text=%1%
FontColor=#Color#,255
Group=DynamicColors
MeasureName=MeasureProgress
Loading

0 comments on commit d7b5fc3

Please sign in to comment.