home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
[ VB .Net Event Handeling ]
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="DJBlu" data-source="post: 672249" data-attributes="member: 54957"><p>[CODE]Imports System</p><p>Imports System.Windows.Forms</p><p>Imports MediaPortal.GUI.Library</p><p>Imports MediaPortal.Dialogs</p><p></p><p>Public Class Plugin</p><p> Implements IPlugin</p><p> Implements ISetupForm</p><p></p><p> Public Sub Start() Implements IPlugin.Start</p><p> Log.Info("Started and Added Handler")</p><p> AddHandler MediaPortal.Player.g_Player.PlayBackChanged, AddressOf PlayBackChanged</p><p> End Sub</p><p> Public Sub PlayBackChanged(ByVal type As MediaPortal.Player.g_Player.MediaType, ByVal stoptime As Integer, ByVal filename As String)</p><p> Dim dlg As GUIDialogOK = GUIWindowManager.GetWindow(GUIWindow.Window.WINDOW_DIALOG_OK)</p><p> dlg.SetHeading("Window Title")</p><p> dlg.SetLine(1, "Last Song was")</p><p> dlg.SetLine(2, filename)</p><p> dlg.DoModal(GUIWindowManager.ActiveWindow)</p><p> End Sub</p><p> Public Sub [Stop]() Implements IPlugin.Stop</p><p> RemoveHandler MediaPortal.Player.g_Player.PlayBackChanged, AddressOf PlayBackChanged</p><p> Log.Debug("Removed Handler")</p><p></p><p> End Sub</p><p></p><p> Public Function Author() As String Implements MediaPortal.GUI.Library.ISetupForm.Author</p><p> Return "Your_Name"</p><p> End Function</p><p></p><p> Public Function CanEnable() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.CanEnable</p><p> Return True</p><p> End Function</p><p></p><p> Public Function DefaultEnabled() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.DefaultEnabled</p><p> Return True</p><p> End Function</p><p></p><p> Public Function Description() As String Implements MediaPortal.GUI.Library.ISetupForm.Description</p><p> Return "Description"</p><p> End Function</p><p></p><p> 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</p><p></p><p> End Function</p><p></p><p> Public Function GetWindowId() As Integer Implements MediaPortal.GUI.Library.ISetupForm.GetWindowId</p><p> Return 1000000</p><p> End Function</p><p></p><p> Public Function HasSetup() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.HasSetup</p><p> Return False</p><p> End Function</p><p></p><p> Public Function PluginName() As String Implements MediaPortal.GUI.Library.ISetupForm.PluginName</p><p> Return "Test"</p><p> End Function</p><p></p><p> Public Sub ShowPlugin() Implements MediaPortal.GUI.Library.ISetupForm.ShowPlugin</p><p></p><p> End Sub</p><p>End Class[/CODE]</p><p></p><p>This works. I have just tested it.</p><p></p><p>Make sure you put your plugin in the process folder.</p></blockquote><p></p>
[QUOTE="DJBlu, post: 672249, member: 54957"] [CODE]Imports System Imports System.Windows.Forms Imports MediaPortal.GUI.Library Imports MediaPortal.Dialogs Public Class Plugin Implements IPlugin Implements ISetupForm Public Sub Start() Implements IPlugin.Start Log.Info("Started and Added Handler") AddHandler MediaPortal.Player.g_Player.PlayBackChanged, AddressOf PlayBackChanged End Sub Public Sub PlayBackChanged(ByVal type As MediaPortal.Player.g_Player.MediaType, ByVal stoptime As Integer, ByVal filename As String) Dim dlg As GUIDialogOK = GUIWindowManager.GetWindow(GUIWindow.Window.WINDOW_DIALOG_OK) dlg.SetHeading("Window Title") dlg.SetLine(1, "Last Song was") dlg.SetLine(2, filename) dlg.DoModal(GUIWindowManager.ActiveWindow) End Sub Public Sub [Stop]() Implements IPlugin.Stop RemoveHandler MediaPortal.Player.g_Player.PlayBackChanged, AddressOf PlayBackChanged Log.Debug("Removed Handler") End Sub Public Function Author() As String Implements MediaPortal.GUI.Library.ISetupForm.Author Return "Your_Name" End Function Public Function CanEnable() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.CanEnable Return True End Function Public Function DefaultEnabled() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.DefaultEnabled Return True End Function Public Function Description() As String Implements MediaPortal.GUI.Library.ISetupForm.Description Return "Description" 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 End Function Public Function GetWindowId() As Integer Implements MediaPortal.GUI.Library.ISetupForm.GetWindowId Return 1000000 End Function Public Function HasSetup() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.HasSetup Return False End Function Public Function PluginName() As String Implements MediaPortal.GUI.Library.ISetupForm.PluginName Return "Test" End Function Public Sub ShowPlugin() Implements MediaPortal.GUI.Library.ISetupForm.ShowPlugin End Sub End Class[/CODE] This works. I have just tested it. Make sure you put your plugin in the process folder. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
[ VB .Net Event Handeling ]
Contact us
RSS
Top
Bottom