RuneAudio keyboard client for Windows

General discussion about RuneAudio. Do not post any support or feature requests here.

RuneAudio keyboard client for Windows

Postby ACX » 30 May 2014, 15:24

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.
User avatar
ACX
RuneAudio co-founder
 
Posts: 1693
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: RuneAudio keyboard client for Windows

Postby Stino » 07 Jun 2014, 19:40

Great, I'll give this a try.
Stino
 
Posts: 17
Joined: 26 May 2014, 15:09

Re: RuneAudio keyboard client for Windows

Postby AudioS » 03 Oct 2014, 07:41

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.
AudioS
 
Posts: 4
Joined: 03 Oct 2014, 07:39

Re: RuneAudio keyboard client for Windows

Postby Dezo » 02 Nov 2014, 10:26

Dezo
 
Posts: 11
Joined: 01 Nov 2014, 13:33

Re: RuneAudio keyboard client for Windows

Postby ACX » 02 Nov 2014, 12:05


Thank you for the tip, they changed the url in the meanwhile. I've updated my post.
User avatar
ACX
RuneAudio co-founder
 
Posts: 1693
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: RuneAudio keyboard client for Windows

Postby mblataric » 05 Jun 2016, 16:39

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

mblataric
 
Posts: 1
Joined: 05 Jun 2016, 16:33

Re: RuneAudio keyboard client for Windows

Postby dsummerbell » 15 Jun 2016, 19:56

Thanks for that little snippet of code. Very useful.
dsummerbell
 
Posts: 1
Joined: 15 Jun 2016, 19:27

Re: RuneAudio keyboard client for Windows

Postby graceinc » 19 Jun 2017, 13:37

Came to this thread today for the snippet code, glad i got it.
graceinc
 
Posts: 31
Joined: 02 Mar 2017, 08:31

support RuneAudio Donate with PayPal


Return to General discussion

Who is online

Users browsing this forum: No registered users and 2 guests