diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-10-29 11:54:40 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-10-29 11:54:40 +0000 |
| commit | b3e0107872acf9f4ed336c53979c4e9f72e951e6 (patch) | |
| tree | a9aef47b92ca6e45db8bc713f133511f954c0b33 /src/plugins/General/hotkey | |
| parent | 4e7e1408f048e2a71bb46660d3dcb29423a3af67 (diff) | |
| download | qmmp-b3e0107872acf9f4ed336c53979c4e9f72e951e6.tar.gz qmmp-b3e0107872acf9f4ed336c53979c4e9f72e951e6.tar.bz2 qmmp-b3e0107872acf9f4ed336c53979c4e9f72e951e6.zip | |
skinned: added volume hotkeys
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3831 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/hotkey')
| -rw-r--r-- | src/plugins/General/hotkey/hotkeymanager_win.cpp | 17 | ||||
| -rw-r--r-- | src/plugins/General/hotkey/hotkeymanager_x11.cpp | 17 |
2 files changed, 6 insertions, 28 deletions
diff --git a/src/plugins/General/hotkey/hotkeymanager_win.cpp b/src/plugins/General/hotkey/hotkeymanager_win.cpp index 1acec3910..ea0b95870 100644 --- a/src/plugins/General/hotkey/hotkeymanager_win.cpp +++ b/src/plugins/General/hotkey/hotkeymanager_win.cpp @@ -130,21 +130,10 @@ public: UiHelper::instance()->toggleVisibility();
break;
case Hotkey::VOLUME_UP:
+ core->changeVolume(+5);
+ break;
case Hotkey::VOLUME_DOWN:
- {
- 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(m_hotkey.action == Hotkey::VOLUME_UP)
- volume = qMin (100, volume + 5);
- else
- volume = qMax (0, volume - 5);
- core->setVolume(volume-qMax(balance,0)*volume/100,
- volume+qMin(balance,0)*volume/100);
- }
+ core->changeVolume(-5);
break;
case Hotkey::FORWARD:
core->seek(core->elapsed() + 5000);
diff --git a/src/plugins/General/hotkey/hotkeymanager_x11.cpp b/src/plugins/General/hotkey/hotkeymanager_x11.cpp index 241b2ea64..0b90c6c13 100644 --- a/src/plugins/General/hotkey/hotkeymanager_x11.cpp +++ b/src/plugins/General/hotkey/hotkeymanager_x11.cpp @@ -178,21 +178,10 @@ bool HotkeyManager::eventFilter(QObject* o, QEvent* e) UiHelper::instance()->toggleVisibility(); break; case Hotkey::VOLUME_UP: + core->changeVolume(+5); + break; case Hotkey::VOLUME_DOWN: - { - 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(hotkey->action == Hotkey::VOLUME_UP) - volume = qMin (100, volume + 5); - else - volume = qMax (0, volume - 5); - core->setVolume(volume-qMax(balance,0)*volume/100, - volume+qMin(balance,0)*volume/100); - } + core->changeVolume(-5); break; case Hotkey::FORWARD: core->seek(core->elapsed() + 5000); |
