It is currently March 28th, 2024, 8:17 pm

Get Path of Music from NowPlaying

Get help with creating, editing & fixing problems with skins
User avatar
iWilder
Posts: 8
Joined: October 27th, 2017, 11:25 am

Get Path of Music from NowPlaying

Post by iWilder »

I'm working on my first full set of skins for my own theme. I've looked at a lot of good work and used it for ideas and inspiration. I'm working on a music player and trying to get the path of a file currently playing to display an image as the Album Art. Here are some of the measures and meters I'm using:

[mFilePlaying]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#Player#
PlayerType=File

[mPath]
Measure=Plugin
Plugin=FileView
Path=mFilePlaying
Count=1

[mFolderPath]
Measure=Plugin
Plugin=FileView
Path=mPath
Type=PathToFile
Group=Children

[FilePlaying]
Meter=String
MeasureName=mFilePlaying
String=%1


[PathPlaying]
Meter=String
MeasureName=mFolderPath
Text=%1
X=250
Y=250

I was trying to pass the complete file path into a FileView plugin, and then extract the the folder path of the current file playing. The FileView plugin seems like it wants to start with a folder path and then works down to files, but I need a way to recursively work my way back up to the folder path that file is located in. So I do get a valid full path from the meter above called FilePlaying which is pretty simple to get that path, but I get nothing from the meter PathPlaying. I'm sure I'm using the FileView plugin incorrectly.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Get Path of Music from NowPlaying

Post by mak_kawa »

I think...

Code: Select all

[FilePlaying]
Meter=String
MeasureName=mFilePlaying
Text=%1
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Get Path of Music from NowPlaying

Post by balala »

I think iWilder, you're making a confusion. As mak_kawa wrote, the String meter doesn't has a String option, just the String measure does. The String meter does has a Text option.
User avatar
iWilder
Posts: 8
Joined: October 27th, 2017, 11:25 am

Re: Get Path of Music from NowPlaying

Post by iWilder »

I understand that, I'm just trying to use the value of File from NowPlaying to create a path to use in the FileView plugin.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Get Path of Music from NowPlaying

Post by balala »

iWilder wrote:I understand that, I'm just trying to use the value of File from NowPlaying to create a path to use in the FileView plugin.
Try to add the following options to the [mFilePlaying] measure:

Code: Select all

RegExpSubstitute=1
Substitute="^(.*)\\(.*)\.(.*)$":"\1"
User avatar
iWilder
Posts: 8
Joined: October 27th, 2017, 11:25 am

Re: Get Path of Music from NowPlaying

Post by iWilder »

Thanks! I thought about some regex, but thought I could maybe do it through FileView plugin.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Get Path of Music from NowPlaying

Post by balala »

iWilder wrote:Thanks! I thought about some regex, but thought I could maybe do it through FileView plugin.
But are working those options, as expected?
User avatar
iWilder
Posts: 8
Joined: October 27th, 2017, 11:25 am

Re: Get Path of Music from NowPlaying

Post by iWilder »

That works...THANKS!!!
User avatar
iWilder
Posts: 8
Joined: October 27th, 2017, 11:25 am

Re: Get Path of Music from NowPlaying

Post by iWilder »

Got the AlbumArt to display!

Thanks again!
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Get Path of Music from NowPlaying

Post by balala »

Glad to help.