summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-01-30 10:50:18 +0100
committertomsmeding <tom.smeding@gmail.com>2016-01-30 10:50:18 +0100
commit1d070eda0973a3b798bfec888a08798e86b3832f (patch)
tree553ec0c66ed7de899b0fa1acc5ee55622a1aa3af
parente5a260f47e58f77ab499495f154081f30a18994b (diff)
interface fixes
-rw-r--r--volume.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/volume.cpp b/volume.cpp
index f05d709..b5858e8 100644
--- a/volume.cpp
+++ b/volume.cpp
@@ -12,6 +12,7 @@ int printusage(int,const char *const *argv,const char *message=NULL){
cout<<"Usage: "<<argv[0]<<" [volume]"<<endl;
cout<<"If [volume] is given, changes volume to that value. (Integer in [0,100].)"<<endl;
cout<<"Otherwise, it shows a graphical slider, adjustable with the arrow keys or h/j/k/l."<<endl;
+ cout<<"In graphical mode, 'm' toggles whether sound is muted."<<endl;
cout<<"If the output is not a tty, the graphical slider is disabled."<<endl;
return 1;
}
@@ -56,7 +57,7 @@ bool getmuted(void){
void displayslider(bool m,int vol){
cout<<"\x1B[2K\r0 |"
- <<string(vol/5,'#')<<string((100-vol)/5,'-')
+ <<string(vol/5,'#')<<string((104-vol)/5,'-')
<<"| 100 ("<<vol<<"%)";
if(m)cout<<" \x1B[1mMUTED (m)\x1B[0m";
cout.flush();
@@ -83,12 +84,12 @@ int interact(bool &m,int &vol){
return 0;
}
if(c!=27){
- cout<<7<<flush;
+ cout<<'\x07'<<flush;
return 0;
}
c=cin.get();
if(c!='['){
- cout<<7<<flush;
+ cout<<'\x07'<<flush;
return 0;
}
c=cin.get();
@@ -96,7 +97,7 @@ int interact(bool &m,int &vol){
if(c=='D')return incvol(vol,-5);
if(c=='A')return incvol(vol,100);
if(c=='B')return incvol(vol,-100);
- cout<<7<<flush;
+ cout<<'\x07'<<flush;
return 0;
}