NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 27 28 29 30 31 93 Next »
1.x plugin development

 
  • 0 Vote(s) - 0 Average
1.x plugin development
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#51
2007-08-04, 08:07 AM
reven Wrote:ive got a crap load of code lying around that does the itemlist with all those views. just would need to adjust it to use the gbpvr way of rendering. and all those views have animations. just would need to clip the viewport otherwise the animations will look crap (overlapping the menus etc) and not sure if gbpvr will do this......

Thanks for the offer reven, good to see you returning to the fold..
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#52
2007-08-04, 09:36 AM
Well I'm still playing (21:30 on a Saturday night)
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#53
2007-08-26, 09:00 AM
GBPVRX2.UiSupport.UiSimpleList internalUIList.

Calling OnKeyDown on it - list has stuff in it, and it's been activated.
But the selected item never changes of the first item.

It's returning true, but still can't figure out why it's not moving.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#54
2007-08-26, 08:34 PM
If you force the screen to repaint by resizing the window, does it show your new selection?
Ton
Offline

Member

Posts: 233
Threads: 16
Joined: Aug 2005
#55
2007-08-27, 06:56 AM
Hello all,

I'm trying my hands at my first plugin, with the new 1.X framework, and I've run into some issues:

1. I'm writing a photo-viewer that supports auto-rotate based on EXIF information, and am using a PopUp to display the actual picture. However, I've had some issues with the UIButton elements....

Initially I tried using "UIButton.Activate" to move focus from one button to the next, but that would leave the button to which I wanted to move the focus in "buttonstate = Activating". I now set "buttonstate" directly, and that does work. Any reason for this???

2. I'm overriding "GetImage" (with the imagecallback interface) to generate thumbnails for the listview. However, this only updates the screen when all the visible list-items are in. In the "Picture Library", these pop in one at a time.. I have been experimenting with a thread to do the work, but this means that I have to update the items in the itemlist, and that is currently only possible to retrieve / replace the entire list... How did you do that??

3. I've been testing for memory-leaks and I've got one... After running for 6-7 hours in slide-show mode calls to "Graphics.DrawImage" fail. However, I am disposing of both the GBPVR UI elements and the images by using either "UIElement.Dispose()", and "Image.Dispose(); set Image=null"...
Anything else I need to do??

Hope you can help. I have to say that the plugin framework is pretty easy to code (once you played around with it a little). Just cost me a couple of days (evening) to get a working (not-bugree though) photo viewer.

That's pretty good in my book.
//Ton
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#56
2007-08-27, 07:09 AM
Ton Wrote:Hello all,

I'm trying my hands at my first plugin, with the new 1.X framework, and I've run into some issues:

1. I'm writing a photo-viewer that supports auto-rotate based on EXIF information, and am using a PopUp to display the actual picture. However, I've had some issues with the UIButton elements....

Initially I tried using "UIButton.Activate" to move focus from one button to the next, but that would leave the button to which I wanted to move the focus in "buttonstate = Activating". I now set "buttonstate" directly, and that does work. Any reason for this???
You should be calling Deactivate() on the old button, and Activate() on the new button you're moving to.

Calling needsRendering() is also required to process animations, and move state from "activating" to "active"

Quote:2. I'm overriding "GetImage" (with the imagecallback interface) to generate thumbnails for the listview. However, this only updates the screen when all the visible list-items are in. In the "Picture Library", these pop in one at a time.. I have been experimenting with a thread to do the work, but this means that I have to update the items in the itemlist, and that is currently only possible to retrieve / replace the entire list... How did you do that??
In the Picture Library I used a single threaded elaborate scheme that is a bit hard to describe, but basically I took a note of start time when GetRenderList() was first called, then in the GetImageCallback() I first check if I've taken over half a second to render the screen, if so, then it sets a 'still loading visible preview images' flag so that the next needsRendering() will return true, then returns a null image for the rest of the visible preview images.

Quote:3. I've been testing for memory-leaks and I've got one... After running for 6-7 hours in slide-show mode calls to "Graphics.DrawImage" fail. However, I am disposing of both the GBPVR UI elements and the images by using either "UIElement.Dispose()", and "Image.Dispose(); set Image=null"...
Anything else I need to do??
My scheme also keeps a cache of preview images so that there is not too many loaded, and so that they are disposed eventually as old elements are aged out of the cache.

Quote:I have to say that the plugin framework is pretty easy to code (once you played around with it a little).
Cheers - glad you like it.
Ton
Offline

Member

Posts: 233
Threads: 16
Joined: Aug 2005
#57
2007-08-28, 12:26 PM
Hi Sub,

Whenever you read this.... I'm still having some issues with memory leaks...

I have found (and fixed) an issue with how I retrieve the file from disk and draw it on the GBPVRUIElement image... When the popup is active, I can now replace the image with the one from disk, and don't see any problem in memory consumption.

I am still however, faced with another leak. It looks that when I dispose of the Popup, some resources are not freed.

I have made a test-build (based on the Weather sample provided by you) and here's what I did (in the popup):

Added the following to the general class elements:
Code:
GBPVRUiElement theImage = null;

Added the following to: Initialize:
Code:
SkinHelper2 myHelper = new SkinHelper2(this.getSkinSubdirectory() + "\\" + this.getSkinFileName());
            theImage = new GBPVRUiElement("TestPhoto", myHelper.getPlacementRect("TestPhoto"), myHelper.getNamedImage("TestPhoto", null));
            Image tmpImage = Image.FromFile("C:\\Test.jpg");
            Graphics g = Graphics.FromImage(theImage.image);
            g.Clear(Color.Red);
            RectangleF r = myHelper.getPlacementRect("TestPhoto");

            g.DrawImageUnscaled(tmpImage, new Rectangle(0, 0, (int)r.Width, (int)r.Height));
            g.Dispose();
            tmpImage.Dispose();

And finally, added the following to the getPostBackgroundRenderList():
Code:
renderList.Add(theImage);

I also tried disposing the image, setting the GBPVRUIElement to null, calling skinhelper2.DisposeResources() and several other things...

Is there something (hopefully simple) that I'm doing wrong??

I have included the adapted source files (AddCityPopup.cs and AddCityPopup.xml" as zip-attachment to this file...

What I observe is that each time the popup is disposed, reources are not freed, resulting in increasing memory-usage each time the popup is displayed...

Hope you (or someone else) can help...

Regards,
//Ton
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#58
2007-08-28, 09:25 PM
You'll probably have to bump this thread about this time next. I'll be home then and can try your sample.
Ton
Offline

Member

Posts: 233
Threads: 16
Joined: Aug 2005
#59
2007-08-28, 11:14 PM
Will do...

I'll see if I can figure something out myself or maybe someone else psycik can help (hear he's been playon around with the new framework too...

From what I can see the amount of memory leeking is about the size of the JPEG, hope that helps....
//Ton
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#60
2007-08-28, 11:33 PM
I think you need to override the Dispose() method, then create an arraylist, disposeList.Add(theImage), then call PluginHelperFactory().getPluginHelper().Dispose(disposeList)...or something like that - I'm not in front of my development PC so cant give you the exact syntax.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (9): « Previous 1 … 4 5 6 7 8 9 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 2,880 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,379 2020-11-14, 08:01 PM
Last Post: sub
  Test/Development environment for npvr.db3 scJohn 10 4,359 2020-09-04, 09:14 PM
Last Post: scJohn
  VIdeo playback from plugin mvallevand 5 3,488 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,919 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,786 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,135 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,963 2013-03-12, 06:48 AM
Last Post: psycik
  Integrated Development Environment (IDE) for plugins osx-addict 5 2,770 2012-10-18, 08:35 PM
Last Post: osx-addict
  Plugin problems with started from the command line mvallevand 11 5,014 2012-08-12, 07:56 PM
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