commit ee30214

hovercats  ·  2026-08-17 22:59:37 +0000 UTC
parent c003db2
sort case statements
1 files changed,  +8, -8
M ampv
M ampv
+8, -8
 1@@ -6,6 +6,14 @@ socket=/tmp/.mpvsocket
 2 fn player {mpv '--input-ipc-server='$socket $*}
 3 
 4 switch($1) {
 5+	case next
 6+		printf 'playlist-next\n' | nc -UN $socket
 7+	case pause
 8+		printf 'cycle pause\n' | nc -UN  $socket
 9+	case prev
10+		printf 'playlist-prev\n' | nc -UN $socket
11+	case shuffle
12+		printf 'playlist-shuffle\n' | nc -UN $socket
13 	case start
14 		player --idle &
15 	case play
16@@ -16,14 +24,6 @@ switch($1) {
17 		}
18 		if not music=$*
19 		player --no-audio-display $music
20-	case pause
21-		printf 'cycle pause\n' | nc -UN  $socket
22-	case next
23-		printf 'playlist-next\n' | nc -UN $socket
24-	case prev
25-		printf 'playlist-prev\n' | nc -UN $socket
26-	case shuffle
27-		printf 'playlist-shuffle\n' | nc -UN $socket
28 	case *
29 		printf 'Error\n'
30 		exit 1