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:
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?
Comments 8
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)
Posted 03 Jan 2009 at 3:23 pm ¶(interactive)
(process-send-string
emms-player-simple-process-name (format “volume %d\n” amount)))
(setq emms-volume-change-function ‘my-mplayer-volume-change-function)
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 ¶thank you for your post ,it is so benefit to learn from it ,will come back
Posted 24 Nov 2010 at 9:34 pm ¶Handbags
Posted 31 Mar 2011 at 2:51 pm ¶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 ¶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 ¶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!
Posted 31 Mar 2011 at 5:42 pm ¶http://www.ghdspeichern.com/ghd-max-stil.html
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