SoundFrame.cpp File Reference

#include "SoundFrame.h"
#include "JackClient.h"

Include dependency graph for SoundFrame.cpp:

Go to the source code of this file.

Functions

SoundFrame operator* (const SoundFrame &f1, float scalar)
SoundFrame operator* (const SoundFrame &f1, const SoundFrame &f2)
SoundFrame operator+ (const SoundFrame &f1, const SoundFrame &f2)
ostream & operator<< (ostream &o, const SoundFrame &sf)


Function Documentation

SoundFrame operator* ( const SoundFrame f1,
float  scalar 
)

Definition at line 158 of file SoundFrame.cpp.

References SoundFrame::GetSamples(), SoundFrame::SampleCount(), and SoundFrame::Set().

00159 {
00160     SoundFrame ret;
00161     ret.Set(f1);
00162 
00163     jack_default_audio_sample_t* out = ret.GetSamples();
00164     for (unsigned int x = 0; x < ret.SampleCount(); ++x) {
00165         out[x] *= scalar;
00166     }
00167 
00168     return ret;
00169 }

SoundFrame operator* ( const SoundFrame f1,
const SoundFrame f2 
)

Definition at line 140 of file SoundFrame.cpp.

References SoundFrame::GetSamples(), SoundFrame::SampleCount(), and SoundFrame::Set().

00141 {
00142     SoundFrame ret;
00143     ret.Set(f1);
00144 
00145     if (f1.SampleCount() < f2.SampleCount()) {
00146         ret.Set(f2.SampleCount());
00147     }
00148 
00149     jack_default_audio_sample_t* out = ret.GetSamples();
00150     jack_default_audio_sample_t* sam = f2.GetSamples();
00151     for (unsigned int x = 0; x < ret.SampleCount(); ++x) {
00152         out[x] *= sam[x];
00153     }
00154 
00155     return ret;
00156 }

SoundFrame operator+ ( const SoundFrame f1,
const SoundFrame f2 
)

Definition at line 122 of file SoundFrame.cpp.

References SoundFrame::GetSamples(), SoundFrame::SampleCount(), and SoundFrame::Set().

00123 {
00124     SoundFrame ret;
00125     ret.Set(f1);
00126 
00127     if (f1.SampleCount() < f2.SampleCount()) {
00128         ret.Set(f2.SampleCount());
00129     }
00130 
00131     jack_default_audio_sample_t* out = ret.GetSamples();
00132     jack_default_audio_sample_t* sam = f2.GetSamples();
00133     for (unsigned int x = 0; x < ret.SampleCount(); ++x) {
00134         out[x] += sam[x];
00135     }
00136 
00137     return ret;
00138 }

ostream& operator<< ( ostream &  o,
const SoundFrame sf 
)

Definition at line 171 of file SoundFrame.cpp.

References SoundFrame::GetSamples(), and SoundFrame::SampleCount().

00172 {
00173     o << sf.SampleCount() << "samples: " << endl;
00174     for (unsigned int x = 0; x < sf.SampleCount(); ++x) {
00175         o << " " << sf.GetSamples()[x];
00176     }
00177     return o;
00178 }


Get JackFX at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated for JackFX by  doxygen