From 7b154250b7c3d90566e649ea7561685e24e4c10f Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 30 Oct 2013 05:53:15 +0000 Subject: refactoring git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3838 90c681e8-e032-0410-971d-27865f9a5e38 --- .../IncDecVolumeOption/incdecvolumeoption.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 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 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(); } -- cgit v1.2.3-13-gbd6f