It is currently May 3rd, 2024, 11:57 pm

NowPlaying:How to display 2 instances of title

Get help with creating, editing & fixing problems with skins
Dwarlorf
Posts: 16
Joined: March 23rd, 2020, 8:31 am

Re: NowPlaying:How to display 2 instances of title

Post by Dwarlorf »

balala wrote: April 1st, 2020, 6:13 pm I see what are you talking about, but in order to can help you furtherly, I'd need those (probably) mp3 files you are working with. Would be much easier for me to work with those. So, if you could send me one (or one having and other not having features) file having the described problems, it would help extremely much to can furtherly help.
Is this possible?
I sent you a PM.
Dwarlorf wrote: April 1st, 2020, 4:51 pm I would really like to have it show nothing when there's no feature.

To do this I figured that I somehow had to compare [MeasureTitle] with [MeasureFeature] because when there's no feature the value of both measures are the same. I managed by using a third measure ([MeasureNoFeat]) and a meter using IfMatch to compare [MeasureFeature] with [MeasureTitle] like this:

Code: Select all

[MeasureNoFeat]
Measure=String
String=[MeasureFeature]
IfMatch=[MeasureTitle]
IfMatchAction=[!SetOption ShowStringMatch Text ""]
IfNotMatchAction=[!SetOption ShowStringMatch Text "No Match"]
DynamicVariables=1

[ShowStringMatch]
Meter=String
X=5
Y=430
SolidColor=250,250,250,210
W=75
H=20

But I can't figure out how I can achieve the same IfMatch effect combined with a substitution in the measure [MeasureFeat] so that it shows either the features or nothing if there's no featuring.So I guess I still need your help with that, if you don't mind.
I'm thinking if it's not better to display all metadata values (Artist :, Album :, etc) in meters like above? Because then I can display the values neatly below each other on the same x-axis position. If you look carefully on the : characters do not completely line out.:
Image
Is it common practice to approach skin layouts like this?
User avatar
Yincognito
Rainmeter Sage
Posts: 7197
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: NowPlaying:How to display 2 instances of title

Post by Yincognito »

Dwarlorf wrote: March 28th, 2020, 10:29 amAs I understand it I cannot use PlayerType title twice and have it show different values? Is there a workaround or some other way achieve this?
In case this issue is not yet solved, having multiple title measures works for me, in Winamp. Maybe it works for Foobar as well:

Code: Select all

[Variables]
SW=1
LW=110
RW=440
CW=14

[Rainmeter]
Update=1000
AccurateText=2
DynamicWindowSize=1

[Metadata]
Name=
Author=
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

---Measures---

[MeasurePlayer]
Measure=NowPlaying
PlayerName=CAD
PlayerType=FILE

[MeasureArtist]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=ARTIST

[MeasureAlbum]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=ALBUM

[MeasureYear]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=YEAR
RegExpSubstitute=1
Substitute="^([0])$":""

[MeasureTrack]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=NUMBER
RegExpSubstitute=1
Substitute="^([1-9])$":"0\1","^([0])$":""

[MeasureTitle]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=TITLE
RegExpSubstitute=1
Substitute="(?siU)^(.*)[\(\s]+?(?:featuring|feat|ft)[\.\s]+?(.*)[\)\s]*?$":"\1"

[MeasureFeaturing]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=TITLE
RegExpSubstitute=1
Substitute="(?siU)^(.*)[\(\s]+?(?:featuring|feat|ft)[\.\s]+?(.*)[\)\s]*?$":"\2","(?:^$|^\\2$|^[MeasureTitle:EscapeRegExp]$)":"None"
DynamicVariables=1

[MeasureLength]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=DURATION
Formula=(((MeasureDuration = 0) )
Substitute="00:00":""

[MeasureProgress]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=PROGRESS

[MeasureStatus]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=STATE
Substitute="0":"Foobar is off/not playing","1":"Foobar is playing","2":"Foobar is paused"

[MeasureVolume]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=VOLUME

---Styles---

[SBase]
FontColor=250,250,250,210
FontFace=Sansation
FontSize=18
StringStyle=Normal
StringAlign=LEFT
AntiAlias=1
ClipString=1

[SLeftCol]
X=0
Y=0R
W=#LW#

[SRightCol]
X=0R
Y=0r
W=#RW#

---Meters---

[MeterArtistLabel]
Meter=STRING
MeterStyle=SBase | SLeftCol
Text="Artist"

[MeterArtistValue]
Meter=STRING
MeterStyle=SBase | SRightCol
MeasureName=MeasureArtist
Text=": %1"

[MeterAlbumLabel]
Meter=STRING
MeterStyle=SBase | SLeftCol
Text="Album"

[MeterAlbumValue]
Meter=STRING
MeterStyle=SBase | SRightCol
MeasureName=MeasureAlbum
Text=": %1"

[MeterYearLabel]
Meter=STRING
MeterStyle=SBase | SLeftCol
Text="Year"

[MeterYearValue]
Meter=STRING
MeterStyle=SBase | SRightCol
MeasureName=MeasureYear
Text=": %1"

[MeterTrackLabel]
Meter=STRING
MeterStyle=SBase | SLeftCol
Text="Track"

[MeterTrackValue]
Meter=STRING
MeterStyle=SBase | SRightCol
MeasureName=MeasureTrack
Text=": %1"

[MeterLengthLabel]
Meter=STRING
MeterStyle=SBase | SLeftCol
Text="Length"

[MeterLengthValue]
Meter=STRING
MeterStyle=SBase | SRightCol
MeasureName=MeasureLength
Text=": %1"

[MeterTitleLabel]
Meter=STRING
MeterStyle=SBase | SLeftCol
Text="Song"

[MeterTitleValue]
Meter=STRING
MeterStyle=SBase | SRightCol
MeasureName=MeasureTitle
Text=": %1"

[MeterFeaturingLabel]
Meter=STRING
MeterStyle=SBase | SLeftCol
Text="Featuring"

[MeterFeaturingValue]
Meter=STRING
MeterStyle=SBase | SRightCol
MeasureName=MeasureFeaturing
Text=": %1"

[MeterProgressLabel]
Meter=STRING
MeterStyle=SBase | SLeftCol
Text="Progress"

[MeterProgressColon]
Meter=STRING
MeterStyle=SBase | SRightCol
W=#CW#
Text=":"

[MeterProgressValue]
Meter=BAR
MeterStyle=SBase | SRightCol
Y=11r
W=(#RW#-#CW#)
H=15
SolidColor=150,150,150,255
BarColor=250,250,250,210
BarOrientation=Horizontal
MeasureName=MeasureProgress
DynamicVariables=1

[MeterSeparator]
Meter=Shape
MeterStyle=SBase | SLeftCol
Y=([MeterProgressLabel:H]/2)R
W=(#LW#+#RW#)
H=(#SW#)
Shape=Line 0,(#SW#/2),(#LW#+#RW#),(#SW#/2) | StrokeWidth #SW# | Stroke Color 255,255,255,255
DynamicVariables=1

[MeterStatusLabel]
Meter=STRING
MeterStyle=SBase | SLeftCol
Y=7R
Text="Status"

[MeterStatusValue]
Meter=STRING
MeterStyle=SBase | SRightCol
MeasureName=MeasureStatus
Text=": %1"

[MeterVolumeLabel]
Meter=STRING
MeterStyle=SBase | SLeftCol
Text="Volume"

[MeterVolumeColon]
Meter=STRING
MeterStyle=SBase | SRightCol
W=#CW#
Text=":"

[MeterVolumeValue]
Meter=BAR
MeterStyle=SBase | SRightCol
Y=11r
W=(#RW#-#CW#)
H=15
SolidColor=150,150,150,255
BarColor=250,250,250,210
BarOrientation=Horizontal
MeasureName=MeasureVolume
DynamicVariables=1
As you can see, no need for an IfMatch, as the comparison (and the replacement) can be done inside the RegExp Substitution. The variables allow some design tweaks, since:
SW = acronym for Stroke Width (the thickness of the separator line, which, by the way, should be drawn using a shape, and not the Line measure)
LW = acronym for Left Width (the width of the left column, the one displaying the labels)
RW = acronym for Right Width (the width of the right column, the one displaying the values)
CW = acronym for Colon Width (the width of the colon, i.e. the : after the labels)

Preview:
Foobar.jpg
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Dwarlorf
Posts: 16
Joined: March 23rd, 2020, 8:31 am

Re: NowPlaying:How to display 2 instances of title

Post by Dwarlorf »

Yincognito wrote: April 4th, 2020, 2:51 am In case this issue is not yet solved, having multiple title measures works for me, in Winamp. Maybe it works for Foobar as well:
That certainly works. Thank you very much! I'll look into the code to try to understand how everything works exactly, and tweak it a little bit.
User avatar
Yincognito
Rainmeter Sage
Posts: 7197
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: NowPlaying:How to display 2 instances of title

Post by Yincognito »

Dwarlorf wrote: April 4th, 2020, 8:52 am That certainly works. Thank you very much! I'll look into the code to try to understand how everything works exactly, and tweak it a little bit.
Okeydokey. If you have any questions regarding how it works, feel free to ask. I didn't cover the possibility of "featuring" to be in the Artist part of the MP3 tag (personally, I have a few of those), but even so, adapting it shouldn't be too difficult, basically doing the same as it was done for the Title (those 2 measures and their substitutes), and then adding both Featuring measures (the one for Artist and the one for the Title) to the [MeterFeaturingValue] meter using a space or a comma to separate them. Just saying.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16198
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: NowPlaying:How to display 2 instances of title

Post by balala »

Dwarlorf wrote: April 4th, 2020, 8:52 am That certainly works. Thank you very much! I'll look into the code to try to understand how everything works exactly, and tweak it a little bit.
Have Yincognito soled?
Dwarlorf
Posts: 16
Joined: March 23rd, 2020, 8:31 am

Re: NowPlaying:How to display 2 instances of title

Post by Dwarlorf »

balala wrote: April 4th, 2020, 9:40 am Have Yincognito soled?
Yes he has. I was about to send you a message, so feel free to stop your efforts. And thanks once again!
Yincognito wrote: April 4th, 2020, 9:10 am Okeydokey. If you have any questions regarding how it works, feel free to ask.
I will.
Yincognito wrote: April 4th, 2020, 9:10 am I didn't cover the possibility of "featuring" to be in the Artist part of the MP3 tag (personally, I have a few of those), but even so, adapting it shouldn't be too difficult, basically doing the same as it was done for the Title (those 2 measures and their substitutes), and then adding both Featuring measures (the one for Artist and the one for the Title) to the [MeterFeaturingValue] meter using a space or a comma to separate them. Just saying.
I might have a few too but basically I'm reformatting new music so that the featuring is in the title tag and not the artist tag and change old stuff when I come across it.
User avatar
balala
Rainmeter Sage
Posts: 16198
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: NowPlaying:How to display 2 instances of title

Post by balala »

Dwarlorf wrote: April 4th, 2020, 9:51 am Yes he has. I was about to send you a message, so feel free to stop your efforts. And thanks once again!
Ok, in this case I'm not working on this anymore. Sorry I didn't finished what have i promised, but at least it's good someone (precisely Yincognito) did. :thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 7197
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: NowPlaying:How to display 2 instances of title

Post by Yincognito »

Dwarlorf wrote: April 4th, 2020, 9:51 am... but basically I'm reformatting new music so that the featuring is in the title tag and not the artist tag and change old stuff when I come across it.
I see. There might be some programs that do this automatically, you know... I'm not 100% sure about this, but it worth investigating, especially if you have a lot of music to "convert" to the new "system".
balala wrote: April 4th, 2020, 10:13 amSorry I didn't finished what have i promised, but at least it's good someone (precisely Yincognito) did. :thumbup:
You deserve to be helped by others as well, especially regarding the amount of effort you put in on the forum. You work for the benefit of others a lot, so the least one can do when he can is to ease your burden. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16198
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: NowPlaying:How to display 2 instances of title

Post by balala »

Yincognito wrote: April 4th, 2020, 11:48 am You deserve to be helped by others as well, especially regarding the amount of effort you put in on the forum. You work for the benefit of others a lot, so the least one can do when he can is to ease your burden. ;-)
Yes, but I love Rainmeter and working with the skins. That's why it's not a huge effort.
User avatar
Yincognito
Rainmeter Sage
Posts: 7197
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: NowPlaying:How to display 2 instances of title

Post by Yincognito »

balala wrote: April 4th, 2020, 11:53 am Yes, but I love Rainmeter and working with the skins. That's why it's not a huge effort.
I know you do - I do as well. But sometimes things accumulate and become difficult to manage for a single (or a few) person(s). That's the whole point of people working in shifts in factories and such. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth