;;; find-and-play.el --- Interface to find-and-play. ;; Copyright (C) 2003,2004 Marco Parrone. ;; Filename: find-and-play.el ;; Version: 0.3.0 (alpha) ;; Updated: 2004-01-23 ;; Keywords: music, player, mp3, ogg, wav ;; Author: Marco Parrone ;; Maintainer: Marco Parrone ;; Description: interface to find-and-play (a music files searcher and player) ;; Language: Emacs Lisp ;; Compatibility: Emacs 21 ;; Location: http://savannah.nongnu.org/cgi-bin/viewcvs/*checkout*/emhacks/emhacks/elisp/find-and-play.el?rev=HEAD&content-type=text/plain ;; This file is not part of GNU Emacs. ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;;; Commentary: ;; find-and-play.el is a frontend for using find-and-play (a music ;; file searcher and player). ;;; Code: (eval-when-compile (require 'dired)) (defgroup find-and-play nil "Interface to find-and-play." :prefix "find-and-play-" :group 'external) (defcustom find-and-play-default-directory "~/" "*The default directory for the music files path prompt." :type 'string :group 'find-and-play) (defun find-and-play (directory) "Find all the music files in a directory and play them. If a file is selected, play that file." (shell-command (concat "find-and-play " (shell-quote-argument directory) " >& /dev/null & ") (concat "*(find-and-play " directory ")*"))) (defun find-and-play-interactive () "Find all the music files in a directory and play them. If a file is selected, play that file." (interactive) (find-and-play (expand-file-name (read-file-name "File or directory to play: " find-and-play-default-directory)))) (defun dired-do-find-and-play (ARG) "Call find-and-play on the marked (or next ARG) files." (interactive "P") (let ((files (list))) (dired-map-over-marks (setq files (cons (dired-get-filename) files)) ARG 'find-and-play) (setq files (apply (function concat) (mapcar (lambda (a) (concat (shell-quote-argument a) " ")) files))) (shell-command (concat "find-and-play " files " >& /dev/null & ") (concat "*(find-and-play " files ")*")))) (provide 'find-and-play) ;; Local Variables: ;; mode: emacs-lisp ;; mode: auto-fill ;; fill-column: 70 ;; comment-column: 32 ;; End: ;;;; find-and-play.el ends here.