External Control Plugin Version II - ideas please! (3 Viewers)

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
Quick reminder before you guys get carried away with what to expect:
I'm only providing the framework for external applications to communicate with MP - I'm not actually programming any pocketPC app, web interface etc. If anyone wants to take up that challenge, feel free to.

Sam
 
P

plagnioj

Guest
I think that we can both work together.

Develop the webservices and after the WebInterface and I want to develop a
remote application Like I said here
 

STSC

Portal Pro
December 4, 2004
139
0
Germany
Hi Sam,

I also made a couple small modifiactions to your external control plugin:

- AssemblyResolver: Right know you need all your assemblies like core.dll, databases.dll ... of MP a second time in your client folder. That's not necessary any longer.
- I also want to implement AddRecording/DeleteRecording and I think that I might know a solution, how to add recordings without MP running. This should also solve Machine's issues when the DB structure of MP changes.

I'm not going to write my own external control plugin, because you did already a very good job! I will mail you my modifications when I'm finished with my PVR Scheduler Plugin in a couple weeks, so that we can combine everything. But let me know before you release your next version.

And thank you very much for your very good plugin!
 

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
STSC said:
Hi Sam,

I also made a couple small modifiactions to your external control plugin:

- AssemblyResolver: Right know you need all your assemblies like core.dll, databases.dll ... of MP a second time in your client folder. That's not necessary any longer.
- I also want to implement AddRecording/DeleteRecording and I think that I might know a solution, how to add recordings without MP running. This should also solve Machine's issues when the DB structure of MP changes.

I'm not going to write my own external control plugin, because you did already a very good job! I will mail you my modifications when I'm finished with my PVR Scheduler Plugin in a couple weeks, so that we can combine everything. But let me know before you release your next version.

And thank you very much for your very good plugin!

Thanks for that STSC! I've been pondering the first problem for ages... I'm interested in seeing how you solved the problem.

I was going to do the 2nd point, but if you're going to do it, feel free to - I'll work on some other part of it.

No problems - I'll wait until you email me the modifications before I release it. Looking forward to your PVR Scheduler plugin!

Sam
 
A

Anonymous

Guest
upnp, from what i know, is kinda of like a web service anyway and requires a web server.

If a web service was developed for media portal a pocketpc (or any other platform) program could be made quite easily to request data from it using rpc calls and preset its own GUI to the user, which would make it alot more responsive and look nicer/more easily skinable in line with MediaPortal.

If anyone starts work on this i would like to help where I can, I have some programing experince, mostly self taught stuff.
 

STSC

Portal Pro
December 4, 2004
139
0
Germany
Hi Sam,

I'm almost done with my changes, but I'm still having a small issue.
I tried to create a WindowsProgressDialog that runs up to 100% and returns a true value. When you cancel it with "ESC" then it returns false.

Code:
    Public Function WindowsProgressDialog(ByVal DialogHeading As String, ByVal DialogLine1 As String, ByVal DialogLine2 As String, ByVal DialogLine3 As String) As Boolean

        'Create dialog to show progress
        Dim dlgProgress As MediaPortal.Dialogs.GUIDialogProgress = CType(MediaPortal.GUI.Library.GUIWindowManager.GetWindow(CType(MediaPortal.GUI.Library.GUIWindow.Window.WINDOW_DIALOG_PROGRESS, Integer)), MediaPortal.Dialogs.GUIDialogProgress)
        If (Not dlgProgress Is Nothing) Then
            dlgProgress.SetHeading(DialogHeading)
            dlgProgress.SetLine(1, DialogLine1)
            dlgProgress.SetLine(2, DialogLine2)
            dlgProgress.SetLine(3, DialogLine3)
            dlgProgress.StartModal(MediaPortal.GUI.Library.GUIWindowManager.ActiveWindow)
            dlgProgress.SetPercentage(0)
            dlgProgress.Progress()
            dlgProgress.ShowProgressBar(True)
        End If

        Dim iCounter As Integer = 0
        Try
            While iCounter <= 100
                dlgProgress.SetPercentage(iCounter)
                Threading.Thread.Sleep(100)
                iCounter += 1
            End While

        Catch ex As IndexOutOfRangeException
            dlgProgress.Close()
            Return False
        Catch ex As WebException
            dlgProgress.Close()
            Return False
        Catch ex As Exception
            dlgProgress.Close()
            Return False
        End Try
        dlgProgress.Close()
        Return True
    End Function

When you get a chance you could test my code and maybe you know why it doesn't work like this. Don't forget to add a reference to WindowPlugins.dll.
I will send you everything back after this works and you can put everything together. Thanks!!
 

vbap

Portal Pro
February 15, 2005
131
1
Melbourne, Australia
Hi Sam,

This sounds like it will be a very useful framework. Is the intention to build the framework as has been discussed in the "LCD Plugin" threads (eg http://nolanparty.com/mediaportal.sourceforge.net/phpBB2/viewtopic.php?t=3564 ? )

ie:
HdWagner said:
samuel337 said:
Really? I've managed to get the current MP state alright for the web interface that I'm working on. Maybe you're needing more info that I am, but I can send you the code that I have now to determine firstly, the type of media playing, secondly the description, and thirdly the duration if applicable.
Yes, that's right. It is possible to retrieve some info. But we're looking for a more holistic approach: a standard interface that enables every plugin to send data to a/any client.
This way not only media info can be shown, but also weather, menus, mail status, tv channel, ...

With your framework, would an LCD plugin (for example) have to perodically "poll" the GUIPropertyManager to display updates in the state, or would an event be triggered if the sate of any property was changed?
 

STSC

Portal Pro
December 4, 2004
139
0
Germany
There will be no events for sure! Because Sam is using .NET Remoting and it is kind of tricky to implement events. I wouldn't say that it's not possible but it's not very reliable. I'm also working with .NET Remoting right now and the best solution is when you usa a thread timer and poll the data every 10 seconds..

The other solution would be to write a process plugin for MediaPortal., because I think that there might be no advantage for you when you use the external contral plugin. The advantage is that you could get the data in a network or maybe also when MP is not running (but this doesn't work yet) and that you would get further informations outside from MP.
But let's wait what Sam has to tell us.
 

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
Matter of fact, I just did some brief research on events in .NET remoting, and it doesn't seem that hard after all... I can't guarantee that I can do it, but I'll definitely try. Here's an article I found on it: http://www.c-sharpcorner.com/Code/2003/Nov/RemotingEvents.asp

But you can of course, keep polling the plugin if you like.

I will expose the whole GUIPropertyManager component - you can access the properties and edit them provided you know the tag (e.g. #currentmodule).

STSC - I'll have a look at your problem this weekend.

DanHarvey:
upnp communication is via HTTP, so in that sense its like a web server. However, with .NET its easy to open a port and use it for communication (without all the web server stuff, e.g. authentication, server farming, configuration etc.). So it doesn't require a web server like IIS or apache.

I'll expose my plugin as a web service later, but if you're going to be using a .NET language, I suggest communicating with the plugin via .NET remoting rather than web services. This way, it eliminates the middle-man (web service).

Sam
 

Users who are viewing this thread

Top Bottom