writing a lcd display program in c

on

Let’s start with the final part: how to compile:
gcc -c mpddispl.c -o mpddispl.o
gcc mpddispl.o /usr/lib/libmpdclient.so -o mpddispl

Now the beginning.

I bought a nifty display for my raspberry pi running mpd: a piface with a display:

pifacecadonpi

 

Now what i want is just simple. Show the streamname and current song that is mpd playing.

Oh and I want to make it an C excercise. Later on Python, but for now C.

To make live a bit easier, I want to use at least 2 ‘standard’ libraries.

1. libmpdclient for communcation with mpd

2. libpifacecad for communication with the display (and lateron all the buttons).

libmpdclient (and the dev version for some header info) can be installed by apt-get install libmpdclient2 libmpdclient-dev

libpifacecad can be installed by compiling according to this page: http://piface.github.io/libpifacecad/

 

First things first: query mpd.
You can get lots of info from mpd. But what I want to show is some song info currently playing. Like the songtitle or the stream name.