It is currently April 20th, 2024, 11:46 am

IfCondition does not change volume

Get help with creating, editing & fixing problems with skins
User avatar
JamHadar
Posts: 7
Joined: August 24th, 2021, 9:33 am

IfCondition does not change volume

Post by JamHadar »

I'm trying to make my own skin and i have a problem with IfCondition.
Basically, i want skin constantly set specific volume, depending on current volume.
In example below, the first condition works fine, every time i make volume 0, skin toggle mute, but the others don't work at all, when volume equal 10 or 30, nothing happens.

What am i doing wrong?

Code: Select all

Measure = Plugin
Plugin = Win7AudioPlugin

IfCondition = (MeasureVolume = 0)
IfTrueAction = [!CommandMeasure MeasureVolume "ToggleMute"]

IfCondition1 = (MeasureVolume = 10)
IfTrueAction1 = [!CommandMeasure MeasureVolume "SetVolume 20"]

IfCondition2 = (MeasureVolume = 30)
IfTrueAction2 = [!CommandMeasure MeasureVolume "SetVolume 40"]
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: IfCondition does not change volume

Post by Yincognito »

JamHadar wrote: August 24th, 2021, 10:25 am I'm trying to make my own skin and i have a problem with IfCondition.
Basically, i want skin constantly set specific volume, depending on current volume.
In example below, the first condition works fine, every time i make volume 0, skin toggle mute, but the others don't work at all, when volume equal 10 or 30, nothing happens.

What am i doing wrong?

Code: Select all

Measure = Plugin
Plugin = Win7AudioPlugin

IfCondition = (MeasureVolume = 0)
IfTrueAction = [!CommandMeasure MeasureVolume "ToggleMute"]

IfCondition1 = (MeasureVolume = 10)
IfTrueAction1 = [!CommandMeasure MeasureVolume "SetVolume 20"]

IfCondition2 = (MeasureVolume = 30)
IfTrueAction2 = [!CommandMeasure MeasureVolume "SetVolume 40"]
I'm on mobile now so can't test, but just from the top of my head, there isn't such a thing like IfCondition1. The numbering starts at 2, so you'd have IfCondition, IfCondition2, IfCondition3, and so on.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: IfCondition does not change volume

Post by death.crafter »

JamHadar wrote: August 24th, 2021, 10:25 am I'm trying to make my own skin and i have a problem with IfCondition.
Basically, i want skin constantly set specific volume, depending on current volume.
In example below, the first condition works fine, every time i make volume 0, skin toggle mute, but the others don't work at all, when volume equal 10 or 30, nothing happens.

What am i doing wrong?

Code: Select all

Measure = Plugin
Plugin = Win7AudioPlugin

IfCondition = (MeasureVolume = 0)
IfTrueAction = [!CommandMeasure MeasureVolume "ToggleMute"]

IfCondition1 = (MeasureVolume = 10)
IfTrueAction1 = [!CommandMeasure MeasureVolume "SetVolume 20"]

IfCondition2 = (MeasureVolume = 30)
IfTrueAction2 = [!CommandMeasure MeasureVolume "SetVolume 40"]
Dou you have measurename defined?

Code: Select all

[MeasureVolume]
...
Or else do you get any errors in log? Rightclick tray menu > About or Log from Manage
from the Realm of Death
User avatar
JamHadar
Posts: 7
Joined: August 24th, 2021, 9:33 am

Re: IfCondition does not change volume

Post by JamHadar »

Yincognito wrote: August 24th, 2021, 10:42 am I'm on mobile now so can't test, but just from the top of my head, there isn't such a thing like IfCondition1. The numbering starts at 2, so you'd have IfCondition, IfCondition2, IfCondition3, and so on.
Oh my god, this is kinda unintuitive to me. Yeah that helped, Thanks.
User avatar
JamHadar
Posts: 7
Joined: August 24th, 2021, 9:33 am

Re: IfCondition does not change volume

Post by JamHadar »

death.crafter wrote: August 24th, 2021, 10:45 am Dou you have measurename defined?
Yes i do, but the problem was in IfCondition1. Thanks
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: IfCondition does not change volume

Post by Yincognito »

JamHadar wrote: August 24th, 2021, 11:08 am Oh my god, this is kinda unintuitive to me. Yeah that helped, Thanks.
Well, it depends on how you look at it. In a way, IfCondition IS what you'd call the 1st IfCondition, aka IfCondition1. For the cases where the option is the sole IfCondition in the measure, it makes little sense to name it IfCondition1 though, especially since it's kinda confusing to have numbered options everywhere, even if numbering would not be needed.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
JamHadar
Posts: 7
Joined: August 24th, 2021, 9:33 am

Re: IfCondition does not change volume

Post by JamHadar »

Yincognito wrote: August 24th, 2021, 11:20 am Well, it depends on how you look at it. In a way, IfCondition IS what you'd call the 1st IfCondition, aka IfCondition1. For the cases where the option is the sole IfCondition in the measure, it makes little sense to name it IfCondition1 though, especially since it's kinda confusing to have numbered options everywhere, even if numbering would not be needed.
Nah, for me, it's 0, 1, 2, 3...n. So, IfCondition is equivalent of IfCondition0 and logical continuation for me is IfCondition1.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IfCondition does not change volume

Post by jsmorley »

JamHadar wrote: August 24th, 2021, 11:29 am Nah, for me, it's 0, 1, 2, 3...n. So, IfCondition is equivalent of IfCondition0 and logical continuation for me is IfCondition1.
If we had it to do over again, that thinking might have been good. However, due to backwards compatibility, it sorta is what it is...
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: IfCondition does not change volume

Post by Yincognito »

JamHadar wrote: August 24th, 2021, 11:29 am Nah, for me, it's 0, 1, 2, 3...n. So, IfCondition is equivalent of IfCondition0 and logical continuation for me is IfCondition1.
Ah, I see. The eternal problem of where to start indexing from: 0 or 1. That depends from implementation to implementation, as already noted... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth