blob: 4bd35a91086c46acb264c4c07185d1b636435ea2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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)
|