NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 22 23 24 25 26 … 93 Next »
Interface BaseButtonListUiTask, but more...

 
  • 0 Vote(s) - 0 Average
Interface BaseButtonListUiTask, but more...
sjbirk
Offline

Member

Posts: 65
Threads: 14
Joined: Jan 2005
#1
2007-10-11, 11:59 PM
i currently interface the BaseButtonListUiTask class from my plugin, but what if i want to build another element object that is not of type list. i want a new view that is of my own design... how do i get instantiate this within my plugin?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,753
Threads: 769
Joined: Nov 2003
#2
2007-10-12, 12:04 AM
If you're not going to use a list at all, then you can use the BaseButtonUiTask base class.

What type of information or thing are you wanting to display? I should be able to give you a recommendation of how to do it.
sjbirk
Offline

Member

Posts: 65
Threads: 14
Joined: Jan 2005
#3
2007-10-12, 03:13 PM
i do use the list for a majority of the plugin, but i'd like to have an "informational" screen display when a list item is selected.

i also have another question; i love the BaseButtonListUiTask because all you have to do is attach an arraylist of objects to it. but the downside is attaching a huge list to it. building the arraylist is very time consuming, thus causing the end user to hang while the list is built. i'm talking a list of 1k+ objects.
my thought is to build the list 7 objects (the amount shown on my screen for a page of the list) large, rebuild the list on new page view, and override the onkeypress (up, down, pageup, pagedown) methods. is there an easier way?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,753
Threads: 769
Joined: Nov 2003
#4
2007-10-12, 05:17 PM
Quote:i do use the list for a majority of the plugin, but i'd like to have an "informational" screen display when a list item is selected.
If the informational screen is a popup, then I guess you dont can just create a popup and make it visible with the BaseButtonListUiTask.SetPopup() call.

Alternatively when you want the info item to show, call uiList.SetVisible(false), then override the BaseButtonListUiTask.GetRenderList(). Make the new implementation call ArrayList renderList = base.GetRenderList(), then add whatever other items you want rendered to the list.

You should look at the UiStatic class. It has a constructor where you pass in your skinhelper object and the composite image name and a hashtable of arguments. You can then call renderList.AddRange(myUiStatic.GetRenderList()) to add to the render list mentioned above, and the composite image from your skin.xml file will be added to the info display on the screen.

Quote:i also have another question; i love the BaseButtonListUiTask because all you have to do is attach an arraylist of objects to it. but the downside is attaching a huge list to it. building the arraylist is very time consuming, thus causing the end user to hang while the list is built. i'm talking a list of 1k+ objects.
It doesnt matter whether a list has 10 items or 1000 items, it shouldnt take GB-PVR any longer to draw the list. Its only drawing the items that are visible, which should take next to no time.

Is your problem because you're loading images from disk for putting in the list? If so, you can look into the UiList.GetImage() call back which allows these images to be delay loaded until they actually need to be displayed on the screen.

Quote:my thought is to build the list 7 objects (the amount shown on my screen for a page of the list) large, rebuild the list on new page view, and override the onkeypress (up, down, pageup, pagedown) methods. is there an easier way?
Yuck. I'm sure you wont have to do this. What is taking so long for building your list of objects?
sjbirk
Offline

Member

Posts: 65
Threads: 14
Joined: Jan 2005
#5
2007-10-12, 07:20 PM
Quote:It doesnt matter whether a list has 10 items or 1000 items, it shouldnt take GB-PVR any longer to draw the list. Its only drawing the items that are visible, which should take next to no time.

Agreed. The issue I was referring to has nothing to do with GB-PVR, but rather me building an arraylist for the uiList. In some cases, for 1k+ iterations I have to create UiList.Item(), add properties, and then add the item to my arraylist.

Is there an easier, and less processing intensive, way of accomplishing this?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,753
Threads: 769
Joined: Nov 2003
#6
2007-10-12, 07:33 PM
Quote:In some cases, for 1k+ iterations I have to create UiList.Item(), add properties, and then add the item to my arraylist.

Is there an easier, and less processing intensive, way of accomplishing this?
Even that should be pretty fast on the computers we're all using to day. A couple of hundred millisecond type stuff.

Its a pretty generic question though, so without any concrete details about what is in these properties, it's hard to recommend specific optimisations. I suppose I should recommend generic optimisations, like not recreating that list after the first time. If you have multiple different views of different item lists, then keep them constructed after the initial load and simply switch which on is set on the uiList etc. I'm sure there is some optomisitions you can come up with to make it fast.
sjbirk
Offline

Member

Posts: 65
Threads: 14
Joined: Jan 2005
#7
2007-10-12, 07:47 PM
Quote:Its a pretty generic question though, so without any concrete details about what is in these properties, it's hard to recommend specific optimisations. I suppose I should recommend generic optimisations, like not recreating that list after the first time. If you have multiple different views of different item lists, then keep them constructed after the initial load and simply switch which on is set on the uiList etc. I'm sure there is some optomisitions you can come up with to make it fast.

The properties are quite simple; name and desc...

I will do some tests this weekend... and hopefully find better results.
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#8
2007-10-13, 06:08 AM
sjbirk Wrote:Agreed. The issue I was referring to has nothing to do with GB-PVR, but rather me building an arraylist for the uiList. In some cases, for 1k+ iterations I have to create UiList.Item(), add properties, and then add the item to my arraylist.

Is there an easier, and less processing intensive, way of accomplishing this?
I had the same issue of hanging with my Netflix plugin. Even though I am not creating as many items as you (100-160), it was taking a while because it was downloading cover art for each item. I solved it by having the PopulateListWidget() launch a popup saying it was retrieving then launch a background thread to populate the list. The background thread would then close the popup when it finished.

Code:
protected override void PopulateListWidget()
        {
            setPopup(new GBPVRX2.Popups.PopupMessageBox(this, "Adding items to list.")); // launches popup.
            new Thread(bgListWidget).Start(); // launch background thread to populate list.
        }

        private void bgListWidget()
        {
            ArrayList itemList = new ArrayList();
            for (int i = 0; i < 1000; i++)
            {
                 UiList.Item item = new UiList.Item();
                 item.AddProperty("@title", "Item # " + i.ToString());
                 itemList.Add(item);

                 // This will add items to the screen as they are added to the list.
                 uiList.setItemList(itemList);
            }

            // This will add all items to the screen after the list is complete.
            // uiList.setItemList(itemList);
            setPopup(null); // Close the popup.
        }
sjbirk
Offline

Member

Posts: 65
Threads: 14
Joined: Jan 2005
#9
2007-10-14, 03:36 PM
Quote:I had the same issue of hanging with my Netflix plugin. Even though I am not creating as many items as you (100-160), it was taking a while because it was downloading cover art for each item.

you nailed it whurlston. i am accessing an object model external to gb-pvr which is causing the delay. thanks for the popup suggestion.

sub, i built an 8500 item list without hitting the external object model; it built in at most a second.

thanks for both of your help.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,753
Threads: 769
Joined: Nov 2003
#10
2007-10-14, 04:36 PM
Just to add further info, I use a differnet approach to solving the problem whurlston describes. Instead of downloading the images from the external site while constructing the list I set the image parameter to "this" and implement the UiList.GetImage() call back. This method is then called to delay loaded these images. They only requested when they're made visible for the first time.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Plugins and interface questions from a C# rookie mvallevand 11 4,152 2008-08-26, 03:20 PM
Last Post: McBainUK
  Any chance to add a second list to BaseButtonListUiTask ? lupus11 9 2,539 2008-01-02, 09:07 PM
Last Post: lupus11
  v1.x BaseButtonListUiTask plugin/skin question DronnyBoyd 20 5,549 2007-09-18, 11:44 AM
Last Post: sub
  TaskImages in BaseButtonListUiTask McBainUK 2 1,519 2007-09-12, 11:17 AM
Last Post: McBainUK
  Developer API or Web Interface question jdonth 2 1,554 2007-07-15, 02:18 PM
Last Post: jdonth
  Recordings made via the Web Admin interface are at the wrong resolution! mmatheny 9 3,062 2006-08-04, 06:34 PM
Last Post: HtV
  Drawing an interface boohiss 2 1,855 2006-07-31, 08:20 PM
Last Post: boohiss
  Interface to allow a plugin to show itself over the top of a playing video McBainUK 3 1,882 2006-02-22, 11:07 PM
Last Post: McBainUK
  GBPVRUIElements - skinnable user interface widget libary McBainUK 14 4,788 2006-02-15, 10:12 AM
Last Post: dottore
  Web Interface and IIS paulcaley 7 3,237 2004-11-12, 06:26 PM
Last Post: Huw

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

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

Linear Mode
Threaded Mode