Needed: Delphi 7 application
Requirements:
1) From the Registry determine the path to the current user's MY MUSIC folder, e.g. "C:\Documents and Settings\John\My Documents\My Music". Then append the string "iTunes" to the above path and store this as:
var
iTunesPath : String;
2) Store the following string as a constant:
const
iTunesDatabaseFileName : String = 'iTunes Music [login to view URL]';
3) Open the above file from the above path and parse the XML looking for certain tags/data based upon constants defined in the const section of app.
4) The tags to search will be defined like this:
type
iTuneArray = array[1..2] of String;
var
iTunesTag : iTuneArray;
...
procedure [login to view URL](Sender: TObject);
begin
iTunesTag[1] := 'Artist';
iTunesTag[2] := 'Album';
5) Parse/search/scan the 'iTunes Music [login to view URL]' file for the tags defined in the array. If data is found, then store it to a SQLite 3 table. Data should only be parsed/collected within the "[key]Tracks[/key]" section. Parsing should be CASE INSENSITIVE.
6) The SQLite table needs to be created each time the app is run. If a table already exists, it must be deleted and a new one created.
7) The SQLite table will be created with fields that correspond to the iTunesTag's. In the example above, 2 fields will be created, 1 named 'Artist' and the other 'Album'. Field length will be specified this way:
type
SQLiteFieldSizeArray = array[1..2] of Byte;
var
SQLiteFieldSize : SQLiteFieldSizeArray;
...
procedure [login to view URL](Sender: TObject);
begin
SQLiteFieldSize[1] := 64;
SQLiteFieldSize[2] := 128;
8) During the parsing of the XML, if the following key/line is found, then the [string] data will be stored to iTunesVersion (TString):
[key]Application Version[/key][string]8.0.1[/string]
E.g., after parsing the above line, iTunesVersion will contain '8.0.1'
9) After the parsing and data storage to the SQLite table is complete, then create an ASCII file named:
'iTunes' + iTunesTag[1] + '.' + iTunesVersion
In this file should contain all of the data found in all of the records found in iTunesTag[1] and be a sorted (0-9, a-Z). Note, however, NO DUPLICATES must exist in this sorted, exported list. "No duplicates" takes into consideration casing. In other words the following will NOT be allowed:
Rick Springfield
Rolling stones
Rolling Stones
ROLLING STONES
Rudy Valentino
Instead, only one "Rolling Stones" is allowed. I don't care which one of the 3 "Rolling Stones" is chosen, just as long as only one gets into the exported ASCII file.
Note: I've replaced the "less than" and "greater than" symbols from this description because eLance prohibits "HTML tags".