[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mpv a5c6eed9ac 44/50: Add volume control commands
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mpv a5c6eed9ac 44/50: Add volume control commands |
Date: |
Tue, 28 Dec 2021 00:58:43 -0500 (EST) |
branch: elpa/mpv
commit a5c6eed9acf2faf31e56b3ebe86b1b0405636d45
Author: c1-g <char1iegordon@protonmail.com>
Commit: Johann Klähn <johann@jklaehn.de>
Add volume control commands
---
README.md | 1 +
mpv.el | 27 +++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/README.md b/README.md
index e9f581df94..cecebce604 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,7 @@ Among others, mpv.el provides
- `mpv-kill`
- `mpv-seek-forward` / `mpv-seek-backward`
- `mpv-speed-increase` / `mpv-speed-decrease`
+- `mpv-volume-increase` / `mpv-speed-volume`
- `mpv-insert-playback-position`
- `mpv-seek-to-position-at-point`
diff --git a/mpv.el b/mpv.el
index 5348c92c83..d99d9ff206 100644
--- a/mpv.el
+++ b/mpv.el
@@ -63,6 +63,11 @@
:type 'number
:group 'mpv)
+(defcustom mpv-volume-step 1.50
+ "Scale factor used when adjusting volume."
+ :type 'number
+ :group 'mpv)
+
(defcustom mpv-seek-step 5
"Step size in seconds used when seeking."
:type 'number
@@ -323,6 +328,28 @@ This can be used with the `org-open-at-point-functions'
hook."
(interactive "p")
(mpv-speed-increase (- steps)))
+;;;###autoload
+(defun mpv-volume-set (factor)
+ "Set playback volume to FACTOR."
+ (interactive "nFactor: ")
+ (mpv--enqueue `("set" "volume" ,(abs factor)) #'ignore))
+
+;;;###autoload
+(defun mpv-volume-increase (steps)
+ "Increase playback volume by STEPS factors of `mpv-volume-step'."
+ (interactive "p")
+ (let ((factor (* (abs steps)
+ (if (> steps 0)
+ mpv-volume-step
+ (/ 1 mpv-volume-step)))))
+ (mpv--enqueue `("multiply" "volume" ,factor) #'ignore)))
+
+;;;###autoload
+(defun mpv-volume-decrease (steps)
+ "Decrease playback volume by STEPS factors of `mpv-volume-step'."
+ (interactive "p")
+ (mpv-volume-increase (- steps)))
+
(defun mpv--raw-prefix-to-seconds (arg)
"Convert raw prefix argument ARG to seconds using `mpv-seek-step'.
Numeric arguments will be treated as seconds, repeated use
- [nongnu] elpa/mpv f31cbdb94a 37/50: Add convenience functions to get and set properties, (continued)
- [nongnu] elpa/mpv f31cbdb94a 37/50: Add convenience functions to get and set properties, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv f0f61db3af 47/50: Add COPYING file following GPL, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 4774d52c8c 48/50: Merge pull request #21 from sachac/master, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 604b32d7e6 11/50: add play command, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 15c51ddc5e 10/50: remove dependency on dash library, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 059135de39 28/50: version 0.1.0, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 9e1781249f 27/50: convert numbers to strings before encoding as JSON, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 79e01bf89b 35/50: Remove stale socket files when mpv process is gone, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 4dddd55c5e 41/50: Add mpv-version., ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 2d40c45505 38/50: Add mpv-seek and mpv-revert-seek commands, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv a5c6eed9ac 44/50: Add volume control commands,
ELPA Syncer <=
- [nongnu] elpa/mpv 3a43c9e60a 14/50: reorder function definitions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 338af25d20 23/50: add mpv-on-event-hook, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 937bdf522a 17/50: implement seeking and changing of playback speed, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 0e4318b45f 13/50: improve docstrings, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 0579b5c707 09/50: support inserting org timer list items, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv ce3bbfac36 22/50: add mpv-default-options, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 9ef359d712 20/50: fix generation of autoloads, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 9ff4d5d80b 25/50: fix mpv-insert-playback-position, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 705e81b8a6 42/50: Make mpv-version more verbose and update its docstring as suggested, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv ed83369372 39/50: Fix mpv-seek-to-position-at-point for start-of-playback position, ELPA Syncer, 2021/12/28