aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/CommandLineOptions
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-11-26 14:23:15 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-11-26 14:23:15 +0000
commit385ed55c91b1bb50fb98dce6744b2ab139568f60 (patch)
tree4555500a121e6302d1989443d387fb47438d2d14 /src/plugins/CommandLineOptions
parent6ace877caaa0c67b7269947a0c00e47cb5dc6507 (diff)
downloadqmmp-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')
-rw-r--r--src/plugins/CommandLineOptions/IncDecVolumeOption/CMakeLists.txt3
-rw-r--r--src/plugins/CommandLineOptions/IncDecVolumeOption/IncDecVolumeOption.pro2
-rw-r--r--src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp15
3 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/CommandLineOptions/IncDecVolumeOption/CMakeLists.txt b/src/plugins/CommandLineOptions/IncDecVolumeOption/CMakeLists.txt
index 1fa84810a..881387776 100644
--- a/src/plugins/CommandLineOptions/IncDecVolumeOption/CMakeLists.txt
+++ b/src/plugins/CommandLineOptions/IncDecVolumeOption/CMakeLists.txt
@@ -25,6 +25,7 @@ SET(QT_INCLUDES
# libqmmpui
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmpui)
+link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp)
SET(libincdecvolumeoption_SRCS
incdecvolumeoption.cpp
@@ -48,5 +49,5 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
ADD_LIBRARY(incdecvolumeoption SHARED ${libincdecvolumeoption_SRCS} ${libincdecvolumeoption_MOC_SRCS}
${libincdecvolumeoption_RCC_SRCS})
add_dependencies(incdecvolumeoption qmmpui)
-target_link_libraries(incdecvolumeoption ${QT_LIBRARIES} -lqmmpui)
+target_link_libraries(incdecvolumeoption ${QT_LIBRARIES} -lqmmpui -lqmmp)
install(TARGETS incdecvolumeoption DESTINATION ${LIB_DIR}/qmmp/CommandLineOptions)
diff --git a/src/plugins/CommandLineOptions/IncDecVolumeOption/IncDecVolumeOption.pro b/src/plugins/CommandLineOptions/IncDecVolumeOption/IncDecVolumeOption.pro
index c385841f3..39f710127 100644
--- a/src/plugins/CommandLineOptions/IncDecVolumeOption/IncDecVolumeOption.pro
+++ b/src/plugins/CommandLineOptions/IncDecVolumeOption/IncDecVolumeOption.pro
@@ -28,7 +28,7 @@ INSTALLS += target
INCLUDEPATH += ../../../../src
-LIBS += -lqmmpui
+LIBS += -lqmmpui -lqmmp
HEADERS += incdecvolumeoption.h
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