It is currently July 15th, 2024, 6:48 am
- Board indexCommunity Support
- Search
Windows Now Playing
Post Reply
- Print view
57 posts
- 1
- 2
- 3
- 4
- 5
- 6
- Next
- bigparty
- Posts: 5
- Joined: March 7th, 2021, 7:39 pm
Windows Now Playing
- Quote
Postby bigparty »
Hello. I was looking for a skin to display the music information and all skin needed to inform a music player (spotify, wpm, foobar2000 ...). My idea was to display the information of any player or browser that was playing any music or video, as well as in the "now playing" of Windows.
As today I only use the browser to listen music, the WebNowPlaying plugin would be enough for me. However, it was not compatible with my browser. So I decided to make a program myself to get this information directly from Windows.
The software I made takes information about the title, artist, album name and thumbnail. As in windows, it works with any program and takes information from everything that plays some type of media. If it is useful for someone, I am making a skin available with the example of use. It has some bugs, but I currently use it to get the title and name of the artist and it works well.
- Attachments
WindowsNowPlaying_07.03.2021.rmskin
- (5.27 KiB) Downloaded 1993 times
Top
- bigparty
- Posts: 5
- Joined: March 7th, 2021, 7:39 pm
Re: Windows Now Playing
- Quote
Postby bigparty »
How to use:
Through the RunCommand plugin.
Abstract example:
Parameter = WindowsNowPlaying [title|artist|album] [truncate at] [add at end of truncated string]
or
Parameter = WindowsNowPlaying thumb
Real example:
Code: Select all
[MeasureTitle]Measure=PluginPlugin=RunCommandParameter=WindowsNowPlaying title 32 ...DynamicVariables=1OutputType=ANSIOutputFile=#CURRENTPATH#title.txt
The output of [MeasureTitle] will be the title of the song / video or whatever is playing. If it is longer than 32 characters, it will be truncated to the 32nd character and "..." will be added to the end.
The [truncate at] and [add at end of truncated string] parameters cannot be used with the thumb parameter.
When calling "WindowsNowPlaying thumb" a file named "thumbnail.png" will be saved in the same location as the .ini, if something is playing. For the example I used the QuotePlugin plugin to display the image.
The output of "WindowsNowPlaying thumb" can be two values (150/84). These values represent the height of the image resolution. The file can be in the format of 150x150 or 150x84 (youtube thumnails generally).
When there is nothing playing or paused, the output will be null / empty and the thumbnail will be deleted.
And I believe that is all.
Top
- Posts: 209
- Joined: July 12th, 2020, 7:47 am
- Location: Ada, Garden City
- Contact:
Contact deflore08
Re: Windows Now Playing
- Quote
Postby deflore08 »
Really useful! Thank you buddy!
Top
- Posts: 269
- Joined: May 12th, 2019, 8:55 am
Re: Windows Now Playing
- Quote
Postby Cariboudjan »
Excellent work here. Question, would it be possible for you to recompile the addon to remove new lines from the output?
When using WriteKeyValue to save the output, it creates unneeded/unwanted newlines below the variable.
Using RegExpSubstitute=1 and Substitute="\r\n":"" doesn't appear to work with RunCommand measures?
Also if exceptions could return no text. Maybe move the exception to the Rainmeter log instead of a returning it as the measure's value.
Also would be good to have some way of automatically triggering the RunCommand bangs when some sort of other trigger identifies that a song name has changed.
Last edited by Cariboudjan on June 29th, 2021, 7:21 pm, edited 1 time in total.
Top
- Developer
- Posts: 22646
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Windows Now Playing
- Quote
Postby jsmorley »
Cariboudjan wrote: ↑June 29th, 2021, 6:11 pmExcellent work here. Question, would it be possible for you to recompile the addon to remove new lines from the output?
When using WriteKeyValue to save the output, it creates unneeded/unwanted newlines below the variable.
Using RegExpSubstitute=1 and Substitute="\r\n":"" doesn't appear to work with RunCommand measures?
Also if exceptions could return no text. Maybe move the exception to the Rainmeter log instead of a returning it as the measure's value.
123.png
Don't use Substitute="\r\n":"". Use Substitute="#CRLF#":"" instead.
Top
- Posts: 269
- Joined: May 12th, 2019, 8:55 am
Re: Windows Now Playing
- Quote
Postby Cariboudjan »
Huh. Never considered that.
Top
- Rainmeter Sage
- Posts: 7727
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Windows Now Playing
- Quote
Postby Yincognito »
jsmorley wrote: ↑June 29th, 2021, 6:41 pmDon't use Substitute="\r\n":"". Use Substitute="#CRLF#":"" instead.
\R or \r?\n should work as well, shouldn't they? If it's just \n used as CR/LF instead of the \r\n, that is...
I'm successfully substituting in RunCommand outputs using \n, by the way, so I'm guessing that's the problem.
Top
- Developer
- Posts: 22646
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Windows Now Playing
- Quote
Postby jsmorley »
Yincognito wrote: ↑June 29th, 2021, 10:06 pm\R or \r?\n should work as well, shouldn't they? If it's just \n used as CR/LF instead of the \r\n, that is...
I'm successfully substituting in RunCommand outputs using \n, by the way, so I'm guessing that's the problem.
Sure, but #CRLF# will match either way. If the file has \r\n (Windows) EOL characters, or \n (Unix) EOL character. So it seems a lot simpler, or at least more reliable, to me.
I suspect that #CRLF# actually just matches on the \n, but if you remove the \n from the \r\n EOL, it has the same effect. I think a \r by itself has no effect at all. The whole Carriage Return deal is a prehensile tail in any case, that Windows just kept so older code won't fail. Not that many "carriages" out there to "return"...
Top
- Rainmeter Sage
- Posts: 7727
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Windows Now Playing
- Quote
Postby Yincognito »
jsmorley wrote: ↑June 29th, 2021, 10:15 pmSure, but #CRLF# will match either way. If the file has \r\n (Windows) EOL characters, or \n (Unix) EOL characters. So it seems a lot simpler, or at least more reliable, to me.
Of course - just wanted to be sure it's not something else than that.
Top
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
- Contact:
Re: Windows Now Playing
- Quote
Postby death.crafter »
jsmorley wrote: ↑June 29th, 2021, 10:15 pmhttps://www.youtube.com/watch?v=g2LJ1i7222c
A perfect good morning song lol... I am glad I didn't just mark the forums read and paid a visit here
Top
Post Reply
- Print view
57 posts
- 1
- 2
- 3
- 4
- 5
- 6
- Next