/* SampleSelector.h */

#ifndef Included_SampleSelector_h
#define Included_SampleSelector_h

/* SampleSelector module depends on */
/* MiscInfo.h */
/* Audit */
/* Debug */
/* Definitions */
/* Memory */
/* SampleList */
/* WaveTableList */
/* AlgoSampList */
/* AlgoWaveTableList */

typedef float SampRangeHzType;

struct SampleSelectorRec;
typedef struct SampleSelectorRec SampleSelectorRec;

/* types that a sample can be */
typedef enum
	{
		eDataSample EXECUTE(= -4811),
		eAlgoSample,
		eDataWaveTable,
		eAlgoWaveTable
	} SampleSourceTypes;

/* forwards */
struct SampleListRec;
struct AlgoSampListRec;
struct WaveTableListRec;
struct AlgoWaveTableListRec;

/* create a new sample selector record */
SampleSelectorRec*		NewSampleSelectorList(double LowestBound);

/* dispose of a sample selector list */
void									DisposeSampleSelectorList(SampleSelectorRec* SampList);

/* add a new sample thing, with it's upper bound.  the object becomes the */
/* owner of the name string */
MyBoolean							AppendSampleSelector(SampleSelectorRec* SampList,
												double UpperBound, char* Name);

/* get the number of sample ranges specified in the list */
long									GetSampleSelectorListLength(SampleSelectorRec* SampList);

/* return the low bound frequency of a particular list entry */
SampRangeHzType				GetSampleListEntryLowFreqBound(SampleSelectorRec* SampList,
												long Index);

/* return the high bound frequency of a particular list entry */
SampRangeHzType				GetSampleListEntryHighFreqBound(SampleSelectorRec* SampList,
												long Index);

/* get the actual ptr to the sample name */
char*									GetSampleListEntryName(SampleSelectorRec* SampList, long Index);

/* resolve named references to samples.  returns False if it can't */
MyBoolean							ResolveSamplesInSampleList(SampleSelectorRec* SampList,
												struct SampleListRec* SampleList,
												struct AlgoSampListRec* AlgoSampList);

/* resolve named references to wave tables.  returns False if it can't */
MyBoolean							ResolveWaveTablesInSampleList(SampleSelectorRec* SampList,
												struct WaveTableListRec* WaveTableList,
												struct AlgoWaveTableListRec* AlgoWaveTableList);

/* get the wave type of an entry */
SampleSourceTypes			GetSampleListWaveType(SampleSelectorRec* SampList,
												long Index);

/* get a reference to the object */
void*									GetSampleListWaveReference(SampleSelectorRec* SampList,
												long Index);

#endif
