aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Misc/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp
diff options
context:
space:
mode:
authorvovanec <vovanec@90c681e8-e032-0410-971d-27865f9a5e38>2008-02-07 13:36:34 +0000
committervovanec <vovanec@90c681e8-e032-0410-971d-27865f9a5e38>2008-02-07 13:36:34 +0000
commit06d1877811fa6aa97dddc0e03bcde4e766928c87 (patch)
treec25462d0e58c3d58c728664440412bf4f16a49ec /src/plugins/Misc/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp
parent3f6b60f23c44a8ba8dd97ca6f41a16e2af7ef2f7 (diff)
downloadqmmp-06d1877811fa6aa97dddc0e03bcde4e766928c87.tar.gz
qmmp-06d1877811fa6aa97dddc0e03bcde4e766928c87.tar.bz2
qmmp-06d1877811fa6aa97dddc0e03bcde4e766928c87.zip
new directory structure
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@232 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Misc/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp')
-rw-r--r--src/plugins/Misc/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/plugins/Misc/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp b/src/plugins/Misc/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp
new file mode 100644
index 000000000..4bd35a910
--- /dev/null
+++ b/src/plugins/Misc/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp
@@ -0,0 +1,53 @@
+#include <QtPlugin>
+
+#include "incdecvolumeoption.h"
+#include <soundcore.h>
+#include "mainwindow.h"
+
+bool IncDecVolumeCommandLineOption::identify(const QString & str) const
+{
+ if(
+ str == QString("--volume-inc") ||
+ str == QString("--volume-dec")
+ )
+ {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+const QString IncDecVolumeCommandLineOption::helpString() const
+{
+ return QString(
+ "--volume-inc Increase volume with step 10\n"
+ "--volume-dec Decrease volume with step 10\n"
+ );
+}
+
+
+void IncDecVolumeCommandLineOption::executeCommand(const QString & option_string, MainWindow *mw)
+{
+ if (option_string == "--volume-inc")
+ {
+ int l = 0;
+ int r = 0;
+ mw->soundCore()->volume(&l,&r);
+ mw->soundCore()->setVolume(l+10,r+10);
+ }
+ else if (option_string == "--volume-dec")
+ {
+ int l = 0;
+ int r = 0;
+ mw->soundCore()->volume(&l,&r);
+ mw->soundCore()->setVolume(l-10,r-10);
+ }
+}
+
+const QString IncDecVolumeCommandLineOption::name() const
+{
+ return "IncDecVolumeCommandLineOption";
+}
+
+Q_EXPORT_PLUGIN(IncDecVolumeCommandLineOption)
+