Default style (Cherry Eve). Switch styles (Capricorn). XML Feed Calendar
All | General | Programming | Shell
20050203 Thursday February 03, 2005

What file is playing under xmms

Here's a simple program that determines what file is playing under xmms. Short, sweet and to the point. You need the xmms headers and libintl, but apart form those it should compile just dandily (big ifs of course).

#include <sys/types.h>
#include <xmmsctrl.h>
#include <glib.h>
#include <stdio.h>

int
main(int argc, char **argv)
{
        gint session = 0;
        gchar *file;
        gint pos;

        if (xmms_remote_get_version(session) == 0) {
                return (0);
        }

        pos = xmms_remote_get_playlist_pos(session);

        file = xmms_remote_get_playlist_file(session, pos);
        if (file != NULL) {
                printf("%s\n", file);
        }
}
February 03, 2005 03:27 PM GMT Permalink