#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#AdditionalJar: c:/temp/jaudiotagger-2.2.6-SNAPSHOT.jar ' where I put the jar file
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim audioFile As JavaObject
Dim audioHeader As JavaObject
Dim audioTags As JavaObject
Dim fi As JavaObject
Dim audioTaggerFileIO As JavaObject
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
' get instance of AudioFileIO so we can read the file
audioTaggerFileIO.InitializeNewInstance("org.jaudiotagger.audio.AudioFileIO",Null)
' file to read must be a java.io.File just pass full path to it
fi.InitializeNewInstance("java.io.File",Array("Z:/Plex/Shared Music/4 Non-Blondes - What's Going On.mp3"))
' read the file and store reference to it in audioFile
' audioFile will assume the correct class by the read as it's a javaobject
audioFile = audioTaggerFileIO.RunMethod("read",Array(fi))
' read the headers from audioFile and put into audioHeaders
' again audioHeaders will assume the correct class as it's a java object
audioHeader = audioFile.RunMethod("getAudioHeader",Null)
' log the headers to see what we have
Log(audioHeader)
' read the tags from the audioFile
audioTags = audioFile.RunMethod("getTag",Null)
' log them to see what we got
Log(audioTags)
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub