Page 1 of 1

RuneAudio keyboard client for Windows

PostPosted: 30 May 2014, 15:24
by ACX
While working at home I was missing the ability to control the playback without having to focus on the RuneUI's browser tab/windows. I was used to do it in the past when using foobar2000, using the multimedia keys of my Logitech Illuminated Keyboard. So I decided to solve my little issue writing a simple script for AutoHotKey.
I'm going to share it with everyone else who could have my same needs. This should work with every keyboard with multimedia keys.

=== INSTRUCTIONS ================

1) Download and install AutoHotKey from the official website

2) Download and install CURL for Windows
(I installed this package for Win64)

3) Create an empty text file with this content:

Code: Select all
Media_Prev::
Run, curl http://runeaudio.local/command/?cmd=previous,, Hide
return

Media_Next::
Run, curl http://runeaudio.local/command/?cmd=next,, Hide
return

Media_Play_Pause::
Run, curl http://runeaudio.local/command/?cmd=pause,, Hide
return

;Volume_Mute::
;Run, curl "http://runeaudio.local/command/?cmd=setvol 0",, Hide
;return

Volume_Down::
Run, curl "http://runeaudio.local/command/?cmd=volume -1",, Hide
return

Volume_Up::
Run, curl "http://runeaudio.local/command/?cmd=volume +1",, Hide
return


and save it as RuneAudio.ahk where you want (e.g. under your Documents folder)

4) Right click on the AutoHotKey icon in the tray bar and select Edit This Script from the menu

5) add this line in the script:

Code: Select all
#Include <PATH>\RuneAudio.ahk

where <PATH> is where you put the RuneAudio.ahk script before, or

Code: Select all
#Include C:\Users\<USER>\Documents\RuneAudio.ahk

if you put under your Documents folder (and where <USER> is your user name

After that, save the modified file

6) Right click on the AutoHotKey icon in the tray bar and select Reload This Script from the menu

7) Use your multimedia keys to control playback and enjoy your music while doing something else :)

============================

The scripts simply makes CURL requests to RuneUI at these urls:
http://runeaudio.local/command/?cmd=CMD
where CMD is a command from MPD playback command reference.

You can replace runeaudio.local with your RuneAudio's device IP address if your PC doesn't resolve the hostname.

Re: RuneAudio keyboard client for Windows

PostPosted: 07 Jun 2014, 19:40
by Stino
Great, I'll give this a try.

Re: RuneAudio keyboard client for Windows

PostPosted: 03 Oct 2014, 07:41
by AudioS
Hi,
Do you know a command how to play exact file from NAS to MPD? I'm trying to use MP3Toys with Runeaudio as external player.

Thanks.

Re: RuneAudio keyboard client for Windows

PostPosted: 02 Nov 2014, 10:26
by Dezo

Re: RuneAudio keyboard client for Windows

PostPosted: 02 Nov 2014, 12:05
by ACX

Thank you for the tip, they changed the url in the meanwhile. I've updated my post.

Re: RuneAudio keyboard client for Windows

PostPosted: 05 Jun 2016, 16:39
by mblataric
Hi,

I have expanded the code a bit to allow stop and also play from stop by calling status command first.
However, I couldn't figure out how to completely hide cmd window, so if anyone knows how to get output from cmd and hide the window in the same time - that would be great.

A note - I have commented volume control since I use digital out and DAC, so these controls do nothing for me. If you need them just uncomment lines for volume control (remove ; at line beginning)

Code: Select all
RuneGetStatus() {
   Cmd:=ComObjCreate("WScript.Shell")
   CmdRun:=Cmd.Exec(ComSpec " /c curl http://runeaudio.local/command/?cmd=status"), Hide
   output:=CmdRun.StdOut.ReadAll()
        return %output%
}

    Media_Prev::
    Run, curl http://runeaudio.local/command/?cmd=previous,, Hide
    return

    Media_Next::
    Run, curl http://runeaudio.local/command/?cmd=next,, Hide
    return

    Media_Play_Pause::
    RuneState := RuneGetStatus()

    IfInString RuneState, stop
       Run, curl http://runeaudio.local/command/?cmd=play,, Hide
    IfInString RuneState, play
       Run, curl "http://runeaudio.local/command/?cmd=pause`%201",, Hide
    IfInString RuneState, pause
       Run, curl "http://runeaudio.local/command/?cmd=pause`%200",, Hide
    return

    Media_Stop::
    Run, curl http://runeaudio.local/command/?cmd=stop,, Hide
    return

    ;Volume_Mute::
    ;Run, curl "http://runeaudio.local/command/?cmd=setvol 0",, Hide
    ;return

    ;Volume_Down::
    ;Run, curl "http://runeaudio.local/command/?cmd=volume -1",, Hide
    ;return

    ;Volume_Up::
    ;Run, curl "http://runeaudio.local/command/?cmd=volume +1",, Hide
    ;return


Re: RuneAudio keyboard client for Windows

PostPosted: 15 Jun 2016, 19:56
by dsummerbell
Thanks for that little snippet of code. Very useful.

Re: RuneAudio keyboard client for Windows

PostPosted: 19 Jun 2017, 13:37
by graceinc
Came to this thread today for the snippet code, glad i got it.