diff options
author | Ken Moore <ken@ixsystems.com> | 2018-03-02 11:05:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-02 11:05:23 -0500 |
commit | 49375cce2330b576f8d565cfe1dbca389ff9c989 (patch) | |
tree | 2a7f1c3882747509485661700510cfa6c111fb81 /src-qt5/core/lumina-open/main.cpp | |
parent | Start writing up research on how to do the keyboard event listening. (diff) | |
parent | enable to set volumeup/down parcentage (diff) | |
download | lumina-49375cce2330b576f8d565cfe1dbca389ff9c989.tar.gz lumina-49375cce2330b576f8d565cfe1dbca389ff9c989.tar.bz2 lumina-49375cce2330b576f8d565cfe1dbca389ff9c989.zip |
Merge pull request #552 from boronology/patch-1
enable to set volumeup/down parcentage
Diffstat (limited to 'src-qt5/core/lumina-open/main.cpp')
-rw-r--r-- | src-qt5/core/lumina-open/main.cpp | 36 |
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 |