From 385ed55c91b1bb50fb98dce6744b2ab139568f60 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 26 Nov 2008 14:23:15 +0000 Subject: fixed command line plugin git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@640 90c681e8-e032-0410-971d-27865f9a5e38 --- .../IncDecVolumeOption/incdecvolumeoption.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp') 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 #include #include +#include #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 -- cgit v1.2.3-13-gbd6f