VoltoCDX
CDDB Component


Introduction
User Guide
Object Model
Technical Reference
Code Example
Download
Buy a License
Other Volto Components


    
General Information
Product Name VoltoCDX CDDB Component
Function Interface to CDDB-enabled databases
File Name VoltoCDX.dll
File Size 136.0KB (139,264 bytes)
Current Version V1.0-24
Revision Date 24-JUN-2004
Release Date 31-AUG-2001
Component Type ActiveX DLL
ProgID VoltoCDX.CDX
CLSID BD31FF35-3596-4B7A-B724-B87D72948CD9
DLL Base Address &H28800000
Prerequisites Visual Basic 6.0 runtime
License Price $19.95

Objects
CDX

This object provides methods and properties to retrieve and submit CDDB data and to configure various parameters required for CDDB server access.

The following table describes the object's methods:

MethodDescription
AppSettings Sets the application name and version.
GetData Queries the CDDB server.
ProductLicense Enables unrestricted product functionality.
ServerSettings Sets connection parameters for the CDDB server.
SubmitData Submits data to the CDDB server.
UserSettings Sets the user name and host.

The following table describes the object's properties:

PropertyDescription
CDs Collection of CD objects.                                  
Drives Collection of valid CD drive letters.
Genres Collection of valid CD genres.
ProductVersion Current component version.
Sites Collection of Site objects.
Status Last HTTP status.



CD

This object provides properties to retrieve data about one specific CD. Multiple CD objects may exist in the CDX.CDs collection which is created by calling the CDX.GetData method.

The following table describes the object's properties:

PropertyDescription
Artist CD artist name.
CDDBid Unique id for this CD.
ExtdGenre Extended free text genre description.
ExtdInfo Extended free text description.
FullTitle CD title and artist name.
Genre Genre description.
Length Length in seconds.
LengthMS Length in minutes and seconds.
QueryString Unique CDDB string used to query CDDB server.
Revision CDDB database record revision.
Title CD title without artist name.
Tracks Collection of Track objects.
XcmdFile Raw CDDB database file.
Year Year of publication.



Track

This object provides properties to retrieve data about one specific CD track. Multiple Track objects may exist in the CD.Tracks collection which is created by calling the CDX.GetData method.

The following table describes the object's properties:

PropertyDescription
ExtdInfo Extended free text description.
FrameOffset Track frame offset.
Length Length in seconds.
LengthMS Length in minutes and seconds.
Position Track position.
Title Track title.



Site

This object provides properties to retrieve data about one specific CDDB database site. Multiple Site objects may exist in the CDX.Sites collection which is created the first time that the collection property is read.

The following table describes the object's properties:

PropertyDescription
Address CDDB server path.
Description Description of geographical location.
Latitude Latitude of the server site.
Longitude Longitude of the server site.
Port CDDB server port.
Protocol Protocol to access this site.
Site Site internet address.

Methods
AppSettings

Sets the application name and version that will be sent when accessing a CDDB server.

Syntax

object.AppSettings AppName, AppVersion

The AppSettings method has the following parts:

Part Description
object An instance of the CDX object.
AppName String value specifying the application name.
AppVer String value specifying the application version.

Note: This method is overridden in unregistered evaluation components. The application name will always be set to the default value of VOLTOCDX and the application version will be set to the version of the VoltoCDX component.



GetData

Gets CDDB data from a CDDB server or from a locally stored CDDB database file. If successful, the CDs collection property will contain one more more CD objects representing matching database records.

Syntax

object.GetData GetMode, ModeParam [,CDDBid] [,LocalDBdir]

The GetData method has the following parts:

Part Description
object An instance of the CDX object.
GetMode Required. A get mode constant specifying the type of query. These constants are available as CDXGetModeConstants and valid values are:

Constant Value Description
modeCD 1 Detect and recognise an audio CD and query the CDDB server.
modeCDLocal 2 Detect and recognise an audio CD. Do not query the CDDB server. Return local CD data including CDDB id, CDDB query string, CD length, track count and track times only.
modeQueryString 3 Query the CDDB server by specifying a CDDB query string.
modeGenreCDDBID 4 Query the CDDB server or a local database file by specifying a CD id and genre.
ModeParam Required. A string parameter whose value depends on the value of the GetMode parameter:

GetMode Value of ModeParam
modeCD CD drive letter.
modeCDLocal CD drive letter.
modeQueryString CDDB query string.
modeGenreCDDBID Genre description.
CDDBID Optional. A string value specifying the CD id. Set this value only when using the modeGenreCDDBID query mode.
LocalDBdir Optional. A string value specifying the path to the root directory containing local CDDB database files. Set this value only when using the modeGenreCDDBID query mode. If the value is not null, CDDB queries will be made against the local database rather than a CDDB server.

Note: When using the modeCDLocal or modGenreCDDBID modes, only a single CD object will be returned. Several CD objects may be returned When using the modeCD and modeQueryString modes as the CDDB database can contain several entries corresponding to the same query string, each entry having a different genre. The CDs.Count property indicates the number of returned objects (or matching records).

Examples: This code segment demonstrates each of the GetData modes. In the first example, only basic timing information is retrieved for the CD in drive "E" - no CDDB query is made. The next example shows how to make a CDDB query for the CD. Example 3 shows a CDDB query made using the CDDB query string that was retrieved in the first example. The last example demonstrates how to make a CDDB query using the CDDBid and genre of the first CD record retrieved in the second example:

        dim myCD        as CD
        dim QueryString as string
        dim CDDBid      as string
        dim Genre       as string
    
    '-- Ex 1: Local data for CD in drive E
        objCDX.GetData modeCDLocal, "E"
        set myCD = objCDX.CDs(1)
        QueryString = myCD.QueryString
        CDDBid = myCD.CDDBid

    '-- Ex 2: Query for CD in drive E
        objCDX.GetData modeCD, "E"
        set myCD = objCDX.CDs(1)
        Genre = myCD.Genre

    '-- Ex 3: Query using query string
        objCDX.GetData modeQueryString, QueryString

    '-- Ex 4: Query using Genre and CDDBid
        objCDX.GetData modeGenreCDDBID, Genre, CDDBid

        


ProductLicense

Unlocks full component functionality when a valid Serial Number and License Key pair is given. The Serial Number and License Key, together with a license file, are provided when purchasing a license for this component. Returns a boolean value - true if a valid Serial Number and License Key were entered, or false otherwise.

Syntax

object.ProductLicense (SerialNo, LicenseKey)

The ProductLicense method has the following parts:

Part Description
object An instance of the CDX object.
SerialNo String value specifying a valid Serial Number.
LicenseKey String value specifying a valid License Key.

Remarks

Call this method once only, immediately after creating the object, in order to unlock full component functionality. If you do not make a successful call to this method, then only restricted, evaluation mode functionality will be available.

Note that the license file provided to licensed users must be present in the same directory as that in which the component has been installed. This file must also be distributed with compiled applications and copied to the appropriate directory by the application's setup utility.




ServerSettings

Sets the network parameters required to make a connection to a CDDB server. You need only call this method if you do not wish to use the default settings (described below), or if you are using a proxy server.

Syntax

object.ServerSettings Server [,Port] [,Timeout] [,ProxyServer] [,ProxyPort] [,ProxyUserName] [,ProxyPassword]

The ServerSettings method has the following parts:

Part Description
object An instance of the CDX object.
Server Required. String value specifying the CDDB server address. Default value is freedb.freedb.org.
Port Optional. Long value specifying the CDDB port. Default value is 80.
Timeout Optional. Long value specifying the connection timeout in seconds. Default value is 60. Maximum value is 60. Minimum value is 1.
ProxyServer Optional. String value specifying the proxy server address. Note: Leave this blank if not connecting via a proxy server - if this value is not null, VoltoCDX will attempt to connect via the specified proxy.
ProxyUserName Optional. String value specifying the username required to access a proxy server. Set this value for proxy servers that require authentication.
ProxyPassword Optional. String value specifying the password required to access a proxy server. Set this value for proxy servers that require authentication.
ProxyPort Optional. Long value specifying the proxy server port. Default value is 80.
ProxyPort Optional. Long value specifying the proxy server port. Default value is 80.



SubmitData

Submits CDDB data to a CDDB server.

Syntax

object.SubmitData cdData [,SubmitMode] [,Comments] [,Message]

The SubmitData method has the following parts:

Part Description
object An instance of the CDX object.
cdData Required. A CD object containing the CD data to be submitted.
SubmitMode Optional. A submit mode constant specifying the type of submission. These constants are available as CDXSubmitModeConstants and valid values are:

Constant Value Description
modeSubmit 1 Normal submission.
modeTest 2 Test submission (default). Only test submissions may be made using unregistered evaluation components.
Comments Optional. String value specifying comments to be included with the submission.
Message Optional. String value specifying a text that will be included in the message sent to the submitting user in case the submission is rejected. Maximum of 70 characters.

Notes: This method does not return a status. The status of the submission (accepted or rejected) will be given in an email sent by the CDDB server to the submitting user. It is therefore essential that this email address be specified using the CDX.UserSettings method prior to calling the SubmitData method. Furthermore an error will be raised if any of the following required data is missing: CD title, CD genre, CD track data (at least 1 track including a title and frame offset), frame offsets for CD tracks, CD length, CDDB server address, user's email address.



UserSettings

Sets the user name, email and host name that will be sent when accessing a CDDB server. Note that the email address must be set before calling the CDX.SubmitData method.

Syntax

object.UserSettings Email [,UserName] [,Host]

The UserSettings method has the following parts:

Part Description
object An instance of the CDX object.
Email String value specifying a valid email address to which submission confirmations will be sent.
UserName Optional. String value specifying the user's name.
Host Optional. String value specifying the user's host.




Properties
Address

Returns a string value containing any additional addressing information needed to access the CDDB server. For example, for HTTP protocol servers, this would be the path to the CDDB server CGI script. This field will be "-" if no additional addressing information is needed.

Syntax

object.Address

The Address property has the following parts:

PartDescription
object An instance of the Site object.



Artist

Returns or sets a string value containing a CD's artist name. The artist name is not always provided by the CDDB server, so this value may be null following a query.

Syntax

object.Artist [= name]

The Artist property has the following parts:

PartDescription
object An instance of the CD object.
name String value specifying the artist name.



CDDBid

Returns or sets a string value containing a CD's unique id code. This property is usually generated automatically or retrieved from the CDDB server.

Syntax

object.CDDBid [= id]

The CDDBid property has the following parts:

PartDescription
object An instance of the CD object.
id String value specifying the CD id.



CDs

Returns or sets a collection of CD objects where each CD object represents one CDDB database record for a CD.

Syntax

object.CDs [= collection]

The CDs property has the following parts:

PartDescription
object An instance of the CDX object.
collection Collection of CD objects.



Description

Returns a string value containing a short description of the geographical location of a CDDB site.

Syntax

object.Description

The Description property has the following parts:

PartDescription
object An instance of the Site object.



Drives

Returns a collection of string values containing all valid CD drive letters.

Syntax

object.Drives

The Drives property has the following parts:

PartDescription
object An instance of the CDX object.



ExtdGenre

Returns or sets a string value containing an extended free text description of a CD's genre. This data is optional in CDDB databases, so the property may be set to null following a query.

Syntax

object.ExtdGenre [= text]

The ExtdGenre property has the following parts:

PartDescription
object An instance of the CD object.
text String value specifying the free text genre description.



ExtdInfo

Returns or sets a string value containing an extended free text description of a CD or track. This data is optional in CDDB databases, so the property may be set to null following a query.

Syntax

object.ExtdInfo [= text]

The ExtdInfo property has the following parts:

PartDescription
object An instance of the CD or Track object.
text String value specifying the free text CD description.



FrameOffset

Returns or sets a long value containing the frame offset for a track.

Syntax

object.FrameOffset [= offset]

The FrameOffset property has the following parts:

PartDescription
object An instance of the CD or Track object.
offset Long value specifying the frame offset.



FullTitle

Returns or sets a string value containing the title of the CD. The property contains both the CD title and the artist name. Artist name data is optional in CDDB databases, so the property may be contain only the title.

Syntax

object.FullTitle [= title]

The FullTitle property has the following parts:

PartDescription
object An instance of the CD object.
title String value specifying the CD title and artist name in the format title / artist.



Genre

Returns or sets a string value containing the CD's genre name.

Syntax

object.Genre [= name]

The Genre property has the following parts:

PartDescription
object An instance of the CD object.
name String value specifying the genre name.

Note: The genre name must be one of the valid CDDB genre names. A list of these names can be obtained from the CDX.Genres collection.



Genres

Returns a collection of string values containing all valid CD genres. The first time that this property is read, VoltoCDX will retrieve the genre list from the CDDB server specified using the CDX.ServerSettings method.

Syntax

object.Genres

The Genres property has the following parts:

PartDescription
object An instance of the CDX object.



Latitude

Returns a string value containing the latitude of a CDDB site. The format is as follows: CDDD.MM Where "C" is the compass direction (N, S), "DDD" is the degrees, and "MM" is the minutes.

Syntax

object.Latitude

The Latitude property has the following parts:

PartDescription
object An instance of the Site object.



Length

Returns or sets a long value containing the length in seconds of a CD or track.

Syntax

object.Length [= seconds]

The Length property has the following parts:

PartDescription
object An instance of the CD or Track object.
seconds Long value specifying the length in seconds.



LengthMS

Returns a string value containing the length in minutes and seconds of a CD or track. The format is MM:SS.

Syntax

object.LengthMS

The LengthMS property has the following parts:

PartDescription
object An instance of the CD or Track object.



Longitude

Returns a string value containing the longitude of a CDDB site. The format is as follows: CDDD.MM Where "C" is the compass direction (E, W), "DDD" is the degrees, and "MM" is the minutes.

Syntax

object.Longitude

The Longitude property has the following parts:

PartDescription
object An instance of the Site object.



Port

Returns a long value containing the port number at which the server resides on a CDDB site.

Syntax

object.Port

The Port property has the following parts:

PartDescription
object An instance of the Site object.



Position

Returns or sets a long value containing the position value for a track.

Syntax

object.Position [= position]

The Position property has the following parts:

PartDescription
object An instance of the CD or Track object.
position Long value specifying the position.



ProductVersion

Returns a string value containing the version of the VoltoCDX component.

Syntax

object.ProductVersion

The ProductVersion property has the following parts:

PartDescription
object An instance of the CDX object.



Protocol

Returns a string value containing the transfer protocol used to access a CDDB site. This is either cddp or http.

Syntax

object.Protocol

The Protocol property has the following parts:

PartDescription
object An instance of the Site object.



QueryString

Returns a string value containing a query string that identifies a specific CD when making queries to the CDDB database. This value is generated automatically when calling the CDX.GetData method and may be stored and used on a later occasion to query the CDDB database directly, without the need for the original audio CD to be present in the CD drive. See the description of the CDX.GetData method for information on how to do this.

Syntax

object.QueryString

The QueryString property has the following parts:

PartDescription
object An instance of the CD object.



Revision

Returns or sets a long value containing the revision number of the CDDB database record for a CD. An application may typically retrieve a CD record, modify certain properties and then increment this value before resubmitting the data to the CDDB server.

Syntax

object.Revision [= number]

The Revision property has the following parts:

PartDescription
object An instance of the CD object.
number Long value specifying the revision number.



Site

Returns a string value containing the internet address of the CDDB site.

Syntax

object.Site

The Site property has the following parts:

PartDescription
object An instance of the Site object.



Sites

Returns a collection of Site objects representing all valid CDDB servers. The first time that this property is read, VoltoCDX will retrieve the site list from the CDDB server specified using the CDX.ServerSettings method.

Syntax

object.Sites

The Sites property has the following parts:

PartDescription
object An instance of the CDX object.



Status

Returns a string value containing the HTTP status code returned following the last access to the CDDB server.

Syntax

object.Status

The Status property has the following parts:

PartDescription
object An instance of the CDX object.

The following list shows some common return values:

ValueDescription
200 OK, or found an exact match
202 No match found
211 OK, found inexact matches
401 CDDB entry not found
402 Server error
403 Database entry is corrupt



Title

Returns or sets a string value containing the title of a CD or track. In the case of a CD title, the value does not include the artist name (if existing).

Syntax

object.Title [= title]

The Title property has the following parts:

PartDescription
object An instance of the CD or Track object.
title String value specifying the title.



Tracks

Returns or sets a collection of Track objects where each Track object represents one track on a CD.

Syntax

object.Tracks [= collection]

The Tracks property has the following parts:

PartDescription
object An instance of the CD object.
collection Collection of Track objects.



XcmdFile

Returns a string value containing a raw CDDB database record for a CD. Such records may be stored locally and used for future local off-line CDDB queries for example.

Syntax

object.XcmdFile

The XcmdFile property has the following parts:

PartDescription
object An instance of the CD object.

Note: This property is always set to null in unregistered evaluation components.



Year

Returns or sets a string value containing the publication year of a CD. This data is optional in CDDB databases, so the property may be set to null following a query.

Syntax

object.Year [= year]

The Year property has the following parts:

PartDescription
object An instance of the CD object.
year String value specifying the year.


Errors
Various errors may be raised when accessing a CDDB site. Error constants are available as CDXErrorConstants and valid values are:

Error Number Description
ERR_BADDRIVE 1 Drive invalid, unavailable or locked by another application
ERR_READERROR 2 Error reading CD
ERR_DRIVENOTSET 3 No CD drive was specified
ERR_BUSY 4 Busy connecting to CDDB server
ERR_CANTCONNECT 5 Error connecting to CDDB server
ERR_NOCDDBINFO 6 CD not found in CDDB database
ERR_TIMEOUT 7 Timeout connecting to CDDB server
ERR_INVALIDREQUEST 8 CDDB server rejected request
ERR_INVALIDRESPONSE 9 Invalid response from CDDB server
ERR_BADEMAIL 10 Invalid format for email address
ERR_NOSERVER 11 No CD title specified
ERR_NOQUERYSTRING 12 No Query string specified
ERR_NOTITLE 13 CDDB server rejected request
ERR_NOGENRE 14 No CD genre specified
ERR_NOCDDBID 15 No CD id specified
ERR_NOEMAIL 16 No email address specified
ERR_NOTRACKS 17 No track data specified
ERR_NOCDLENGTH 18 No CD length specified
ERR_NOFRAMEOFFSETS 18 No track frame offsets specified


© Copyright 2006 VOLTO.COM