Figuring out customization groups.
[emus.git] / emus.el
1 ;;; emus.el --- Simple music player for Emacs
2
3 ;; Author: T. G. Vaughan <tgvaughan@gmail.com>
4 ;; Version: 1.0
5 ;; Keywords: multimedia
6 ;; URL: http://github.com/tgvaughan/emus
7
8 ;;; Commentary:
9
10 ;; This is a simple package for playing audio from a local library
11 ;; of audio files.
12
13 ;;; Code:
14
15 (defgroup emus nil
16   "Simple music player for Emacs inspired by CMUS."
17   :group 'multimedia)
18
19 (defcustom emus-directory "~/Music/"
20   "Directory containing audio files for emus."
21   :type 'string
22   :group 'emus)
23
24 (defcustom emus-mpg123-excecutable "mpg123"
25   "Name of (and, optionally, path to) mpg123 binary."
26   :type 'string
27   :group 'emus)
28
29 (defun emus-get-audio-files ()
30   "Get all mp3 files in main emus directory."
31   (directory-files-recursively emus-directory ".*\\.mp3"))
32
33 (defun emus ()
34   "Switch to *emus* audio library buffer."
35   (interactive)
36   (switch-to-buffer "*emus*")
37   (emus-mode))
38
39 (define-derived-mode emus-mode special-mode "Emus"
40   "Major mode for EMUS music player."
41
42   (setq-local default-directory emus-directory)
43
44   (let ((player (make-process :name "mpg123" :command '(emus-mpg123-excecutable "-R"))))
45     (process-send-string player "load The Midnight - Endless Summer - 01 Endless Summer.mp3\n")))
46
47 ;;; emus.el ends here