
MfcCDDB
v1.33 A set of
MFC classes to support access to CDDB servers
Welcome to MfcCDDB, a collection of MFC
classes to support access to the Compact Disc DataBases
on the Internet.
CDDB is an information database containing artist, disc title, track titles, and other information for digital audio compact
discs. Over time, this archive has grown to contain a substantial collection of CD information and is continuing to grow at a rapid rate.
This database can be accessed by applications via the CDDB server hosts that have been set up on the Internet around the world.
The CDDB data format and the CDDB servers are designed to be open, and
are used by many client applications requiring CD information. CDDB has become the de facto standard for Internet access of compact disc
information.
The enclosed zip file contains the MfcCDDB source code and a simple test program which exercises
all class API's.
Copyright
- You are allowed to include the source code in
any product (commercial, shareware, freeware or otherwise) when your product
is released in binary form.
- You are allowed to modify the source code in
any way you want except you cannot modify the copyright details at the top
of each module.
- If you want to distribute source code with
your application, then you are only allowed to distribute versions released
by the author. This is to maintain a single distribution point for the
source code.
Updates
V1.0 (11 May 1999)
V1.1 (20 May 1999)
- Added support for MOTD (Message of the Day).
- Added support for Submitting an album to CDDB.
- Fixed a number of places where calling the TRACE function was causing an
access violation
- Fixed a bug in GetErrorMessage which was causing SDK errors to return the
string "The operation completed successfully".
V1.11 (14 July 1999)
- Fixed two potential GPF's in the CCDDB::ReadResponse function.
- Minor Update to the documentation.
V1.12 (29 November 1999)
- Fixed a number of bugs when compiled with VC 6.0.
V1.13 (17 January 2000)
- Fixed a number of compiler errors which seem to have crept into MfcCDDB.H
v1.12.
V1.14 (23 January 2000)
- The code has now been fully tested with the open source alternative to CDDB
namely www.freedb.org. CDDB has become more
commercialized of late, since its introduction of a binary SDK with closed validation
and new licensing rules. I also believe that CDDB will stop access sometime
in 2000 to its databases via non CDDB originated code. Therefore I would suggest
that developers using MfcCDDB should provide users with a configuration dialog
to allow the CDDB server to be specified, that way you will not have irate customers
ringing you when CDDB stops allowing access to it. You can use this open source
server instead of the CDDB one in the MfcCDDB code by using "freedb.freedb.org"
instead of "cddb.cddb.com" in the call to CCDDB::Sites and by specifying CDDB
protocol version 3 in the function SetCDDBProtocolVersion. This is required
because as of January 2000 freedb only supports CDDB protocol version 3.
- Fixed a bug in the app.cpp code to the sample Submit call which was causing
it to fail.
V1.15 (13 February 2000)
- Now fully supports access when behind a HTTP proxy.
- Also now includes support for proxy authentication.
V1.16 (7 May 2000)
- Fixed a problem in GetUserName and GetHostName with embedded spaces
V1.17 (17 May 2000)
- Now handles CDDB records which have more than one DTITLE line.
V1.18 (30 May 2000)
- Now prevents creation of empty extended track tags (EXTT=).
V1.19 (5 September 2000)
- Modified CCDDB::GetTrackPositions to fail when the CD does not contain any
audio tracks
V1.20 (9 August 2001)
- Fixed a bug where the first track title was not being parsed correctly.
Thanks to Jared Allen for spotting this.
V1.21 (7 October 2001)
- Major update to bring code into line with freedb standard. As mentioned
in previous updates you can no longer use MFCCDDB with the commerical CDDB web
site at Gracenote (formerly CDDB). Instead now the code can only be used with
the open source alternative of freedb. Updates include:
- Updated copyright information
- Fixed calculation the extra disc length parameter, which must be specified
in the query string.
- Fixed bug where discid for submissions was having any leading 0's stripped.
- Updated m_sProductVersion as it was out of date.
- Changed default server in Sites method to "freedb.freedb.org"
- Removed comment line which says "Copyright ... CDDB Inc" from Submit method
- Updated links in documentation to be www.freedb.org
- Fixed a bug in ReadResponse when an error occurs reading from the socket
- Reworked the ReadResponse method to be more inline with my W3MFC socket
class
- Updated the sample app to display the last command response when a function
fails
- framework now works with version 5 of the CDDB protocol. This gives two
extra fields in the CDDB record class namely Year and Genre.
- Complete rewrite of the ParseRecordBody to improve readibilty of the function.
This means that the code now correctly supports all text record values which
span multiple lines
- Made m_ExtendedData member of CCDDBRecord a CString instead of a string
array
- Fixed a bug in CCDDB::ParseKeywordLine
- Fixed bug when separating artist and title from DTITLE lines
- Fixed an infinite recursion bug in ReplaceSubString
V1.22 (8 October 2001)
- Minor update following feedback from freedb.
V1.23 (2 February 2002)
- Fixed a minor parsing bug in CCDDB::GetNextLine. Thanks to Thomas Lang for
this fix.
V1.24 (24 June 2002)
- Now fully supports local access to database. The standard and alternate
form are both fully supported.
- Optimized #include of 2 files in mfccddb.cpp
V1.25 (3 August 2003)
- Fixed a bug when the MCI device was not being closed if the inserted CD
did not contain an Audio CD. Thanks to Christian Inkster for reporting this
problem.
V1.26 (3 November 2003)
- Simplified the code in CCDDB::ReadResponse. Thanks to Clarke Brunt for reporting
this issue.
V1.27 (20 August 2004)
- General tidy up of the GetUserName and GetHostName functions.
V1.28 (29 June 2005)
- Updated copyright details.
- Updated comments regarding how to include headers into your pre compiled
header
- Reviewed all TRACE statements for correctness
- Updates to the GetUserName and GetHostName functions to exclude high
ASCII
characters. Thanks to Stefan Becker for providing the fix for this bug.
- Removed unreferenced variable warning in CCDDB::FormSubmitLine.
- Fixed a number of level 4 warnings when code is compiled in Visual Studio
.NET 2003
- Fixed various warnings when code is compiled with /Wp64 compiler setting
in Visual Studio .NET 2003. Please note that to achieve this, the code now requires
a recentish Platform SDK to be installed and configured if the code is compiled
on Visual C++ 6.
V1.29 (1 January 2007)
- Updated copyright details.
- Addition of a MFCCDDB_EXT_CLASS preprocessor macro to allow the classes
to be more easily added to an extension dll
- Updated the code to clean compile in VC 2005
- Updated documentation to use the same style as the web site
- Default timeout is now 60 seconds for release builds and 90 seconds for
debug builds
- Reviewed all CString::Format calls for correctness
- Optimized CCDDBSite constructor code
- Optimized CCDDBQueryResult constructor code
- Optimized CCDDBTrackPosition constructor code
- Optimized CCDDBRecord constructor code
- Optimized CCDDB constructor code
- Removed unused CCDDB destructor
- Fixed Unicode issue in CCDDB::GetCDROMDrives
- Updated usage of CString::TrimLeft and CString::TrimRight in the code
- Replaced usage of CCDDB::ReplaceSubString with CString::Replace
- Hostname can now be customized via a SetHostName method
- m_sLastCommandResponse is now not reset when a response is successfully
parsed
- UserName can now be customized via a SetUserName method
- CCDDBSite::Parse now does not fail if protocol is not "http"
- Reworked the classes to be exception based along the lines of the
author's CPJNSMTPConnection class. This should improve the robustness of
client application code. Please note that because of this redesign, you
should re-examine all client code to make sure it catches the new exceptions
thrown from the classes as appropriate
- Fixed a bug in CCDDB::SplitSemiColonLine where 1 character length values
would not be parsed correctly
- Added a constructor to the class CCDDBStatus
- Fixed a bug in CCDDB::ParseCommentLine where 1 character length values
would not be parsed correctly
- Fixed a bug in CCDDB::ReadResponse where it had problems parsing the
body of the response for query and submit requests if the body arrives in a
second packet from the network
- CCDDB::ParseRecordBodyFromFile now allows other processes to read the
file which it is currently attempting to parse
- Optimized code in CCDDB::Read(const CString& sDirectory... which
operates on the passed in dwDiscID parameter
- Optimized code in CCDDB::ParseRecordBodyFromFile to handle parsing the
non-standard (Windows) format of CDDB record format
V1.30 (12 January 2008)
- Updated copyright details.
- Updated sample app code to remove VC 6 style classwizard comments
- Updated the sample app to clean compile on VC 2008
- CCDDBException::GetErrorMessage now uses the
FORMAT_MESSAGE_IGNORE_INSERTS flag. For more information please see Raymond
Chen's blog at
http://blogs.msdn.com/oldnewthing/archive/2007/11/28/6564257.aspx.
Thanks to Alexey Kuznetsov for reporting this issue.
- CCDDBException::GetErrorMessage now uses Checked::tcsncpy_s if compiled
using VC 2005 or later.
V1.31 (31 August 2008)
- Code now compiles cleanly using Code Analysis (/analyze)
- Updated code to compile correctly using _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
define
- The code now only supports VC 2005 or later.
- Added support for parsing CCDDBSite::m_sProtocol
- Code now uses ATL's support for base64 encoding
- The code now uses the author's CWSocket to encapsulate socket
functionality
- Fixed a bug in the calculation of the total track length in
CCDDB::ComputeDiscID. Thanks to Tom van Dijck for reporting this bug.
- General tidy up of all the parsing code in the classes
- The classes now supports v6 Protocol level (if the code is compiled for
Unicode)
- GetTrackPositions has been renamed to GetTrackPositionsUsingMCI.
- Addition of a GetTrackPositionsUsingDeviceIoControl using the API DeviceIoControl and the IOCTL code of IOCTL_CDROM_READ_TOC to get the track
positions. This method works on all versions of Windows based on the NT
Kernel (i.e. NT, 2000, XP, 2003, Vista and 2008). It should also work for
multi-session CD's i.e. CD's which have data sessions as well as an audio
session.
- ComputeDiscID has been renamed to ComputeDiscIDUsingMCI.
- Addition of a ComputeDiscIDUsingDeviceIoControl method.
V1.32 (24 December 2009)
- Removed various preprocessor defines from top of MfcCDDB as they are
available in standard VC headers.
- Fixed up a minor case sensitively issue with the various "MfcCDBD"
files.
- Updated copyright details.
- Updated the sample app configuration settings to more modern default
values.
- Fix a bug where the drive/device name created in
GetTrackPositionsUsingDeviceIoControl was incorrectly created as
"\\.\\[Drive Letter]:" instead of the correct format of "\\.\[Drive
Letter]:". This could lead to this function call failing in certain
circumstances. Thanks to "Jase" for reporting this issue.
- Updated the code in CCDDB::ReadResponse in line with the similar
response parsing code in the CPJNPOP3Connection v1.47, This helps address an
issue where the terminator could not be found if the response gets split
across socket calls. This update also helps avoid excessive CPU utilization
when we receive large responses. Thanks to Markus Hlacer, "Jase" and Alexey
Rabets for reporting this issue.
- Eliminated use of old style CT2A / CA2T macros and replaced with CStringA/W.
V1.33 (10 April 2010)
- Updated copyright details.
- CCDDB::ParseQueryBody now does not consider receiving a 202 response
as an error