Nsound  0.9.4
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Nsound::MixerNode Class Reference

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

#include <Nsound/MixerNode.h>

Public Member Functions

 MixerNode (float64 first_beat_time, float64 bpm, const AudioStream &as)
 Constructor. More...
 
boolean operator== (const MixerNode &) const
 
boolean operator< (const MixerNode &) const
 
std::string printNode ()
 This method returns a string that represents the node. More...
 

Public Attributes

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

Static Public Attributes

static uint32 id_count_ = 0
 

Detailed Description

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

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.

47  : audio_stream_(&as),
48  bpm_(bpm),
49  first_beat_time_(time),
51 {}
const AudioStream * audio_stream_
The pointer to the AudioStream.
Definition: MixerNode.h:84
static uint32 id_count_
Definition: MixerNode.h:94
float64 first_beat_time_
The time the AudioStream first occurs in the list.
Definition: MixerNode.h:90
float64 bpm_
The number of beats per minute.
Definition: MixerNode.h:87

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_.

56 {
57  if(id_ == rhs.id_
58  && bpm_ == rhs.bpm_
60  {
61  return true;
62  }
63 
64  return false;
65 }
float64 first_beat_time_
The time the AudioStream first occurs in the list.
Definition: MixerNode.h:90
float64 bpm_
The number of beats per minute.
Definition: MixerNode.h:87
boolean Nsound::MixerNode::operator< ( const MixerNode rhs) const

Definition at line 69 of file MixerNode.cc.

References first_beat_time_, and id_.

70 {
72  || id_ < rhs.id_)
73  {
74  return true;
75  }
76 
77  return false;
78 }
float64 first_beat_time_
The time the AudioStream first occurs in the list.
Definition: MixerNode.h:90
std::string Nsound::MixerNode::printNode ( )

This method returns a string that represents the node.

This method returns a string that represents the node.

Definition at line 88 of file MixerNode.cc.

89 {
90  using std::endl;
91 
92  std::stringstream out;
93 
94  out << "first_beat_time_: "
96  << endl
97  << "bpm_: "
98  << bpm_
99  << endl
100  << "audio_stream_ length: "
101  << static_cast<float64>(audio_stream_->getLength())
102  / static_cast<float64>(audio_stream_->getSampleRate())
103  << " seconds"
104  << endl
105  << endl;
106 
107  return out.str();
108 }
const AudioStream * audio_stream_
The pointer to the AudioStream.
Definition: MixerNode.h:84
float64 getSampleRate() const
Returns the sample rate of the stream.
Definition: AudioStream.h:217
uint32 getLength() const
Returns the number of samples of audio data in the stream.
Definition: AudioStream.cc:197
double float64
Definition: Nsound.h:146
float64 first_beat_time_
The time the AudioStream first occurs in the list.
Definition: MixerNode.h:90
float64 bpm_
The number of beats per minute.
Definition: MixerNode.h:87

Member Data Documentation

const AudioStream* Nsound::MixerNode::audio_stream_

The pointer to the AudioStream.

Definition at line 84 of file MixerNode.h.

float64 Nsound::MixerNode::bpm_

The number of beats per minute.

Definition at line 87 of file MixerNode.h.

Referenced by operator==().

float64 Nsound::MixerNode::first_beat_time_

The time the AudioStream first occurs in the list.

Definition at line 90 of file MixerNode.h.

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

uint32 Nsound::MixerNode::id_

Definition at line 92 of file MixerNode.h.

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

uint32 MixerNode::id_count_ = 0
static

Definition at line 94 of file MixerNode.h.


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