Mathias Weber wrote: > I tried to look how to disable a joystick plugin if it was running but > i couldn't get how i could achieve this. First I would need to check > if a joystick plugin is active if yes i have to stop it and restart it > when the emulator is finished.
That would be nice to have :) > What I have seen so far is that I can activate and deactivate a plugin > with plugin.activate and plugin.deactivate. But how do I check if a > plugin is running? Do i just use getbyname? Would you use > plugin.activate/deactivate or add a method to the joystick to let the > plugin release the interface? plugin.deactivate doesn't work while freevo is running. I wanted to implement it for some time but I did not see the urgent in this. But there is get_ressource() in application. Right now it is used so that audio player and video player know that the other one is blocking the audio device. I guess this function would be a good starting point. Right now only applications can block a ressource, we need to make it possible that plugins can do, too. get_resources returns a dict ressource name -> application of all ressources blocked. In a perfect world get_resources returns an empty dict. So what we should do: joystick plugin reserves the joystick ressource. Now games does get_resources('joystick', 'video', 'audio') and the return is { 'joystick': JoystickPluginInstance }. This means audio and video could be reservered (but are not because not all ressources are free). Now games has the plugin for joystick and can call a 'pause' function and the joystick plugin releases the joystick. The next get_resources would return an empty dict, games can start. After games is done the games plugin calls 'resume' on the JoystickPluginInstance. I just moved get_resources and free_ressources out of the internal code and accessable for everyone. So the joystick plugin should do get_resources('joystick') in __init__ or plugin_activate. If the return value is not empty it is an error. The plugin should have a pause and resume function calling free_ressources and get_resources. You can access this fuctions through the application module: freevo.ui.application.get_resources. Hope this helps. Dischi -- Wash: This is gonna get pretty interesting. Mal: Define "interesting". Wash: Oh God, oh God, we're all gonna die? - Serenity (2005)
pgp46eZXceWK2.pgp
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Freevo-devel mailing list Freevo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freevo-devel