Create an action to toggle between audio sources
#1
Star 
I am frequently switching my audio output device between HDMI and one of the other outputs depending on whether or not I want to use the built in TV speakers, or the stereo. I'd like to map a key on the remote to this which I think involves creating an action to allow one button to toggle through the sources. Is this possible?
Need help programming a Streamzap remote?
Reply
#2
hiya graysky, yes it's possible as i too am currently looking into this.

You have to use an program called Autohotkey and using a script, you can create an executable file which can do this for you.

FYI, my current setup is a htpc + monitor which kids use for their school work most of the time on, but it's also connected to the tv via hdmi. My plan is to have a hotkey that on pressing switches from vga pc monitor to hdmi on tv and also switches the audio source from standard pc speakers to optical connected to amp.

Maybe we can work together to help each other? PM me if your interested!
Reply
#3
I'd like to have a solution that doesn't use an addon if possible.
Need help programming a Streamzap remote?
Reply
#4
It's not an xbmc addon...it runs with windows at startup
Reply
#5
There's this way (tested and works perfect):
http://forum.xbmc.org/showthread.php?tid=200081
Reply
#6
Thanks live4ever for the link. That only switches audio, but what if I want to do a combination of things, such as switch audio and video?
Reply
#7
Try this

http://forum.xbmc.org/showthread.php?tid=199579
Reply
#8
Thank you very much for the link teeedubb. Being a noob I don't have a clue about python, but from looking at that script, it seems to me that it only relates to audio switching. But I need a script that on a SINGLE HOTKEY press can allow me to:-

1. Switch from SPEAKER to SPDIF
2. Switch from MONITOR DISPLAY 1 (1280 x 1024) to TV DISPLAY 2 (1080P/24Hz)

and vice versa.

The only option I can think of is AutoHotkey scripts.

Know of any other suggestions?
Reply
#9
You don't need to know python, just edit the json strings. The examples there are for audio but it can be used for anything that can be toggled via json. There is a link to a list of items you can change in the first post, and the scripts can be modified to show current settings of what you want to change.

You can use ahk, but that will use json too, plus its even more complicated as you need IP addresses, port numbers and the escaping of special ahk characters.
Reply
#10
I'm really sorry teeedubb. I have tried to suss it out, but It's way over my head mate. I want to thank you for you time and effort to help me, but I don't have a clue what to do.
Reply
#11
What didn't work? If there's is errors post your log file to pastebin and post the link here so I can have a look.

With the first example comment out (put #'s in front of) all the lines between the 'edit below' + 'edit above' lines (there's two lots), then running the script from xbmc will print the current audio device to the xbmc.log file. Changing the audio output device via zbmc's gui to what you want then running the script will show you what strings you need to use for your setup.

Looks like you can change the display and resolution too via jsonrpc, so you should he able to make that script do what you want.
Reply
#12
Sorry for the misunderstanding mate. I'm trying to say I don't have a clue what info/commands or how to add code as I've never done coding/scripting in my life.
Reply
#13
@teeedubb - Thanks! I replied in your linked thread. For those wishing to do this, see: http://forum.xbmc.org/showthread.php?tid...pid1780475
Need help programming a Streamzap remote?
Reply

Logout Mark Read Team Forum Stats Members Help
Create an action to toggle between audio sources1