- MP3 v2 tag info for One Web MP3 Server
Back  - Source Code:      See code as in source: Open the Popup Window

<%@ Language=VBScript%>
<%Option Explicit%>
<html>
<head>
<!-- Next line: One Web include-file, do not remove this include! (remove this comment!) //-->
<!--#include file="siteutils.inc"-->
<script language="JavaScript">
// POPUP SCREEN SIZE & KEEP WINDOW ON TOP:
// SCREEN: Set width and hight to fit your needs:
// remove script if not needed! (remove this comment!) 

var width = 600
var hight = 500
var timer = '';
top.resizeTo(width,hight);
var x = (screen.width - width) / 2;
var y = (screen.height - hight) / 2;
window.moveTo(y,x);
// KEEP POPUP ON TOP:
// blurred() and focused() called from <body onstart >
// remove from body tag and delete script if not needed!
// (remove this comment!)

function blurred() {
timer = setTimeout('self.focus()',100);
}
function focused() {
if (timer != '')
clearTimeout(timer);
}
</script>
<!--
------- REMOVE THIS COMMENT BLOCK (and other comments for smaller file!) ------- (Start)

INSTALL:

Copy the 3ntID3Plus.ocx file to a permanent folder (ex system32) and register it:
Regsvr32.exe 3ntID3Plus.ocx

Rename the original fileinfo.asp to something like fileinfo-original.asp
Copy this file to replace the original fileinfo.asp


POPUP THIS FILE WITHOUT MENUS (Change code in main.asp):

This change is not needed! Only do it if you want the popup to be without menus!

You can show the fileinfo.asp file in a popup without menus if you replace the code at about line 289 of original main.asp file.
Original code in main.asp:

(In download file the char  % is changed to # in the code! Change it back to do search and replace! ):

<td nowrap class="PlayList"> <a onMouseOver="window.status='Get ID3 info from <%=Replace(strDisplayFileName, "'", "\'")%>';return true" onMouseOut="window.status='';return true" href="fileinfo.asp?TargetFile=<%=Server.URLEncode(strThisSubFolder & "\" & objFile.Name)%>" target="_blank">I</a>

Change this code to:
(In download file the char  % is changed to # in the code! Change it back to do search and replace! ):

<%strPopup1 = "fileinfo.asp?TargetFile="
strPopup1 = strpopup1 & Server.URLEncode(strThisSubFolder & "\" & objFile.Name)%>�
<a href="javascript:void(0)" onclick="popUp1('<%=strpopup1%>');">I</a>%>


At top of the main.asp file after the - include file="siteutils.inc" - line put the following code:

<SCRIPT LANGUAGE="JavaScript">
function popUp1(URL) {
day = new Date();
id = day.getTime();
eval("popup" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=400,left = 287,top = 364');");
}
</script>
 

This script (or any window popup script named popUp1) could also be put into the siteutils.inc file.
Set resizable=1 to allow for people using large fonts!

Find the line in main.asp starting with Dim strFolderPath and change it to:

 Dim strFolderPath, strPopup1

I guess this is all changes needed - mail me if errors after doing all changes above! 

------- REMOVE THIS COMMENT BLOCK ------- (End)
//-->

<%'GENRE FINDER
Function GetGenre(strGenreID)
Dim strGenre
' If problems with too many unbehaved MP3 files, remove the ' from the next line!
'ON ERROR RESUME NEXT

strGenre = "N/A" ' For invalid (>0) Genre codes
Select Case strGenreID
Case 0 : strGenre = "Blues"
Case 1 : strGenre = "Classic Rock"
Case 2 : strGenre = "Country"
Case 3 : strGenre = "Dance"
Case 4 : strGenre = "Disco"
Case 5 : strGenre = "Funk"
Case 6 : strGenre = "Grunge"
Case 7 : strGenre = "Hip-Hop"
Case 8 : strGenre = "Jazz"
Case 9 : strGenre = "Metal"
Case 10 : strGenre = "New Age"
Case 11 : strGenre = "Oldies"
Case 12 : strGenre = "Other"
Case 13 : strGenre = "Pop"
Case 14 : strGenre = "R&B"
Case 15 : strGenre = "Rap"
Case 16 : strGenre = "Reggae"
Case 17 : strGenre = "Rock"
Case 18 : strGenre = "Techno"
Case 19 : strGenre = "Industrial"
Case 20 : strGenre = "Alternative"
Case 21 : strGenre = "Ska"
Case 22 : strGenre = "Death Metal"
Case 23 : strGenre = "Pranks"
Case 24 : strGenre = "Soundtrack"
Case 25 : strGenre = "Euro-Techno"
Case 26 : strGenre = "Ambient"
Case 27 : strGenre = "Trip-Hop"
Case 28 : strGenre = "Vocal"
Case 29 : strGenre = "Jazz+Funk"
Case 30 : strGenre = "Fusion"
Case 31 : strGenre = "Trance"
Case 32 : strGenre = "Classical"
Case 33 : strGenre = "Instrumental"
Case 34 : strGenre = "Acid"
Case 35 : strGenre = "House"
Case 36 : strGenre = "Game"
Case 37 : strGenre = "Sound Clip"
Case 38 : strGenre = "Gospel"
Case 39 : strGenre = "Noise"
Case 40 : strGenre = "AlternRock"
Case 41 : strGenre = "Bass"
Case 42 : strGenre = "Soul"
Case 43 : strGenre = "Punk"
Case 44 : strGenre = "Space"
Case 45 : strGenre = "Meditative"
Case 46 : strGenre = "Instrumental Pop"
Case 47 : strGenre = "Instrumental Rock"
Case 48 : strGenre = "Ethnic"
Case 49 : strGenre = "Gothic"
Case 50 : strGenre = "Darkwave"
Case 51 : strGenre = "Techno-Industrial"
Case 52 : strGenre = "Electronic"
Case 53 : strGenre = "Pop-Folk"
Case 54 : strGenre = "Eurodance"
Case 55 : strGenre = "Dream"
Case 56 : strGenre = "Southern Rock"
Case 57 : strGenre = "Comedy"
Case 58 : strGenre = "Cult"
Case 59 : strGenre = "Gangsta"
Case 60 : strGenre = "Top 40"
Case 61 : strGenre = "Christian Rap"
Case 62 : strGenre = "Pop/Funk"
Case 63 : strGenre = "Jungle"
Case 64 : strGenre = "Native American"
Case 65 : strGenre = "Cabaret"
Case 66 : strGenre = "New Wave"
Case 67 : strGenre = "Psychadelic"
Case 68 : strGenre = "Rave"
Case 69 : strGenre = "Showtunes"
Case 70 : strGenre = "Trailer"
Case 71 : strGenre = "Lo-Fi"
Case 72 : strGenre = "Tribal"
Case 73 : strGenre = "Acid Punk"
Case 74 : strGenre = "Acid Jazz"
Case 75 : strGenre = "Polka"
Case 76 : strGenre = "Retro"
Case 77 : strGenre = "Musical"
Case 78 : strGenre = "Rock & Roll"
Case 79 : strGenre = "Hard Rock"
'The following genres are Winamp extensions
Case 80 : strGenre = "Folk"
Case 81 : strGenre = "Folk-Rock"
Case 82 : strGenre = "National Folk"
Case 83 : strGenre = "Swing"
Case 84 : strGenre = "Fast Fusion"
Case 85 : strGenre = "Bebob"
Case 86 : strGenre = "Latin"
Case 87 : strGenre = "Revival"
Case 88 : strGenre = "Celtic"
Case 89 : strGenre = "Bluegrass"
Case 90 : strGenre = "Avantgarde"
Case 91 : strGenre = "Gothic Rock"
Case 92 : strGenre = "Progressive Rock"
Case 93 : strGenre = "Psychedelic Rock"
Case 94 : strGenre = "Symphonic Rock"
Case 95 : strGenre = "Slow Rock"
Case 96 : strGenre = "Big Band"
Case 97 : strGenre = "Chorus"
Case 98 : strGenre = "Easy Listening"
Case 99 : strGenre = "Acoustic"
Case 100 : strGenre = "Humour"
Case 101 : strGenre = "Speech"
Case 102 : strGenre = "Chanson"
Case 103 : strGenre = "Opera"
Case 104 : strGenre = "Chamber Music"
Case 105 : strGenre = "Sonata"
Case 106 : strGenre = "Symphony"
Case 107 : strGenre = "Booty Bass"
Case 108 : strGenre = "Primus"
Case 109 : strGenre = "Porn Groove"
Case 110 : strGenre = "Satire"
Case 111 : strGenre = "Slow Jam"
Case 112 : strGenre = "Club"
Case 113 : strGenre = "Tango"
Case 114 : strGenre = "Samba"
Case 115 : strGenre = "Folklore"
Case 116 : strGenre = "Ballad"
Case 117 : strGenre = "Power Ballad"
Case 118 : strGenre = "Rhythmic Soul"
Case 119 : strGenre = "Freestyle"
Case 120 : strGenre = "Duet"
Case 121 : strGenre = "Punk Rock"
Case 122 : strGenre = "Drum Solo"
Case 123 : strGenre = "Acapella"
Case 124 : strGenre = "Euro-House"
Case 125 : strGenre = "Dance Hall"
Case 126 : strGenre = "N/A" 
End Select
'RETURN GENRE NAME
GetGenre = strGenre
End Function%>
<title>File Info</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%Style%>
</head>
<body class="DefaultBody" bgcolor="#FBEFDD" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" link="#404040" vlink="#404040" alink="#404040" onBlur="blurred()" onFocus="focused()">
<%
' General and Tag-v1 Dims:
Dim strTargetFile, objID3, nGenre, strTitle, strArtist, strAlbum, strGenre1, x
' Some of the v2 Dims:
Dim strComposer, strOriginalArtist, strComment, strTrack, nV2, nV1
' MP3 format information Dims:
Dim strMp3FileSize, strMp3FileLenght, strMp3Bitrate, strMp3Frequency, strMp3Layer, strMp3MPEG, strMp3CRC, strMp3Emphasis, strMp3Channels
' Get target file information:
strTargetFile = strDefaultPath & "\" & Request.Querystring("TargetFile")
' Start the server ID3 information reader OCX:
set objID3 = Server.CreateObject("ID3PlusOCX.ID3")
objID3.ReadID3(strTargetFile)
strTargetfile = mid(strTargetFile,InStrRev(strTargetFile,"\")+1) 
' Set default tags in case no tags found in the MP3 file:
strTitle = "N/A"
strArtist = "N/A"
strAlbum = "N/A"
strGenre1 = "N/A"
strTrack = "N/A"
strComposer = "N/A"
strOriginalArtist = "N/A"
strComment = "N/A"
strMp3FileSize = "N/A"
strMp3FileLenght = "N/A"
strMp3Bitrate = "N/A"
strMp3Frequency = "N/A"
strMp3Layer = "3?"
strMp3MPEG = "MPEG?"
strMp3Emphasis ="N/A"
strMp3Channels = "Stereo?"
strMp3CRC = "N/A"
' See what tags the MP3 file contains:
if objID3.TAGv2Exists then nv2=1 else nv2=0
if objID3.TAGv1Exists then nv1=1 else nv1=0
If nv2 then
'Read most common v2 tags:
strTitle = objID3.TAGv2Title
strArtist = objID3.Tagv2Artist
strAlbum = objID3.Tagv2Album
if objID3.Tagv2Genre < "127" then
' Read standard tags from table:
nGenre = objID3.Tagv2Genre
strGenre1 = GetGenre(nGenre)
else
' Try to get some string value for non standard Genre:
strGenre1 = objID3.Tagv2Genre
end if
strComposer = objID3.Tagv2Composer
strOriginalArtist = objID3.Tagv2OriginalArtist
strComment = objID3.Tagv2Comment
strTrack = objID3.Tagv2Track
elseIf nv1 then
'Read the v1 tags generally available:
strTitle = objID3.TAGv1Title
strArtist = objID3.Tagv1Artist
strAlbum = objID3.Tagv1Album
nGenre = objID3.Tagv1GenreIndex
'Read Genre name from table using Genre number:
strGenre1 = GetGenre(nGenre)
strComment = objID3.Tagv1Comment
else
'No tags found; using default values!
end if
If nv2 OR nv1 then
' If tags found, try to get some MP3 file format info:
strMp3FileSize = objID3.Mp3FileSize
strMp3FileLenght = objID3.Mp3FileLenght
strMp3Bitrate = objID3.Mp3Bitrate
strMp3Frequency = objID3.Mp3Frequency
strMp3Layer = objID3.Mp3Layer
strMp3MPEG = objID3.Mp3MPEG
strMp3CRC = objID3.Mp3CRC
strMp3Emphasis = objID3.Mp3Emphasis
strMp3Channels = objID3.Mp3Channels
end if
%>
<!--
Display the Tags in HTML format (Change to fit your needs!):
Keep all one-line info whitin one set of <tr> </tr> if you keep this table format!
(remove this comment!)
//-->

<table border="0" cellspacing="0" cellpadding="0">
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList"></td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="Title"><br />Mp3 tag info from:</td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList"><br />Filename:</td>
<td width="20" class="PlayList"></td>
<td class="PlayList"><br /><%=strTargetFile%></td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList"><br />Title:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"><br /><%=strTitle%></td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">Artist:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"> <%=strArtist%></td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">Album:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"> <%=strAlbum%></td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">Genre:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"><%=strGenre1%></td>
<%If nv2 then %>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">Composer:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"> <%=strComposer%></td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">Original Artist:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"> <%=strOriginalArtist%></td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">Comment:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"> <%=strComment%></td>
</tr>
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">Track:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"> <%=strTrack%></td>
</tr>
<%end if%>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">File Size:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"><%=strMp3FileSize%></td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">File Lenght:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"> <%=strMp3FileLenght%>&nbsp;&nbsp; (Invalid for VBR)</td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">Bitrate:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"> <%=strMp3Bitrate%>&nbsp;&nbsp; (Invalid for VBR)</td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">Frequency:</td>
<td width="20" class="PlayList">&nbsp;</td>
<td class="PlayList"> <%=strMp3Frequency%></td>
</tr>
<tr> 
<td class="PlayList" width="10">&nbsp;</td>
<td class="PlayList">Layer:</td>
<td width="20" class="PlayList">&nbsp;</td>
<!-- Display a lot of MP3 format info on on line (Change to fit your needs!): (remove this comment!)//--> 
<td class="PlayList"><%=strMp3MPEG%>:&nbsp;<%=strMp3Layer%>&nbsp;<%=strMp3Channels%>&nbsp;&nbsp;&nbsp;CRC: <%=strMp3CRC%>&nbsp;&nbsp;&nbsp;Emp: <%=strMp3Emphasis%>&nbsp;&nbsp;&nbsp;ID tag:
<!-- Display MP3 tag format (Change to fit your needs!): (remove this comment!)//--> 
<%if nV1=1 AND nV2=0 then %> 
3v1
<%elseif nv1=0 AND nv2=1 then%>
3v2
<%elseif nv1=1 AND nv2=1 then%> 
3v1 and 3v2
<%else%>
No tags found in file!
<%end if %></td>
</tr>
</table>

</body>
</html>

Back
Hosted by www.Geocities.ws

1