Nsound::MixerNode Class Reference

#include <Nsound/MixerNode.h>

List of all members.

Public Member Functions

 MixerNode (float64 first_beat_time, float64 bpm, const AudioStream &as)
 Constructor.
boolean operator== (const MixerNode &) const
boolean operator< (const MixerNode &) const
std::string printNode ()

Public Attributes

const AudioStreamaudio_stream_
 The pointer to the AudioStream.
float64 bpm_
 The number of beats per minute.
float64 first_beat_time_
 The time the AudioStream first occurs in the list.
uint32 id_

Static Public Attributes

static uint32 id_count_ = 0

Detailed Description

This class holds the nodes for use with the Mixer class.

Definition at line 55 of file MixerNode.h.


Constructor & Destructor Documentation

Nsound::MixerNode::MixerNode ( float64  first_beat_time,
float64  bpm,
const AudioStream as 
)

Constructor.

Constructor

Definition at line 46 of file MixerNode.cc.

00047     : audio_stream_(&as),
00048       bpm_(bpm),
00049       first_beat_time_(time),
00050       id_(MixerNode::id_count_++)
00051 {}


Member Function Documentation

boolean Nsound::MixerNode::operator== ( const MixerNode rhs  )  const

Definition at line 55 of file MixerNode.cc.

References bpm_, first_beat_time_, and id_.

00056 {
00057     if(id_ == rhs.id_
00058         && bpm_ == rhs.bpm_
00059         && first_beat_time_ == rhs.first_beat_time_)
00060     {
00061         return true;
00062     }
00063 
00064     return false;
00065 }

boolean Nsound::MixerNode::operator< ( const MixerNode rhs  )  const

Definition at line 69 of file MixerNode.cc.

References first_beat_time_, and id_.

00070 {
00071     if(first_beat_time_ < rhs.first_beat_time_
00072         || id_ < rhs.id_)
00073     {
00074         return true;
00075     }
00076 
00077     return false;
00078 }

std::string Nsound::MixerNode::printNode (  ) 

This method returns a string that represents the node.

Definition at line 88 of file MixerNode.cc.

References audio_stream_, bpm_, first_beat_time_, Nsound::AudioStream::getLength(), and Nsound::AudioStream::getSampleRate().

00089 {
00090     using std::endl;
00091 
00092     std::stringstream out;
00093 
00094     out << "first_beat_time_: "
00095         << first_beat_time_
00096         << endl
00097         << "bpm_: "
00098         << bpm_
00099         << endl
00100         << "audio_stream_ length: "
00101         << static_cast<float64>(audio_stream_->getLength())
00102                 / static_cast<float64>(audio_stream_->getSampleRate())
00103         << " seconds"
00104         << endl
00105         << endl;
00106 
00107     return out.str();
00108 }


Member Data Documentation

The pointer to the AudioStream.

Definition at line 84 of file MixerNode.h.

Referenced by printNode().

The number of beats per minute.

Definition at line 87 of file MixerNode.h.

Referenced by operator==(), and printNode().

The time the AudioStream first occurs in the list.

Definition at line 90 of file MixerNode.h.

Referenced by operator<(), operator==(), and printNode().

Definition at line 92 of file MixerNode.h.

Referenced by operator<(), and operator==().

Definition at line 94 of file MixerNode.h.


The documentation for this class was generated from the following files:
Generated on Sun Apr 15 20:10:50 2012 for nsound by  doxygen 1.6.3