Nsound  0.9.4
Namespaces | Macros | Functions
Macros.h File Reference

Go to the source code of this file.

Namespaces

 Nsound
 

Macros

#define M_LINE_PREFIX   __FILE__ << ":" << __LINE__ << ": "
 
#define M_PRINT_LINE   printf("%s:%4d: ", __FILE__, __LINE__)
 
#define M_ROUND_UP(a, b)   ((a % b != 0) ? (a - a % b + b) : a)
 
#define M_ROUND_FLOAT32(f, N)   (floorf((f) * 1.0E##N + 0.5f) / 1.0E##N)
 
#define M_ABS(x)   ((x) < 0 ? -(x) : (x))
 
#define M_MAX(x, y)   ((x) > (y) ? (x) : (y))
 
#define M_MIN(x, y)   ((x) < (y) ? (x) : (y))
 
#define M_SQUARE(x)   ((x) * (x))
 
#define M_CHECK_PTR(ptr)
 
#define M_ASSERT_VALUE(a, op, value)
 
#define M_ASSERT_MSG(expr, message)
 
#define M_THROW(message)
 

Functions

void Nsound::__throw__ (const std::string &message)
 

Macro Definition Documentation

#define M_LINE_PREFIX   __FILE__ << ":" << __LINE__ << ": "

Definition at line 36 of file Macros.h.

#define M_PRINT_LINE   printf("%s:%4d: ", __FILE__, __LINE__)

Definition at line 37 of file Macros.h.

#define M_ROUND_UP (   a,
 
)    ((a % b != 0) ? (a - a % b + b) : a)

Definition at line 40 of file Macros.h.

#define M_ROUND_FLOAT32 (   f,
 
)    (floorf((f) * 1.0E##N + 0.5f) / 1.0E##N)

Definition at line 43 of file Macros.h.

#define M_ABS (   x)    ((x) < 0 ? -(x) : (x))

Definition at line 45 of file Macros.h.

#define M_MAX (   x,
 
)    ((x) > (y) ? (x) : (y))

Definition at line 46 of file Macros.h.

#define M_MIN (   x,
 
)    ((x) < (y) ? (x) : (y))

Definition at line 47 of file Macros.h.

#define M_SQUARE (   x)    ((x) * (x))

Definition at line 48 of file Macros.h.

#define M_CHECK_PTR (   ptr)
Value:
if((ptr) == NULL) \
{ \
std::stringstream ss; \
ss << M_LINE_PREFIX \
<< "FATAL ERROR: " \
<< #ptr \
<< " is NULL"; \
Nsound::__throw__(ss.str()); \
}
void __throw__(const std::string &message)
Definition: Macros.h:54
#define M_LINE_PREFIX
Definition: Macros.h:36

Definition at line 64 of file Macros.h.

Referenced by findID3v1Tag(), Nsound::Generator::generate2(), Nsound::AudioStream::readWavefile(), Nsound::Buffer::readWavefile(), Nsound::Vocoder::Vocoder(), Nsound::AudioStream::writeWavefile(), and Nsound::Buffer::writeWavefile().

#define M_ASSERT_VALUE (   a,
  op,
  value 
)
Value:
if(! ((a) op (value)) ) \
{ \
std::stringstream ss; \
ss << M_LINE_PREFIX \
<< "FATAL ERROR: " \
<< #a \
<< " " #op " " \
<< #value \
<< " condition not met " \
<< "(" \
<< (a) \
<< " " #op " " \
<< (value) \
<< ")"; \
Nsound::__throw__(ss.str()); \
}
void __throw__(const std::string &message)
Definition: Macros.h:54
#define M_LINE_PREFIX
Definition: Macros.h:36

Definition at line 76 of file Macros.h.

Referenced by Nsound::Buffer::_get_resample(), Nsound::Mixer::add(), Nsound::AudioStream::add(), Nsound::AudioStream::AudioStream(), Nsound::BufferWindowSearch::BufferWindowSearch(), Nsound::DelayLine::DelayLine(), Nsound::FilterIIR::designKernel(), Nsound::Generator::drawFatGaussian(), Nsound::Generator::drawLine(), Nsound::Generator::drawParabola(), Nsound::Generator::drawSine(), Nsound::Generator::drawSine2(), Nsound::EnvelopeAdsr::EnvelopeAdsr(), f_to_mel(), Nsound::FilterDelay::FilterDelay(), Nsound::FilterFlanger::FilterFlanger(), Nsound::FilterPhaser::FilterPhaser(), Nsound::Generator::gaussianNoise(), Nsound::Generator::generate(), Nsound::Generator::generate2(), Nsound::Buffer::getDownSample(), Nsound::Buffer::getMax(), Nsound::Buffer::getMaxMagnitude(), Nsound::Buffer::getMin(), Nsound::Mixer::getStream(), mel_to_f(), Nsound::Buffer::mul(), Nsound::AudioStream::operator()(), Nsound::AudioStream::operator*=(), Nsound::AudioStream::operator+=(), Nsound::AudioStream::operator-=(), Nsound::AudioStream::operator/=(), Nsound::AudioStream::operator<<(), Nsound::AudioStream::operator[](), Nsound::AudioStream::operator^=(), Nsound::AudioStream::pan(), Nsound::OrganPipe::play(), Nsound::Plotter::plot(), Nsound::AudioStream::resample2(), Nsound::EnvelopeAdsr::setAttackTime(), Nsound::Wavefile::setDefaultSampleRate(), Nsound::EnvelopeAdsr::setDelayTime(), Nsound::EnvelopeAdsr::setReleaseTime(), Nsound::EnvelopeAdsr::setSustainAmplitude(), Nsound::EnvelopeAdsr::shape(), Nsound::AudioStream::substream(), Nsound::Generator::tanh(), Nsound::Triangle::Triangle(), Nsound::Vocoder::Vocoder(), Nsound::Generator::whiteNoise(), Nsound::Plotter::xlim(), and Nsound::Plotter::ylim().

#define M_ASSERT_MSG (   expr,
  message 
)
Value:
if(! (expr) ) \
{ \
std::stringstream ss; \
ss << M_LINE_PREFIX \
<< "Asertion Failed: " \
<< #expr \
<< " : " \
<< message; \
Nsound::__throw__(ss.str()); \
}
void __throw__(const std::string &message)
Definition: Macros.h:54
#define M_LINE_PREFIX
Definition: Macros.h:36

Definition at line 95 of file Macros.h.

Referenced by Nsound::DelayLine::read().

#define M_THROW (   message)