X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=bin%2Fkhatus_controller;h=c2e5d914df7fa4f0bebfa531104c5f484c983c10;hb=d06e7260cd2c4cb3813d197628ee224771f775cb;hp=d9218ceac999313e83e559362b42dcc9cd02c10d;hpb=f03e88c6896157abd5517394024162aedebff829;p=khatus.git diff --git a/bin/khatus_controller b/bin/khatus_controller index d9218ce..c2e5d91 100755 --- a/bin/khatus_controller +++ b/bin/khatus_controller @@ -95,8 +95,7 @@ /^in:VOLUME/\ { - shift() - db["volume"] = $0 + set_volume() } /^in:MPD_SONG OK +MPD/ { delete db_mpd_song; next } @@ -124,6 +123,24 @@ output_msg_status_bar(make_status_bar()) } +function set_volume( mute, left, right) { + # 0 RUNNING no 75% 75% + #msg_head = $1 + #sink = $2 + #state = $3 + mute = $4 + left = $5 + right = $6 + + if (mute == "no") { + db["volume"] = sprintf("%s %s", left, right) + } else if (mute == "yes") { + db["volume"] = "X" + } else { + # TODO: Log error - unexpected mute value + } +} + function set_mpd_song( key, val) { key = $2 shift()