Hi "Daniel C. Casimiro" wrote: > I am trying to fix the games plugin in CVS so that it works again.
Great I > am learning the plugin system at the same time. Could someone take a > look at what I have so far and provide me some feedback? Sure. It looks ok for me. But you use a player.py for all games (like the audio plugin). We need it for the audio plugin to have one player gui (showing the status) while having different plugins. I guess you don't need that player class and should handle everything inside the plugin (similar to video). > What is attached: > This is a simplified version that only implements the essentials. Move > your existing "games" directory to something like "games.old" and unpack > the tarball in the freevo directory. I added it to CVS (without testing, I don't use games). It has much less features than before, but it was already broken, so there is no loss. > What works: > - The games plugin shows up in the main menu. > - A listing of available roms is displayed. > - A ZSNES plugin that launches zsnes ok > What's broken: > - The freevo screen is black after zsnes is exited. I cannot get the > menu to come back. A nasty trick. You inherit from Application. When you call Application.stop() the menu comes back. But when you override stop() in your code without calling Application.stop(), you won't see the menu. In fact, you can't just call Application.stop() on stop. You need to call it when the app behind it is gone. Looking at video.xine, you see it does not define stop at all. It is all in childapp.py: | def stop(self): | """ | Stop the Application. | """ | if hasattr(self, 'item') and self.has_child(): | self.child_stop() | else: | base.Application.stop(self) I guess you should also inherit from application.ChildApp and not use the player and everything works out of the box. The functions does the follwing: 1. case: the plyer stops by itself. A STOP event will be send and the eventhandler in xine will call self.stop(). has_child() is False because the app is dead and base.Application.stop() will be called to show the menu again. 2. case: The STOP event wll stop the player. The eventhandler will also call that function but has_child() is true. So it will stop the child. When the child is dead, we do the same as in case1. Writing this: I guess this needs some cleanup. One function doing both isn't easy to understand. Dischi -- Isn't air travel wonderful? Breakfast in London, dinner in New York, luggage in Brazil.
pgppwjZE0PN0h.pgp
Description: PGP signature