Nsound  0.9.4
Public Member Functions | Private Attributes | List of all members
Nsound::AudioStreamSelection Class Reference

A helper class for advance operators. More...

#include <Nsound/AudioStreamSelection.h>

Public Member Functions

 AudioStreamSelection (AudioStream &as, const BooleanVectorVector &bv)
 
 AudioStreamSelection (const AudioStreamSelection &copy)
 
AudioStreamSelectionoperator= (const AudioStreamSelection &rhs)
 
 ~AudioStreamSelection ()
 
AudioStreamSelectionoperator+= (const float64 &rhs)
 
AudioStreamSelectionoperator-= (const float64 &rhs)
 
AudioStreamSelectionoperator*= (const float64 &rhs)
 
AudioStreamSelectionoperator/= (const float64 &rhs)
 
AudioStreamSelectionoperator^= (const float64 &rhs)
 
AudioStreamSelectionoperator= (const float64 &rhs)
 
void set (const float64 &rhs)
 

Private Attributes

AudioStreamtarget_as_
 
BooleanVectorVector bv_
 

Detailed Description

A helper class for advance operators.

Definition at line 50 of file AudioStreamSelection.h.

Constructor & Destructor Documentation

Nsound::AudioStreamSelection::AudioStreamSelection ( AudioStream as,
const BooleanVectorVector bv 
)

Definition at line 41 of file AudioStreamSelection.cc.

42  :
43  target_as_(&as),
44  bv_(bv)
45 {
46 }
Nsound::AudioStreamSelection::AudioStreamSelection ( const AudioStreamSelection copy)

Definition at line 50 of file AudioStreamSelection.cc.

51  :
52  target_as_(copy.target_as_),
53  bv_(copy.bv_)
54 {
55 }
Nsound::AudioStreamSelection::~AudioStreamSelection ( )
inline

Definition at line 58 of file AudioStreamSelection.h.

58 {}

Member Function Documentation

AudioStreamSelection & Nsound::AudioStreamSelection::operator= ( const AudioStreamSelection rhs)

Definition at line 60 of file AudioStreamSelection.cc.

References bv_, and target_as_.

61 {
62  if(this == & rhs)
63  {
64  return *this;
65  }
66 
67  target_as_ = rhs.target_as_;
68  bv_ = rhs.bv_;
69  return *this;
70 }
AudioStreamSelection & Nsound::AudioStreamSelection::operator+= ( const float64 rhs)

Definition at line 76 of file AudioStreamSelection.cc.

77 {
78  uint32 n_channels = target_as_->getNChannels();
79  uint32 n_bv = static_cast<uint32>(bv_.size());
80 
81  for(uint32 i = 0; i < n_channels && i < n_bv; ++i)
82  {
83  (*target_as_)[i](bv_[i]) += rhs;
84  }
85 
86  return *this;
87 }
unsigned int uint32
Definition: Nsound.h:153
uint32 getNChannels(void) const
Returns the number of audio channels in the stream.
Definition: AudioStream.h:212
AudioStreamSelection & Nsound::AudioStreamSelection::operator-= ( const float64 rhs)

Definition at line 92 of file AudioStreamSelection.cc.

93 {
94  uint32 n_channels = target_as_->getNChannels();
95  uint32 n_bv = static_cast<uint32>(bv_.size());
96 
97  for(uint32 i = 0; i < n_channels && i < n_bv; ++i)
98  {
99  (*target_as_)[i](bv_[i]) -= rhs;
100  }
101 
102  return *this;
103 }
unsigned int uint32
Definition: Nsound.h:153
uint32 getNChannels(void) const
Returns the number of audio channels in the stream.
Definition: AudioStream.h:212
AudioStreamSelection & Nsound::AudioStreamSelection::operator*= ( const float64 rhs)

Definition at line 108 of file AudioStreamSelection.cc.

109 {
110  uint32 n_channels = target_as_->getNChannels();
111  uint32 n_bv = static_cast<uint32>(bv_.size());
112 
113  for(uint32 i = 0; i < n_channels && i < n_bv; ++i)
114  {
115  (*target_as_)[i](bv_[i]) *= rhs;
116  }
117 
118  return *this;
119 }
unsigned int uint32
Definition: Nsound.h:153
uint32 getNChannels(void) const
Returns the number of audio channels in the stream.
Definition: AudioStream.h:212
AudioStreamSelection & Nsound::AudioStreamSelection::operator/= ( const float64 rhs)

Definition at line 124 of file AudioStreamSelection.cc.

125 {
126  uint32 n_channels = target_as_->getNChannels();
127  uint32 n_bv = static_cast<uint32>(bv_.size());
128 
129  for(uint32 i = 0; i < n_channels && i < n_bv; ++i)
130  {
131  (*target_as_)[i](bv_[i]) /= rhs;
132  }
133 
134  return *this;
135 }
unsigned int uint32
Definition: Nsound.h:153
uint32 getNChannels(void) const
Returns the number of audio channels in the stream.
Definition: AudioStream.h:212
AudioStreamSelection & Nsound::AudioStreamSelection::operator^= ( const float64 rhs)

Definition at line 140 of file AudioStreamSelection.cc.

141 {
142  uint32 n_channels = target_as_->getNChannels();
143  uint32 n_bv = static_cast<uint32>(bv_.size());
144 
145  for(uint32 i = 0; i < n_channels && i < n_bv; ++i)
146  {
147  (*target_as_)[i](bv_[i]) ^= rhs;
148  }
149 
150  return *this;
151 }
unsigned int uint32
Definition: Nsound.h:153
uint32 getNChannels(void) const
Returns the number of audio channels in the stream.
Definition: AudioStream.h:212
AudioStreamSelection & Nsound::AudioStreamSelection::operator= ( const float64 rhs)

Definition at line 156 of file AudioStreamSelection.cc.

157 {
158  uint32 n_channels = target_as_->getNChannels();
159  uint32 n_bv = static_cast<uint32>(bv_.size());
160 
161  for(uint32 i = 0; i < n_channels && i < n_bv; ++i)
162  {
163  (*target_as_)[i](bv_[i]) = rhs;
164  }
165 
166  return *this;
167 }
unsigned int uint32
Definition: Nsound.h:153
uint32 getNChannels(void) const
Returns the number of audio channels in the stream.
Definition: AudioStream.h:212
void Nsound::AudioStreamSelection::set ( const float64 rhs)
inline

Definition at line 70 of file AudioStreamSelection.h.

70 {this->operator=(rhs);};
AudioStreamSelection & operator=(const AudioStreamSelection &rhs)

Member Data Documentation

AudioStream* Nsound::AudioStreamSelection::target_as_
private

Definition at line 70 of file AudioStreamSelection.h.

Referenced by operator=().

BooleanVectorVector Nsound::AudioStreamSelection::bv_
private

Definition at line 75 of file AudioStreamSelection.h.

Referenced by operator=().


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