/* OscEffectGenerator.h */

#ifndef Included_OscEffectGenerator_h
#define Included_OscEffectGenerator_h

/* OscEffectGenerator module depends on */
/* MiscInfo.h */
/* Audit */
/* Debug */
/* Definitions */
/* FixedPoint */
/* EffectSpecList */
/* OscDelayLine */
/* OscNLProc */
/* OscFilterArray */
/* Analyzer */
/* Memory */
/* AccentStruct */

#include "FixedPoint.h"
#include "AccentStruct.h"

struct OscEffectGenRec;
typedef struct OscEffectGenRec OscEffectGenRec;

/* forwards */
struct EffectSpecListRec;
struct NoteObjectRec;
struct MainWindowRec;

/* dispose of cached effect generator structures */
void									FlushOscEffectGeneratorInfo(void);

/* create a new oscillator effect generator */
OscEffectGenRec*			NewOscEffectGenerator(struct EffectSpecListRec* SpecList,
												float EnvelopeTicksPerSecond, long SamplingRate,
												MyBoolean DoingStereo, float InverseVolume,
												struct MainWindowRec* MainWindow, AccentParam* Accents,
												float HurryUp, float InitialFrequency,
												float FreqForMultisampling, long* PreOriginTimeOut);

/* fix up pre-origin time for the oscillator effect generator */
void									FixUpOscEffectGeneratorPreOrigin(OscEffectGenRec* Generator,
												long ActualPreOrigin);

/* dispose of an oscillator effect generator */
void									DisposeOscEffectGenerator(OscEffectGenRec* Generator);

/* update envelopes for effects */
void									OscEffectGeneratorUpdateEnvelopes(OscEffectGenRec* Generator,
												float OscillatorFrequency);

/* generate effect cycle.  this is called once per envelope tick to apply */
/* effects to data generated during this envelope clock cycle. */
void									ApplyOscEffectGenerator(OscEffectGenRec* Generator,
												largefixedsigned* Data, long NumFrames);

/* create key-up impulse */
void									OscEffectKeyUpSustain1(OscEffectGenRec* Generator);
void									OscEffectKeyUpSustain2(OscEffectGenRec* Generator);
void									OscEffectKeyUpSustain3(OscEffectGenRec* Generator);

/* retrigger effect envelopes from the origin point */
void									OscEffectGeneratorRetriggerFromOrigin(OscEffectGenRec* Generator,
												AccentParam* Accents, float NewInitialFrequency,
												float HurryUp, MyBoolean ActuallyRetrigger);

#endif
