#!/bin/sh
PATH="$(dirname $0):$PATH"
class=$(sipbmp3-get-config zephyr-class)
host=$(sipbmp3-get-config host)
queue=$(sipbmp3-get-config queue)
instance="$queue-volume@$host"

channel=$(sipbmp3-get-config channel)

amixer set $channel "$2" \
 | perl -lne 'print $1 if (/Front Left: Playback ([0-9]+)/)'

zwrite -c $class -i $instance -d -n -m "Setting volume to $(volume-get) on $queue"
