1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-27 08:17:38 +02:00

Move library tree where it belongs

This commit is contained in:
ra
2010-01-24 09:19:39 +00:00
parent e74978ba77
commit 58caf78a86
6020 changed files with 2790154 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
/***************************************************/
/*! \class Generator
\brief STK abstract unit generator parent class.
This class provides common functionality for
STK unit generator sample-source subclasses.
by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
*/
/***************************************************/
#include "Generator.h"
using namespace Nyq;
Generator :: Generator() : Stk()
{
lastOutput_ = 0.0;
}
Generator :: ~Generator()
{
}
StkFloat Generator :: tick( void )
{
return computeSample();
}
StkFrames& Generator :: tick( StkFrames& frames, unsigned int channel )
{
if ( channel >= frames.channels() ) {
errorString_ << "Generator::tick(): channel and StkFrames arguments are incompatible!";
handleError( StkError::FUNCTION_ARGUMENT );
}
if ( frames.channels() == 1 ) {
for ( unsigned int i=0; i<frames.frames(); i++ )
frames[i] = computeSample();
}
else if ( frames.interleaved() ) {
unsigned int hop = frames.channels();
unsigned int index = channel;
for ( unsigned int i=0; i<frames.frames(); i++ ) {
frames[index] = computeSample();
index += hop;
}
}
else {
unsigned int iStart = channel * frames.frames();
for ( unsigned int i=0; i<frames.frames(); i++, iStart++ )
frames[iStart] = computeSample();
}
return frames;
}