| |||||||
| Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here. |
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Portal Member Join Date: May 2006 Location: Williamsburg,VA
Posts: 49
Thanks: 0
Thanked 1 Time in 1 Post
| Ok, this is probably a stupid question but I did search and couldn't find an answer. Is there a sample for developing a plugin in VB.net, is it even possible to do this? I sure would appreciate to push in the right direction.... Thanks, Richard |
| | |
| | #2 (permalink) |
| Portal Member Join Date: Jun 2005 Location: Norway
Posts: 199
Thanks: 1
Thanked 0 Times in 0 Posts
| I am pretty shure you can use any .net langue, but there is just a developing guide for c# that I know of. http://www.team-mediaportal.com/arti..._a_plugin.html pherhaps this plugin could be useful? http://forum.team-mediaportal.com/viewtopic.php?t=9749
__________________ htpc- all in one. |
| | |
| | #3 (permalink) |
| Portal Member Join Date: May 2006 Location: Williamsburg,VA
Posts: 49
Thanks: 0
Thanked 1 Time in 1 Post
| Thanks, got another question that I'm sure has already been answered. But I'm gonna ask it anyways ![]() Do I have to compile Mediaportal in order to write a plugin for it or can I just use the current release and reference it that way? Thanks Richard |
| | |
| | #4 (permalink) | |
| Portal Developer Join Date: Jan 2005 Age: 30
Posts: 3,451
Thanks: 90
Thanked 114 Times in 92 Posts
| Quote:
__________________ http://day2.no-ip.org/ "Commy64 - The problem there is that Oprah was on. MP tried to save you by blanking the screen" | |
| | |
| | #6 (permalink) |
| Portal Member Join Date: May 2006 Location: Williamsburg,VA
Posts: 49
Thanks: 0
Thanked 1 Time in 1 Post
| I started working on converting the sample as well this morning. Hopefully I'll get to finish that part up when I get home tonight. Considering I'm a vb6 kind of guy I'm sure I'll end up with some more questions along the way. Thanks for the help so far, I really do appreciate it. |
| | |
| | #7 (permalink) |
| Portal Member Join Date: May 2006 Location: Williamsburg,VA
Posts: 49
Thanks: 0
Thanked 1 Time in 1 Post
| I've tried my best at converting the sample to vb.net. I'm no longer receiving any error messages, however the plugin still doesn't show up in MediaPortal. Can someone give me a clue as what is wrong with the following code? Thanks, Richard Code: Public Class Class1
Inherits MediaPortal.GUI.Library.GUIWindow
Implements MediaPortal.GUI.Library.ISetupForm
Public Function PluginName() As String Implements MediaPortal.GUI.Library.ISetupForm.PluginName
Return "MyFirstPlugin"
End Function
Public Function Description() As String Implements MediaPortal.GUI.Library.ISetupForm.Description
Return "My First plugin tutorial"
End Function
Public Function Author() As String Implements MediaPortal.GUI.Library.ISetupForm.Author
Return "Frodo"
End Function
Public Sub ShowPlugin() Implements MediaPortal.GUI.Library.ISetupForm.ShowPlugin
MsgBox("Nothing to configure, this is just an example")
End Sub
Public Function CanEnable() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.CanEnable
Return True
End Function
Public Function GetWindowId() As Integer Implements MediaPortal.GUI.Library.ISetupForm.GetWindowId
Return 5678
End Function
Public Function DefaultEnabled() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.DefaultEnabled
Return True
End Function
Public Function HasSetup() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.HasSetup
Return True
End Function
Public Function GetHome(ByRef strButtonText As String, ByRef strButtonImage As String, ByRef strButtonImageFocus As String, ByRef strPictureImage As String) As Boolean Implements MediaPortal.GUI.Library.ISetupForm.GetHome
strButtonText = String.Empty
strButtonImage = String.Empty
strButtonImageFocus = String.Empty
strPictureImage = String.Empty
Return False
End Function
End Class
|
| | |
| | #8 (permalink) |
| Portal Member Join Date: Aug 2004 Location: Melbourne, Australia
Posts: 773
Thanks: 0
Thanked 0 Times in 0 Posts
| Also implement MediaPortal.GUI.Library.IShowPlugin. You also need these methods: Code: Public Overrides Function Init() As Boolean
Return Load(MediaPortal.GUI.Library.GUIGraphicsContext.Skin & "\<filename of skin xml file>")
End Function
Public Overrides Sub OnAction(ByVal action As MediaPortal.GUI.Library.Action)
If action.wID = MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU Then
MediaPortal.GUI.Library.GUIWindowManager.ActivateWindow(MediaPortal.GUI.Library.GUIWindow.Window.WINDOW_HOME)
Exit Sub
End If
MyBase.OnAction(action)
End Sub
Public Overrides Function OnMessage(ByVal message As MediaPortal.GUI.Library.GUIMessage) As Boolean
Select Case message.Message
Case MediaPortal.GUI.Library.GUIMessage.MessageType.GUI_MSG_WINDOW_INIT
'load any settings here and anything else that needs to be done when screen is shown
MyBase.OnMessage(message)
Case MediaPortal.GUI.Library.GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT
'save any settings here
Case MediaPortal.GUI.Library.GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED
'this is triggered when focus has changed on screen, use message.SenderControlId to find out which control
Case MediaPortal.GUI.Library.GUIMessage.MessageType.GUI_MSG_CLICKED
'this is triggered when a control on screen has been clicked, use message.SenderControlId to find out which control
Case Else
Return MyBase.OnMessage(message)
End Select
End Function
Sam |
| | |
| | #10 (permalink) |
| Portal Member Join Date: May 2006 Location: Williamsburg,VA
Posts: 49
Thanks: 0
Thanked 1 Time in 1 Post
| That worked like a champ, thanks! And just to make this thread complete so maybe someone else who is looking for this can find it a little easier, here's the complete sample class for vb.net: Code: Public Class MediaPortalInterface
Inherits MediaPortal.GUI.Library.GUIWindow
Implements MediaPortal.GUI.Library.ISetupForm
Public Function PluginName() As String _
Implements MediaPortal.GUI.Library.ISetupForm.PluginName
Return "myFirstPlugin"
End Function
Public Function Description() As String _
Implements MediaPortal.GUI.Library.ISetupForm.Description
Return "VB.net Sample Code"
End Function
Public Function Author() As String _
Implements MediaPortal.GUI.Library.ISetupForm.Author
Return "SampleCoder"
End Function
Public Sub ShowPlugin() _
Implements MediaPortal.GUI.Library.ISetupForm.ShowPlugin
msgbox "Nothing to configure."
End Sub
Public Function CanEnable() As Boolean _
Implements MediaPortal.GUI.Library.ISetupForm.CanEnable
Return True
End Function
Public Function GetWindowId() As Integer _
Implements MediaPortal.GUI.Library.ISetupForm.GetWindowId
Return 5678
End Function
Public Overrides Property GetID() As Integer
Get
Return GetWindowId()
End Get
Set(ByVal value As Integer)
End Set
End Property
Public Function DefaultEnabled() As Boolean _
Implements MediaPortal.GUI.Library.ISetupForm.DefaultEnabled
Return True
End Function
Public Function HasSetup() As Boolean _
Implements MediaPortal.GUI.Library.ISetupForm.HasSetup
Return True
End Function
Public Function GetHome(ByRef strButtonText As String, _
ByRef strButtonImage As String, _
ByRef strButtonImageFocus As String, _
ByRef strPictureImage As String) As Boolean _
Implements MediaPortal.GUI.Library.ISetupForm.GetHome
strButtonText = String.Empty
strButtonImage = String.Empty
strButtonImageFocus = String.Empty
strPictureImage = String.Empty
Return False
End Function
Public Overrides Function Init() As Boolean
Return Load(MediaPortal.GUI.Library.GUIGraphicsContext.Skin & _
"\<filename>")
End Function
Public Overrides Sub OnAction(ByVal action As MediaPortal.GUI.Library.Action)
If action.wID = _
MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU Then
MediaPortal.GUI.Library.GUIWindowManager.ActivateWindow( _
MediaPortal.GUI.Library.GUIWindow.Window.WINDOW_HOME)
Exit Sub
End If
MyBase.OnAction(action)
End Sub
Public Overrides Function OnMessage( _
ByVal message As MediaPortal.GUI.Library.GUIMessage) As Boolean
Select Case message.Message
Case MediaPortal.GUI.Library.GUIMessage.MessageType.GUI_MSG_WINDOW_INIT
'load any settings here and anything else
'that needs to be done when screen is shown
MyBase.OnMessage(message)
Case MediaPortal.GUI.Library.GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT
'save any settings here
Case MediaPortal.GUI.Library.GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED
'this is triggered when focus has changed on screen,
'use message.SenderControlId to find out which control
Case MediaPortal.GUI.Library.GUIMessage.MessageType.GUI_MSG_CLICKED
'this is triggered when a control on screen has been clicked,
'use message.SenderControlId to find out which control
Case Else
Return MyBase.OnMessage(message)
End Select
End Function
End Class
|
| | |
![]() |
| Bookmarks |
| Tags |
| vbnet |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to start writing your own plugin part 1 available | frodo | Plugins | 61 | 2008-05-01 22:38 |
| VB.NET Plugin Writing Tutorial | samuel337 | Plugins | 6 | 2008-04-30 22:23 |
| VB.Net PlugIn | shrek | Plugins | 2 | 2005-11-09 00:30 |
| Plugin for Napster with SOAP | Anonymous | Plugins | 6 | 2004-11-04 15:18 |
| NON-GUI plugin problem in MediaPortal interface - VB.NET | Anonymous | Plugins | 3 | 2004-10-28 13:29 |