diff options
author | William Xu <william.xwl@gmail.com> | 2007-06-21 15:55:00 +0000 |
---|---|---|
committer | William Xu <william.xwl@gmail.com> | 2007-06-21 15:55:00 +0000 |
commit | a55fa5da02057f1955ce8abfac7fc173fa5bd659 (patch) | |
tree | 58c5615fa08f71e14fb1a451d4411d517d5aea39 | |
parent | 0f92c8f2851542b482047bf138ac14fa735fc228 (diff) |
emms-player-mplayer.el: New variable: emms-player-mplayer-subtitle-extensions.
darcs-hash:20070621155548-cfa61-fa61b2eca9ad5eb4085e5401db809f023304f5cb.gz
-rw-r--r-- | emms-player-mplayer.el | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/emms-player-mplayer.el b/emms-player-mplayer.el index fe7a100..aaf46c0 100644 --- a/emms-player-mplayer.el +++ b/emms-player-mplayer.el @@ -31,6 +31,12 @@ (require 'emms-compat) (require 'emms-player-simple) +(defcustom emms-player-mplayer-subtitle-extensions + '("sub" "srt" "gb.srt" "big5.srt") + "Possible movie subtitle file extensions." + :type 'symbol + :group 'emms) + (define-emms-simple-player mplayer '(file url) (regexp-opt '(".ogg" ".mp3" ".wav" ".mpg" ".mpeg" ".wmv" ".wma" ".mov" ".avi" ".divx" ".ogm" ".asf" ".mkv" "http://" "mms://" @@ -79,10 +85,12 @@ (let* ((track (emms-playlist-current-selected-track)) (name (emms-track-name track)) (ext (file-name-extension name)) - (sub (replace-regexp-in-string (concat ext "$") "sub" name)) - ;; TODO, script for chinese, gb, big, etc. - (srt (replace-regexp-in-string (concat ext "$") "srt" name)) - (choices (emms-remove-if-not 'file-exists-p (list sub srt))) + (choices + (emms-remove-if-not 'file-exists-p + (mapcar (lambda (el) + (replace-regexp-in-string + (concat ext "$") el name)) + emms-player-mplayer-subtitle-extensions))) (subtitle nil)) (cond ((> (length choices) 1) (setq subtitle |