Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: Gnus elisp source for Now-Playing
       [not found] <m3n0all1z4.fsf@home.tcob1.net>
@ 2003-11-25  3:13 ` Henrik Enberg
       [not found]   ` <m3ptfgivl9.fsf@toyland.sauerland.de>
  0 siblings, 1 reply; 2+ messages in thread
From: Henrik Enberg @ 2003-11-25  3:13 UTC (permalink / raw)


sean@tcob1.net (Sean Rima) writes:

> Some where on the web I found and lost a segment of text that allowed
> for adding a X-XMMS-NOW-PLAYING header but I cannot find it. If
> anyone has something similar please share it,Please :)

put this in ~/.gnus:

(defun xmms-now-playing ()
  (let ((track (shell-command-to-string "xmms-now-playing")))
    (unless (string-equal "" track)
      (save-excursion
	(goto-char (point-min))
	(re-search-forward "^--text follows this line--")
	(forward-line 0)
	(insert "X-Now-Playing: " track "\n")))))

(add-hook 'message-setup-hook 'xmms-now-playing)

you also need the below C program. put it in a directory on $PATH when
you've compiled it.  Also, this requires the XMMS development headers to
be installed.  Use "apt-get install xmms-dev" if you're on on Debian.

---- xmms-now-playing.c ----

/* compile with:  
 gcc -O2 -Wall `xmms-config --cflags --libs` -o xmms-now-playing xmms-now-playing.c
 */

#include <xmmsctrl.h>
#include <glib.h>

int
main (void)
{
  int n = -1;

  if ((n = xmms_remote_get_playlist_pos (0)) > -1)
    {
      char *title;

      if ((title = xmms_remote_get_playlist_title (0, n)))
	{
	  g_print ("%s", title);
	  g_free (title);
	}
    }
  return 0;
}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Gnus elisp source for Now-Playing
       [not found]   ` <m3ptfgivl9.fsf@toyland.sauerland.de>
@ 2003-11-25 19:23     ` Henrik Enberg
  0 siblings, 0 replies; 2+ messages in thread
From: Henrik Enberg @ 2003-11-25 19:23 UTC (permalink / raw)


Sebastian Kaps <seb-dated-1069928963.6df609@toyland.sauerland.de> writes:

> // Henrik Enberg writes:
>
>> you also need the below C program. put it in a directory on $PATH when
>> you've compiled it.  Also, this requires the XMMS development headers to
>> be installed.  Use "apt-get install xmms-dev" if you're on on Debian.

> But I don't see any great advantage over your method...

The advantage is/was that the song-change plugin didn't even compile for
me when I tried it.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-11-25 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m3n0all1z4.fsf@home.tcob1.net>
2003-11-25  3:13 ` Gnus elisp source for Now-Playing Henrik Enberg
     [not found]   ` <m3ptfgivl9.fsf@toyland.sauerland.de>
2003-11-25 19:23     ` Henrik Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).