Discussion:
[emms-help] Disable mpv "--no-audio-display" while playing
Mohamed Aziz Knani
2018-09-25 11:06:01 UTC
Permalink
Hello,

It would be nice if there was a way to disable "--no-audio-display"
while playing, is there a command to pass using ipc ?
I know this might not be emms related but an answer would be very
helpful, thank you.
--
Mohamed Aziz Knani
http://www.aziz.tn/
Yoni Rabkin
2018-09-25 17:42:09 UTC
Permalink
Post by Mohamed Aziz Knani
Hello,
It would be nice if there was a way to disable "--no-audio-display"
while playing, is there a command to pass using ipc ?
I know this might not be emms related but an answer would be very
helpful, thank you.
Modify the value of `emms-player-mpv-parameters':

(setq emms-player-mpv-parameters '("--quiet" "--really-quiet"))
--
"Cut your own wood and it will warm you twice"
Mohamed Aziz Knani
2018-09-25 18:19:07 UTC
Permalink
Post by Yoni Rabkin
Post by Mohamed Aziz Knani
Hello,
It would be nice if there was a way to disable "--no-audio-display"
while playing, is there a command to pass using ipc ?
I know this might not be emms related but an answer would be very
helpful, thank you.
(setq emms-player-mpv-parameters '("--quiet" "--really-quiet"))
I apologize if my question isn't clear, but I want to be toggle
"--no-audio-display" while the mpv process is running, i.e is there a
command that lets me do that without having to restart mpv. If not a
quick restart of the mpv process shouldn't be a a big of an issue.
--
Mohamed Aziz Knani
http://www.aziz.tn/
Mike Kazantsev
2018-09-26 21:28:00 UTC
Permalink
On Tue, 25 Sep 2018 19:19:07 +0100
Post by Mohamed Aziz Knani
I apologize if my question isn't clear, but I want to be toggle
"--no-audio-display" while the mpv process is running, i.e is there a
command that lets me do that without having to restart mpv. If not a
quick restart of the mpv process shouldn't be a a big of an issue.
Hey,

Yeah, you can generally change any mpv options via something like:

(emms-player-mpv-cmd `(set_property options/ontop yes))

And they mostly available outside of "options/" namespace as properties
("property-list" returns full list of top-level ones).

Two useful properties for what I think you want to do might be "vid"
and "audio-display".

To disable displaying cover art for current and all future tracks,
hiding the window immediately (if any):

(emms-player-mpv-cmd `(set_property vid 0))

(vid corresponds to --vid option, where cover art would be --vid=1)

To only disable "audio-display" option for future played tracks, you can
also set "audio-display" to "no" that way, but setting vid to 0 will
effectively do same thing too.

If you have --force-window=yes (or "immediate"), you'd probably also
need to do "(set_property force-window no)" to disable empty window
hanging around.

And if you want to have some logic to only disable window if it is an
album art, can probably check "albumart" on tracks:

(emms-player-mpv-cmd-prog
`(get_property track-list/1/albumart)
(message "Album art present: %s" (if mpv-data "yes" "no")))

(though maybe checking track-list/count and iterating through these
might be more robust for more complicated media container files)

Note that it's all mpv features, and not really related to how emms
interacts with it, so more in-depth info should be available on mpv
site, docs, MLs, repo script examples, etc.

Cheers!
--
Mike Kazantsev // fraggod.net
Mohamed Aziz Knani
2018-09-27 10:18:58 UTC
Permalink
Post by Mike Kazantsev
On Tue, 25 Sep 2018 19:19:07 +0100
Post by Mohamed Aziz Knani
I apologize if my question isn't clear, but I want to be toggle
"--no-audio-display" while the mpv process is running, i.e is there a
command that lets me do that without having to restart mpv. If not a
quick restart of the mpv process shouldn't be a a big of an issue.
Hey,
(emms-player-mpv-cmd `(set_property options/ontop yes))
And they mostly available outside of "options/" namespace as properties
("property-list" returns full list of top-level ones).
Two useful properties for what I think you want to do might be "vid"
and "audio-display".
To disable displaying cover art for current and all future tracks,
(emms-player-mpv-cmd `(set_property vid 0))
(vid corresponds to --vid option, where cover art would be --vid=1)
To only disable "audio-display" option for future played tracks, you can
also set "audio-display" to "no" that way, but setting vid to 0 will
effectively do same thing too.
If you have --force-window=yes (or "immediate"), you'd probably also
need to do "(set_property force-window no)" to disable empty window
hanging around.
And if you want to have some logic to only disable window if it is an
(emms-player-mpv-cmd-prog
`(get_property track-list/1/albumart)
(message "Album art present: %s" (if mpv-data "yes" "no")))
(though maybe checking track-list/count and iterating through these
might be more robust for more complicated media container files)
Note that it's all mpv features, and not really related to how emms
interacts with it, so more in-depth info should be available on mpv
site, docs, MLs, repo script examples, etc.
Cheers!
Wow this is so cool! Thanks Mike.
--
Mohamed Aziz Knani
http://www.aziz.tn/
Mohamed Aziz Knani
2018-09-27 10:46:30 UTC
Permalink
now I use this

(defun emms-mpv-toggle-vid ()
(interactive)
(emms-player-mpv-cmd `(get_property vid)
(lambda (vid err)
(emms-player-mpv-cmd `(set_property vid ,(if (eq vid ':json-false)
1
0))))))
I needed this because I add videos and music to my emms playlist buffer.
Thanks again Mike.
--
Mohamed Aziz Knani
http://www.aziz.tn/
Loading...