/* OscFilterArray.h */

#ifndef Included_OscFilterArray_h
#define Included_OscFilterArray_h

/* OscFilterArray module depends on */
/* MiscInfo.h */
/* Audit */
/* Debug */
/* Definitions */
/* Memory */
/* FixedPoint */
/* FilterSpec */
/* FilterFirstOrderLowpass */
/* FilterFirstOrderHighpass */
/* FilterSecondOrderReson */
/* FilterSecondOrderZero */
/* FilterButterworthLowpass */
/* FilterButterworthHighpass */
/* FilterButterworthBandpass */
/* FilterButterworthBandreject */
/* FilterNull */
/* EnvelopeState */
/* LFOGenerator */
/* FilterParametricEqualizer */
/* FilterResonantLowpass */
/* AccentStruct */

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

struct OscFilterArrayRec;
typedef struct OscFilterArrayRec OscFilterArrayRec;

/* forwards */
struct FilterSpecRec;

/* flush cached filter array records */
void								FlushCachedOscFilterArrayStuff(void);

/* create a new parallel filter processor */
OscFilterArrayRec*	NewOscFilterArrayProcessor(struct FilterSpecRec* Template,
											float EnvelopeTicksPerSecond, long SamplingRate,
											struct MainWindowRec* MainWindow, AccentParam* Accents,
											float HurryUp, float InitialFrequency, float FreqForMultisampling,
											long* PreOriginTimeOut, MyBoolean StereoFlag);

/* fix up the origin time so that envelopes start at the proper times */
void								FixUpOscFilterArrayProcessorOrigins(OscFilterArrayRec* Filters,
											long ActualPreOriginTime);

/* dispose of the filter processor */
void								DisposeOscFilterArrayProcessor(OscFilterArrayRec* Filters);

/* update filter state with accent information */
void								OscFilterArrayProcessorUpdateEnvelopes(OscFilterArrayRec* Filters,
											float OscillatorFrequency);

/* apply filter processing to some stuff */
void								ApplyOscFilterArray(largefixedsigned* Data, long NumFrames,
											OscFilterArrayRec* Filters);

/* create key-up impulse */
void								OscFilterArrayKeyUpSustain1(OscFilterArrayRec* Filters);
void								OscFilterArrayKeyUpSustain2(OscFilterArrayRec* Filters);
void								OscFilterArrayKeyUpSustain3(OscFilterArrayRec* Filters);

/* retrigger effect envelopes from the origin point */
void								OscFilterArrayRetriggerEnvelopes(OscFilterArrayRec* Filters,
											AccentParam* NewAccents, float NewHurryUp,
											float NewInitialFrequency, MyBoolean ActuallyRetrigger);

#endif
