João Carias,
Go to:
http://www.vbaccelerator.com/article.asp?id=3489
I converted the primary Function from VB.Net to C# below:
Try this:
long DiscID() {
tocSum = 0;
foreach (track in CDTOC) {
tocSum = (tocSum + AddDigits(track .PositionInSeco nds));
}
firstLastSum = CDTOC.track(0). PositionInSecon ds;
firstLastSum = (firstLastSum - CDTOC.leadOut.P ositionInSecond s);
return (ShiftRight((to cSum && 255), 24)
| (ShiftRight(fir stLastSum, 8) | CDTOC.NumTracks ));
}
void AddDigits(void position) {
addDigits = 0;
while ((position > 0)) {
addDigits = (addDigits
+ (position % 10));
position = (position / 10);
}
}
Thanks,
J
--------------------
From: "Quina" <ca*********@gm ail.com>
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
Subject: freeDB discID Calculation - retreive the TOC
Date: 6 Mar 2006 10:05:08 -0800
Organization : http://groups.google.com
Lines: 12
Message-ID: <11************ **********@v46g 2000cwv.googleg roups.com>
NNTP-Posting-Host: 82.154.40.137
Mime-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google. com 1141668319 14850 127.0.0.1 (6 Mar 2006
18:05:19 GMT)X-Complaints-To: gr**********@go ogle.com
NNTP-Posting-Date: Mon, 6 Mar 2006 18:05:19 +0000 (UTC)
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
NET CLR 2.0.50727),gzip (gfe),gzip(gfe)Complaints-To: gr**********@go ogle.com
Injection-Info: v46g2000cwv.goo glegroups.com; posting-host=82.154.40. 137;
posting-account=l4wRMQ0 AAAAZ3HcbFX3kUl CiDa5heVG2
Path:
TK2MSFTNGXA03.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTFEED01.ph x.gbl!TK2MSFTNG P
08.phx.gbl!news feed00.sul.t-online.de!t-online.de!news. glorb.com!postn ews.go
ogle.com!v46g20 00cwv.googlegro ups.com!not-for-mailXref: TK2MSFTNGXA03.p hx.gbl microsoft.publi c.dotnet.langua ges.csharp:3902 35
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
Hi there, i'm building an windows application to manage my disc
collection. I also want to enable it with cd recognition features on
audio CDs. In order to do this I must submit the CD info (discID, ...)
to freedb.org.
The problem is that I don't know how to retrieve the Table Of Contents
(toc) from the disc. The information provided by freedb tells how to
calculate the DiscID, based on the toc, but it doesn't explain how to
get the Toc... there anyone who can help me how to do this?
Thank you in advance,
João Carias
{\rtf1\ansi\ans icpg1252\deff0\ deflang1033{\fo nttbl{\f0\fnil\ fprq2\fcharset0
MS Sans Serif;}{\f1\fsw iss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.21.2500;}\ viewkind4\uc1\p ard\f0\fs20 Cheers,\par
\par
johnKn [MS-SDK]\par
\par
\par
\par
-Please do not send email directly to this alias. This alias is for \par
newsgroup purposes only\par
\par
-This posting is provided "AS IS" with no warranties, and confers no
rights.\par
\par
-To provide additional feedback about your community experience please send
\par
e-mail to:
sd*****@microso ft.com\par
\f1\par
}