SoundGet Mute Is Reversed how to undo that Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
peter_ahk
Posts: 134
Joined: 13 Feb 2024, 14:49

SoundGet Mute Is Reversed how to undo that

Post by peter_ahk » 20 May 2024, 18:56

hello folks

i have this small routine to mute or unmute and i am trying to make its tooltip show the proper state but is does so in reversed saying on when off

i have tried bolt but bolt give the same result, i commented out the other version and my timer is not included here

Code: Select all

VolumeMute:
	SoundSet, +1,, Mute
	;SoundGet, Off, , MUTE
	SoundGet, On, , MUTE
	ToolTip, %On%
	;ToolTip, %Off%
	SetTimer , RemoveToolTip, -1000
return
i can do this but when someone uses another way than my hotkey to launch this label to mute it will also be reversed from there on ofc

Code: Select all

VolumeMute:
muted++
if muted= 1
		{
			SoundSet, +1,, Mute
			ToolTip, Mute
			SetTimer , RemoveToolTip, -1000
			return
		}
else if muted= 2
		{
			SoundSet, +1,, Mute
			ToolTip, Un-Mute
			SetTimer , RemoveToolTip, -1000
			muted= 0
			return
		}

User avatar
mikeyww
Posts: 27261
Joined: 09 Sep 2014, 18:38

Re: SoundGet Mute Is Reversed how to undo that

Post by mikeyww » 20 May 2024, 19:42

Hello,

When the sound is muted, the muting is on.

peter_ahk
Posts: 134
Joined: 13 Feb 2024, 14:49

Re: SoundGet Mute Is Reversed how to undo that

Post by peter_ahk » 20 May 2024, 23:03

mikeyww wrote:
20 May 2024, 19:42
Hello,

When the sound is muted, the muting is on.
hmmm that makes sense thank you mikeyww

peter_ahk
Posts: 134
Joined: 13 Feb 2024, 14:49

Re: SoundGet Mute Is Reversed how to undo that  Topic is solved

Post by peter_ahk » 20 May 2024, 23:27

knowing that this works

Code: Select all

VolumeMute:
        SoundSet, +1,, Mute
	SoundGet, On, , MUTE
	if On = Off
		msg = Un-Mute
	if On = On
		msg = Mute
	ToolTip, %msg%
	SetTimer , RemoveToolTip, -1000
	return

Post Reply

Return to “Ask for Help (v1)”