diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-11-26 14:23:15 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-11-26 14:23:15 +0000 |
| commit | 385ed55c91b1bb50fb98dce6744b2ab139568f60 (patch) | |
| tree | 4555500a121e6302d1989443d387fb47438d2d14 /src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp | |
| parent | 6ace877caaa0c67b7269947a0c00e47cb5dc6507 (diff) | |
| download | qmmp-385ed55c91b1bb50fb98dce6744b2ab139568f60.tar.gz qmmp-385ed55c91b1bb50fb98dce6744b2ab139568f60.tar.bz2 qmmp-385ed55c91b1bb50fb98dce6744b2ab139568f60.zip | |
fixed command line plugin
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@640 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp')
| -rw-r--r-- | src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp b/src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp index 2b095c386..a33fb24f7 100644 --- a/src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp +++ b/src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp @@ -21,6 +21,7 @@ #include <QtPlugin> #include <QTranslator> #include <QLocale> +#include <qmmp/soundcore.h> #include "incdecvolumeoption.h" @@ -48,10 +49,12 @@ const QString IncDecVolumeCommandLineOption::helpString() const void IncDecVolumeCommandLineOption::executeCommand(const QString& opt_str, CommandLineManager* clm) { - /*int volume = qMax(clm->leftVolume(), clm->rightVolume()); + Q_UNUSED(clm); + SoundCore *core = SoundCore::instance(); + int volume = qMax(core->leftVolume(), core->rightVolume()); int balance = 0; - int left = clm->leftVolume(); - int right = clm->rightVolume(); + int left = core->leftVolume(); + int right = core->rightVolume(); if (left || right) balance = (right - left)*100/volume; @@ -62,9 +65,9 @@ void IncDecVolumeCommandLineOption::executeCommand(const QString& opt_str, Comma else if (opt_str == "--volume-dec") { volume = qMax (0, volume - 5); - }*/ - /*ctrl->setVolume(volume-qMax(balance,0)*volume/100, - volume+qMin(balance,0)*volume/100);*/ + } + core->setVolume(volume-qMax(balance,0)*volume/100, + volume+qMin(balance,0)*volume/100); } const QString IncDecVolumeCommandLineOption::name() const |
