csl::HRTFDatabase Class Reference

#include <BinauralDB.h>

List of all members.

Public Member Functions

 ~HRTFDatabase ()
unsigned numHRTFs ()
 Total number of HRTFs loaded into the database.
unsigned windowSize ()
 The size of the analysis window (in samples).
unsigned hrtfLength ()
 The length (in samples) of the Transfer Function buffer.
unsigned hrirLength ()
 The length (in samples) of the impulse responses loaded.
unsigned numBlocks ()
 The length (in windows) of the impulse responses loaded.
unsigned hrtfAt (CPoint srcPos)
 answer the index of the HRTF nearest the given point
HRTFhrtfAt (unsigned index)
 answer an HRTF* by index
void dump (bool verbose=false)
 Print all the HRTFs in the database.
unsigned size ()
 returns the size on bytes of the receiver's storage
void storeToDB (const char *filename, const char *same) throw (CException)

Static Public Member Functions

static HRTFDatabaseDatabase ()
 accessor for the singleton instance
static void Destroy ()
 free the instance
static void Reload (char *folder)
 load the singleton from the given data folder
static void convertDB (const char *listname) throw (CException)
 bulk-convert DBs

Protected Member Functions

 HRTFDatabase (const char *folder)
 constructor that loads from a folder (protected)
void loadFromFolder (const char *folder) throw (CException)
 load a set of HRTFs from a folder or a file list file
void loadFromFile (const char *filename) throw (CException)
void loadFromDB (const char *dbName) throw (CException)

Protected Attributes

HRTFVector mHRTFVector
 vector of the HRTFs that constitute the database
unsigned mWindowSize
 FFT sizes (1024).
unsigned mHRTFLength
 513
unsigned mHRIRLength
 The length of the Head Related Impulse Response (8192).

Static Protected Attributes

static HRTFDatabasemDatabase = 0
 The protected single instance of the HRTF Database.


Detailed Description

HRTFDatabase: has a vector of HRTFs and can access them by position -- hrtfAt(CPoint) -- or by index -- hrtfAt(unsigned). Implemented as a Singleton because it's large (typ 188 HRTFs, 25 MB). 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.

Constructor & Destructor Documentation

csl::HRTFDatabase::~HRTFDatabase (  )  [inline]

HRTFDatabase::HRTFDatabase ( const char *  folder  )  [protected]


Member Function Documentation

HRTFDatabase * HRTFDatabase::Database (  )  [static]

void HRTFDatabase::Destroy (  )  [static]

free the instance

References mDatabase.

void HRTFDatabase::Reload ( char *  folder  )  [static]

load the singleton from the given data folder

References HRTFDatabase(), and mDatabase.

Referenced by convertDB().

void HRTFDatabase::convertDB ( const char *  listname  )  throw (CException) [static]

unsigned HRTFDatabase::numHRTFs (  ) 

Total number of HRTFs loaded into the database.

References mHRTFVector.

Referenced by dump(), hrtfAt(), and size().

unsigned HRTFDatabase::windowSize (  ) 

unsigned HRTFDatabase::hrtfLength (  ) 

The length (in samples) of the Transfer Function buffer.

References mHRTFLength.

Referenced by csl::BinauralPanner::BinauralPanner(), csl::BinauralSourceCache::BinauralSourceCache(), dump(), and csl::BinauralPanner::nextBuffer().

unsigned HRTFDatabase::hrirLength (  ) 

The length (in samples) of the impulse responses loaded.

References mHRIRLength.

Referenced by dump().

unsigned HRTFDatabase::numBlocks (  ) 

The length (in windows) of the impulse responses loaded.

References mHRIRLength, and windowSize().

Referenced by csl::BinauralPanner::BinauralPanner(), and dump().

unsigned HRTFDatabase::hrtfAt ( CPoint  srcPos  ) 

answer the index of the HRTF nearest the given point

References csl::CPoint::distance2(), testkiss::j, mHRTFVector, csl::CPoint::normalize(), and numHRTFs().

Referenced by csl::BinauralPanner::nextBuffer().

HRTF * HRTFDatabase::hrtfAt ( unsigned  index  ) 

answer an HRTF* by index

References mHRTFVector.

void HRTFDatabase::dump ( bool  verbose = false  ) 

Print all the HRTFs in the database.

References hrirLength(), hrtfLength(), csl::logMsg(), mHRTFVector, numBlocks(), numHRTFs(), size(), and windowSize().

unsigned HRTFDatabase::size (  ) 

returns the size on bytes of the receiver's storage

dump the DB as a single binary file

References mHRTFVector, and numHRTFs().

Referenced by dump().

void HRTFDatabase::storeToDB ( const char *  filename,
const char *  same 
) throw (CException)

void HRTFDatabase::loadFromFolder ( const char *  folder  )  throw (CException) [protected]

load a set of HRTFs from a folder or a file list file

References CSL_NAME_LEN, and FLIST_NAME.

Referenced by HRTFDatabase().

void HRTFDatabase::loadFromFile ( const char *  filename  )  throw (CException) [protected]

void HRTFDatabase::loadFromDB ( const char *  dbName  )  throw (CException) [protected]


Member Data Documentation

vector of the HRTFs that constitute the database

Referenced by dump(), hrtfAt(), numHRTFs(), and size().

unsigned csl::HRTFDatabase::mWindowSize [protected]

FFT sizes (1024).

Referenced by HRTFDatabase(), and windowSize().

unsigned csl::HRTFDatabase::mHRTFLength [protected]

513

Referenced by HRTFDatabase(), and hrtfLength().

unsigned csl::HRTFDatabase::mHRIRLength [protected]

The length of the Head Related Impulse Response (8192).

Referenced by hrirLength(), HRTFDatabase(), and numBlocks().

HRTFDatabase * HRTFDatabase::mDatabase = 0 [static, protected]

The protected single instance of the HRTF Database.

HRTFDatabase

Referenced by Database(), Destroy(), and Reload().


The documentation for this class was generated from the following files:

Generated on Thu Sep 17 23:14:18 2009 for CSL by  doxygen 1.5.8