NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Information NextPVR Announcements v
« Previous 1 … 3 4 5 6 7 … 11 Next »
Plugin developers read

 
  • 0 Vote(s) - 0 Average
Plugin developers read
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#1
2006-07-20, 11:10 PM
I wanted to post a reminder to developers about some changes that occurred earlier this year.

A common cause of problems in GB-PVR is trying to use a plugin with a skin that does not explicitly provide support for that plugin. This problem occurs because the plugin is expecting to find its supporting skin files (skin.xml and image files etc), but they are not contained with in the active skin.

Early this year I made a change that will take advantage of the fact that all plugins support the default (blue) skin. Specifically, SkinHelper was changed to automatically fall back to using these resource files in the default skin if they’re not available in the active skin.

This change will only affect things explicitly defined in the plugin’s skin xml file(s). Things that are inherited from the BaseSkin.xml will continue to be loaded from the active skin. This means that buttons will still have the correct appearance for the current skin, and the background image will be correct.

To implement support for this functionality in your plugins, you need to use the correct constructor to SkinHelper. The older constructor to SkinHelper did not provide all the information that was be required to support this.

To use this new functionality, the plugin developer would create a SkinHelper instance using:

Code:
[FONT=Courier New]private SkinHelper skinHelper;[/FONT]
[FONT=Courier New]…[/FONT]
[FONT=Courier New]string pluginName = “TV Guide”; // …also the skin subdirectory[/FONT]
[FONT=Courier New]string skinFileName = “skin.xml”; // note the missing path[/FONT]
[FONT=Courier New]skinHelper = new SkinHelper(pluginName, skinFileName);[/FONT]

Behind the scenes the skin helper will determine the correct path and load the XML file. If the XML file cannot be found in the active skin directory, it’ll fall back to using the default one in the blue directory.

Having plugins support is becoming more important as we make an effort to clean up the skinning in GB-PVR. If you have plugins not currently doing this, please try to make this small change in the very near future.
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#2
2006-07-21, 08:10 AM
the reason why i dont use this:

each of my plugins have been through different versions, and the skin has changed. so if the skin they are using only supports the original plugin, and i use that constructor in the latest one, it will load the skinhelper with an old skin. thus not working Smile

so can you add a third param called version? and just do a string compare on a special attribute "Version"
eg
Code:
<settings>
<Version>2.54.56</Version>
....
</settings>
and if they dont match, default to the blue skin.
thats what im basically doing manually now.

if its just a string compare then each plugin can use their own version numbering.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#3
2006-07-21, 11:59 AM
I did it. I think it makes sense. I can't remember how many people that I;ve "moved on to " gbpvr only to have them frustrated by skins/plugins combinations.

Same with the community skin projects going on with Fatman_do, old_dog and mixman, they're trying hard to come up with a scheme that will make it easier for the end users which is really what we have to think about it.

And if this is the first lead up to it then i think it's a good start.

I think after a while sub, you might want to break functionality with the old constuctor...to enforce conformity.
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#4
2006-07-21, 12:04 PM
Quote:I think after a while sub, you might want to break functionality with the old constuctor...to enforce conformity.
god no, i use that when creating dvd menus for the "my dvd" feature of my vids (not stored in the skin directory you see).
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#5
2006-07-21, 05:19 PM
Reven, please just bite the bullet and make this change. It is going to be a vast improvement over what we currently have.
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#6
2006-07-22, 01:21 AM
sub Wrote:Reven, please just bite the bullet and make this change. It is going to be a vast improvement over what we currently have.
yeah but it wont work, because of different versions.

i would change if it worked under different versions.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#7
2006-07-22, 03:55 AM
Why do you always have to be so difficult? Please, just change it.
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#8
2006-07-22, 05:58 AM
so the skinhelper, checks to see if the skin exists, if it does it loads that one, but what happens if the skin it loads is a old skin that no longer works with the plugin? what happens when it tries to get a node/compositeimage that doesnt exist?
does it crash and throw a fit? or does it automatically get that node/composite image from the blue one?
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#9
2006-07-22, 06:02 AM
But surely when you've released whatever version of your software, and you've missed X skin (not blue), you would have updated the blue skin when you released??

So therefore it should load that.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#10
2006-07-22, 06:10 AM
Quote:so the skinhelper, checks to see if the skin exists, if it does it loads that one, but what happens if the skin it loads is a old skin that no longer works with the plugin?
We need to think ahead here. With the way I'm trying to move things, the majority of skins wont contain a definition for My Videos (for example). Instead, it'll only be defined in the default skin - and it'll be the correct version, because it was installed with your plugin.

In the future I'm hoping new skins will contain very few files (background.jpg, baseskin.xml, preview.jpg, maybe some custom buttons images or some other overridden images), the rest will be picked up from the base skin. It'll still be possible to have customized skins, but in the majority of cases this wont be required.

It'll also give you the benefit of your plugins working with new skins even though nobody explicitly added MyXxxx support to the skin. As you change your plugins, those skins will continue to work with your new plugins without the need for any changes.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (7): 1 2 3 4 5 … 7 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  Developers, need a sub-forum supporting your plugins? sub 52 15,935 2007-07-12, 01:37 PM
Last Post: systemshark
  Plugin authors, please read sub 4 4,594 2006-05-07, 02:32 AM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode