diff options
author | William Xu <william.xwl@gmail.com> | 2008-04-01 13:22:00 +0000 |
---|---|---|
committer | William Xu <william.xwl@gmail.com> | 2008-04-01 13:22:00 +0000 |
commit | ed66137edc089844ccc8162d09a259e5acf7c32d (patch) | |
tree | 3b7fe0e66a739f39582ee0f4c7d82bcb47fdbe79 | |
parent | 0d86b1844c9173c24889896c0531c75973b75e57 (diff) |
Remove codes for loading movie subtitles automatically by emms, since
mplayer has an option(`sub-fuzziness') controlling that.
(emms-player-mplayer-subtitle-checker,
emms-player-mplayer-start-with-subtitle-checker): Removed.
emms-player-mplayer-subtitle-extensions: Removed.
darcs-hash:20080401132242-cfa61-0c70393c1b4b4263e1d5afec5134c947d6659dab.gz
-rw-r--r-- | emms-player-mplayer.el | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/emms-player-mplayer.el b/emms-player-mplayer.el index e19bcc7..c8bf466 100644 --- a/emms-player-mplayer.el +++ b/emms-player-mplayer.el @@ -1,6 +1,6 @@ ;;; emms-player-mplayer.el --- mplayer support for EMMS -;; Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; Authors: William Xu <william.xwl@gmail.com> ;; Jorgen Schaefer <forcer@forcix.cx> @@ -24,19 +24,15 @@ ;;; Commentary: ;; This provides a player that uses mplayer. It supports pause and -;; seeking. +;; seeking. For loading subtitles automatically, try adding +;; "sub-fuzziness=1" to your `~/.mplayer/config', see mplayer manual for +;; more. ;;; Code: (require 'emms-compat) (require 'emms-player-simple) -(defcustom emms-player-mplayer-subtitle-extensions - '("sub" "srt" "gb.srt" "big5.srt" "eng.srt" "chs.srt" "cht.srt") - "Possible movie subtitle file extensions." - :type 'symbol - :group 'emms) - (define-emms-simple-player mplayer '(file url) (mapconcat 'regexp-quote '(".ogg" ".mp3" ".wav" ".mpg" ".mpeg" ".wmv" ".wma" @@ -83,39 +79,5 @@ emms-player-simple-process-name (format "seek %d 2\n" sec))) -(defun emms-player-mplayer-subtitle-checker () - (let* ((track (emms-playlist-current-selected-track)) - (name (emms-track-name track)) - (ext (file-name-extension name)) - (choices - (emms-remove-if-not (lambda (i) - (or (and (eq (emms-track-type track) 'file) - (file-exists-p i)) - (eq (emms-track-type track) 'url))) - (mapcar (lambda (el) - (emms-replace-regexp-in-string - (concat ext "$") el name)) - emms-player-mplayer-subtitle-extensions))) - (subtitle (mapconcat 'identity choices ","))) - (unless (string= subtitle "") - (setq emms-player-mplayer-parameters - (append emms-player-mplayer-parameters - (list "-sub" subtitle)))))) - -(defun emms-player-mplayer-start-with-subtitle-checker (track) - "Start the player process by checking possible subtitles -additionally." - (let ((emms-player-mplayer-parameters emms-player-mplayer-parameters)) - (emms-player-mplayer-subtitle-checker) - (emms-player-simple-start (emms-track-name track) - emms-player-mplayer - emms-player-mplayer-command-name - emms-player-mplayer-parameters))) - -;; I have to redefine `emms-player-mplayer-start', since i can't figure -;; out an easy way to achieve this based on current design. (xwl) -(defalias 'emms-player-mplayer-start - 'emms-player-mplayer-start-with-subtitle-checker) - (provide 'emms-player-mplayer) ;;; emms-player-mplayer.el ends here |