aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
authorboronology <boronology@users.noreply.github.com>2018-03-02 23:34:09 +0900
committerGitHub <noreply@github.com>2018-03-02 23:34:09 +0900
commit80fa887a948817f796c76fd759067ccfd77c92cc (patch)
tree2a7f1c3882747509485661700510cfa6c111fb81 /src-qt5/core
parentStart writing up research on how to do the keyboard event listening. (diff)
downloadlumina-80fa887a948817f796c76fd759067ccfd77c92cc.tar.gz
lumina-80fa887a948817f796c76fd759067ccfd77c92cc.tar.bz2
lumina-80fa887a948817f796c76fd759067ccfd77c92cc.zip
enable to set volumeup/down parcentage
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/lumina-open/main.cpp36
1 files changed, 26 insertions, 10 deletions
diff --git a/src-qt5/core/lumina-open/main.cpp b/src-qt5/core/lumina-open/main.cpp
index 2b9e9184..e53181f9 100644
--- a/src-qt5/core/lumina-open/main.cpp
+++ b/src-qt5/core/lumina-open/main.cpp
@@ -185,17 +185,33 @@ return;
LaunchAutoStart();
return;
}else if(QString(argv[i]).simplified() == "-volumeup"){
-int vol = LOS::audioVolume()+5; //increase 5%
-if(vol>100){ vol=100; }
-LOS::setAudioVolume(vol);
-showOSD(argc,argv, QString(QObject::tr("Audio Volume %1%")).arg(QString::number(vol)) );
-return;
+ bool isInt = false;
+ int volupVal = 5;
+ if(argc > i){
+ int parse = QString(argv[i+1]).toInt(&isInt,10);
+ if(isInt && 0 < parse && parse <= 20){
+ volupVal = parse;
+ }
+ }
+ int vol = LOS::audioVolume()+volupVal;
+ if(vol>100){ vol=100; }
+ LOS::setAudioVolume(vol);
+ showOSD(argc,argv, QString(QObject::tr("Audio Volume %1%")).arg(QString::number(vol)) );
+ return;
}else if(QString(argv[i]).simplified() == "-volumedown"){
-int vol = LOS::audioVolume()-5; //decrease 5%
-if(vol<0){ vol=0; }
-LOS::setAudioVolume(vol);
-showOSD(argc,argv, QString(QObject::tr("Audio Volume %1%")).arg(QString::number(vol)) );
-return;
+ bool isInt = false;
+ int voldownVal = 5;
+ if(argc > i){
+ int parse = QString(argv[i+1]).toInt(&isInt,10);
+ if(isInt && 0 < parse && parse <= 20){
+ voldownVal = parse;
+ }
+ }
+ int vol = LOS::audioVolume()-voldownVal; //decrease 5%
+ if(vol<0){ vol=0; }
+ LOS::setAudioVolume(vol);
+ showOSD(argc,argv, QString(QObject::tr("Audio Volume %1%")).arg(QString::number(vol)) );
+ return;
}else if(QString(argv[i]).simplified() == "-brightnessup"){
int bright = LOS::ScreenBrightness();
if(bright > 0){ //brightness control available
bgstack15