Python-Plugin integration

Discussion about user contributed plugins

Moderator: Moderator

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Python-Plugin integration

Postby Uatschitchun » Fri Oct 17, 2008 8:04 pm

What about that idea:

Would it be possible to open up MMS against python-plugin? Making it possible to re-use MMS' shoutcast/radio plugin (or other funtions, too), to select a stream (or choose a song/video/pic) from within a pyglet :?: :!:
That in mind, adding new features, like starting scripts in an "integrated" way could become possible, couldn't it?
Lg
Roman

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Re: Python-Plugin integration

Postby Uatschitchun » Sat Oct 18, 2008 9:02 am

Is it a dumb idea?
Lg

Roman

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Re: Python-Plugin integration

Postby arj » Sat Oct 18, 2008 12:20 pm

This is probably a question for Fredde. But as far as I understand it, it should be possible. The problem is that everything you want to make available in python has to be wrapped, so Fredde just wrapped everything that is core (like input, drawing, playing music etc.) and build a nice interface on top of that so that it's easier to use them in python.

Fredde
veteran
Posts: 288
Joined: Tue Dec 06, 2005 7:18 am
Location: Sweden

Re: Python-Plugin integration

Postby Fredde » Sun Oct 19, 2008 5:41 pm

Uatschitchun wrote:What about that idea:

Would it be possible to open up MMS against python-plugin? Making it possible to re-use MMS' shoutcast/radio plugin (or other funtions, too), to select a stream (or choose a song/video/pic) from within a pyglet :?: :!:
That in mind, adding new features, like starting scripts in an "integrated" way could become possible, couldn't it?

As arj stated it's it's a question of wrapping the mms code to expose them in python. The core stuff is easy and natural, but you suggest exposing an entire plugin like radio, picture or movie (or do I missunderstand you?)

The problem with staring scripts from outside the script plugin is the decentralized way of doing things in mms. A plugin in mms has a lot of responsibility like drawing stuff and especially handeling the different type of input. It gives freedom, but handeling all these things make it hard for plugins to cooperate/integrate with each other. That's why I introduced the window/control concept in the python plugin. Here the plugin is responsible for handeling the input and delivering it to the current active "window". It doesn't matter if that window is created from C++ or Python. You can compare the script launching list with the start menu, and the scripts with the plugins in the start menu.

Hope I made some sense with this post :?

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Re: Python-Plugin integration

Postby Uatschitchun » Sun Oct 19, 2008 7:40 pm

I meant to only re-use functions available in plugins within pyglets. Like use inet-radio-selection from a pyglet to record that station ...

If I get it right, it needs a different architecture within plugins to do that, correct?
Lg

Roman

Fredde
veteran
Posts: 288
Joined: Tue Dec 06, 2005 7:18 am
Location: Sweden

Re: Python-Plugin integration

Postby Fredde » Mon Oct 20, 2008 2:34 pm

Uatschitchun wrote:I meant to only re-use functions available in plugins within pyglets. Like use inet-radio-selection from a pyglet to record that station ...

Ok I see, I misunderstood you. Well, I never tried that before (like wrapping inet-radio-selection), will give it a try :D
Uatschitchun wrote:If I get it right, it needs a different architecture within plugins to do that, correct?

Well, it's not impossible, but you can't just run the python plugins mainloop method from some other plugin. It need some other method that take a script path as argument , the method also need to handle the input and forward it to the python code. I have to think about it some more.

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Re: Python-Plugin integration

Postby Uatschitchun » Mon Oct 20, 2008 6:12 pm

Was an idea ... don't know if there's sense behind it ... :roll:
Lg

Roman


Return to “user plugins”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest