Simple Lyrics Viewer

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Postby DiddeLeeDoo » Sun Aug 06, 2006 9:19 pm

Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby MeMeMe » Sun Aug 06, 2006 9:50 pm

You may be right!

<slinks away quietly, hoping no-one notices that I actually posted in that thread... :oops: >

:D
MeMeMe
 
Posts: 260
Joined: Fri Dec 23, 2005 11:42 am
Location: In front of my computer

Postby DiddeLeeDoo » Sun Aug 06, 2006 9:57 pm

It's a bit like that here. You almost need your 'Sherlock Holm' hat on at times to find stuff here.. ;)
Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby mynameistajmahal » Mon Aug 14, 2006 2:05 pm

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?
mynameistajmahal
 

Need some help to tweak the code...

Postby MCSmarties » Thu Feb 01, 2007 6:26 pm

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:
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

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!
MCSmarties
 
Posts: 248
Joined: Tue Dec 06, 2005 8:01 pm

Postby trixmoto » Fri Feb 02, 2007 4:37 am

Have you tried "song.OriginalYear"? :)

For allmusic.com, try something like these...

http://allmusic.com/cg/amg.dll?P=amg&x= ... pt1=1&sql=<Artist>
http://allmusic.com/cg/amg.dll?P=amg&x= ... pt1=2&sql=<Album>
http://allmusic.com/cg/amg.dll?P=amg&x= ... pt1=3&sql=<Title>

I don't think you can search for all of them at once though.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Try this...

Postby gege » Fri Feb 02, 2007 10:33 am

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 ;-)

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.
gege
 
Posts: 844
Joined: Tue Sep 05, 2006 2:10 pm
Location: Brazil

Postby MCSmarties » Fri Feb 02, 2007 2:08 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! :oops:

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.
MCSmarties
 
Posts: 248
Joined: Tue Dec 06, 2005 8:01 pm

Got a working version

Postby MCSmarties » Tue Feb 06, 2007 12:39 am

OK guys, I managed to get something to work.
Don't be too hard on me, I'm a newbie in coding! :o

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

with this:
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

I also modified the lyrics_panel.css file to:
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}

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!
MCSmarties
 
Posts: 248
Joined: Tue Dec 06, 2005 8:01 pm

Here we go...

Postby gege » Tue Feb 06, 2007 7:26 am

1. Try 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

Again, I did not test it!


2. Just add the following line to the end of the CSS file:

Code: Select all
a, a:hover{text-decoration:none}


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 ;-)
gege
 
Posts: 844
Joined: Tue Sep 05, 2006 2:10 pm
Location: Brazil

I see the light!

Postby MCSmarties » Tue Feb 06, 2007 11:35 am

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... :P
MCSmarties
 
Posts: 248
Joined: Tue Dec 06, 2005 8:01 pm

Postby mjs93 » Thu Feb 22, 2007 10:36 pm

I have just gotten around to using this script. Works great, many thanks. :)
mjs93
 
Posts: 158
Joined: Fri Jun 17, 2005 3:28 am

Postby DickDiver » Thu Feb 07, 2008 5:18 am

for I am total new to this could you please post the whole working code?

MM3 appreciated

I am using evillyrics.

thanks
Joe Dell Dell
DickDiver
 
Posts: 50
Joined: Wed Feb 16, 2005 11:53 am

Postby gege » Thu Feb 07, 2008 7:39 am

Use my Lyrics and Comment Viewer. Link in my signature.
gege
 
Posts: 844
Joined: Tue Sep 05, 2006 2:10 pm
Location: Brazil

Re: Simple Lyrics Viewer

Postby julian1 » Mon Sep 01, 2008 11:43 pm

I have successfully installed the lyrics panel. However, how to make it view chinese characters? thx
julian1
 

PreviousNext

Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 16 guests