+;;; -* emacs-lisp *-
 ;;; init-emms.el --- music player
 ;; Author: Leon He<leonhe86@gmail.com>
 ;; Version: 0.1

(setq emms-source-file-default-directory "~/Music/")


;; (defun filter-name (name)
;;   "return filter music name by regexp"
;;   ;;(let ()
;;     ;; (if (string-match regexp name)
;;     ;; 	    (progn
;;     ;; 	      (format "%s" )))
;;     ;; )
;;   (format "%s" name)
;;  )

;; ;;format current track,only display title in mode line
(defun eiio-emms-mode-line-playlist-current ()
  "Return a description of the current track."
  (let* ((regexp "/\\([^/]+\\)/\\([^/]+\\)\\.[^.]+$")
         (title (emms-track-get track 'name)))
    (if (string-match regexp title)
     	(progn
	  (format " [ %s ] " (match-string 2 title)))
      )))
 


(setq emms-mode-line-mode-line-function
      'eiio-emms-mode-line-playlist-current)

;; (defun eiio-emms-info-track-des (track)
;;   "Returen a description to current track"
;;   (let ((artist (emms-track-get track 'info-artist))

(require 'emms-player-simple)
(require 'emms-source-file)
(require 'emms-source-playlist)
(require 'emms-player-mplayer)
(emms-all)
(emms-default-players)
