From e8ddda19e1f8406b5a8c5c771513218b1459b734 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Fri, 5 Jan 2007 23:50:00 +0000 Subject: emms-lastfm: Add emms-lastfm-np, which displays the current song information as a message or inserts it at point darcs-hash:20070105235058-1bfb2-35bf242a357711d2539c8d036f6ea6c8cff87957.gz --- emms-lastfm.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'emms-lastfm.el') diff --git a/emms-lastfm.el b/emms-lastfm.el index 4c8d328..0f2ed00 100644 --- a/emms-lastfm.el +++ b/emms-lastfm.el @@ -427,6 +427,26 @@ high. (But then streaming a 128KHz mp3 won't be fun anyway.)" (message "EMMS: Playing Last.fm stream.")) (message "EMMS: Bad response from Last.fm.")))) +(defun emms-lastfm-np (&optional arg) + "Show the currently-playing lastfm radio tune." + (interactive "P") + (emms-lastfm-radio-request-metadata + (lambda (status arg buffer) + (let (artist title) + (save-excursion + (set-buffer emms-lastfm-buffer) + (emms-http-decode-buffer) + (setq artist (emms-key-value "artist") + title (emms-key-value "track"))) + (let ((msg (if title (format emms-show-format + (format "%s - %s" artist title)) + "Nothing playing right now"))) + (if (and arg title) + (with-current-buffer buffer + (insert msg)) + (message msg))))) + (list arg (current-buffer)))) + (defun emms-lastfm-radio-similar-artists (artist) "Plays the similar artist radio of ARTIST." (interactive "sArtist: ") -- cgit v1.2.3