diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-08-03 17:36:00 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-08-03 17:36:00 +0000 |
| commit | 6acb71aa3635dc64cda166326153ef73c182f8f4 (patch) | |
| tree | f277a9ed2821b1ced6f324fabfae0c9841fbd3f6 /src/plugins/General | |
| parent | 14a8533882021e787ecf76997d153b7b3e7a0887 (diff) | |
| download | qmmp-6acb71aa3635dc64cda166326153ef73c182f8f4.tar.gz qmmp-6acb71aa3635dc64cda166326153ef73c182f8f4.tar.bz2 qmmp-6acb71aa3635dc64cda166326153ef73c182f8f4.zip | |
gnomehotkey: fixed support of keyboards with single play/pause button
(#707)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5316 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General')
| -rw-r--r-- | src/plugins/General/gnomehotkey/mediakeys.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/General/gnomehotkey/mediakeys.cpp b/src/plugins/General/gnomehotkey/mediakeys.cpp index 0a371ca97..db196cd11 100644 --- a/src/plugins/General/gnomehotkey/mediakeys.cpp +++ b/src/plugins/General/gnomehotkey/mediakeys.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2014 by Ilya Kotov * + * Copyright (C) 2014-2015 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -105,7 +105,12 @@ void MediaKeys::onKeyPressed(const QString &in0, const QString &in1) SoundCore *core = SoundCore::instance(); qDebug("MediaKeys: [%s] pressed", qPrintable(in1)); if(in1 == "Play") - player->play(); + { + if (core->state() == Qmmp::Stopped) + player->play(); + else if (core->state() != Qmmp::FatalError) + core->pause(); + } else if(in1 == "Pause") core->pause(); else if(in1 == "Stop") |
