It is currently April 20th, 2024, 2:59 am

Volume Change and ToggleMute Substitute="-1":"0"

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Volume Change and ToggleMute Substitute="-1":"0"

Post by balala »

Mor3bane wrote: August 4th, 2020, 1:18 am Here is the skin group rmskin for reference:
Music Controls_1.3.xx.rmskin
This package has five .ini skin files. Which one have we to work with?
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Volume Change and ToggleMute Substitute="-1":"0"

Post by balala »

Mor3bane wrote: August 5th, 2020, 2:45 am These are my Measure and Meter.
Instead of making a substitution on the [Percent] measure, I'd use a Clamp function to limit the returned value:

Code: Select all

[Percent]
Measure=Calc
Formula=( Clamp ( MeasureVolume, 0, 100 ))
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Volume Change and ToggleMute Substitute="-1":"0"

Post by Yincognito »

Mor3bane wrote: August 5th, 2020, 2:45 am Thanks Yincognito
I tried your suggestion but no success.
These are my Measure and Meter.
Yeah, it looks like I have to check your skins, after all, because my posted example works 100% so it must be something in your skins that's preventing the expected result... Will take a look at them in a moment.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Volume Change and ToggleMute Substitute="-1":"0"

Post by Yincognito »

balala wrote: August 5th, 2020, 8:32 am This package has five .ini skin files. Which one have we to work with?
His first posted code is from Round iTunes, the subsequent code is from Small Vol, and here lies the problem, see my following reply.
Last edited by Yincognito on August 5th, 2020, 10:11 am, edited 2 times in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Volume Change and ToggleMute Substitute="-1":"0"

Post by Yincognito »

Mor3bane wrote: August 5th, 2020, 2:45 am Thanks Yincognito
I tried your suggestion but no success.
Yeah, figured out what the problem is. You need to set Text=[Percent]% in your [PercentString] meter from the Round iTunes\music_big.ini skin and the 0 will appear. The reasson is simple: when you set it to Text=[Percent:0]%, the meter displays the number value of that measure, which I already told you it can't be directly modified; on the other hand, when set to Text=[Percent]%, the meter displays the string value of that measure, which is properly substituted with "0".
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Volume Change and ToggleMute Substitute="-1":"0"

Post by Mor3bane »

Yincognito wrote: August 5th, 2020, 10:06 am Yeah, figured out what the problem is. You need to set Text=[Percent]% in your [PercentString] meter from the Round iTunes\music_big.ini skin and the 0 will appear. The reasson is simple: when you set it to Text=[Percent:0]%, the meter displays the number value of that measure, which I already told you it can't be directly modified; on the other hand, when set to Text=[Percent]%, the meter displays the string value of that measure, which is properly substituted with "0".
Such a simple solution!
I've been trying to break the skin to identify any error in code flow. But this was unexpected. I looked at it and looked at it but the zero seemed so 'necessary'. I now know that was not the case.

It is almost release time for version 2 of this mini suite.

Thanks Yincognito (once again). :thumbup: :great: :rosegift:
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Volume Change and ToggleMute Substitute="-1":"0"

Post by Yincognito »

Mor3bane wrote: August 5th, 2020, 10:12 am Such a simple solution!
I've been trying to break the skin to identify any error in code flow. But this was unexpected. I looked at it and looked at it but the zero seemed so 'necessary'. I now know that was not the case.

It is almost release time for version 2 of this mini suite.

Thanks Yincognito (once again). :thumbup: :great: :rosegift:
No worries - glad to help. ;-) As you can see, it sometimes pays off to be aware of the little details in the manual... :Whistle
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Volume Change and ToggleMute Substitute="-1":"0"

Post by balala »

Yincognito wrote: August 5th, 2020, 10:06 am You need to set Text=[Percent]% in your [PercentString] meter from the Round iTunes\music_big.ini skin and the 0 will appear.
The disadvantage of this approach is that it requires to set the dynamic variables. If you put a MeasureName=Percent and you use a simple Text=%1% option on the same string meter, you can avoid setting the dynamic variables.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Volume Change and ToggleMute Substitute="-1":"0"

Post by Yincognito »

balala wrote: August 5th, 2020, 11:56 am The disadvantage of this approach is that it requires to set the dynamic variables. If you put a MeasureName=Percent and you use a simple Text=%1% option on the same string meter, you can avoid setting the dynamic variables.
Well, I only corrected the existing code to solve the issue that was referenced to. :D As for the rest, you're right of course, there's no need to have section variables there in theory, but then, I have no idea what other reasons are there to justify its presence... :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Volume Change and ToggleMute Substitute="-1":"0"

Post by Mor3bane »

balala wrote: August 5th, 2020, 11:56 am The disadvantage of this approach is that it requires to set the dynamic variables. If you put a MeasureName=Percent and you use a simple Text=%1% option on the same string meter, you can avoid setting the dynamic variables.
Thanks, I changed to your recommedation.
Yincognito wrote: August 5th, 2020, 12:30 pm Well, I only corrected the existing code to solve the issue that was referenced to. :D As for the rest, you're right of course, there's no need to have section variables there in theory, but then, I have no idea what other reasons are there to justify its presence... :confused:
No apparent issues, so all is good afaik.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.