It is currently April 27th, 2024, 1:59 am

remaining h/m/s how to?

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: remaining h/m/s how to?

Post by jsmorley »

This will be quite difficult to do with Calc measures, as the approach for splitting a number of seconds up into days/hours/minutes/seconds is something that really needs to be done in a procedural language like Lua. I guess it could be done in Calc measures, but it would take a boatload of them. However, the Uptime measure can do this work for you...

Code: Select all

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

[MeasureDuration]
Measure=Calc
Formula=8459

[MeasurePosition]
Measure=Calc
Formula=310

[MeasureHoursRemaining]
Measure=Uptime
SecondsValue=([MeasureDuration:] - [MeasurePosition:])
Format=%3!i!
DynamicVariables=1

[MeasureMinutesRemaining]
Measure=Uptime
SecondsValue=([MeasureDuration:] - [MeasurePosition:])
Format=%2!i!
DynamicVariables=1

[MeasureSecondsRemaining]
Measure=Uptime
SecondsValue=([MeasureDuration:] - [MeasurePosition:])
Format=%1!i!
DynamicVariables=1

[MeterOutput]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[MeasureHoursRemaining:] Hours, [MeasureMinutesRemaining:] Minutes, [MeasureSecondsRemaining:] Seconds
 

https://docs.rainmeter.net/manual/measures/uptime/


1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: remaining h/m/s how to?

Post by jsmorley »

UpTime is still the right way to go. Just use SecondsValue so it will use that instead of the computer "uptime".
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: remaining h/m/s how to?

Post by jsmorley »

Dunno. Don't have, and don't want to have, WebNowPlaying.

All I can tell you is that if [MeasureDuration] [MeasurePosition] return numbers of seconds, UpTime is the right way to do this.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: remaining h/m/s how to?

Post by jsmorley »

What are these measures all about?

Code: Select all

[MeasureHoursRemaining]
Measure=HoursRemaining
SecondsValue=([MeasureDuration:] - [MeasurePosition:])
Format=%3!i!
DynamicVariables=1

[MeasureMinutesRemaining]
Measure=MinutesRemaining
SecondsValue=([MeasureDuration:] - [MeasurePosition:])
Format=%2!i!
DynamicVariables=1

[MeasureSecondsRemaining]
Measure=SecondsRemaining
SecondsValue=([MeasureDuration:] - [MeasurePosition:])
Format=%1!i!
DynamicVariables=1

These need to be Measure=Uptime.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: remaining h/m/s how to?

Post by jsmorley »

I don't know. Works fine for me.


`.jpg


There is no need for any Calc measures to do this. Just use the UpTime measures the way I have described.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: remaining h/m/s how to?

Post by jsmorley »

So it looks like those measure from WebNowPlaying don't return a number of seconds.

I have no idea how you would do this....

I'm just not interested in any music playing plugin or skin.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: remaining h/m/s how to?

Post by jsmorley »

I'm sorry, but your code is such a mess that I just can't be bothered with it. You have multiple measures called [MeasureDuration] and [MeasurePosition]
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: remaining h/m/s how to?

Post by jsmorley »

This WILL work... Trust me.

Code: Select all

[Rainmeter]
Update=200
DynamicWindowSize=1
AccurateText=1

[MeasurePosition]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Position

[MeasureDuration]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Duration

[MeasureHoursRemaining]
Measure=Uptime
SecondsValue=([MeasureDuration:] - [MeasurePosition:])
Format=%3!i!
DynamicVariables=1

[MeasureMinutesRemaining]
Measure=Uptime
SecondsValue=([MeasureDuration:] - [MeasurePosition:])
Format=%2!i!
DynamicVariables=1

[MeasureSecondsRemaining]
Measure=Uptime
SecondsValue=([MeasureDuration:] - [MeasurePosition:])
Format=%1!i!
DynamicVariables=1

[MeterOutput]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[MeasureHoursRemaining] Hours, [MeasureMinutesRemaining] Minutes, [MeasureSecondsRemaining] Seconds

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

Re: remaining h/m/s how to?

Post by balala »

dvo wrote: October 22nd, 2019, 5:40 pm is there a way to say 90min convert to 1:30:00 min with a sub maybe?
Yes, actually there is. As jsmorley described, you can use an Uptime measure for this:

Code: Select all

[MeasureRemaining]
Measure=Uptime
SecondsValue=(90*60)
Format=%3!i!:%2!02i!:%1!02i!
The idea is to add to the SecondsValue option the number of seconds you want to show as string. Because 90 is the number of minutes, I multiplied it with 60, to get the number of seconds, which has to be used into this option.

Maybe this doesn't have too much importance, however note that in this code there is a small mistake in my opinion (however I, same as jsmorley, also am not using the WebNowPlaying plugin, so can't check, but I'm pretty sure this is correct). In the PlayerName option of the [MeasureArtist] measure you have this: PlayerName=[MeasureArtist], which doesn't look alright, because I don't think you should use the name of the current measure into the code of the measure itself.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: remaining h/m/s how to?

Post by jsmorley »

What happens with the UpTime measure is that whatever you have for SecondsValue becomes the number value of the measure. Then the string value of the measure will be the result that comes from whatever Format option you define. So you are going to always want to use the string value of any UpTime measure.