Mpd

From Remuco

Jump to: navigation, search

Introduction

Remuco has basic support for Mpd. That means Mpd integration is realized by a basic player proxy.

Basic player proxies (BPPs) are the fast and easy way to integrate a media player into Remuco. BPPs are simple text files located in ~/.config/remuco and suffixed with .bpp. For Mpd it is the file ~/.config/remuco/Mpd.bpp. This files describes how to interact with Mpd on a command line basis, i.e. which shell commands to execute in order to control Mpd or to get information about Mpd's state.

Installation

Create the file ~/.config/remuco/Mpd.bpp and fill it with following content:

[config]
[commands]
running = mpc
playpause = mpc toggle
next = mpc next
prev = mpc prev
stop = mpc stop
seek-fwd = mpc seek +5s
seek-bwd = mpc seek -5s
volume-set = mpc volume $PARAM
mute = mpc volume 0
jump = mpc play $( expr $PARAM + 2 )
playing = mpc | fgrep playing
volume = mpc | fgrep volume | cut -d ' ' -f2 | tr -d '%'
plob = mpc | head -n1
playlist = mpc playlist

Bug-cleaned version (playing status work now; volume now works at 100% too; plob shows album name; plob shows file name, when no tag data available):

[config]
shell = /bin/bash
[commands]
running = mpc
playpause = mpc toggle
next = mpc next
prev = mpc prev
stop = mpc stop
seek-fwd = mpc seek +5s
seek-bwd = mpc seek -5s
volume-set = mpc volume $PARAM
mute = mpc volume 0
jump = mpc play $( expr $PARAM + 2 )
playing = playvar=$(mpc | fgrep playing | cut -d ' ' -f1); if [ "$playvar" == "[playing]" ] ; then echo true; else echo false; fi
volume = mpc | fgrep volume | cut -d ':' -f2 | cut -d '%' -f1
plob = mpc status --format "[[%artist%  -  %title%  -  %album%]|[%file%]]" | head -n1
playlist = mpc playlist

Usage

The player proxy gets active on next server startup. You can (re)start the server with the following commands:

$ remuco --restart