1(import [protocol [commands]]2 [mpd.exceptions [*]])3(require [hy.extra.anaphoric [*]]4 [hy.contrib.walk [let]])56(with-decorator (commands.add "next")7 (defn next [ctx args]8 (.next (. ctx playback))))910(with-decorator (commands.add "pause")11 (defn pause [ctx args]12 (if args13 (if (first args)14 (.pause ctx.playback)15 (.play ctx.playback))16 (raise (NotImplementedError "Pause command without argument")))))1718(with-decorator (commands.add "play")19 (defn play [ctx args]20 (if args21 (try22 (ctx.playback.play (first args))23 (except [e IndexError]24 (raise MPDBadIndexError)))25 (ctx.playback.play))26 None))2728(with-decorator (commands.add "stop")29 (defn stop [ctx args]30 (.stop (. ctx playback))))