[WINDOWS] play_pause APPCOMMAND handling
#1
First off, I hope this is the correct spot for mentioning this - I can't seem to submit bugs on trac, don't really know where else to post this - my apologies if I was mistaken Smile

When using a fancy $10 remote from DealExtreme, almost everything works straight out - which is very awesome. However, one particular button is being a bugger: play / pause. When XBMC is playing something it does let me pause and then resume, but when not playing I cannot use it to start playback. Not so much a problem for movies, but with music it's a bit of a bugger.

I've tracked down the key command send by the remote using debug logging: WinEventsWin32.cpp: APPCOMMAND 14. This appears to correspond to the play/pause command. Looking in WinEventsWin32.cpp around line 454 we see:
Code:
case APPCOMMAND_MEDIA_PLAY_PAUSE:
          if (g_application.IsPaused())
            newEvent.appcommand.action = ACTION_PLAYER_PLAY;
          else
            newEvent.appcommand.action = ACTION_PAUSE;
          break;
Judging by the application header, I am guessing this should be changed to:
Code:
case APPCOMMAND_MEDIA_PLAY_PAUSE:
          if (!g_application.IsPlaying())
            newEvent.appcommand.action = ACTION_PLAYER_PLAY;
          else
            newEvent.appcommand.action = ACTION_PAUSE;
          break;
Sadly I am unfamiliar with the source and my builds don't want to run (crash on startup, if they compile at all, I'm probably doing something wrong there) so I can't test it myself, would much appreciate it if any of the dev gods here could take a look Smile

The exact same problem occurs also with the play/pause button on my "multimedia" keyboard, so it is not just limited to my remote.

//edit
Woops, didn't know my forum username/pass worked for trac as well. I'm guessing this is the same problem as the bug reported here so this thread can probably be closed.
Reply
#2
That ticket is XBOX only, so I think this one is different enough.

One thing you need to check is whether IsPlaying is false when you're paused - I have a feeling it's not. Note that this may still pause the video either way, however - the ACTION_PLAYER_PLAY may act like Play/Pause by default - I can't recall exactly.

Get that build env up and running and make sure you set XBMC_HOME in the environment vars for debugging Smile

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
For some reason cURL was throwing up problems it seems - added the library manually, compiled, ran, still got a crash, copied over everything on my working version and voila: it worked Big Grin Not a build environment, but at least I was able to test the proposed change and it appears to be working - including pausing when playing audio and video.

Will see about a proper debugging once I get that running (indeed not sure whether IsPlaying returns false when paused), though I have been trying to get a normal compile to run for days already so no promises Smile Codebase is very neat compared to some open source projects I've worked on, but getting it to compile & run is a tad bit more tricky than I'm used to.
Reply
#4
Excellent. The wiki should detail everything you need - let us know if you find anything off with the instructions.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
After a quick look, ACTION_PLAYER_PLAY acts as Play/Pause so the change can be simplified to this:

Code:
case APPCOMMAND_MEDIA_PLAY:
+case APPCOMMAND_MEDIA_PLAY_PAUSE:
  newEvent.appcommand.action = ACTION_PLAYER_PLAY;
  break;
-case APPCOMMAND_MEDIA_PLAY_PAUSE:
-          if (!g_application.IsPlaying())
-            newEvent.appcommand.action = ACTION_PLAYER_PLAY;
-          else
-            newEvent.appcommand.action = ACTION_PAUSE;
-          break;

I'll commit it, thanks for the report.

Have fun building your own, just avoid spaces in the path to the XBMC code directory. The DownloadBuildDeps script doesn't like them at the moment.
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
[WINDOWS] play_pause APPCOMMAND handling0