From eb93f79afd534728fb10653f030dae8b33da817a Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Sun, 22 Apr 2018 11:25:41 +0200 Subject: [PATCH] Figuring out customization groups. --- emus.el | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/emus.el b/emus.el index d53f430..c66aed3 100644 --- a/emus.el +++ b/emus.el @@ -5,14 +5,43 @@ ;; Keywords: multimedia ;; URL: http://github.com/tgvaughan/emus -;; Commentary: +;;; Commentary: ;; This is a simple package for playing audio from a local library ;; of audio files. -;;;###autoload +;;; Code: + +(defgroup emus nil + "Simple music player for Emacs inspired by CMUS." + :group 'multimedia) + +(defcustom emus-directory "~/Music/" + "Directory containing audio files for emus." + :type 'string + :group 'emus) + +(defcustom emus-mpg123-excecutable "mpg123" + "Name of (and, optionally, path to) mpg123 binary." + :type 'string + :group 'emus) + +(defun emus-get-audio-files () + "Get all mp3 files in main emus directory." + (directory-files-recursively emus-directory ".*\\.mp3")) + (defun emus () "Switch to *emus* audio library buffer." (interactive) (switch-to-buffer "*emus*") (emus-mode)) + +(define-derived-mode emus-mode special-mode "Emus" + "Major mode for EMUS music player." + + (setq-local default-directory emus-directory) + + (let ((player (make-process :name "mpg123" :command '(emus-mpg123-excecutable "-R")))) + (process-send-string player "load The Midnight - Endless Summer - 01 Endless Summer.mp3\n"))) + +;;; emus.el ends here -- 2.20.1