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!
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#91
2014-03-23, 06:46 PM
jrockow Wrote:Things are really looking good, however, now I'm stuck on getting RESUME to work.
In posts #65 and #66 you gave me the code necessary for this function.
But once again I don't know know where to put it, and in what order.
Where do you want it to happen? ie, in response to what action by the user?
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#92
2014-03-23, 07:04 PM
In response to the popup window called by the Activate Item sub.
I have a button labeled RESUME in the popup.

Also, I'm trying to call the PopulateList routine after DELETEing a file, but having a problem inserting the call in the popup.vb.
Getting the "not declared" error again.
How do you repaint the screen after a delete?
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#93
2014-03-23, 07:22 PM
Somewhere in all my reading I came across this statement:

PluginHelperFactory.GetPluginHelper().GetPlaybackP roxy().GetPosition()

Is this anything I'll need for RESUME to work?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#94
2014-03-23, 07:53 PM
Quote:Also, I'm trying to call the PopulateList routine after DELETEing a file, but having a problem inserting the call in the popup.vb.
Getting the "not declared" error again.
This type of problem is nothing to do with NextPVR. This is just straight forward question relating to programming in modern languages that uses classes. These are two different classes, and they have different methods available.

There is lots of ways you can deal with this sort of situation. In this case, the most straight forward way would be to make use of the PluginCallback, which was made to help passing info back from popups. ie, in the popup class you can call:
Code:
callback.PluginCallback(this, "Resume", null);

Then in the main plugin you'd act on that message:
Code:
public void PluginCallback(object source, string command, object args)
        {
                if (command == "Resume")
                {
                        // retrieve resume info
                        int duration = 0;
                        int position = PlaybackPositionHelper.GetPlaybackPosition(filename, out duration);

                        Hashtable resumeMetaData = new Hashtable();
                        resumeMetaData["RESUME_FROM"] = position;
                        PluginHelperFactory.GetPluginHelper().PlayVideoFile(filename, resumeMetaData);
                }
                else if (command == "Delete")
                {
                        ...delete file....
                        PopulateList();
                }
        }
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#95
2014-03-24, 02:52 PM
The problem for today is getting RESUME to work.
When I click the button the error I get is ....

"The method or operation is not implemented"

In your sample code I don't see anything like...
"Implements NUtility.IPluginCallback.PluginCallback"
which I assume I need?

I tried adding it (at various locations) without any success.


Here is my sub....

(In an effort to simplify troubleshooting, I hardcoded the filename)

Public Sub PluginCallback1(source As Object, command As String, args As Object) Implements NUtility.IPluginCallback.PluginCallback
If command = "Resume" Then
' retrieve resume info
Dim duration As Integer = 0
Dim position As Integer = PlaybackPositionHelper.GetPlaybackPosition("R:\JOLOC\CASTLE\CASTLE_20140317_22012300.ts", duration)

Dim resumeMetaData As New Hashtable()
resumeMetaData("RESUME_FROM") = position
PluginHelperFactory.GetPluginHelper().PlayVideoFile("R:\JOLOC\CASTLE\CASTLE_20140317_22012300.ts", resumeMetaData)
ElseIf command = "Delete" Then
' ...delete file....
PluginHelperFactory.GetPluginHelper().ActivatePopup(Nothing)
PopulateList()
End If
End Sub



I also noticed I have this paragraph that looks identical to the one above, except for the name...

#Region "IPluginCallback Members"
Public Sub PluginCallback(source As Object, command As String, args As Object)

(identical code as above SUB)

End Sub
#End Region

Should this be in here?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#96
2014-03-24, 04:28 PM
jrockow Wrote:The problem for today is getting RESUME to work.
When I click the button the error I get is ....

"The method or operation is not implemented"

In your sample code I don't see anything like...
"Implements NUtility.IPluginCallback.PluginCallback"
which I assume I need?
I'm not sure whether the original Test3 plugin you were looking at had it, but it was definitely in the Test4 plugin I posted recently:

Code:
namespace Test3
{
    public class Test4 : NewStyleButtonListPlugin, IPluginConfiguration, IPluginCallback
    {


Code:
public void PluginCallback(object source, string command, object args)
        {
        }
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#97
2014-03-24, 06:32 PM
I started over again.
I removed the sub and all code pertaining to RESUME, removed the "Implements IPluginCallback" call.
Then I first put back the Implements call; now I have this....

Public Class Class1
Inherits NewStyleButtonListPlugin
Implements IPluginCallback
' Implements IPluginConfiguration (commented out)

When I put back the Implements IPluginCallback (above), it created a new plugincallback sub.
I put back the RESUME code and it now looks like this...

Public Sub PluginCallback(source As Object, command As String, args As Object) Implements NUtility.IPluginCallback.PluginCallback
If command = "Resume" Then
Dim duration As Integer = 0
Dim position As Integer = PlaybackPositionHelper.GetPlaybackPosition("R:\JOLOC\CASTLE\CASTLE_20140317_22012300.ts", duration)
Dim resumeMetaData As New Hashtable()
resumeMetaData("RESUME_FROM") = position
PluginHelperFactory.GetPluginHelper().PlayVideoFile("R:\JOLOC\CASTLE\CASTLE_20140317_22012300.ts", resumeMetaData)
ElseIf command = "Delete" Then
' ...delete file....
PluginHelperFactory.GetPluginHelper().ActivatePopup(Nothing)
PopulateList()
End If
End Sub


I have removed any of the "#Region" code I mentioned earlier.

The end result is the same; when I press RESUME I get an error.......
(I included the lines mentioned in the error text)


************** Exception Text **************
System.NotImplementedException: The method or operation is not implemented.
at NewRec.Test3.PlaybackPositionHelper.GetPlaybackPosition(String p1, Int32 duration) in C:\Users\John\documents\visual studio 2010\Projects\NewRec\NewRec\PlaybackPositionHelper.vb:line 6
at NewRec.Test3.Class1.PluginCallback(Object source, String command, Object args) in C:\Users\John\Documents\Visual Studio 2010\Projects\NewRec\NewRec\Class1.vb:line 367 (Dim resumeMetaData As New Hashtable())
at NewRec.Test3.SomePopup.HandleButtonCommand1(String buttonName) in C:\Users\John\Documents\Visual Studio 2010\Projects\NewRec\NewRec\SomePopup.vb:line 149 (callback.PluginCallback(Me, "Resume", Nothing)
at NUtility.Controls.UiButtonList.OnKeyDown(KeyEventArgs e)
at NewRec.Test3.SomePopup.OnKeyDown(KeyEventArgs e) in C:\Users\John\Documents\Visual Studio 2010\Projects\NewRec\NewRec\SomePopup.vb:line 68
( If buttonList.OnKeyDown(e) Then)
at NextPVR.ControllerForm.OnKeyDown(Object sender, KeyEventArgs e)
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.Form.WndProc(Message& m)
at NextPVR.ControllerForm.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#98
2014-03-24, 06:43 PM
jrockow Wrote:System.NotImplementedException: The method or operation is not implemented.
at NewRec.Test3.PlaybackPositionHelper.GetPlaybackPosition(String p1, Int32 duration) in C:\Users\John\documents\visual studio 2010\Projects\NewRec\NewRec\PlaybackPositionHelper.vb:line 6
at NewRec.Test3.Class1.PluginCallback(Object source, String command, Object args) in C:\Users\John\Documents\Visual Studio 2010\Projects\NewRec\NewRec\Class1.vb:line 367 (Dim resumeMetaData As New Hashtable())
at NewRec.Test3.SomePopup.HandleButtonCommand1(String buttonName) in C:\Users\John\Documents\Visual Studio 2010\Projects\NewRec\NewRec\SomePopup.vb:line 149 (callback.PluginCallback(Me, "Resume", Nothing)
It looks like you've created your own class called PlaybackPositionHelper.vb, and you're trying to use that, instead of the one supplied by NextPVR.

Delete your class, and make sure you have the VB.NET equivalent of "using NUtility;" and "using NShared;" at the top of your class.
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#99
2014-03-24, 06:43 PM
After compiling the "#Region" stuff came back.
I guess it's supposed to be there?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#100
2014-03-24, 06:48 PM
#regions, and just a cosmetic thing, so you can click + or - to collapse or expand that section of code.. The editor usually adds them when it implements an interface, to show the methods as grouped together.

They wont be causing you any problems.
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (17): « Previous 1 … 8 9 10 11 12 … 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