Creating a script to control my Pioneer receiver

Discussion in 'Mac Programming' started by mosesaro, Oct 4, 2016.

  1. mosesaro macrumors member

    Joined:
    Aug 18, 2009
    Location:
    New York
    #1
    Hello everybody, I am trying to build a small app and post on github for others to use.



    I am trying to remap the volume up and down on my mac keyboard to control the volume on my amplifier. Right now my main concern is creating a daemon that will listen for the key press and send the appropriate command. The amplifier uses telnet. It works send things. The amp does respond back with a new volume, but I will work with that later. I know swift, but I cannot figure out how to create a daemon.



    host=192.168.0.2

    port=8102
    cmd1='VU' //Volume up
    cmd2='VD' //Volume down

    ( echo open ${host} ${port}
    sleep 1
    echo ${cmd1}
    sleep 1
    echo ${cmd2}
    sleep 1

    echo exit ) | telnet

    Long story short
    How do I create a daemon, that listens to keys pressed on keyboard in background and sends appropriate telnet command to receiver.
     
  2. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #2
    I would start with a normal GUI app. Create a view with control buttons. One for volume up, one for volume down, another for whatever function, etc. In order to talk to the receiver, open a TCP connection to that host and port and start sending the commands over the socket. You don't need 'telnet' to do that for you. After you get that working, you can try and attach to your volume keys. I would probably write the app as a menu bar app eventually.
     

Share This Page