From a55fa5da02057f1955ce8abfac7fc173fa5bd659 Mon Sep 17 00:00:00 2001 From: William Xu Date: Thu, 21 Jun 2007 15:55:00 +0000 Subject: emms-player-mplayer.el: New variable: emms-player-mplayer-subtitle-extensions. darcs-hash:20070621155548-cfa61-fa61b2eca9ad5eb4085e5401db809f023304f5cb.gz --- emms-player-mplayer.el | 16 ++++++++++++---- 1 file 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 -- cgit v1.2.3