diff options
author | lucas <lucas> | 2005-09-12 14:42:00 +0000 |
---|---|---|
committer | lucas <mwolson@gnu.org> | 2005-09-12 14:42:00 +0000 |
commit | f4b96cd517218ec82eb02360216b76f841cd9aae (patch) | |
tree | 094640b1960cea7876410ce7bf6343cef4bfbd7e | |
parent | 0994a7c585ff45c60ec140f754859fd295cf5bd4 (diff) |
Rewrote emms-player-gstreamer
darcs-hash:20050912144233-4f952-041bcf7e8a09c0d53eeb1fd7840c0f3e82995355.gz
-rw-r--r-- | emms-player-gstreamer.el | 73 |
1 files changed, 39 insertions, 34 deletions
diff --git a/emms-player-gstreamer.el b/emms-player-gstreamer.el index 881831f..e3cd782 100644 --- a/emms-player-gstreamer.el +++ b/emms-player-gstreamer.el @@ -1,58 +1,63 @@ ;; emms-gstreamer.el --- EMMS Gstreamer interaction -;; License : GPL v2.1 or later - -;; currently outside other files, as it's very preliminary support +;; Copyright (C) 2005 Lucas Bonnet + +;; Author: Lucas Bonnet <lucas@rincevent.net> +;; Keywords: emms, mp3, ogg, multimedia + +;; This file 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, or (at your option) +;; any later version. +;; +;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +;; Boston, MA 02110-1301 USA + +;;; Commentary: + +;; Very basic support ;; The wrapper concept is easier to set up than a generic gstreamer ;; support, but in the long term, it's probably not a good idea. ;; Installation instructions : -;; 1. Put (require 'emms-gstreamer) in your ~/.emacs or whatever you -;; use to configure EMMS. +;; 1. Put (require 'emms-player-gstreamer) in your ~/.emacs or +;; whatever you use to configure EMMS. ;; 2. Put the wrappers in your `exec-path' : -;; (add-to-list 'exec-path "/path/to/wrappers") or the other way, -;; by moving them in an already present directory. +;; (add-to-list 'exec-path "/path/to/wrapper") or the other way, +;; by moving it to an already known directory. (require 'emms-player-simple) -(defvar emms-gst-sink "alsasink" +(defvar emms-player-gstreamer-sink "alsasink" "The audio output sink to use") -(defvar emms-gstreamer-paused-p nil) - -(define-emms-simple-player gst-mp3 '(file) "\\.[mM][pP][23]$" "gst-mp3-wrapper") -(define-emms-simple-player gst-ogg '(file) (regexp-opt '(".ogg" ".OGG")) "gst-ogg-wrapper") -(define-emms-simple-player gst-flac '(file) (regexp-opt '(".FLAC" ".flac" )) "gst-flac-wrapper") -(define-emms-simple-player gst-mod '(file) (regexp-opt '(".xm" ".it" ".ft" ".mod")) "gst-mod-wrapper") +(define-emms-simple-player gstreamer '(file) + (regexp-opt '(".mp3" ".ogg" ".mod" ".flac" ".xm" ".it" ".ft" + ".MP3" ".OGG" ".MOD" ".FLAC" ".XM" ".IT" ".FT")) + "gst-wrapper") -(add-to-list 'emms-player-list 'emms-player-gst-mp3) -(add-to-list 'emms-player-list 'emms-player-gst-ogg) -(add-to-list 'emms-player-list 'emms-player-gst-flac) -(add-to-list 'emms-player-list 'emms-player-gst-mod) +(setq emms-player-gstreamer-parameters (list emms-player-gstreamer-sink)) -(setq emms-player-gst-mp3-parameters `(,emms-gst-sink)) -(setq emms-player-gst-ogg-parameters `(,emms-gst-sink)) -(setq emms-player-gst-flac-parameters `(,emms-gst-sink)) -(setq emms-player-gst-mod-parameters `(,emms-gst-sink)) +(emms-player-set emms-player-gstreamer 'pause 'emms-player-gstreamer-pause) +(emms-player-set emms-player-gstreamer 'resume 'emms-player-gstreamer-resume) - -(defun emms-gstreamer-play/pause () +(defun emms-player-gstreamer-pause () (interactive) - (if emms-gstreamer-paused-p - (emms-gstreamer-resume) - (emms-gstreamer-pause))) + (signal-process (get-process emms-player-simple-process-name) 'SIGSTOP)) -(defun emms-gstreamer-pause () +(defun emms-player-gstreamer-resume () (interactive) - (signal-process (shell-command-to-string "pgrep gst-launch") 'SIGSTOP) - (setq emms-gstreamer-paused-p t)) + (signal-process (get-process emms-player-simple-process-name) 'SIGCONT)) -(defun emms-gstreamer-resume () - (interactive) - (signal-process (shell-command-to-string "pgrep gst-launch") 'SIGCONT) - (setq emms-gstreamer-paused-p nil)) (provide 'emms-player-gstreamer) |