Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

PitchEvent Class Reference

#include <PitchEvent.h>

Inheritance diagram for PitchEvent:

Inheritance graph
[legend]
List of all members.

Detailed Description

Provides information about a tone detected from the microphone(s).

Definition at line 8 of file PitchEvent.h.

Public Member Functions

 PitchEvent (unsigned int sid, EventTypeID_t type, const float freq_, const char *name_, const float amplitude_, const unsigned int duration_, const float confidence_)
 constructor
 PitchEvent (const PitchEvent &p)
 copy constructor (does what you'd expect, explicit to satisify compiler warning)
PitchEventoperator= (const PitchEvent &p)
 assignment operator (does what you'd expect, explicit to satisify compiler warning)
virtual EventBaseclone () const
 allows a copy to be made of an event, supporting polymorphism
virtual std::string getDescription (bool showTypeSpecific=true, unsigned int verbosity=0) const
 generates a description of the event with variable verbosity
virtual unsigned int getBinSize () const
 should return the minimum size needed if using binary format (i.e. not XML)
virtual unsigned int loadBinaryBuffer (const char buf[], unsigned int len)
 load from binary format
virtual unsigned int saveBinaryBuffer (char buf[], unsigned int len) const
 save to binary format
virtual void loadXML (xmlNode *node)
 load from XML format
virtual void saveXML (xmlNode *node) const
 save to XML format
float getFreq (void) const
 returns freq
float getAmplitude (void) const
 returns amplitude
float getConfidence (void) const
 returns confidence

Protected Attributes

float freq
 the frequency (Hz) being detected
float amplitude
 indicates how loud the signal is -- can be both loud and noisy, loud doesn't necessarily mean "strong"
float confidence
 indicates how much variance is being detected


Constructor & Destructor Documentation

PitchEvent::PitchEvent ( unsigned int  sid,
EventTypeID_t  type,
const float  freq_,
const char *  name_,
const float  amplitude_,
const unsigned int  duration_,
const float  confidence_ 
) [inline]

constructor

Definition at line 11 of file PitchEvent.h.

Referenced by clone().

PitchEvent::PitchEvent ( const PitchEvent p  )  [inline]

copy constructor (does what you'd expect, explicit to satisify compiler warning)

Definition at line 16 of file PitchEvent.h.


Member Function Documentation

virtual EventBase* PitchEvent::clone (  )  const [inline, virtual]

allows a copy to be made of an event, supporting polymorphism

Must be overridden by all subclasses to allow this to happen

I would like to switch this over to the cloneable interface once the compiler gets updated out of the 3.3 branch... see Cloneable::clone() for a discussion of the issue and implementation notes.

Reimplemented from EventBase.

Definition at line 26 of file PitchEvent.h.

float PitchEvent::getAmplitude ( void   )  const [inline]

returns amplitude

Definition at line 37 of file PitchEvent.h.

unsigned int PitchEvent::getBinSize (  )  const [virtual]

should return the minimum size needed if using binary format (i.e. not XML)

Reimplemented from EventBase.

Definition at line 18 of file PitchEvent.cc.

float PitchEvent::getConfidence ( void   )  const [inline]

returns confidence

Definition at line 38 of file PitchEvent.h.

std::string PitchEvent::getDescription ( bool  showTypeSpecific = true,
unsigned int  verbosity = 0 
) const [virtual]

generates a description of the event with variable verbosity

Parameters:
showTypeSpecific should be read by subclasses to add additional information
verbosity can be one of the following values:
  • 0 - Basic: event_name \t generator_id \t source_id \t type_id
  • 1 - Numerics: event_name \t generator_id \t source_id \t type_id
  • 2 - Timing: event_name \t generator_id \t source_id \t type_id \t duration \t timestamp
  • 3 and above - Full: event_name \t generator_id \t source_id \t type_id \t duration \t timestamp \t magnitude if showTypeSpecific, additional fields will be added after the common fields listed above.

Reimplemented from EventBase.

Definition at line 9 of file PitchEvent.cc.

float PitchEvent::getFreq ( void   )  const [inline]

returns freq

Definition at line 36 of file PitchEvent.h.

unsigned int PitchEvent::loadBinaryBuffer ( const char  buf[],
unsigned int  len 
) [virtual]

load from binary format

Reimplemented from EventBase.

Definition at line 31 of file PitchEvent.cc.

void PitchEvent::loadXML ( xmlNode node  )  [virtual]

load from XML format

Reimplemented from EventBase.

Definition at line 53 of file PitchEvent.cc.

PitchEvent& PitchEvent::operator= ( const PitchEvent p  )  [inline]

assignment operator (does what you'd expect, explicit to satisify compiler warning)

Definition at line 21 of file PitchEvent.h.

unsigned int PitchEvent::saveBinaryBuffer ( char  buf[],
unsigned int  len 
) const [virtual]

save to binary format

Reimplemented from EventBase.

Definition at line 42 of file PitchEvent.cc.

void PitchEvent::saveXML ( xmlNode node  )  const [virtual]

save to XML format

Reimplemented from EventBase.

Definition at line 96 of file PitchEvent.cc.


Member Data Documentation

float PitchEvent::amplitude [protected]

indicates how loud the signal is -- can be both loud and noisy, loud doesn't necessarily mean "strong"

Definition at line 42 of file PitchEvent.h.

Referenced by getAmplitude(), getBinSize(), getDescription(), loadBinaryBuffer(), loadXML(), operator=(), saveBinaryBuffer(), and saveXML().

float PitchEvent::confidence [protected]

indicates how much variance is being detected

Definition at line 43 of file PitchEvent.h.

Referenced by getBinSize(), getConfidence(), getDescription(), loadBinaryBuffer(), loadXML(), operator=(), saveBinaryBuffer(), and saveXML().

float PitchEvent::freq [protected]

the frequency (Hz) being detected

Definition at line 41 of file PitchEvent.h.

Referenced by getBinSize(), getDescription(), getFreq(), loadBinaryBuffer(), loadXML(), operator=(), saveBinaryBuffer(), and saveXML().


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

Tekkotsu v3.0
Generated Wed Oct 4 00:05:09 2006 by Doxygen 1.4.7