diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-10-30 05:53:15 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-10-30 05:53:15 +0000 |
| commit | 7b154250b7c3d90566e649ea7561685e24e4c10f (patch) | |
| tree | 81087507109bd30d1ea5f46e65d4a3ab7e79e73c /src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp | |
| parent | 0c6e2be686013179e03b03c5a632d34974841063 (diff) | |
| download | qmmp-7b154250b7c3d90566e649ea7561685e24e4c10f.tar.gz qmmp-7b154250b7c3d90566e649ea7561685e24e4c10f.tar.bz2 qmmp-7b154250b7c3d90566e649ea7561685e24e4c10f.zip | |
refactoring
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3838 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp')
| -rw-r--r-- | src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp b/src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp index dfb58fbba..268cb6f21 100644 --- a/src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp +++ b/src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2012 by Ilya Kotov * + * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -49,24 +49,12 @@ const QString IncDecVolumeCommandLineOption::helpString() const QString IncDecVolumeCommandLineOption::executeCommand(const QString& opt_str, const QStringList &args) { Q_UNUSED(args); - SoundCore *core = SoundCore::instance(); - int volume = qMax(core->leftVolume(), core->rightVolume()); - int balance = 0; - int left = core->leftVolume(); - int right = core->rightVolume(); - if (left || right) - balance = (right - left)*100/volume; if (opt_str == "--volume-inc") - { - volume = qMin (100, volume + 5); - } + SoundCore::instance()->changeVolume(5); else if (opt_str == "--volume-dec") - { - volume = qMax (0, volume - 5); - } - core->setVolume(volume-qMax(balance,0)*volume/100, - volume+qMin(balance,0)*volume/100); + SoundCore::instance()->changeVolume(-5); + return QString(); } |
