From 6acb71aa3635dc64cda166326153ef73c182f8f4 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 3 Aug 2015 17:36:00 +0000 Subject: 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 --- src/plugins/General/gnomehotkey/mediakeys.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/plugins/General/gnomehotkey') 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") -- cgit v1.2.3-13-gbd6f