| 1 |
// Part of SAASound copyright 1998-2018 Dave Hooper <[email protected]> |
| 2 |
// |
| 3 |
// ********** |
| 4 |
// * PUBLIC * |
| 5 |
// ********** |
| 6 |
// |
| 7 |
// SAASndC.h: "C-style" interface for the CSAASound class. |
| 8 |
// |
| 9 |
////////////////////////////////////////////////////////////////////// |
| 10 |
|
| 11 |
#ifndef SAASNDC_H_INCLUDED |
| 12 |
#define SAASNDC_H_INCLUDED |
| 13 |
|
| 14 |
#ifdef _MSC_VER |
| 15 |
#if _MSC_VER >= 1000 |
| 16 |
#pragma once |
| 17 |
#endif // _MSC_VER >= 1000 |
| 18 |
#endif |
| 19 |
|
| 20 |
#ifndef SAASOUND_H_INCLUDED |
| 21 |
|
| 22 |
// Parameters for use with SetSoundParameters, for example, |
| 23 |
// SetSoundParameters(SAAP_NOFILTER | SAAP_44100 | SAAP_16BIT | SAAP_STEREO); |
| 24 |
#define SAAP_FILTER_HIGHPASS_SIMPLE 0x00000400 |
| 25 |
#define SAAP_FILTER_OVERSAMPLE64x 0x00000300 |
| 26 |
#define SAAP_FILTER_OVERSAMPLE2x 0x00000200 |
| 27 |
#define SAAP_FILTER SAAP_FILTER_OVERSAMPLE2x |
| 28 |
#define SAAP_NOFILTER 0x00000100 |
| 29 |
#define SAAP_44100 0x00000030 |
| 30 |
#define SAAP_22050 0x00000020 |
| 31 |
#define SAAP_11025 0x00000010 |
| 32 |
#define SAAP_16BIT 0x0000000c |
| 33 |
#define SAAP_8BIT 0x00000004 |
| 34 |
#define SAAP_STEREO 0x00000003 |
| 35 |
#define SAAP_MONO 0x00000001 |
| 36 |
|
| 37 |
// Bitmasks for use with GetCurrentSoundParameters, for example, |
| 38 |
// unsigned int CurrentSampleRateParameter = GetCurrentSoundParameters() |
| 39 |
#define SAAP_MASK_FILTER 0x00000f00 |
| 40 |
#define SAAP_MASK_FILTER_HIGHPASS 0x00000c00 |
| 41 |
#define SAAP_MASK_FILTER_OVERSAMPLE 0x00000300 |
| 42 |
#define SAAP_MASK_SAMPLERATE 0x000000030 |
| 43 |
#define SAAP_MASK_BITDEPTH 0x0000000c |
| 44 |
#define SAAP_MASK_CHANNELS 0x00000003 |
| 45 |
|
| 46 |
typedef unsigned int SAAPARAM; |
| 47 |
|
| 48 |
|
| 49 |
#ifndef BYTE |
| 50 |
#define BYTE unsigned char |
| 51 |
#endif |
| 52 |
|
| 53 |
#ifdef WIN32 |
| 54 |
#ifndef WINAPI |
| 55 |
#define WINAPI __stdcall |
| 56 |
#endif |
| 57 |
#define EXTAPI __declspec(dllexport) WINAPI |
| 58 |
#else // Win32 |
| 59 |
#ifndef WINAPI |
| 60 |
#define WINAPI /**/ |
| 61 |
#endif |
| 62 |
#define EXTAPI /**/ |
| 63 |
#endif // Win32 |
| 64 |
|
| 65 |
#endif // SAASOUND_H_INCLUDED |
| 66 |
|
| 67 |
typedef void * SAASND; |
| 68 |
|
| 69 |
// the following are implemented as calls, etc, to a class. |
| 70 |
|
| 71 |
#ifdef __cplusplus |
| 72 |
extern "C" { |
| 73 |
#endif |
| 74 |
|
| 75 |
SAASND EXTAPI newSAASND(void); |
| 76 |
void EXTAPI deleteSAASND(SAASND object); |
| 77 |
|
| 78 |
void EXTAPI SAASNDSetSoundParameters(SAASND object, SAAPARAM uParam); |
| 79 |
void EXTAPI SAASNDWriteAddress(SAASND object, BYTE nReg); |
| 80 |
void EXTAPI SAASNDWriteData(SAASND object, BYTE nData); |
| 81 |
void EXTAPI SAASNDWriteAddressData(SAASND object, BYTE nReg, BYTE nData); |
| 82 |
void EXTAPI SAASNDClear(SAASND object); |
| 83 |
BYTE EXTAPI SAASNDReadAddress(SAASND object); |
| 84 |
|
| 85 |
SAAPARAM EXTAPI SAASNDGetCurrentSoundParameters(SAASND object); |
| 86 |
unsigned short EXTAPI SAASNDGetCurrentBytesPerSample(SAASND object); |
| 87 |
unsigned short EXTAPI SAASNDGetBytesPerSample(SAAPARAM uParam); |
| 88 |
unsigned int EXTAPI SAASNDGetCurrentSampleRate(SAASND object); |
| 89 |
unsigned int EXTAPI SAASNDGetSampleRate(SAAPARAM uParam); |
| 90 |
|
| 91 |
void EXTAPI SAASNDGenerateMany(SAASND object, BYTE * pBuffer, unsigned int nSamples); |
| 92 |
|
| 93 |
void EXTAPI SAASNDSetClockRate(SAASND object, unsigned int nClockRate); |
| 94 |
void EXTAPI SAASNDSetSampleRate(SAASND object, unsigned int nSampleRate); |
| 95 |
void EXTAPI SAASNDSetOversample(SAASND object, unsigned int nOversample); |
| 96 |
|
| 97 |
|
| 98 |
#ifdef __cplusplus |
| 99 |
}; // extern "C" |
| 100 |
#endif |
| 101 |
|
| 102 |
#endif // SAASNDC_H_INCLUDED |