#include <BinauralDB.h>
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 | |
| HRTF * | hrtfAt (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 HRTFDatabase * | Database () |
| 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 HRTFDatabase * | mDatabase = 0 |
| The protected single instance of the HRTF Database. | |
| csl::HRTFDatabase::~HRTFDatabase | ( | ) | [inline] |
| HRTFDatabase::HRTFDatabase | ( | const char * | folder | ) | [protected] |
constructor that loads from a folder (protected)
References CSL_NAME_LEN, HRIR_SIZE, HRTF_BLOCK_SIZE, csl::kLogError, loadFromDB(), loadFromFile(), loadFromFolder(), csl::logMsg(), mHRIRLength, mHRTFLength, csl::CException::mMessage, and mWindowSize.
Referenced by Database(), and Reload().
| HRTFDatabase * HRTFDatabase::Database | ( | ) | [static] |
accessor for the singleton instance
References csl::CGestalt::dataFolder(), DEFAULT_HRTF_FOLDER, HRTFDatabase(), and mDatabase.
Referenced by csl::BinauralPanner::BinauralPanner(), csl::BinauralSourceCache::BinauralSourceCache(), convertDB(), and csl::BinauralPanner::nextBuffer().
| void HRTFDatabase::Destroy | ( | ) | [static] |
| 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] |
bulk-convert DBs
References CSL_NAME_LEN, Database(), csl::CGestalt::dataFolder(), csl::logMsg(), Reload(), and storeToDB().
| unsigned HRTFDatabase::numHRTFs | ( | ) |
| unsigned HRTFDatabase::windowSize | ( | ) |
The size of the analysis window (in samples).
References mWindowSize.
Referenced by csl::BinauralPanner::BinauralPanner(), csl::BinauralSourceCache::BinauralSourceCache(), dump(), csl::BinauralPanner::nextBuffer(), and numBlocks().
| 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 | ) |
| 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) |
References CSL_DEGS_PER_RAD, testkiss::j, csl::HRTF::mHrtfL, and csl::HRTF::mHrtfR.
Referenced by convertDB().
| 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] |
References csl::CSL_FFT_COMPLEX, CSL_NAME_LEN, fft::fft(), and csl::logMsg().
Referenced by HRTFDatabase().
| void HRTFDatabase::loadFromDB | ( | const char * | dbName | ) | throw (CException) [protected] |
References CSL_DEGS_PER_RAD, CSL_LINE_LEN, CSL_NAME_LEN, csl::kLogError, kPolar, csl::logMsg(), csl::HRTF::mHrtfL, csl::HRTF::mHrtfR, csl::HRTF::mPosition, and csl::CPoint::set().
Referenced by HRTFDatabase().
HRTFVector csl::HRTFDatabase::mHRTFVector [protected] |
vector of the HRTFs that constitute the database
Referenced by dump(), hrtfAt(), numHRTFs(), and size().
unsigned csl::HRTFDatabase::mWindowSize [protected] |
unsigned csl::HRTFDatabase::mHRTFLength [protected] |
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.
Referenced by Database(), Destroy(), and Reload().
1.5.8