3
« on: February 10, 2021, 06:25:18 PM »
Steve,
Thanks for your support. Your suggestions got my plug-in working properly.
In summary, for Forum Readers, my goal was to create a window that displays the current playing track name.
This window will get merged with a Zoom channel using OBS to automatically display the current track on our Zoom channel.
In the Visual Basic Source Plug-in 3.1, I created Form1 and added a TextBox1
At the top of the TestVbDll.vb file I declared oForm
Dim oForm As Form1
In the Initialise Function I added code to create the form in the MusicBee GUI thread:
Dim MBptr As IntPtr
MBptr = mbApiInterface.MB_GetWindowHandle()
Dim f As Form = DirectCast(Form.FromHandle(MBptr), Form)
f.Invoke(
Sub()
' this code runs in the GUI thread
f.Show()
oForm = New Form1()
oForm.Show()
End Sub
)
and in the TrackChanged Notification I added code to write the current track to the text box
Dim tracktitle As String = mbApiInterface.NowPlaying_GetFileTag(MetaDataType.TrackTitle)
oForm.TextBox1.Text = tracktitle