Page 5 of 5

Re: Simple Lyrics Viewer

Posted: Fri Feb 27, 2009 5:34 am
by pranjal
are lyrics displayed for any song?and if yes how can i see them :( :x

Re: Simple Lyrics Viewer

Posted: Sun Jul 28, 2013 11:23 am
by Guest
Begges wrote:Hi Monkey out there,

when i have added all lyrics from Evillyrics with my Eviltagger-script, i was searching for a script, that shows these lyrics from the ID3v2 tag
the info panel was a bit too much for me, as i can see album art and song infos straight in MM.
I was just missing a lyrics panel, as the one with the covers.

And here it is :-)
Please check and submit errors

Code: Select all


' a simple Show lyrics script
'just adds a docking panle with lyrics inside
'
'thanks to all forum members for their code snippets!!!!
'
'
'here are the ini-Lines
'
' [ShowLyrics]
' FileName=ShowLyrics.vbs
' ProcName=ShowLyrics
' Order=17
' DisplayName=Show  InsideLyrics (id3V2)
' Description=Shows InsideLyrics (id3V2)
' Language=VBScript
' ScriptType=0
'

Dim Tmr, strOldsong
Dim strPath
Dim lyrPanel

Sub Showlyrics
	ExportLyrics
	CreatePanel
	Set Tmr = SDB.CreateTimer(1000)
	Script.RegisterEvent Tmr, "OnTimer", "Update"
End Sub

Sub ExportLyrics
	Dim Song, strLyrics, strHeader
	Dim TmpFile
  	
	'exports the lyrics to a temporary html file
	strPath=sdb.applicationpath
	strPath=strPath & "~~SimpleLyricsTemp.html"
	Set Song = SDB.Player.CurrentSong
	strLyrics = Song.lyrics
	if StrLyrics = "" then StrLyrics ="No id3V2 Lyric Tag found in" & CHR(10) & Song.path
	strOldsong = song.path
	strheader = "<plaintext style=""font-family:Arial,sans-serif; font-size:10px;"">"
	strlyrics = strheader & strlyrics '& "</plaintext>"
	Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
	tmpFile.WriteLine strLyrics
End Sub


Sub CreatePanel
	Dim Form
	
	'creates the panel
	Set Form = SDB.Objects("LyricPanel")
	If Form is Nothing Then
		Set Form = SDB.UI.NewDockablePersistentPanel("LyricPanel")
		Form.DockedTo = 2
		Form.Common.Width = 250
		Form.Caption = "Lyrics"
		Set lyrPanel = SDB.UI.NewActiveX(Form, "Shell.Explorer")
		lyrPanel.Common.Align = 5  
		lyrPanel.Interf.Navigate strpath  ' open the temp-lyric-file
		Form.Common.Visible = True
		SDB.Objects("LyricPanel") = Form    
		SDB.Objects("LyricX") = lyrPanel.Interf
		Script.RegisterEvent Form, "OnClose", "FormClose"
	End If
End Sub

Sub Update(Timer)
	Dim NewSong
	Set NewSong = SDB.Player.CurrentSong
	If strOldsong <> NewSong.path Then
		ExportLyrics	'export new lyrics
		lyrPanel.Interf.Navigate strpath 'open the temp-lyric-file again
	End If

End Sub

Sub FormClose(Node)
	SDB.Objects("LyricPanel") = Nothing
	SDB.Objects("LyricX").Navigate "about:blank"
	SDB.Objects("LyricX") = Nothing
	Script.UnregisterEvents Tmr
End Sub