summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-01-30 10:33:30 +0100
committertomsmeding <tom.smeding@gmail.com>2016-01-30 10:33:30 +0100
commite5a260f47e58f77ab499495f154081f30a18994b (patch)
tree5f5c287f204767205942971a2ecdf81269d8ef0f
parente916fd6cb3836942456b4f1cc1b44454e393cc62 (diff)
enable min/max setting
-rw-r--r--volume.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/volume.cpp b/volume.cpp
index c6c0e03..f05d709 100644
--- a/volume.cpp
+++ b/volume.cpp
@@ -11,8 +11,8 @@ int printusage(int,const char *const *argv,const char *message=NULL){
if(message)cout<<message<<endl;
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/l. If the"<<endl;
- cout<<"output is not a tty, the graphical slider is disabled."<<endl;
+ cout<<"Otherwise, it shows a graphical slider, adjustable with the arrow keys or h/j/k/l."<<endl;
+ cout<<"If the output is not a tty, the graphical slider is disabled."<<endl;
return 1;
}
@@ -75,6 +75,8 @@ int interact(bool &m,int &vol){
if(c=='q'||c=='Q'||c=='\n'||c=='\r')return 1;
if(c=='l')return incvol(vol,5);
if(c=='h')return incvol(vol,-5);
+ if(c=='k')return incvol(vol,100);
+ if(c=='j')return incvol(vol,-100);
if(c=='m'){
m=!m;
setmuted(m);
@@ -92,6 +94,8 @@ int interact(bool &m,int &vol){
c=cin.get();
if(c=='C')return incvol(vol,5);
if(c=='D')return incvol(vol,-5);
+ if(c=='A')return incvol(vol,100);
+ if(c=='B')return incvol(vol,-100);
cout<<7<<flush;
return 0;
}