From a9f9c2d796123e4097c015d6f276d35056ac7920 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Thu, 23 Feb 2017 23:50:29 +0100 Subject: Add command-line mute switch --- volume.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/volume.cpp b/volume.cpp index ca2f564..2ece4fc 100644 --- a/volume.cpp +++ b/volume.cpp @@ -11,6 +11,7 @@ int printusage(int,const char *const *argv,const char *message=NULL){ if(message)cout<2)return printusage(argc,argv); if(argc==2){ if(argv[1][0]=='\0')return printusage(argc,argv,"Invalid volume format"); + if(strcmp(argv[1],"m")==0){ + setmuted(!getmuted()); + return 0; + } char *endp; const int vol=strtol(argv[1],&endp,10); if(*endp!='\0')return printusage(argc,argv,"Invalid volume format"); -- cgit v1.2.3-70-g09d2