]> git.phdru.name Git - dotfiles.git/commitdiff
Play video file(s) asking audio volume
authorOleg Broytman <phd@phdru.name>
Sun, 14 Apr 2019 18:03:09 +0000 (21:03 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 14 Apr 2019 18:03:09 +0000 (21:03 +0300)
.mc/menu
bin/mplay

index 8c75e0b742450b45bd5ae7d3ce641f21cea5e768..4b5fa952d1c3d798c608ac6bdd8f31436b2cdf8f 100644 (file)
--- a/.mc/menu
+++ b/.mc/menu
@@ -176,6 +176,12 @@ i  DVD info
 m  Play video file(s) with mplayer
    mplayer %s &
 
++ f \.(aac|ac3|ape|cue|dts|flac|m3u|mp3|MP3|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|iso|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$ | t d | t t
+= f \.(aac|ac3|ape|cue|dts|flac|m3u|mp3|MP3|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|iso|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$
+m  Play video file(s) with mplayer asking audio volume
+   AUDIO_VOLUME=%{Enter volume}
+   AUDIO_VOLUME=$AUDIO_VOLUME mplayer %s &
+
 + f \.(m3u|mp3|MP3|cue|aac|ac3|ape|dts|flac|ogg|OGG|pls|WAV|wav|wv|avi|AVI|flv|m2ts|m4v|mka|mkv|MKV|mov|MOV|mp4|MP4|mpg|MPG|vob|VOB|wma|wmv)$ | t t
 M  Play audio/video with gmplayer
    gmplayer %s &
index 698586646d4b278079b0730d8142bb4313dc6e85..e4ca11004c5b1d39c3198b168f33c776fa48261c 100755 (executable)
--- a/bin/mplay
+++ b/bin/mplay
@@ -2,6 +2,10 @@
 
 options="--ao pulse --quiet"
 
+if [ -n "$AUDIO_VOLUME" ]; then
+   options="$options --af=loudnorm --volume=$AUDIO_VOLUME"
+fi
+
 if [ "$DISPLAY" ]; then
    (xscreensaver-command -exit
    xset -dpms s off) &