[MPlayer-dev-eng] [PATCH] OSD mute state display

Diego Biurrun diego at biurrun.de
Sat Mar 18 01:19:35 CET 2006


Here's a small usability improvement: Print an OSD message for mute key
presses.  Almost all other keys give OSD feedback and if the volume is
very low it's sometimes not easy to know if mute is enabled or not.

It's very trivial, I'm committing this in the next few days unless there
are objections.

Diego
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.912
diff -u -r1.912 mplayer.c
--- mplayer.c	5 Mar 2006 08:55:08 -0000	1.912
+++ mplayer.c	18 Mar 2006 00:16:45 -0000
@@ -1056,6 +1056,7 @@
 #define OSD_MSG_OSD_STATUS              4
 #define OSD_MSG_BAR                     5
 #define OSD_MSG_PAUSE                   6
+#define OSD_MSG_MUTE                    7
 
 // These will later be implemented via properties and removed
 #define OSD_MSG_AV_DELAY               100
@@ -3323,6 +3324,8 @@
       if ((edl_muted | user_muted) != mixer.muted)
 #endif
       mixer_mute(&mixer);
+      set_osd_msg(OSD_MSG_MUTE,1,osd_duration, MSGTR_OSDMute,
+                  mixer.muted ? MSGTR_OSDenabled : MSGTR_OSDdisabled);
       break;
     case MP_CMD_LOADFILE : {
       play_tree_t* e = play_tree_new();
Index: help/help_mp-en.h
===================================================================
RCS file: /cvsroot/mplayer/main/help/help_mp-en.h,v
retrieving revision 1.225
diff -u -r1.225 help_mp-en.h
--- help/help_mp-en.h	15 Mar 2006 21:32:10 -0000	1.225
+++ help/help_mp-en.h	18 Mar 2006 00:16:45 -0000
@@ -227,6 +227,7 @@
 #define MSGTR_OSDSubBottom "bottom"
 #define MSGTR_OSDSubCenter "center"
 #define MSGTR_OSDSubTop "top"
+#define MSGTR_OSDMute "Mute: %s"
 
 // mencoder.c:
 


More information about the MPlayer-dev-eng mailing list