NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
1 2 3 4 5 … 93 Next »
Plugins and NPVR. Where do we start?

 
  • 0 Vote(s) - 0 Average
Plugins and NPVR. Where do we start?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,772
Threads: 769
Joined: Nov 2003
#11
2010-06-15, 11:41 PM
Ommina Wrote:Hm. Am I required to inherit from NUtility.Base.SimpleButtonPlugin or NUtility.Base.NewStyleButtonListPlugin ?
No, you're not requrired to use those base classes, but they are there to make things easier for you. You can instead implement a plugin that implements IScreenPlugin, and implement all the methods (like GetRenderList() etc).

Quote:I'm not seeing any other place with a .GetSkinHelper() -- IScreenPlugin doesn't have it.
IScreenHelper is an interface that the application calls to interact with all plugins. The application never calls GetSkinHelper() on a plugin. This is just something the bases classes were doing internally within the plugin. You dont have to have an equivalent if you implement IScreenHelper. In fact, a plugin doesnt even need to use the skinhelper if it doesnt want to. If you were implementing a IScreenPlugin from scratch, I'd expect you probably would have a SkinHelper member variable, and would probably initialise it the first time the application calls Activate() on your plugin.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,586
Threads: 384
Joined: Dec 2004
#12
2010-06-15, 11:41 PM
Ommina Wrote:Hm. Am I required to inherit from NUtility.Base.SimpleButtonPlugin or NUtility.Base.NewStyleButtonListPlugin ? I'm not seeing any other place with a .GetSkinHelper() -- IScreenPlugin doesn't have it.

Or am I missing something obvious - again ?
Both classes implement IScreenPlugin. If your plugin class implements IScreenPlugin directly you'd have to create your own SkinHelper object. Much easier to use an existing plugin base class.

EDIT: ....and sub gets there first yet again. Big Grin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,772
Threads: 769
Joined: Nov 2003
#13
2010-06-15, 11:48 PM
Too slow my friend, too slow... Smile
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#14
2010-07-08, 10:27 PM
So - is there any provision for left/right scrolling of the (new style) buttons?

One limitation that I've quickly hit against is that the new style allows very few buttons. Far fewer than I need.

Thinking aloud, I suppose I can simulate the scrolling myself... although all buttons would then have to be a fixed width, which is somewhat unattractive.

Any suggestions or alternate solutions for dealing with having more buttons than space?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,772
Threads: 769
Joined: Nov 2003
#15
2010-07-08, 10:32 PM
Ommina Wrote:So - is there any provision for left/right scrolling of the (new style) buttons?

One limitation that I've quickly hit against is that the new style allows very few buttons. Far fewer than I need.

Thinking aloud, I suppose I can simulate the scrolling myself... although all buttons would then have to be a fixed width, which is somewhat unattractive.

Any suggestions or alternate solutions for dealing with having more buttons than space?
There is nothing built in that'll do that currently. You can squeeze in about 5 or 6 buttons by lengthing the buttonstrip background in the skin file though.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#16
2010-07-09, 12:21 PM
Just getting starting with my first ever plugin, an attempt at duplicating the "System" functionality from GBPVR into nPVR...

Can I ask a hopefully simple question: how do I popup a message dialog? I need to do one with a basic "ok" option, and one with the usual "are you sure yes/no" options.

I've found PluginHelperFactory.GetPluginHelper().ShowMessage() in the examples, but that just seems to overlay a graphic (which would be fine for a simple message) but I see no way to get rid of it again (quickly).

Iain
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#17
2010-07-09, 01:49 PM
Calling PluginHelperFactory.GetPluginHelper().ShowMessage("") or PluginHelperFactory.GetPluginHelper().ShowMessage(string.Empty) will get rid of the message popup.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#18
2010-07-09, 02:04 PM
whurlston Wrote:Calling PluginHelperFactory.GetPluginHelper().ShowMessage("") or PluginHelperFactory.GetPluginHelper().ShowMessage(string.Empty) will get rid of the message popup.

Cheers.

So far I've managed to get all the main options implemented, including the Update EPG. At least I think I have - I'm doing it all in a VM with no tuners so can't be sure :-)

Next is to figure out how to display text and/or draw to the display itself. I'm a Java programmer by day so this is all new to me...

Iain
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#19
2010-07-09, 06:13 PM
Ok, my next question...

I've found two ways so far of displaying an image. I can either create a UiElement object and add it to the render list, or I can define an <image> element in the skin.

The latter looks like the preferred way of doing it, because it'll be easier to tweak positions and sizes etc?

The image I want to use will be custom generated. I'm making a Bitmap object, and drawing to its Graphics. But how can I match its size to what will appear on screen?

If I don't set fixedAspectRatio=true in the skin then it gets scaled to fit (and looks messy). If I do set it, then the image appears perfectly, but obviously I need to match sizes. So is there a way to convert from skin co-ordinates into usable width and height values for the Graphics object?

Thanks

Iain

(please jump in stop me at any time if it looks like I'm doing things the stupid way)
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,772
Threads: 769
Joined: Nov 2003
#20
2010-07-09, 07:30 PM
I'm not at home to give you an example at the moment, but I'd generally use a UiStatic, and pass in the name of an Element in the skin file. That Element can define an <Image> to be drawn. In the args to the UiStatic, pass in something like args["@previewImage"] = this;, and implement the SkinHelper.IGetImageCallback() interface. This way your GetImage(width, height) method will be called when it needs that image, and it'll pass you the image size in pixels etc.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (9): « Previous 1 2 3 4 5 … 9 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  API channel.stream.start mvallevand 2 1,429 2023-05-07, 09:40 PM
Last Post: mvallevand
  Way to tell programmatically if channel load in from NPVR has finished... gdogg371 3 2,430 2021-03-11, 03:59 PM
Last Post: mvallevand
  Test/Development environment for npvr.db3 scJohn 10 4,485 2020-09-04, 09:14 PM
Last Post: scJohn
  How to extract M3U8 and get matching XMLTV guide data from NPVR almightyj 0 3,519 2018-10-23, 07:24 AM
Last Post: almightyj
  ios app to control npvr ui idea jnbooker15 4 3,676 2015-09-21, 10:19 PM
Last Post: sub
  ios app to control npvr ui idea jnbooker15 0 2,516 2015-09-21, 06:39 PM
Last Post: jnbooker15
  I want to start developing plugins...but how? OrenShapir 6 4,139 2014-11-18, 10:38 PM
Last Post: mvallevand
  Couple of questions about hacking npvr.db3 drmargarit 6 4,322 2014-09-08, 02:22 AM
Last Post: sub
  Absolute newbie trying to realize an idea - where to start? Oopsjoppe 13 5,742 2013-11-11, 05:33 PM
Last Post: Oopsjoppe
  high res (256x256+) npvr icon? reven 15 5,968 2013-09-01, 05:13 AM
Last Post: psycik

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

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

Linear Mode
Threaded Mode