NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 20 21 22 23 24 … 93 Next »
WizTools - 1.x Plugin Development Toolkit

 
  • 0 Vote(s) - 0 Average
WizTools - 1.x Plugin Development Toolkit
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#141
2008-01-05, 07:23 PM
idkpmiller Wrote:Hi Sub,

Thanks for the assistance, I getting the following error:

2008-01-05 18:56:49.718 VERBOSE [1] System.NullReferenceException: Object reference not set to an instance of an object.
at GBPVRX2.SkinHelper2.getNamedImage(Image image, String name, Hashtable parameters, XmlNode fromNode)
at GBPVRX2.SkinHelper2.getNamedImage(String name, Hashtable parameters)
at GBPVRX2.UiSupport.UiStatic..ctor(SkinHelper2 skinHelper, String compositeImageName, Hashtable args)
at GameZone.GameZone.GameZoneTask.Activate() in H:\GB-PVR\project\GameZone 2\GameZone 2\GameZone 2\GameZoneTask.vb:line 1081
at GBPVRX2.MenuTask.xd2a3a83a17aec615.OnKeyDown(KeyEventArgs e)
at GBPVRX2.x0061b801bdf12d35.xdae9991ab918b397(Object xdf2e3583f942db7b, KeyEventArgs xc4f45905cb1fc7ba)
at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
Does the pvrx2.exe.log indicate anything not being found in the skin file immediately prior to this error?
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#142
2008-01-05, 07:35 PM
idkpmiller Wrote:Apoligies to all (especially JW) for being side tracked, I am still having the same issue after many hours of playing if anyone has any ideas I would love to hear them, in the menatime I will read MS knowledge base on debugging class libraries :-)
No Problem.

1) If you are using the express version of Visual Studio, you might have to manually update the project file. Instruction on how to do that for C# can be found by reading thru this thread: http://forums.nextpvr.com/showthread.php...ight=debug

2) I use a different method to display thumbnail images in my plugins. There is an interface SkinHelper2.GetImageCallback that can be used. The WizUiHelperPlugin example shows how to do this for the Popup example. Here is a quick recap:
  • Create an object that implements the SkinHelper2.GetImageCallback interface. In the example, this is the ShowInfo object found in WizUiHelperPluginTask.cs.
Code:
[SIZE=2][COLOR=#0000ff]public [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]ShowInfo[/COLOR][/SIZE][SIZE=2] : [/SIZE][SIZE=2][COLOR=#2b91af]SkinHelper2[/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af]GetImageCallback[/COLOR][/SIZE]
  • The ShowInfo object must implement the GetImage method. In this method, return an Image object of the graphic you want displayed. At runtime, subs code will automatically call this method if the object is referenced as a parameter in the parameter hashtable.
Code:
[SIZE=2][COLOR=#0000ff]public [/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]Image[/COLOR][/SIZE][SIZE=2] GetImage([/SIZE][SIZE=2][COLOR=#2b91af]Hashtable[/COLOR][/SIZE][SIZE=2] parameters, [/SIZE][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] name, [/SIZE][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] width, [/SIZE][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] height)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#2b91af]Image[/COLOR][/SIZE][SIZE=2] thumbnail = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]Bitmap[/COLOR][/SIZE][SIZE=2](100, 100);[/SIZE]
[SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] thumbFileName = [/SIZE][SIZE=2][COLOR=#2b91af]WizInfo[/COLOR][/SIZE][SIZE=2].GBPvrSkinRootDirectory() + [/SIZE][SIZE=2][COLOR=#a31515]@"WizUiHelper\Big Lebowski, The.jpg"[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] (![/SIZE][SIZE=2][COLOR=#2b91af]File[/COLOR][/SIZE][SIZE=2].Exists(thumbFileName))[/SIZE]
[SIZE=2] thumbFileName = [/SIZE][SIZE=2][COLOR=#2b91af]WizInfo[/COLOR][/SIZE][SIZE=2].GBPvrStandardSkinDirectory() + [/SIZE][SIZE=2][COLOR=#a31515]@"WizUiHelper\Big Lebowski, The.jpg"[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#2b91af]File[/COLOR][/SIZE][SIZE=2].Exists(thumbFileName))[/SIZE]
[SIZE=2] thumbnail = [/SIZE][SIZE=2][COLOR=#2b91af]Image[/COLOR][/SIZE][SIZE=2].FromFile(thumbFileName);[/SIZE]
[SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][SIZE=2] thumbnail;[/SIZE]
[SIZE=2]}[/SIZE]
  • In the plugin, create a ShowInfo object, and at the time you are building the detail for the plugin controls, populate the arguments for the target control, for example (see @thumbnail):
Code:
[SIZE=2]lblProgramInfo.addArg([/SIZE][SIZE=2][COLOR=#a31515]"@text"[/COLOR][/SIZE][SIZE=2], selectedShow.ProgramTitle);[/SIZE]
[SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] rating = selectedShow.ProgramRating;[/SIZE]
[SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] channel = selectedShow.ProgramChannel;[/SIZE]
[SIZE=2]lblProgramInfo.addArg([/SIZE][SIZE=2][COLOR=#a31515]"@rating"[/COLOR][/SIZE][SIZE=2], rating);[/SIZE]
[SIZE=2]lblProgramInfo.addArg([/SIZE][SIZE=2][COLOR=#a31515]"@channel"[/COLOR][/SIZE][SIZE=2], channel);[/SIZE]
[SIZE=2]lblProgramInfo.addArg([/SIZE][SIZE=2][COLOR=#a31515]"@desc"[/COLOR][/SIZE][SIZE=2], selectedShow.ProgramDescription);[/SIZE]
[SIZE=2]// selectedShow is a ShowInfo object that has the GetImage() method[/SIZE]
[SIZE=2]lblProgramInfo.addArg([/SIZE][SIZE=2][COLOR=#a31515]"@thumbnail"[/COLOR][/SIZE][SIZE=2], selectedShow);[/SIZE]
  • In the skin, define a @thumbnail image entry as follows:
Code:
<CompositeImage name="ProgramInfoImage" size="75.0,25.0">
    <DrawRoundedRect          loc="1,1" size="98,98" fillColor="PopupBackground" borderColor="PopupBorder" radius="@PopupCornerRadius" borderWidth="@PopupBorderWidth"/>
    <DrawText text="@text"    loc="2.0, 0.0" size="96.0,15.0" textStyle="ProgramTitle"     align="Left" />
    <DrawText text="@rating"  loc="2.0,15.0" size="80.0,15.0" textStyle="ProgramRating"    align="Left"/>
    <DrawText text="@channel" loc="2.0,30.0" size="80.0,15.0" textStyle="ProgramChannel"   align="Left"/>
    <DrawText text="@desc"    loc="2.0,47.0" size="80.0,54.0" textStyle="ProgramDesc"      align="Left"/>
    <DrawImage filename="@thumbnail" loc="80.0,16.0" size="17.0,80.0" fixedAspectRatio="true" />
</CompositeImage>

Now at runtime, when PVRX2 attempts to render the lblProgramInfo, it will call the GetImage method for rendering the @thumbnail reference.

I've attached the code for WizUiHelperDemoPlugin.
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#143
2008-01-05, 10:26 PM
Ommina Wrote:I'm going to spend some more time stripping the popup down (pop up down?) to see if I can find something that makes a difference. I'll post back if I have anything interesting to report. Or more silly jokes.

So! Back to this one. Last night, instead of spending my time doing silly things like sleeping, I created another popup. This popup consists of a button. The button says 'close'. And that's pretty much it.

Two member variables - the control manager and the button. Constructor is empty, initialize creates the OK button and adds it to the manager.

Dispose calls dispose on the control manager along with the base class dispose.

A couple functions for the renderlist, one for OnKeyDown to close the popop, nothing else for code really.

It's still managing to gulp up a fair chunk of memory. Not just 30K or something that would look like an image loaded but never sent away. It's about 2000K worth of claimed private bytes per popup creation.

Values claimed by the example Big Lebowsky popup are roughly similar, but by no means precisely. Still one to two MB per popup instance.

I'm planning on moving the plugins to a different machine entirely later today and see what happens there. Beyond that, though, does anybody have any guesses what I could be doing wrong?
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#144
2008-01-05, 11:44 PM
Ommina Wrote:It's still managing to gulp up a fair chunk of memory. Not just 30K or something that would look like an image loaded but never sent away. It's about 2000K worth of claimed private bytes per popup creation.

I'm planning on moving the plugins to a different machine entirely later today and see what happens there. Beyond that, though, does anybody have any guesses what I could be doing wrong?

Does your setPopup() routine call dispose as follows:
Code:
[SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][SIZE=2][COLOR=#808080]<summary>[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][SIZE=2][COLOR=#008000] Set the current popup. Pass null to shut down popup.[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][SIZE=2][COLOR=#808080]</summary>[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][SIZE=2][COLOR=#808080]<param name="popup"></param>[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]private [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] setPopup([/SIZE][SIZE=2][COLOR=#2b91af]IMenuTask[/COLOR][/SIZE][SIZE=2] popup)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff]   if[/COLOR][/SIZE][SIZE=2] (([/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].activePopup != popup) && ([/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].activePopup [/SIZE][SIZE=2][COLOR=#0000ff]is[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]IUiPopup[/COLOR][/SIZE][SIZE=2]))[/SIZE]
[SIZE=2]   {[/SIZE]
[SIZE=2]       (([/SIZE][SIZE=2][COLOR=#2b91af]IUiPopup[/COLOR][/SIZE][SIZE=2])[/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].activePopup).Dispose();[/SIZE]
[SIZE=2]   }[/SIZE]
[SIZE=2][COLOR=#0000ff]   this[/COLOR][/SIZE][SIZE=2].activePopup = popup;[/SIZE]
[SIZE=2]   mMoreRenderingRequired = [/SIZE][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE]

And, in your popup, do you dispose the control it the Popup.Dispose() method?

For example in the xxxPopup.cs:
Code:
public override void Dispose()
        {
            LogMessage("Dispose()", "ENTER");
            base.Dispose();
            ctlMgr.Dispose();
            LogMessage("Dispose()", "EXIT");
        }
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#145
2008-01-06, 12:44 AM
Yep, on both counts.

I'm also getting the associated control .Dispose() indications in the log file:

Quote:2008-01-05 17:34:44.237 VERBOSE [1] WizUiButton: Dispose()- CloseButton
2008-01-05 17:34:44.252 VERBOSE [1] WizUiButton: Dispose()- VoteButton
2008-01-05 17:34:44.252 VERBOSE [1] WizUiButton: Dispose()- VoteSubmitButton
2008-01-05 17:34:44.252 VERBOSE [1] WizUiButton: Dispose()- VoteCancelButton
2008-01-05 17:34:44.252 VERBOSE [1] WizUiButton.Dispose(): AnimeInfo
2008-01-05 17:34:44.252 VERBOSE [1] WizUiButton.Dispose(): Ratings
2008-01-05 17:34:44.252 VERBOSE [1] WizUiButton.Dispose(): Awards
2008-01-05 17:34:44.252 VERBOSE [1] WizUiButton.Dispose(): EpisodeDetails
2008-01-05 17:34:44.252 VERBOSE [1] WizUiButton.Dispose(): VoteBox

Curiously, the last five are not buttons though, but labels.

Given the different format between the two of them, though, I figured this was just a visual thing and not something to be concerned with. Should I be concerned after all?

Is there anything else of relevance in the handlePopupCallback? Right now it is just SetPopup(null) and setting needsMoreRendering to true.
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#146
2008-01-06, 12:45 AM
Hi JW,

I was having major grief getting VB to do the first part of your way of displaying images

JavaWiz Wrote:
  • Create an object that implements the SkinHelper2.GetImageCallback interface. In the example, this is the ShowInfo object found in WizUiHelperPluginTask.cs.

Also without the code actually working it was not clear to me how it should work, this is what prompted my first post on the subject..

Sub provided a different way which I could understand from the code unfortunately for whatever reason I just cant get that to work.

I have relooked at the code you provided and tried once again to get it working and this time was successful Big Grin

So I now have working code to play with to see how it works and see if I can get an understanding of how it functions.

Thanks to everyone that has helped with my issue here, really appreciate such positive support.

Thanks!

P.S. before I go any furthur I will sort out the VB template and upload it, in case some other person decides that they will use VB may save them alot of grief.
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#147
2008-01-06, 12:50 AM
Ommina Wrote:Yep, on both counts.

Curiously, the last five are not buttons though, but labels.

Given the different format between the two of them, though, I figured this was just a visual thing and not something to be concerned with. Should I be concerned after all?
No problem, cut and paste error, fixed in next version.

Quote:Is there anything else of relevance in the handlePopupCallback? Right now it is just SetPopup(null) and setting needsMoreRendering to true.
That should be ok.
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#148
2008-01-06, 01:39 AM
Ok this is the first time I have tried to send a complete project source, so I hope it works for others, I have been using VB 2005 express I have not tested in sharp develop it sometimes throws a fit when changing IDEs.

I hope someone else can make use of the efforts of the guys here in getting this to work for me.

Cheers
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#149
2008-01-06, 02:53 AM
idkpmiller Wrote:Ok this is the first time I have tried to send a complete project source, so I hope it works for others, I have been using VB 2005 express I have not tested in sharp develop it sometimes throws a fit when changing IDEs.

I hope someone else can make use of the efforts of the guys here in getting this to work for me.

Cheers
Thanks, I'll see about adding this code into the Wiz Developer Toolkit. I'd like to make a wiki page to distribute this information, but have not had the time to start it...
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#150
2008-01-06, 03:07 AM
Ommina-

Based on information sub supplied in this thread, I think you should modify all your popup Dispose routines to reflect the skinHelper2.DisposeResources() call. Perhaps that may help your memory consumption problems.
Code:
[SIZE=2][COLOR=#0000ff]public [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]override [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] Dispose()[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#2b91af]   WizInfo[/COLOR][/SIZE][SIZE=2].LogMessage([/SIZE][SIZE=2][COLOR=#a31515]"SearchWizX2"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].getName() + [/SIZE][SIZE=2][COLOR=#a31515]"Dispose()"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#a31515]"ENTER"[/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000ff]   base[/COLOR][/SIZE][SIZE=2].Dispose();[/SIZE]
[SIZE=2]   ctlMgr.Dispose();[/SIZE]
    [SIZE=3][B]skinHelper2.DisposeResources();[/B][/SIZE]
[SIZE=2][COLOR=#2b91af]   WizInfo[/COLOR][/SIZE][SIZE=2].LogMessage([/SIZE][SIZE=2][COLOR=#a31515]"SearchWizX2"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].getName() + [/SIZE][SIZE=2][COLOR=#a31515]"Dispose()"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#a31515]"EXIT"[/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2]}[/SIZE]
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (31): « Previous 1 … 13 14 15 16 17 … 31 Next »
Jump to page 


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