aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <machine.sanctum@gmail.com>2014-09-23 07:07:11 +0200
committerMartijn Kaijser <machine.sanctum@gmail.com>2014-09-23 07:07:11 +0200
commitaf0436a4e897e1d997a130d11ffaf7d29f88a1d4 (patch)
treec9f9a6f244d0361f20a2c3ae4c4e1eb61af315ef
parentfa8281b3388a1e73f5d2c85285c3a4f185fba3b5 (diff)
parent1983bc77558e8bd1a6b6f0ed1ec7ccf7efe714a8 (diff)
Merge pull request #5307 from da-anda/just-play
[UX] Play button/action should not pause
-rw-r--r--system/keymaps/joystick.AppleRemote.xml2
-rw-r--r--system/keymaps/joystick.PS3.Remote.Keyboard.xml4
-rw-r--r--system/keymaps/remote.xml2
-rw-r--r--xbmc/Application.cpp43
4 files changed, 24 insertions, 27 deletions
diff --git a/system/keymaps/joystick.AppleRemote.xml b/system/keymaps/joystick.AppleRemote.xml
index 5abbafd355..d29c421e0d 100644
--- a/system/keymaps/joystick.AppleRemote.xml
+++ b/system/keymaps/joystick.AppleRemote.xml
@@ -45,7 +45,7 @@
<!-- hold right --> <button id="10">Right</button>
<!-- new aluminium remote buttons -->
- <!-- play/pause --> <button id="12">Play</button>
+ <!-- play/pause --> <button id="12">PlayPause</button>
<!-- Additional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen-->
<!-- pageup --> <button id="13">PageUp</button>
diff --git a/system/keymaps/joystick.PS3.Remote.Keyboard.xml b/system/keymaps/joystick.PS3.Remote.Keyboard.xml
index 571c46a235..4b4c5cc9ed 100644
--- a/system/keymaps/joystick.PS3.Remote.Keyboard.xml
+++ b/system/keymaps/joystick.PS3.Remote.Keyboard.xml
@@ -70,7 +70,7 @@
<altname>MoSart PS3 Remote Keyboard</altname>
<button id="4">OSD</button>
<button id="1">Info</button>
- <button id="2">Play</button>
+ <button id="2">Pause</button>
<button id="3">Stop</button>
<hat id="1" position="left">SkipPrevious</hat>
<hat id="1" position="right">SkipNext</hat>
@@ -91,7 +91,7 @@
<joystick name="PLAYSTATION(R)3 Remote Keyboard">
<altname>PS3 Remote Keyboard</altname>
<altname>MoSart PS3 Remote Keyboard</altname>
- <button id="2">Play</button>
+ <button id="2">Pause</button>
<button id="3">Stop</button>
<button id="4">OSD</button>
<button id="7">Rewind</button>
diff --git a/system/keymaps/remote.xml b/system/keymaps/remote.xml
index d0957e2c6a..9d39fa60d0 100644
--- a/system/keymaps/remote.xml
+++ b/system/keymaps/remote.xml
@@ -38,7 +38,7 @@
<keymap>
<global>
<remote>
- <play>Play</play>
+ <play>PlayPause</play>
<pause>Pause</pause>
<stop>Stop</stop>
<forward>FastForward</forward>
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 94ee013376..38d9b2719a 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -2594,10 +2594,10 @@ bool CApplication::OnAction(const CAction &action)
}
// The action PLAYPAUSE behaves as ACTION_PAUSE if we are currently
- // playing or ACTION_PLAYER_PLAY if we are not playing.
+ // playing or ACTION_PLAYER_PLAY if we are seeking (FF/RW) or not playing.
if (action.GetID() == ACTION_PLAYER_PLAYPAUSE)
{
- if (m_pPlayer->IsPlaying())
+ if (m_pPlayer->IsPlaying() && m_pPlayer->GetPlaySpeed() == 1)
return OnAction(CAction(ACTION_PAUSE));
else
return OnAction(CAction(ACTION_PLAYER_PLAY));
@@ -2741,36 +2741,33 @@ bool CApplication::OnAction(const CAction &action)
return true;
}
- // pause : pauses current audio song
- if (action.GetID() == ACTION_PAUSE && m_pPlayer->GetPlaySpeed() == 1)
+ // pause : toggle pause action
+ if (action.GetID() == ACTION_PAUSE)
{
m_pPlayer->Pause();
-#ifdef HAS_KARAOKE
+ // go back to normal play speed on unpause
+ if (!m_pPlayer->IsPaused() && m_pPlayer->GetPlaySpeed() != 1)
+ m_pPlayer->SetPlaySpeed(1, g_application.m_muted);
+
+ #ifdef HAS_KARAOKE
m_pKaraokeMgr->SetPaused( m_pPlayer->IsPaused() );
#endif
- if (!m_pPlayer->IsPaused())
- { // unpaused - set the playspeed back to normal
- m_pPlayer->SetPlaySpeed(1, g_application.m_muted);
- }
g_audioManager.Enable(m_pPlayer->IsPaused());
return true;
}
+ // play: unpause or set playspeed back to normal
+ if (action.GetID() == ACTION_PLAYER_PLAY)
+ {
+ // if currently paused - unpause
+ if (m_pPlayer->IsPaused())
+ return OnAction(CAction(ACTION_PAUSE));
+ // if we do a FF/RW then go back to normal speed
+ if (m_pPlayer->GetPlaySpeed() != 1)
+ m_pPlayer->SetPlaySpeed(1, g_application.m_muted);
+ return true;
+ }
if (!m_pPlayer->IsPaused())
{
- // if we do a FF/RW in my music then map PLAY action togo back to normal speed
- // if we are playing at normal speed, then allow play to pause
- if (action.GetID() == ACTION_PLAYER_PLAY || action.GetID() == ACTION_PAUSE)
- {
- if (m_pPlayer->GetPlaySpeed() != 1)
- {
- m_pPlayer->SetPlaySpeed(1, g_application.m_muted);
- }
- else
- {
- m_pPlayer->Pause();
- }
- return true;
- }
if (action.GetID() == ACTION_PLAYER_FORWARD || action.GetID() == ACTION_PLAYER_REWIND)
{
int iPlaySpeed = m_pPlayer->GetPlaySpeed();