It is currently September 8th, 2024, 12:14 am

How to make RM add the extention file in a text line.

Get help with creating, editing & fixing problems with skins
User avatar
Bayushi Tai
Posts: 24
Joined: July 17th, 2012, 4:50 am

How to make RM add the extention file in a text line.

Post by Bayushi Tai »

Hello everyone, I’ll like to have a code lines so my skin can tell me the extension of the file that my audio app is playing… for example:

I’m playing a song in AIMP and my skin already says:

It’s My Life
Bon Jovi
Crush (2000)

1052 kbps.


I’m playing a FLAC file, I’ll like that my last line says:

FLAC in 1052 kbps.

How can I do that?

here's the code:

Code: Select all

[Title]
Meter=String
MeasureName=mTitle
X=232
Y=400
W=150
H=22
FontFace=Accidental Presidency
FontSize=14
FontColor=64,103,116,255
StringAlign=RIGHT
StringEffect=Shadow
ClipString=1
AntiAlias=1
Text="%1"
Hidden=1
Group=up

[Artist]
Meter=String
MeasureName=mArtist
X=232
Y=428
W=150
H=22
FontFace=Accidental Presidency
FontSize=14
FontColor=64,103,116,255
AntiAlias=1
ClipString=1
StringEffect=Shadow
StringAlign=RIGHT
Hidden=1
Group=up

[MeasurePlayer]
Measure=Plugin
Plugin=NowPlaying
PlayerName=#Player#
PlayerType=ARTIST

[MeasureAlbum]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=Album

[MeasureYear]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=Year


[MeterTrackInfo]
Meter=String
MeasureName=MeasureAlbum
MeasureName2=MeasureYear
Text="%1 (%2)"
X=232
Y=460
W=150
H=50
FontFace=Accidental Presidency
FontSize=14
FontColor=64,103,116,255
StringAlign=RIGHT
StringEffect=Shadow
AntiAlias=1
ClipString=1
Hidden=1
Group=up



[MeterFileBit]
MeasureName=MeasureFileBit
Meter=STRING
X=82
Y=526
W=140
H=50
AntiAlias=1
FontColor=254,159,64,255
StringAlign=LEFT
FontSize=15
FontFace=Accidental Presidency
StringEffect=Shadow
Postfix=" kbps."
Hidden=1
GRoup=up

[MeasureFileBit]
Measure=Plugin
Plugin=Plugins\WindowMessagePlugin.dll
WindowClass=Winamp v1.x
WindowMessage=1024 1 126
UpdateDivider=200

BTW:My skin is a tab skin, tha's why those text lines are hidden.

this is a screenshot from my skin.
dgdd.png
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 8030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to make RM add the extention file in a text line.

Post by Yincognito »

Make a new NowPlaying measure having PlayerType=File and add to it something like:

Code: Select all

RegExpSubstitute=1
Substitute="^.*\.":""
or some other substitution to either leave only the file extension or extract it from the full file path. This is not tested, but if your AIMP is fully supported by NowPlaying, it should give you an idea of how to achieve what you want.

Reference:
https://docs.rainmeter.net/manual/measures/nowplaying/
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make RM add the extention file in a text line.

Post by balala »

Bayushi Tai wrote: July 23rd, 2024, 5:47 am How can I do that?
What Yincognito meant in his reply is this: add the following measure to your code:

Code: Select all

[MeasureFileType]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=File
RegExpSubstitute=1
Substitute="^.*\.":""
This measure returns only the extension of the file. Note that besides adding the proper Substitute option (Yincognito's option, to be precise, not mine!), I also rewrote the measure to be not a Plugin measure, but a NowPlaying measure. Many years ago these measures were indeed Plugin measures, but in meantime they have been converted to internal measures and these days they should be used accordingly. Same way, all of your measures ([MeasurePlayer], [MeasureAlbum] and [MeasureYear]) should be rewritten the same way, to convert them to NowPlaying measures, instead of using them as Plugin measures.
Now if added this measure, you can alter a little bit the [MeterFileBit] meter, by adding the following two options:
  • MeasureName2=MeasureFileType
  • Text=%2 in %1 kbps.
Along with this remove the Postfix option, especially that this option has been deprecated long time ago:

Code: Select all

[MeterFileBit]
MeasureName=MeasureFileBit
MeasureName2=MeasureFileType
...
Text=%2 in %1 kbps.
;Postfix=" kbps."
...
(see that I left the Postfix option, but commented it out).
User avatar
Bayushi Tai
Posts: 24
Joined: July 17th, 2012, 4:50 am

Re: How to make RM add the extention file in a text line.

Post by Bayushi Tai »

Thank you to both of you, I'll test it right now!
Oh, and thanks for the extra tip of the "NowPlaying"

Works like a charm!
thank you!.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make RM add the extention file in a text line.

Post by balala »

Bayushi Tai wrote: July 24th, 2024, 1:07 am Works like a charm!
Great!
User avatar
Yincognito
Rainmeter Sage
Posts: 8030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to make RM add the extention file in a text line.

Post by Yincognito »

Bayushi Tai wrote: July 24th, 2024, 1:07 am Thank you to both of you, I'll test it right now!
Oh, and thanks for the extra tip of the "NowPlaying"

Works like a charm!
:great:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth