Hi. So I've been messing with
AutoHotkey and trying to set up a couple of hotkeys for restarting soundcards and toggling bypass. I have the soundcard restarting function working. I have the ability to turn on or turn off the bypass by forcing a value (0 or nonzero).
However, I don't know how to do a Bypass toggle that doesn't need to query the current state and make a decision on what to respond with. I was hoping just sending the "237" signal would work to toggle whatever the state is; like 10439 restarts soundcards without having to force a value.
Right Ctrl+Numpad Divide send a restart signal to the soundcards with this:
Code:
>^NumpadDiv::
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", "http://127.0.0.1:8080/json-1/list`%7B`%2210439`%22`%7B`%7D`%7D", false)
try whr.Send()
this is the actual URL it sends
http://127.0.0.1:8080/json-1/list%7B"10439"%7B%7D%7D which works for its button.
However, this command for Right Ctrl+Numpad Multiply does not do anything unless I tell it a value to force.
Code:
>^NumpadMult::
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", "http://127.0.0.1:8080/json-1/list`%7B`%22237`%22`%7B`%7D`%7D", false)
try whr.Send()
http://127.0.0.1:8080/json-1/list%7B"237"%7B%7D%7D is the URL.
However, this URL DOES turn off the bypass
http://127.0.0.1:8080/json-1/list%7B%22 ... 0%22%7D%7D
And this URL enables it (same with the value 1 or -1. Sadly -1 doesn't toggle it either)
http://127.0.0.1:8080/json-1/list%7B%22 ... 1%22%7D%7D
Is anybody familiar enough with JSON and AutoHotkey to where they can help me make a script that can check its state, then send an opposing value? Should I contact Hans and ask for an easy toggle function to call that doesn't require a specific value to work?
Thanks!
edit2: Optimially I think it would be handy to be able to force a new_value of "-1" and have Stereo Tool toggle the bypass from its current state (before re-setting the value appropriately internally or whatever makes it work the next time it's sent).
edit1: fixed up some grammar and added some links