aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/CommandLineOptions
diff options
context:
space:
mode:
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