diff options
Diffstat (limited to 'emms-source-file.el')
-rw-r--r-- | emms-source-file.el | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/emms-source-file.el b/emms-source-file.el index e2e1cec..6634130 100644 --- a/emms-source-file.el +++ b/emms-source-file.el @@ -140,42 +140,6 @@ value of `emms-source-file-default-directory'." (emms-track 'file file))) (emms-source-file-directory-tree dir regex))) -;;;###autoload (autoload 'emms-play-playlist "emms-source-file" nil t) -;;;###autoload (autoload 'emms-add-playlist "emms-source-file" nil t) -(define-emms-source playlist (playlist) - "A source for .m3u and .pls playlists. It ignores empty lines, -or lines starting with '#'." - (interactive (list (read-file-name "Play file: " - emms-source-file-default-directory - emms-source-file-default-directory - t))) - (dolist (file (emms-source-file-parse-playlist playlist)) - (if (string-match "\\`http://" file) - (emms-source-url file) - (emms-source-file file)))) - -(defun emms-source-file-parse-playlist (playlist) - "Extract a list of filenames from the given .m3u or .pls playlist. -Empty lines and lines starting with '#' are ignored." - (let ((files '()) - (pls-p (if (string-match "\\.pls\\'" playlist) t nil)) - (dir (file-name-directory playlist))) - (with-temp-buffer - (insert-file-contents playlist) - (goto-char (point-min)) - (while (re-search-forward "^[^# ].*$" nil t) - (let ((line (match-string 0))) - (when pls-p - (if (string-match "\\`File[0-9]*=\\(.+\\)\\'" line) - (setq line (match-string 1 line)) - (setq line ""))) - (unless (string= line "") - (setq files (cons (if (or (string-match "\\`http://" line) - (file-name-absolute-p line)) - line - (concat dir line)) - files)))))) - (reverse files))) ;;; Helper functions |