Simple Lyrics Viewer
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
do you think it would be possible to have the lyrics window appear only when there are lyrics in the tag? So instead of having a window that wastes space and says No Lyrics for some songs, there would be no window at all for those songs. And then, when there are songs playing with lyrics, the window can pop up all docked and nice on the side and wow all my friends!
is that possible?
is that possible?
-
- Posts: 251
- Joined: Tue Dec 06, 2005 8:01 pm
Need some help to tweak the code...
I love Begges' lyrics panel and have been using it ever since I found it.
I also tried to tweak it a little. My version reformatted a bit the title display and also shows the song year:
<Album>
<Artist>
<Song Title> (<Year>)
Relevant code modified:
I would like to modify it a bit more extensively, but I'm reaching the end of my (very limited) coding skills!
Can someone help me?
I would like to add the ORIGINAL YEAR (if it exists), like this:
<Album> (<Year>)
<Artist>
<Song Title> (<Original Year>)
Another neat feature would be to include links to allmusic.com.
What I have in mind is to search allmusic.com for <Album>, <Artist> and <Title> whenever these lines are clicked.
Is this possible?
Thanks!
I also tried to tweak it a little. My version reformatted a bit the title display and also shows the song year:
<Album>
<Artist>
<Song Title> (<Year>)
Relevant code modified:
Code: Select all
strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
strSongTitle = "<h3>" & song.Title & " (" & song.Year & ")" & "</h3>"
strArtistName = "<h2>" & song.ArtistName & "</h2>"
strAlbumName = "<h1>" & song.AlbumName & "</h1>"
strHeaderEnd = "<plaintext>"
strCompleteLyrics = strHeaderBegin & strAlbumName & strArtistName & strSongTitle & strHeaderEnd & strLyrics
Can someone help me?
I would like to add the ORIGINAL YEAR (if it exists), like this:
<Album> (<Year>)
<Artist>
<Song Title> (<Original Year>)
Another neat feature would be to include links to allmusic.com.
What I have in mind is to search allmusic.com for <Album>, <Artist> and <Title> whenever these lines are clicked.
Is this possible?
Thanks!
Have you tried "song.OriginalYear"? 
For allmusic.com, try something like these...
http://allmusic.com/cg/amg.dll?P=amg&x= ... ql=<Artist>
http://allmusic.com/cg/amg.dll?P=amg&x= ... sql=<Album>
http://allmusic.com/cg/amg.dll?P=amg&x= ... sql=<Title>
I don't think you can search for all of them at once though.

For allmusic.com, try something like these...
http://allmusic.com/cg/amg.dll?P=amg&x= ... ql=<Artist>
http://allmusic.com/cg/amg.dll?P=amg&x= ... sql=<Album>
http://allmusic.com/cg/amg.dll?P=amg&x= ... sql=<Title>
I don't think you can search for all of them at once though.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Try this...
I did not test it but I think the code below may work for the (year) thing...
As always, use it at your own risk
As always, use it at your own risk

Code: Select all
Sub ExportLyrics
DIM origYear, albumYear
....
If song.Year>0 Then
albumYear= " (" & song.Year & ") "
else albumYear= ""
If song.OriginalYear>0 Then
origYear= " (" & song.OriginalYear & ")"
else origYear= ""
strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
strSongTitle = "<h3>" & song.Title & origYear & "</h3>"
strArtistName = "<h2>" & song.ArtistName & "</h2>"
strAlbumName = "<h1>" & song.AlbumName & albumYear & "</h1>"
strHeaderEnd = "<plaintext>"
strCompleteLyrics = strHeaderBegin & strAlbumName & strArtistName & strSongTitle & strHeaderEnd & strLyrics
....
End Sub
Last edited by gege on Mon Feb 05, 2007 5:48 am, edited 1 time in total.
-
- Posts: 251
- Joined: Tue Dec 06, 2005 8:01 pm
Duh...! Of course I would have to define a variable to assign to song.OriginalYear first... so that's why it didn't work!
Thanks for the input guys, will play around with this over the weekend.
Now I need to find out how to add a HTML link but I think I can figure it out.
If I can get something to work, I'll post it here.

Thanks for the input guys, will play around with this over the weekend.
Now I need to find out how to add a HTML link but I think I can figure it out.
If I can get something to work, I'll post it here.
-
- Posts: 251
- Joined: Tue Dec 06, 2005 8:01 pm
Got a working version
OK guys, I managed to get something to work.
Don't be too hard on me, I'm a newbie in coding!
I replaced this part:
with this:
I also modified the lyrics_panel.css file to:
Like I said, this seems to be working for me but I'm not 100% happy.
Could somebody help me with the following questions?
1. How can I concatenate the functions FndArtist, FndAlbum and FndTitle into one? They're practically identical!
2. Is there a way to prevent the links from being underlined? Just nitpicking aesthetics...
3. This code opens a IE window even though I have Firefox installed and configured as my default internet browser. Can I make these links open in Firefox (or is there even a way to show that content within the lyrics panel?)
Thanks!
Don't be too hard on me, I'm a newbie in coding!

I replaced this part:
Code: Select all
strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
strSongTitle = "<h1>" & song.Title & "</h1>"
strArtistName = "<h2>" & song.ArtistName & "</h2>"
strHeaderEnd = "<plaintext>"
strCompleteLyrics = strHeaderBegin & strSongTitle & strArtistName & strHeaderEnd & strLyrics
Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
tmpFile.WriteLine strCompleteLyrics
End Sub
Code: Select all
Dim origYear, albumYear
If song.Year>0 Then
albumYear= " (" & song.Year & ") "
Else
albumYear= ""
End If
If song.OriginalYear>0 Then
origYear= " (" & song.OriginalYear & ")"
Else
origYear= albumYear
End If
strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
strSongTitle = "<h3>" & song.Title & origYear & "</h3>"
strSongTitle="<a target=""_New"" href="""& FndTitle(song.Title) &""">"& strSongTitle &"</a>"
strArtistName = "<h2>" & song.ArtistName & "</h2>"
strArtistName="<a target=""_New"" href="""& FndArtist(song.ArtistName) &""">"& strArtistName &"</a>"
strAlbumName = "<h1>" & song.AlbumName & albumYear & "</h1>"
strAlbumName="<a target=""_New"" href="""& FndAlbum(song.AlbumName) &""">"& strAlbumName &"</a>"
strHeaderEnd = "<plaintext>"
strCompleteLyrics = strHeaderBegin & strAlbumName & strArtistName & strSongTitle & strHeaderEnd & strLyrics
Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
tmpFile.WriteLine strCompleteLyrics
End Sub
Function FndArtist(cString)
FndArtist="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=1&sql="&cString&"&btnG"
End Function
Function FndAlbum(cString)
FndAlbum="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=2&sql="&cString&"&btnG"
End Function
Function FndTitle(cString)
FndTitle="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=3&sql="&cString&"&btnG"
End Function
Code: Select all
body{font:8pt Verdana, Arial, sans serif;margin:0;padding:17px 14px;background:#bed7f4 url('lyrics_panel_bg.gif') no-repeat}
plaintext{font:8pt Verdana, Arial, sans serif;margin:0;padding:15px 5px}
h1{margin:5px;clear:both;font-size:150%;font-style:italic;color:#222}
h2{margin:5px;clear:both;font-size:130%;font-weight:normal;color:#222;padding:0 0 12px 0}
h3{margin:5px;clear:both;font-size:180%;font-weight:bolder;color:#222}
Could somebody help me with the following questions?
1. How can I concatenate the functions FndArtist, FndAlbum and FndTitle into one? They're practically identical!
2. Is there a way to prevent the links from being underlined? Just nitpicking aesthetics...
3. This code opens a IE window even though I have Firefox installed and configured as my default internet browser. Can I make these links open in Firefox (or is there even a way to show that content within the lyrics panel?)
Thanks!
Here we go...
1. Try this:
Again, I did not test it!
2. Just add the following line to the end of the CSS file:
3. a) To force links to open in Firefox, install the FirefoxView extension in Firefox. It adds a "View this page in Firefox" option in IE context menu. This way you can right click the link and choose that option.
b) To open a link in the panel itself, without opening a new window, replace "<a target=""_New" by "<a target=""_self" in link's code.
Oh... And I want the complete code when you finish this
Code: Select all
strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
strSongTitle = "<h3>" & song.Title & origYear & "</h3>"
strSongTitle="<a target=""_New"" href="""& FndInfo("3",song.Title) &""">"& strSongTitle &"</a>"
strArtistName = "<h2>" & song.ArtistName & "</h2>"
strArtistName="<a target=""_New"" href="""& FndInfo("1",song.ArtistName) &""">"& strArtistName &"</a>"
strAlbumName = "<h1>" & song.AlbumName & albumYear & "</h1>"
strAlbumName="<a target=""_New"" href="""& FndInfo("2",song.AlbumName) &""">"& strAlbumName &"</a>"
strHeaderEnd = "<plaintext>"
strCompleteLyrics = strHeaderBegin & strAlbumName & strArtistName & strSongTitle & strHeaderEnd & strLyrics
Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
tmpFile.WriteLine strCompleteLyrics
End Sub
Function FndInfo(infoType,cString)
FndInfo="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=" & infoType & "&sql=" & cString & "&btnG"
End Function
2. Just add the following line to the end of the CSS file:
Code: Select all
a, a:hover{text-decoration:none}
b) To open a link in the panel itself, without opening a new window, replace "<a target=""_New" by "<a target=""_self" in link's code.
Oh... And I want the complete code when you finish this

-
- Posts: 251
- Joined: Tue Dec 06, 2005 8:01 pm
I see the light!
Thanks Gege. Will wrap this up tonight.
And sure I'll post the "complete" code!
What between Begges 95%, your 3% and the 2% I figured out using one of DiddeLeeDoo's scripts as template, my own contribution is tending to nil...
And sure I'll post the "complete" code!
What between Begges 95%, your 3% and the 2% I figured out using one of DiddeLeeDoo's scripts as template, my own contribution is tending to nil...

Re: Simple Lyrics Viewer
I have successfully installed the lyrics panel. However, how to make it view chinese characters? thx