From b582a75d033e5a21090c854f58abeefdd238798f Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 25 Aug 2021 10:56:13 -0400 Subject: * emms-source-file.el: use thing-at-point for URLs. --- emms-source-file.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emms-source-file.el b/emms-source-file.el index 9678b41..7186a92 100644 --- a/emms-source-file.el +++ b/emms-source-file.el @@ -45,6 +45,7 @@ (require 'locate) (error nil))) (require 'dired) +(require 'thingatpt) (defgroup emms-source-file nil "*Sources for EMMS that use the file system." @@ -293,7 +294,7 @@ files) can play." ;;;###autoload (autoload 'emms-add-url "emms-source-file" nil t) (define-emms-source url (url) "An EMMS source for an URL - for example, for streaming." - (interactive "sPlay URL: ") + (interactive (list (read-string "Play URL: " (thing-at-point-url-at-point)))) (emms-playlist-insert-track (emms-track 'url url))) ;;;###autoload (autoload 'emms-play-streamlist "emms-source-file" nil t) -- cgit v1.2.3 From fe94a7cc170404f3361779b8adbe00abcde6af6b Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Thu, 9 Sep 2021 21:53:22 -0400 Subject: * emms-volume-sndioctl.el: new file A mode for changing volume using sndioctl on OpenBSD. --- emms-volume-sndioctl.el | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 emms-volume-sndioctl.el diff --git a/emms-volume-sndioctl.el b/emms-volume-sndioctl.el new file mode 100644 index 0000000..4bfb574 --- /dev/null +++ b/emms-volume-sndioctl.el @@ -0,0 +1,71 @@ +;;; emms-volume-sndioctl.el --- a mode for changing volume using sndioctl -*- lexical-binding: t; -*- + +;; Copyright (C) 2006, 2007, 2008, 2009, 2019 Free Software Foundation, Inc. + +;; Authors: Omar Polo + +;; This file is part of EMMS. + +;; EMMS 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 3, or (at your option) +;; any later version. +;; +;; EMMS 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 EMMS; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: + +;; This file defines a few simple functions to raise or lower the +;; volume using sndioctl. It can be used stand-alone, though it's +;; meant for usage with EMMS, particularly with emms-volume.el + +;;; History: + +;; Sep 09 2021: Based on emms-volume-mixerctl.el by Omar Polo + +;;; Code: + +(defcustom emms-volume-sndioctl-stream "output" + "The stream to change the volume with. +Usually it's the global \"output\". For a full list of available +controls, run `sndioctl' in a shell." + :type '(choice (const :tag "output" "output") + (string :tag "Something else: ")) + :group 'emms-volume) + +(defcustom emms-volume-sndioctl-device nil + "The card number to change volume. +The card is identified by a number. For a full list run `ls +/dev/mixer?*' in a shell." + :type '(choice (const :tag "none" nil) + (string :tag "Device: ")) + :group 'emms-volume) + +;;;###autoload +(defun emms-volume-sndioctl-change (amount) + "Change sndioctl level by AMOUNT." + (message "Playback channels: %s" + (with-temp-buffer + (when (zerop + (apply #'call-process + "sndioctl" nil (current-buffer) nil + `("-n" + ,@(when emms-volume-sndioctl-device + `("-f" ,emms-volume-sndioctl-device)) + ,(format "%s.level=%s%f" + emms-volume-sndioctl-stream + (if (> amount 0) "+" "") + (/ (float amount) 100))))) + (string-trim-right (buffer-string)))))) + +(provide 'emms-volume-sndioctl) + +;;; emms-volume-sndioctl.el ends here -- cgit v1.2.3 From a04d31d5c3a513f1f3c82f33407212455fa98cc7 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Thu, 9 Sep 2021 21:54:52 -0400 Subject: * emms-volume-sndioctl.el: add missing require --- emms-volume-sndioctl.el | 1 + 1 file changed, 1 insertion(+) diff --git a/emms-volume-sndioctl.el b/emms-volume-sndioctl.el index 4bfb574..74ca4b3 100644 --- a/emms-volume-sndioctl.el +++ b/emms-volume-sndioctl.el @@ -32,6 +32,7 @@ ;; Sep 09 2021: Based on emms-volume-mixerctl.el by Omar Polo ;;; Code: +(require 'subr-x) (defcustom emms-volume-sndioctl-stream "output" "The stream to change the volume with. -- cgit v1.2.3 From cdea65b8e8e552a70e21f6e920dfaf581eafb615 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Thu, 9 Sep 2021 22:01:29 -0400 Subject: * AUTHORS: add Omar Polo --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 3066a76..b577bb1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -24,6 +24,7 @@ Martin Schoenmakers Matthew Kennedy Michael Olson Nick Alcock +Omar Polo Petteri Hintsanen Pierre Neidhardt stardiviner -- cgit v1.2.3 From 1cbc3af9d48b3b79b8bd274a5dcde793dbb4c9f3 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Thu, 9 Sep 2021 22:02:30 -0400 Subject: * doc/developer-release.txt: add note about AUTHORS. --- doc/developer-release.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/developer-release.txt b/doc/developer-release.txt index cd3e06d..69f4dc8 100644 --- a/doc/developer-release.txt +++ b/doc/developer-release.txt @@ -8,6 +8,8 @@ distributed via Emacs ELPA (https://elpa.gnu.org/). * Update NEWS. +* Update AUTHORS file with the names of any new contributors. + * Update the manual (makeinfo --html --no-split emms.texinfo). * Update website (cvs commit -m "update website" index.html). -- cgit v1.2.3 From bc0d2ec1ba99409421d3f75aae315e10b5014b31 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sat, 11 Sep 2021 16:26:36 -0400 Subject: * emms-volume.el: load sndioctl load sndioctl and use correct quoting style --- emms-volume.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/emms-volume.el b/emms-volume.el index bb92a31..dd40934 100644 --- a/emms-volume.el +++ b/emms-volume.el @@ -52,6 +52,7 @@ (require 'emms-volume-amixer) (require 'emms-volume-pulse) (require 'emms-volume-mixerctl) +(require 'emms-volume-sndioctl) ;; Customize group (defgroup emms-volume nil @@ -61,9 +62,12 @@ ;; General volume setting related code. (defcustom emms-volume-change-function (cond - ((executable-find "amixer") 'emms-volume-amixer-change) - ((executable-find "pactl") 'emms-volume-pulse-change) - ((executable-find "mixerctl") 'emms-volume-mixerctl-change) + ;; check for sndioctl first to avoid picking up mixerctl or pactl + ;; on OpenBSD. + ((executable-find "sndioctl") #'emms-volume-sndioctl-change) + ((executable-find "amixer") #'emms-volume-amixer-change) + ((executable-find "pactl") #'emms-volume-pulse-change) + ((executable-find "mixerctl") #'emms-volume-mixerctl-change) (t #'(lambda (_amount) (user-error "%s" "No supported mixer found. Please, define ‘emms-volume-change-function’.")))) "The function to use to change the volume. If you have your own functions for changing volume, set this." @@ -71,6 +75,7 @@ If you have your own functions for changing volume, set this." (const :tag "MPD" emms-volume-mpd-change) (const :tag "PulseAudio" emms-volume-pulse-change) (const :tag "Mixerctl" emms-volume-mixerctl-change) + (const :tag "Sndioctl" emms-volume-sndioctl-change) (function :tag "Lisp function"))) (defcustom emms-volume-change-amount 2 -- cgit v1.2.3 From c42fab572846b1dd76d82c5293ccfb6ee2c45991 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sat, 11 Sep 2021 16:31:18 -0400 Subject: release 7.7 --- NEWS | 7 +++++++ emms.el | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 30b97f7..d2fc196 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +New in 7.7 + + * Add sndioctl support. + * Use thing-at-point for URLs. + * Add player-preference interface. + + New in 7.6 * Change the way we write the NEWS file: "New in..." instead of "News since...". diff --git a/emms.el b/emms.el index f3bb678..2186853 100644 --- a/emms.el +++ b/emms.el @@ -4,7 +4,7 @@ ;; Author: Jorgen Schäfer , the Emms developers (see AUTHORS file) ;; Maintainer: Yoni Rabkin -;; Version: 7.6 +;; Version: 7.7 ;; Keywords: emms, mp3, ogg, flac, music, mpeg, video, multimedia ;; Package-Type: multi ;; Package-Requires: ((cl-lib "0.5") (nadvice "0.3") (seq)) @@ -44,7 +44,7 @@ ;;; Code: -(defvar emms-version "7.6" +(defvar emms-version "7.7" "EMMS version string.") -- cgit v1.2.3