NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 5 6 7 8 9 … 93 Next »
Noobie Here!

 
  • 0 Vote(s) - 0 Average
Noobie Here!
jrockow
Offline

Senior Member

Posts: 716
Threads: 111
Joined: Nov 2005
#61
2014-03-20, 01:57 PM
I'm very exictied at what I've accomplished so far.
It's beginning to look like exactly what I had in mind.

However, still no joy getting my second buttonlist to show up.
And for me that's a huge deal.

The status at this point is, when I fire up the plugin I immediately get the following error...

"Object reference not set to an instance of an object"

It must be caused by this statement I have in my Initialise sub:

Dim ExtraButtonStrip = New UiButtonStrip("ExtraButtonList", New String() {"John"}, Me, New Hashtable(), skinHelper)

I'm just not experienced enough to know for sure I'm adding the proper code to the proper location in the file.
A lot of the terms you use are not familiar yet to me.

How about if you add the necessary code to your Test3 file and let me figure it out from there.
That way you won't need to decipher my VB code, and it may be a better learning experience for me.




On another matter, I'm ready to get into the Play, Pause, Stop commands, etc.
Earlier you sent the commands to do the Play (which when I use it also seems to take care of PAUSE, FF, etc), and the DELETE which seems to work for me.
The one I really need now is the RESUME command.

Before I go off and try to create a popup to take care of all of this, I have a question.
Is it possible for me to somehow use the popup from your Recordings menu, as everything I need is already there?


As always, thanx for your help, your patience and mostly your time!
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,788
Threads: 769
Joined: Nov 2003
#62
2014-03-20, 04:28 PM
See attached updated files. With this I see two lines two lines of buttons, and can click on either. The changes were what I described earlier:

declare variable
Code:
private UiButtonStrip extraButtonStrip;

initialise it in the Initialise() function
Code:
extraButtonStrip = new UiButtonStrip("ExtraButtonList", new string[] {"Extra1", "Extra2", "Extra3"}, this, new Hashtable(), skinHelper);

add it to the render list:
Code:
public override List<UiElement> GetRenderList()
        {
            List<UiElement> renderList = base.GetRenderList();
            renderList.AddRange(extraButtonStrip.GetRenderList());
            return renderList;
        }

override the ButtonStripCallback() method to handle action required when each button is pressed
Code:
public override void ButtonStripCallback(string button)
        {
            if (button == "Extra1")
            {
                PluginHelperFactory.GetPluginHelper().ShowMessage("Extra1 clicked");
                return;
            }
            else if (button == "Extra2")
            {
                PluginHelperFactory.GetPluginHelper().ShowMessage("Extra2 clicked");
                return;
            }
            else if (button == "Extra3")
            {
                PluginHelperFactory.GetPluginHelper().ShowMessage("Extra3 clicked");
                return;
            }

            base.ButtonStripCallback(button);
        }

Make these new buttons get a chance to handle mouse clicks, so pass OnClick events to the control
Code:
public override bool OnClick(System.Drawing.PointF location)
        {
            if (extraButtonStrip.OnClick(location))
                return true;
            return base.OnClick(location);
        }
.

I'd also modified the skin to define the list of buttons, and move its position slightly lower than the existing set of buttons (defined in global.xml).
Code:
    <!--ButtonList-->
    <Element name="ExtraButtonList" location="0,8" size="67.98,4.64" alpha="255" alphaFade="true">
        <Rect location="0,5" size="100,90" fillColor="Base2_Horizontal_FadeOut_Opaque" borderColor="Transparent" borderWidth="0"/>
            <Rect location="0,94" size="100,6.18" fillColor="Accent2_Horizontal_FadeOut"/>
        
        <RoundedRect visible="@button1Selected" location="1.13,12.36" size="18,75.28" fillColor="Selected_Button" borderColor="Border2" radius="0.52" borderWidth="0.15"/>
          <Text text="@button1" name="@button1" location="2.13,10" size="16,80" font="Title3Minimum" align="Center" valign="Center"/>
          <Text text="@button1" name="@button1" visible="@button1Selected" location="2.13,10" size="16,80" font="ButtonListReverse" align="Center" valign="Center"/>
        
        <RoundedRect visible="@button2Selected" location="17.13,12.36" size="18,75.28" fillColor="Selected_Button" borderColor="Border2" radius="0.52" borderWidth="0.15"/>
          <Text text="@button2" name="@button2" location="18.13,10" size="16,80" font="Title3Minimum" align="Center" valign="Center"/>
          <Text text="@button2" name="@button2" visible="@button2Selected" location="18.13,10" size="16,80" font="ButtonListReverse" align="Center" valign="Center"/>
        
        <RoundedRect visible="@button3Selected" location="33.13,12.36" size="18,75.28" fillColor="Selected_Button" borderColor="Border2" radius="0.52" borderWidth="0.15"/>
          <Text text="@button3" name="@button3" location="34.13,10" size="16,80" font="Title3Minimum" align="Center" valign="Center"/>
          <Text text="@button3" name="@button3" visible="@button3Selected" location="34.13,10" size="16,80" font="ButtonListReverse" align="Center" valign="Center"/>
        
        <RoundedRect visible="@button4Selected" location="49.13,12.36" size="18,75.28" fillColor="Selected_Button" borderColor="Border2" radius="0.52" borderWidth="0.15"/>
          <Text text="@button4" name="@button4" location="50.13,10" size="16,80" font="Title3Minimum" align="Center" valign="Center"/>
        <Text text="@button4" name="@button4" visible="@button4Selected" location="50.13,10" size="16,80" font="ButtonListReverse" align="Center" valign="Center"/>
        
        <RoundedRect visible="@button5Selected" location="65.13,12.36" size="18,75.28" fillColor="Selected_Button" borderColor="Border2" radius="0.52" borderWidth="0.15"/>
          <Text text="@button5" name="@button5" location="66.13,10" size="16,80" font="Title3Minimum" align="Center" valign="Center"/>
          <Text text="@button5" name="@button5" visible="@button5Selected" location="66.13,10" size="16,80" font="ButtonListReverse" align="Center" valign="Center"/>
    </Element>
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,788
Threads: 769
Joined: Nov 2003
#63
2014-03-20, 04:32 PM
jrockow Wrote:On another matter, I'm ready to get into the Play, Pause, Stop commands, etc.
Earlier you sent the commands to do the Play (which when I use it also seems to take care of PAUSE, FF, etc), and the DELETE which seems to work for me.
Yes, once you request playback starts, NextPVR handles all the normal playback stuff, like skipping etc. You don't need to do anything for this.

Quote:Before I go off and try to create a popup to take care of all of this, I have a question.
Is it possible for me to somehow use the popup from your Recordings menu, as everything I need is already there?
Nope, it's not possible for you to reuse this screen. You'd need to create your own in your plugin.
jrockow
Offline

Senior Member

Posts: 716
Threads: 111
Joined: Nov 2005
#64
2014-03-20, 05:25 PM
Can you tell me what I need for the RESUME command.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,788
Threads: 769
Joined: Nov 2003
#65
2014-03-20, 06:14 PM
There is a couple of ways you can resume. This is what I do:

Code:
Hashtable resumeMetaData = new Hashtable();
                    resumeMetaData["RESUME_FROM"] = position;

                    // start from beginning
                    PluginHelperFactory.GetPluginHelper().PlayVideoFile(filename, resumeMetaData);
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,788
Threads: 769
Joined: Nov 2003
#66
2014-03-20, 06:15 PM
You can get the last playback position with:

Code:
// retrieve resume info
                int duration = 0;
                int position = PlaybackPositionHelper.GetPlaybackPosition(filename, out duration);
jrockow
Offline

Senior Member

Posts: 716
Threads: 111
Joined: Nov 2005
#67
2014-03-21, 02:35 AM
I am now able to see the second button list.
It looks like it should function OK.

However, now I can't see the first (hidden) button list.
If I click in the area where the buttons should appear, it seems to work.
I just can't see the buttons or text.

I can't seem to find any elemnts in the skin file you sent that pertain to the first list.

Should I be able to cursor right and left thru the buttons on the second list?
It looks like I can only point & click with a mouse.

What command would I use to re-Populate my list?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,788
Threads: 769
Joined: Nov 2003
#68
2014-03-21, 03:13 AM
jrockow Wrote:However, now I can't see the first (hidden) button list.
If I click in the area where the buttons should appear, it seems to work.
I just can't see the buttons or text.
The first row of buttons is the default one that comes with the plugin framework, and behaves the same was as every other screen, ie hidden until you move the mouse up to that corner of the screen, or until you press the 'home' button.

Quote:I can't seem to find any elemnts in the skin file you sent that pertain to the first list.
As mentioned in an earlier post, they're defined in global.xml. They're defined there because their definition is shared by lots of screens.

Quote:Should I be able to cursor right and left thru the buttons on the second list?
Full keyboard control for this non-standard screne layout of two rows of buttons might be tricky. You probably need to override OnKeyDown, and pass call extraButtonStrip.OnKeyDown(e), to give it a chance to handle key presses. (in the same way I overrode OnClick() in that example)

Quote:What command would I use to re-Populate my list?
Take look you the PopulateList() method in that sample code. You can call those types of commands any time you want, and it'll reload the list.
jrockow
Offline

Senior Member

Posts: 716
Threads: 111
Joined: Nov 2005
#69
2014-03-21, 01:24 PM
I'm not sure I properly explained my problem with buttonlist #1.
I understand it is hidden by default, but what I'm saying is I can't get it to display no matter what I try.
I've tried the HOME key, the mouse cursor, and nothing I do works; the button and the label stay hidden.
It does however work, if I click in the area where I think the button is located.

As for being defined in global.xml, can that be overridden?
Can I have the code for buttonlist #1 added in my plugin, along with the code for the second buttonlist?
I need to be able to modify the labels and function of all the buttons from within my plugin.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,788
Threads: 769
Joined: Nov 2003
#70
2014-03-21, 05:01 PM
jrockow Wrote:I'm not sure I properly explained my problem with buttonlist #1.
I understand it is hidden by default, but what I'm saying is I can't get it to display no matter what I try.
I've tried the HOME key, the mouse cursor, and nothing I do works; the button and the label stay hidden.
It does however work, if I click in the area where I think the button is located.
With just those few edits to Test3 that I posted, buttonlist #1 was working fine. It'd show up if I move my cursor near that corner of the screen. It'd also show if I press the 'Home' button. I've attached the complete code.

Quote:As for being defined in global.xml, can that be overridden?
Can I have the code for buttonlist #1 added in my plugin, along with the code for the second buttonlist?
I need to be able to modify the labels and function of all the buttons from within my plugin.
I can't see why not.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

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


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

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

Linear Mode
Threaded Mode