emms using mplayer

Tuesday, July 25th, 2006

Well I said I could use music play daemon to play media files within Emacs, there’s something made it uncomfortable: every time I found some new mp3 files, I’ll need to rebuild the mpd database and restart the daemon. This is boring especially when I get one from a friend and just want to play it once: The mpd backend always comes before mplayer and all other backends and report “this file is not in the database” and I have to switch to the command line :(

And today I find the “-slave” option of mplayer. This makes mplayer a daemon running at the background and waiting for commands from Emacs. So there’s no need to tweak later-do-interval and I can change volume via mplayer.

So here’s my new setting, using mplayer instead of mpd:

(setq emms-player-mplayer-command-name "mplayer"
emms-player-mplayer-parameters ‘("-slave")
emms-player-mpg321-command-name "mpg123"
emms-player-list
‘(emms-player-mplayer
emms-player-mplayer-playlist
emms-player-mpg321
emms-player-ogg123))
(defun ddliu-emms-player-mplayer-volume-up ()
"Depends on mplayer’s -slave mode."
(interactive)
(process-send-string
emms-player-simple-process-name "volume 1\n"))

(defun ddliu-emms-player-mplayer-volume-down ()
“Depends on mplayer’s -slave mode.”
(interactive)
(process-send-string
emms-player-simple-process-name “volume -1\n”))

(define-key emms-playlist-mode-map (kbd “>”) ‘ddliu-emms-player-mplayer-volume-up)
(define-key emms-playlist-mode-map (kbd “<”) ‘ddliu-emms-player-mplayer-volume-down)
One drawback is that if I exit Emacs, the music will stop. But… who will exim Emacs?

Tags: ,

Comments 8

  1. lgfang wrote:

    thanks.

    And I modified it a little bit so that it work with emms-volume-raise/emms-volume-lower

    (defun my-mplayer-volume-change-function (amount)
    (interactive)
    (process-send-string
    emms-player-simple-process-name (format “volume %d\n” amount)))
    (setq emms-volume-change-function ‘my-mplayer-volume-change-function)

    Posted 03 Jan 2009 at 3:23 pm
  2. ugg boots chocolate wrote:

    The cooking range, refrigerator, cooking grills, food processors and microwave oven are the main appliances that you have in your kitchen. Instead of buying new items for remodeling you can make them repainted or overhauled.

    Posted 04 Nov 2010 at 10:31 am
  3. ugg boots günstig wrote:

    thank you for your post ,it is so benefit to learn from it ,will come back

    Posted 24 Nov 2010 at 9:34 pm
  4. sitefel wrote:

    Handbags

    Posted 31 Mar 2011 at 2:51 pm
  5. true religion outlet wrote:

    Imagine the beaded diamond jewelry designer within of you producing a custom made beaded necklace, or bracelet of beaded silver beads with turquoise stones, capped with sterling silver accents. and even a beaded crystal diamond jewelry item and even a middle shaped pendant?

    Posted 31 Mar 2011 at 3:46 pm
  6. thomas sabo uhren wrote:

    Some may disagree, but it doesn’t look as if Ugg Boots will be going out of fashion anytime soon. There are a lot of imitators out there, but Uggs are the original and still the best

    Posted 31 Mar 2011 at 4:58 pm
  7. ghd max style wrote:

    Oh I love all of these! Especially because they are so simple and beautiful yet have a cool edge. And I love the idea of adding a studded accessory to a feminine outfit- I think I will try that soon!
    http://www.ghdspeichern.com/ghd-max-stil.html

    Posted 31 Mar 2011 at 5:42 pm
  8. arizona dui lawyer wrote:

    Ask for advice in plain language and summarize how you understand it.

    Posted 27 Apr 2012 at 11:55 pm

Post a Comment

You could use <code type="name"> to get your code colorized

Your email is never published nor shared. Required fields are marked *

Close
E-mail It