OpenDAFF C++ API  v1.7
Directional Audio File Format
Public Member Functions | Static Public Member Functions | List of all members
DAFFReader Class Referenceabstract

Reader interface for DAFF files. More...

#include <DAFFReader.h>

Inheritance diagram for DAFFReader:
DAFFReaderImpl

Public Member Functions

virtual ~DAFFReader ()
 Destructor. More...
 
virtual bool isFileOpened () const =0
 Returns whether a file is opened. More...
 
virtual int openFile (const std::string &sFilePath)=0
 Opens a DAFF file for reading. More...
 
virtual void closeFile ()=0
 Closes an opened DAFF file. More...
 
virtual std::string getFilename () const =0
 Returns the name of the opened DAFF file. More...
 
virtual int deserialize (char *pDAFFDataBuffer)=0
 Deserializes DAFF content from a byte buffer. More...
 
virtual bool isValid () const =0
 
virtual int getFileFormatVersion () const =0
 Returns the DAFF version of the file format. More...
 
virtual int getContentType () const =0
 Returns the content type. More...
 
virtual DAFFContentgetContent () const =0
 Returns the content. More...
 
virtual const DAFFMetadatagetMetadata () const =0
 Returns the metadata. More...
 
virtual DAFFPropertiesgetProperties () const =0
 Returns the properties of the file. More...
 
virtual std::string toString () const =0
 Returns string with information about the reader. More...
 

Static Public Member Functions

static DAFFReadercreate ()
 Factory method. More...
 

Detailed Description

Reader interface for DAFF files.

This purely abstract class defines the reader interface for DAFF files. Instances of the class must be created using the factory method create()

This is only a brief summary of the basics of DAFF. If you are new to DAFF we recommend visiting the project website at http://www.opendaff.org to get in touch with DAFF. It comes with detailed explanations, nice and supportive figures and tables and some little tutorials and code examples.

Agreements

All angles in the DAFF Reader Interface and all angles in a daff file are in gradients [°]! If not marked otherwise, we use right-hand rotation. The default coordinate system and it's cartesian representation: *

The default coordinate system and it's polar representation: for data view:

The orientation of an object is defined by its yaw, pitch and roll rotation according to the specification used in aerospace applications projected on our default coordinate system:

Coordinate systems

OpenDAFF differentiates heavily between the data view and the object view. The data view has its own coordinate system (Data Spherical Coordinate system, DSC) represented by the angles alpha and beta. It describes in which way your data has been recorded, measured or generated. The object view uses the azimuth and elevation nominclature with phi and theta angles for representation of the object (Object Spherical Coordinate system, OSC). It is invented to access your data without bothering how it is saved, you simply request a point on the sphere grid of your object and the transformation from object view to data view is covered by the library. Both the data and the object coordinate system are connected by the orientation which is defined by yaw, pitch and roll angles once in the daff file header block. If you are only using daff files you will only need the object view. If you are generating daff files from your records you have to define the correct orientation once (according to you setup) and never have to think about it anymore.

Reference parameter

A daff file version 0.1 can only save one record set of a fixed distance. If not specified, it will assume a distance of 1 meter for simplification matters. Anyway it's up to your software application if you use multiple distances and how you pay respect on displacement. Same applies for sound pressure level reference.

Interpolation

When using the methods getNearestNeighbour or getCell, the library will always work on data view coordinate system. If you are using the object view (which is recommended in any case) it will transform from OSC to DSC first and then interpolate the requested angular pair or cell and then return the appripriate index of the record. This can lead to some difficulties especially if the data sphere and the object sphere do not have the poles at same places. E.g. if you have recorder head-related impulse responses with the poles at the up and down direction but you change the direction so that the poles of the object are lying at front/back direction you will get bigger errors in that areas because the grids do not match. Be aware of that and, if possible, simply avoid it :)

Definitions

It is generally a good idea to have a look at the "DAFFDefs.h" header file. Here you find a couple of definitions which we recommend to use when working with OpenDAFF, especially this will lead to a greater robustness of your code with later versions of DAFF. Codes available:

Definition at line 116 of file DAFFReader.h.

Constructor & Destructor Documentation

virtual DAFFReader::~DAFFReader ( )
inlinevirtual

Destructor.

Definition at line 126 of file DAFFReader.h.

Member Function Documentation

virtual void DAFFReader::closeFile ( )
pure virtual

Closes an opened DAFF file.

Implemented in DAFFReaderImpl.

DAFFReader * DAFFReader::create ( )
static

Factory method.

This method must be used to create reader instances

Definition at line 4 of file DAFFReader.cpp.

virtual int DAFFReader::deserialize ( char *  pDAFFDataBuffer)
pure virtual

Deserializes DAFF content from a byte buffer.

Implemented in DAFFReaderImpl.

virtual DAFFContent* DAFFReader::getContent ( ) const
pure virtual

Returns the content.

Implemented in DAFFReaderImpl.

virtual int DAFFReader::getContentType ( ) const
pure virtual

Returns the content type.

Implemented in DAFFReaderImpl.

virtual int DAFFReader::getFileFormatVersion ( ) const
pure virtual

Returns the DAFF version of the file format.

Implemented in DAFFReaderImpl.

virtual std::string DAFFReader::getFilename ( ) const
pure virtual

Returns the name of the opened DAFF file.

Implemented in DAFFReaderImpl.

virtual const DAFFMetadata* DAFFReader::getMetadata ( ) const
pure virtual

Returns the metadata.

Implemented in DAFFReaderImpl.

virtual DAFFProperties* DAFFReader::getProperties ( ) const
pure virtual

Returns the properties of the file.

Implemented in DAFFReaderImpl.

virtual bool DAFFReader::isFileOpened ( ) const
pure virtual

Returns whether a file is opened.

Implemented in DAFFReaderImpl.

virtual bool DAFFReader::isValid ( ) const
pure virtual

Implemented in DAFFReaderImpl.

virtual int DAFFReader::openFile ( const std::string &  sFilePath)
pure virtual

Opens a DAFF file for reading.

This method opens the given DAFF file for reading and loads all of its data into the memory.

Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implemented in DAFFReaderImpl.

virtual std::string DAFFReader::toString ( ) const
pure virtual

Returns string with information about the reader.

Implemented in DAFFReaderImpl.


The documentation for this class was generated from the following files:
OpenDAFF is a project from the Institute of Technical Acoustics, RWTH Aachen University, Germany.