Posts: 1,397
Joined: Aug 2009
Reputation:
23
2014-08-10, 14:27
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?
Posts: 109
Joined: Jan 2012
Reputation:
0
2014-08-10, 14:52
(This post was last modified: 2014-08-10, 14:53 by noobnas.)
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!
Posts: 1,397
Joined: Aug 2009
Reputation:
23
I'd like to have a solution that doesn't use an addon if possible.
Posts: 109
Joined: Jan 2012
Reputation:
0
It's not an xbmc addon...it runs with windows at startup
Posts: 109
Joined: Jan 2012
Reputation:
0
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?
Posts: 109
Joined: Jan 2012
Reputation:
0
2014-08-10, 22:54
(This post was last modified: 2014-08-10, 22:55 by noobnas.)
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?
Posts: 3,544
Joined: Mar 2010
Reputation:
119
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.
Posts: 109
Joined: Jan 2012
Reputation:
0
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.
Posts: 3,544
Joined: Mar 2010
Reputation:
119
2014-08-11, 01:01
(This post was last modified: 2014-08-11, 01:08 by teeedubb.)
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.
Posts: 109
Joined: Jan 2012
Reputation:
0
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.