
CSL HRTF file format and IRCAM HRTF Datasets

Class HRTFDatabase: vector of HRTFs; implemented as a Singleton because it's large.
	Has a vector of HRTFs and can access them by position -- hrtfAt(CPoint) --
	or by index -- hrtfAt(unsigned). Create it with a folder/resource name, 
	it reads "files.txt" for a list of HRIR files to load.
	This has a number of file/folder/DB IO methods for load/store of bulk HRTF 
	data sets in IRCAM format and CSL's pre-processed HRTF.dat files.

CSL HRTF.dat file format
	Header = a string with the label and geometry list,
	label is: "HRTF"  name  #-hrtfs  HRIR-len  blk-size  #-blocks
		as in, HRTF   1047  188      8192      512       16

	geometry is a cr-separated list of 2 integers per line of the azim/elev 
	in degrees of the points; empty line ends list.

	Header is followed by the per-head, per-spsition, blocked HRTF complex vectors.
	2-16 blocks/set, each has 257 or 513 complex values for L and R
		for full-len HRIR, this = 8 * 2 * 513 * 16 = 131 kB / HRTF * 188 = 24.6 MB / DB
	There is support in the code for taking a subset of the HRIR and changing the block size.
	Trailer is "\nHRTF\n" (as read length check).

The methods HRTFDatabase::storeToDB() and HRTFDatabase::loadFromDB() implement this format.

Example Header

	~/Code/CSL/CSL_Data/IRCAM_HRTF/1024_DB/HRTF_1014.dat
	188 positions, use first 1024 samples of stereo HRIR
	Split into 4 blocks of 256
	first line = header
	lines 2-189 az/el positions
	Empty line
	188 * 4 * 2 blocks of 256 complex numbers each follow
	File ends with "HRTF" (as read length check).

----

HRTF 1014	188	1024	256	4
0	0
0	15
0	30
0	45
0	60
0	75
180	90
0	-45
0	-30
0	-15
15	0
15	15
15	30
15	45
15	-45
15	-30
15	-15
30	0
30	15
30	30
30	45
30	60
30	-45
30	-30
30	-15
45	0
45	15
45	30
45	45
45	-45
45	-30
45	-15
60	0
60	15
60	30
60	45
60	60
60	75
60	-45
60	-30
60	-15
75	0
75	15
75	30
75	45
75	-45
75	-30
75	-15
90	0
90	15
90	30
90	45
90	60
90	-45
90	-30
90	-15
105	0
105	15
105	30
105	45
105	-45
105	-30
105	-15
120	0
120	15
120	30
120	45
120	60
120	75
120	-45
120	-30
120	-15
135	0
135	15
135	30
135	45
135	-45
135	-30
135	-15
150	0
150	15
150	30
150	45
150	60
150	-45
150	-30
150	-15
165	0
165	15
165	30
165	45
165	-45
165	-30
165	-15
180	0
180	15
180	30
180	45
180	60
180	75
180	-45
180	-30
180	-15
195	0
195	15
195	30
195	45
195	-45
195	-30
195	-15
210	0
210	15
210	30
210	45
210	60
210	-45
210	-30
210	-15
225	0
225	15
225	30
225	45
225	-45
225	-30
225	-15
240	0
240	15
240	30
240	45
240	60
240	75
240	-45
240	-30
240	-15
255	0
255	15
255	30
255	45
255	-45
255	-30
255	-15
270	0
270	15
270	30
270	45
270	60
270	-45
270	-30
270	-15
285	0
285	15
285	30
285	45
285	-45
285	-30
285	-15
300	0
300	15
300	30
300	45
300	60
300	75
300	-45
300	-30
300	-15
315	0
315	15
315	30
315	45
315	-45
315	-30
315	-15
330	0
330	15
330	30
330	45
330	60
330	-45
330	-30
330	-15
345	0
345	15
345	30
345	45
345	-45
345	-30
345	-15
345	-15

Blocks of complex numbers follow

File ends with "HRTF" (as read length check).

