Here's a little more detail.
First a live screenshot

The video is actually video in both places (though it's a little unnerving because it's impossible to get them exactly synced up so it sounds like an echo

The white window toward the bottom is an addin controlled window. There's a label that just shows info on the current game, game list, etc.
then the video (shrunk down, but easily resizable). and finally the game snapshot (almost completely hidden, but that's the point with this little test).
Obviously, it's not much, but it also requires only this much code, literally.
''' <summary>
''' Handle the MalaGameSelected event
''' </summary>
''' <param name="EventGame"></param>
''' <remarks></remarks>
Private Sub CustomMalaPlugin_MaLaGameSelected(ByVal EventGame As MaLaEventGame) Handles Me.MaLaGameSelected
Try
If _MessageWindow Is Nothing Then
_MessageWindow = New MyMessageWindow
_MessageWindow.AlignToMaLaWindow(BuiltInMalaWindows.Custom1)
_MessageWindow.Visible = True
End If
Dim c = Me.Mala.Settings.String("Mame", "Snaps")
Dim d = Me.Mala.Settings.Mame.ControlsFile.Value
_MessageWindow.Caption = d & "=" & Me.Mala.CurrentGameList.Name & "=" & EventGame.Description & "=" & c
_MessageWindow.picImage.Image = EventGame.MameDefinableImage1
Dim snappath = System.IO.Path.Combine(Me.Mala.Settings.Mame.Snaps.Value, EventGame.Rom)
Dim cppath = System.IO.Path.Combine(Me.Mala.Settings.Mame.CPanel.Value, EventGame.Rom)
Dim marqueepath = System.IO.Path.Combine(Me.Mala.Settings.Mame.Marquee.Value, EventGame.Rom)
Try
With _MessageWindow.MediaPlayer
'---- stop playing anything that's playing
.Ctlcontrols.stop()
.settings.autoStart = False
.settings.enableErrorDialogs = False
.enableContextMenu = False
.uiMode = "none"
.URL = EventGame.VideoFile
If Len(.URL) > 0 Then
.Ctlcontrols.play()
End If
End With
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Catch ex As Exception
MsgBox("Exception:" & ex.ToString)
End Try
End Sub
And you don't necessarily need the Exception stuff. It just helps with debugging right now.
The MyMessageWindow class is a user control that inherits from a control in the master plugin. It's virtually empty.
Imports Mala4Net
Public Class MyMessageWindow
Inherits MalaWindow
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
End Sub
Public Property Caption() As String
Get
Return lblCaption.Text
End Get
Set(ByVal value As String)
lblCaption.Text = value
End Set
End Property
Private Sub MediaPlayer_EndOfStream(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_EndOfStreamEvent) Handles MediaPlayer.EndOfStream
'---- automatically restart playing
MediaPlayer.Ctlcontrols.play()
End Sub
End Class
It may not be obvious from the code snippet, but there's no lowlevel api stuff exposed anywhere. You create whatever windows you need, inheriting from a base class, move them whereever you want (or align them to fit over an existing Mala window, that way you can leverage the already existing layout), and put whatever you need in them.
Of course, this is all done in code right now, but the idea is to have an application object framework exposing as much of Mala as I can expose, easily accessible to .net code. Notice how you can retrieve (and alter) settings via early bound properties (they mirror the Mala INI files for simplicity, though I'm altering the object layout a little to make things a little more intuitive):
debug.print Me.Mala.Settings.Mame.Snaps.Value
Once that's in place, stuff like laying flash movies down, swapping images, etc should be much easier to do.
The biggest shortcoming of it all is that since most of the Mala UI is owner drawn directly on the mala window, I can't really layer anything "under" any of the content that Mala draws. At least, not yet. Maybe if there was a "BeforeDraw" event or something

But since this is a big Object Framework type project, documentation is a must, so now I'm off to continue figuring out how to get Sandcastle to automatically document everything for me
