On Sunday 13 November 2005 12:00 am, Jesse Guardiani wrote:
> Hello,
> 
> Last night I recompiled MythTV-0.18.1 with joystick
> support so I could use my wireless X-Box controller
> as a remote when I'm not playing games.
> 
> I soon realized that this causes a problem:
> When a ROM is executing (snes9x in this case), MythTV
> continues to read joystick events. So when the ROM is
> exited all of the events that have been queued up are
> played back. Usually this means that additional ROMs
> are executed. Exiting them brings on more. And it just
> continues until all of the joystick events are consumed.
> 
> I've been reading the code, and it looks like a Mute
> Event can be sent. Does anyone have a patch that sends
> a joystick mute event from MythGame before a ROM is
> executed?


I *think* I've solved this bug with the attached patch.
The only problem is that MythTV doesn't install the
mythtv/jsmenuevent.h header by default, so anyone wanting
to give this patch a try will need to copy the header from
the source tar.gz to the proper place on their system before
compiling.

I'll try to remember to submit a bug report on this in
the morning.


-- 
Jesse Guardiani
Programmer/Sys Admin
[EMAIL PROTECTED]
diff -ur mythplugins-0.18.1/mythgame/mythgame/sneshandler.cpp mythplugins-0.18.1.mod/mythgame/mythgame/sneshandler.cpp
--- mythplugins-0.18.1/mythgame/mythgame/sneshandler.cpp	2005-02-24 16:21:39.000000000 -0500
+++ mythplugins-0.18.1.mod/mythgame/mythgame/sneshandler.cpp	2005-11-13 02:21:54.000000000 -0500
@@ -14,6 +14,7 @@
 #include <mythtv/mythcontext.h>
 #include <mythtv/mythdbcon.h>
 #include <mythtv/mythdialogs.h>
+#include <mythtv/jsmenuevent.h>
 
 #include <string>
 #include <math.h>
@@ -445,9 +446,15 @@
     exec+= " \"" + gContext->GetSetting("SnesRomLocation") + "/" + romdata->Romname() + "\"";
     cout << exec << endl;
 
+    // Mute Joystick events in libmyth while ROM is executing
+    QApplication::postEvent(gContext->GetMainWindow(), new JoystickMenuMuteEvent(true));
+
     // Run the emulator and wait for it to terminate.
     FILE* command = popen(exec, "w");
     pclose(command);
+
+    // Un-Mute Joystick events in libmyth now that ROM execution is finished
+    QApplication::postEvent(gContext->GetMainWindow(), new JoystickMenuMuteEvent(false));
 }
 
 void SnesHandler::edit_settings(RomInfo * romdata)
_______________________________________________
mythtv-users mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

Reply via email to