Re: [LAU] Toggle Jack Transport CLI

From: <hollundertee@email-addr-hidden>
Date: Mon Dec 19 2016 - 13:42:46 EET

On Tue, 15 Nov 2016 23:18:48 +0100
Christopher Arndt <chris@email-addr-hidden> wrote:

> Am 15.11.2016 um 22:48 schrieb Yassin Philip:
> > Thanks everyone, I got my transport toggle
> > now! It's disturbingly hacky, but it works :)
>
> Well, I showed you a comfortingly non-hacky solution. But if you want
> to continue funling around with bash, it's your call. ;)
>
> Chris

Thanks everyone, I adapted the script according to your suggestions.
Here is my version, which seems to work so far. Note that I reset jack
transport to 0 after stopping it. If you have any suggestions as to how
to improve it, please mention them. I am by no means an expert in bash
scripting. In fact, I pasionately hate that language.

Regards,
Philipp

#!/usr/bin/env bash

function jack_transport_status() {
  jack_showtime | head -n1 & >/dev/null 2>&1
  wait
}

if jack_transport_status | grep -q -i stopped
then
  echo play | jack_transport >/dev/null 2>&1
else
        echo stop | jack_transport >/dev/null 2>&1
        echo locate 0 | jack_transport >/dev/null 2>&1
fi
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Mon Dec 19 16:15:02 2016

This archive was generated by hypermail 2.1.8 : Mon Dec 19 2016 - 16:15:02 EET