bass.h
来自「Ion Team Lord Of The Rings Demo 模拟指环王的3」· C头文件 代码 · 共 1,189 行 · 第 1/4 页
H
1,189 行
#define EAX_PRESET_MOUNTAINS EAX_ENVIRONMENT_MOUNTAINS,0.194F,7.841F,0.472F
#define EAX_PRESET_QUARRY EAX_ENVIRONMENT_QUARRY,1.0F,1.499F,0.5F
#define EAX_PRESET_PLAIN EAX_ENVIRONMENT_PLAIN,0.097F,2.767F,0.224F
#define EAX_PRESET_PARKINGLOT EAX_ENVIRONMENT_PARKINGLOT,0.208F,1.652F,1.5F
#define EAX_PRESET_SEWERPIPE EAX_ENVIRONMENT_SEWERPIPE,0.652F,2.886F,0.25F
#define EAX_PRESET_UNDERWATER EAX_ENVIRONMENT_UNDERWATER,1.0F,1.499F,0.0F
#define EAX_PRESET_DRUGGED EAX_ENVIRONMENT_DRUGGED,0.875F,8.392F,1.388F
#define EAX_PRESET_DIZZY EAX_ENVIRONMENT_DIZZY,0.139F,17.234F,0.666F
#define EAX_PRESET_PSYCHOTIC EAX_ENVIRONMENT_PSYCHOTIC,0.486F,7.563F,0.806F
// software 3D mixing algorithm modes (used with BASS_Set3DAlgorithm)
#define BASS_3DALG_DEFAULT 0
/* default algorithm (currently translates to BASS_3DALG_OFF) */
#define BASS_3DALG_OFF 1
/* Uses normal left and right panning. The vertical axis is ignored except for
scaling of volume due to distance. Doppler shift and volume scaling are still
applied, but the 3D filtering is not performed. This is the most CPU efficient
software implementation, but provides no virtual 3D audio effect. Head Related
Transfer Function processing will not be done. Since only normal stereo panning
is used, a channel using this algorithm may be accelerated by a 2D hardware
voice if no free 3D hardware voices are available. */
#define BASS_3DALG_FULL 2
/* This algorithm gives the highest quality 3D audio effect, but uses more CPU.
Requires Windows 98 2nd Edition or Windows 2000 that uses WDM drivers, if this
mode is not available then BASS_3DALG_OFF will be used instead. */
#define BASS_3DALG_LIGHT 3
/* This algorithm gives a good 3D audio effect, and uses less CPU than the FULL
mode. Requires Windows 98 2nd Edition or Windows 2000 that uses WDM drivers, if
this mode is not available then BASS_3DALG_OFF will be used instead. */
typedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, DWORD user);
/* Stream callback function. NOTE: A stream function should obviously be as quick
as possible, other streams (and MOD musics) can't be mixed until it's finished.
handle : The stream that needs writing
buffer : Buffer to write the samples in
length : Number of bytes to write
user : The 'user' parameter value given when calling BASS_StreamCreate
RETURN : Number of bytes written. If less than "length" then the
stream is assumed to be at the end, and is stopped. */
/* Sync types (with BASS_ChannelSetSync() "param" and SYNCPROC "data"
definitions) & flags. */
#define BASS_SYNC_MUSICPOS 0
#define BASS_SYNC_POS 0
/* Sync when a music or stream reaches a position.
if HMUSIC...
param: LOWORD=order (0=first, -1=all) HIWORD=row (0=first, -1=all)
data : LOWORD=order HIWORD=row
if HSTREAM...
param: position in bytes
data : not used */
#define BASS_SYNC_MUSICINST 1
/* Sync when an instrument (sample for the non-instrument based formats)
is played in a music (not including retrigs).
param: LOWORD=instrument (1=first) HIWORD=note (0=c0...119=b9, -1=all)
data : LOWORD=note HIWORD=volume (0-64) */
#define BASS_SYNC_END 2
/* Sync when a music or file stream reaches the end.
param: not used
data : 1 = the sync is triggered by a backward jump in a MOD music, otherwise not used */
#define BASS_SYNC_MUSICFX 3
/* Sync when the "sync" effect (XM/MTM/MOD: E8x/Wxx, IT/S3M: S2x) is used.
param: 0:data=pos, 1:data="x" value
data : param=0: LOWORD=order HIWORD=row, param=1: "x" value */
#define BASS_SYNC_META 4
/* Sync when metadata is received in a Shoutcast stream.
param: not used
data : pointer to the metadata */
#define BASS_SYNC_MESSAGE 0x20000000 // FLAG: post a Windows message (instead of callback)
/* When using a window message "callback", the message to post is given in the "proc"
parameter of BASS_ChannelSetSync, and is posted to the window specified in the BASS_Init
call. The message parameters are: WPARAM = data, LPARAM = user. */
#define BASS_SYNC_MIXTIME 0x40000000 // FLAG: sync at mixtime, else at playtime
#define BASS_SYNC_ONETIME 0x80000000 // FLAG: sync only once, else continuously
typedef void (CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, DWORD user);
/* Sync callback function. NOTE: a sync callback function should be very
quick (eg. just posting a message) as other syncs cannot be processed
until it has finished. If the sync is a "mixtime" sync, then other streams
and MOD musics can not be mixed until it's finished either.
handle : The sync that has occured
channel: Channel that the sync occured in
data : Additional data associated with the sync's occurance
user : The 'user' parameter given when calling BASS_ChannelSetSync */
typedef void (CALLBACK DSPPROC)(HSYNC handle, DWORD channel, void *buffer, DWORD length, DWORD user);
/* DSP callback function. NOTE: A DSP function should obviously be as quick as
possible... other DSP functions, streams and MOD musics can not be processed
until it's finished.
handle : The DSP handle
channel: Channel that the DSP is being applied to
buffer : Buffer to apply the DSP to
length : Number of bytes in the buffer
user : The 'user' parameter given when calling BASS_ChannelSetDSP */
typedef BOOL (CALLBACK RECORDPROC)(void *buffer, DWORD length, DWORD user);
/* Recording callback function.
buffer : Buffer containing the recorded sample data
length : Number of bytes
user : The 'user' parameter value given when calling BASS_RecordStart
RETURN : TRUE = continue recording, FALSE = stop */
// BASS_ChannelGetData flags
#define BASS_DATA_FFT512 0x80000000 // 512 sample FFT
#define BASS_DATA_FFT1024 0x80000001 // 1024 FFT
#define BASS_DATA_FFT2048 0x80000002 // 2048 FFT
// BASS_StreamGetTags flags : what's returned
#define BASS_TAG_ID3 0 // ID3v1 tags : 128 byte block
#define BASS_TAG_ID3V2 1 // ID3v2 tags : variable length block
#define BASS_TAG_OGG 2 // OGG comments : array of null-terminated strings
#define BASS_TAG_HTTP 3 // HTTP headers : array of null-terminated strings
#define BASS_TAG_ICY 4 // ICY headers : array of null-terminated strings
#define BASS_TAG_META 5 // ICY metadata : null-terminated string
// DX8 effect types, use with BASS_ChannelSetFX
enum
{
BASS_FX_CHORUS, // GUID_DSFX_STANDARD_CHORUS
BASS_FX_COMPRESSOR, // GUID_DSFX_STANDARD_COMPRESSOR
BASS_FX_DISTORTION, // GUID_DSFX_STANDARD_DISTORTION
BASS_FX_ECHO, // GUID_DSFX_STANDARD_ECHO
BASS_FX_FLANGER, // GUID_DSFX_STANDARD_FLANGER
BASS_FX_GARGLE, // GUID_DSFX_STANDARD_GARGLE
BASS_FX_I3DL2REVERB, // GUID_DSFX_STANDARD_I3DL2REVERB
BASS_FX_PARAMEQ, // GUID_DSFX_STANDARD_PARAMEQ
BASS_FX_REVERB // GUID_DSFX_WAVES_REVERB
};
typedef struct {
float fWetDryMix;
float fDepth;
float fFeedback;
float fFrequency;
DWORD lWaveform; // 0=triangle, 1=sine
float fDelay;
DWORD lPhase; // BASS_FX_PHASE_xxx
} BASS_FXCHORUS; // DSFXChorus
typedef struct {
float fGain;
float fAttack;
float fRelease;
float fThreshold;
float fRatio;
float fPredelay;
} BASS_FXCOMPRESSOR; // DSFXCompressor
typedef struct {
float fGain;
float fEdge;
float fPostEQCenterFrequency;
float fPostEQBandwidth;
float fPreLowpassCutoff;
} BASS_FXDISTORTION; // DSFXDistortion
typedef struct {
float fWetDryMix;
float fFeedback;
float fLeftDelay;
float fRightDelay;
BOOL lPanDelay;
} BASS_FXECHO; // DSFXEcho
typedef struct {
float fWetDryMix;
float fDepth;
float fFeedback;
float fFrequency;
DWORD lWaveform; // 0=triangle, 1=sine
float fDelay;
DWORD lPhase; // BASS_FX_PHASE_xxx
} BASS_FXFLANGER; // DSFXFlanger
typedef struct {
DWORD dwRateHz; // Rate of modulation in hz
DWORD dwWaveShape; // 0=triangle, 1=square
} BASS_FXGARGLE; // DSFXGargle
typedef struct {
int lRoom; // [-10000, 0] default: -1000 mB
int lRoomHF; // [-10000, 0] default: 0 mB
float flRoomRolloffFactor; // [0.0, 10.0] default: 0.0
float flDecayTime; // [0.1, 20.0] default: 1.49s
float flDecayHFRatio; // [0.1, 2.0] default: 0.83
int lReflections; // [-10000, 1000] default: -2602 mB
float flReflectionsDelay; // [0.0, 0.3] default: 0.007 s
int lReverb; // [-10000, 2000] default: 200 mB
float flReverbDelay; // [0.0, 0.1] default: 0.011 s
float flDiffusion; // [0.0, 100.0] default: 100.0 %
float flDensity; // [0.0, 100.0] default: 100.0 %
float flHFReference; // [20.0, 20000.0] default: 5000.0 Hz
} BASS_FXI3DL2REVERB; // DSFXI3DL2Reverb
typedef struct {
float fCenter;
float fBandwidth;
float fGain;
} BASS_FXPARAMEQ; // DSFXParamEq
typedef struct {
float fInGain; // [-96.0,0.0] default: 0.0 dB
float fReverbMix; // [-96.0,0.0] default: 0.0 db
float fReverbTime; // [0.001,3000.0] default: 1000.0 ms
float fHighFreqRTRatio; // [0.001,0.999] default: 0.001
} BASS_FXREVERB; // DSFXWavesReverb
#define BASS_FX_PHASE_NEG_180 0
#define BASS_FX_PHASE_NEG_90 1
#define BASS_FX_PHASE_ZERO 2
#define BASS_FX_PHASE_90 3
#define BASS_FX_PHASE_180 4
#define CDCHANNEL 0 // CD channel, for use with BASS_Channel functions
#define RECORDCHAN 1 // Recording channel, for use with BASS_Channel functions
// BASS_CDGetID flags
#define BASS_CDID_IDENTITY 0
#define BASS_CDID_UPC 1
#define BASS_CDID_CDDB 2
DWORD BASSDEF(BASS_GetVersion)();
/* Retrieve the version number of BASS that is loaded.
RETURN : The BASS version (LOWORD.HIWORD) */
char *BASSDEF(BASS_GetDeviceDescription)(DWORD devnum);
/* Get the text description of a device. This function can be used to
enumerate the available devices.
devnum : The device (0=first)
RETURN : The text description of the device (NULL=error) */
float BASSDEF(BASS_SetBufferLength)(float length);
/* Set the amount that BASS mixes ahead new musics/streams. Changing
this setting does not affect musics/streams that have already been
loaded/created. Increasing the buffer length, decreases the chance of
the sound possibly breaking-up on slower computers, but also requires
more memory. The default length is 0.5 secs.
length : The buffer length in seconds
RETURN : The actual new buffer length */
void BASSDEF(BASS_SetGlobalVolumes)(int musvol, int samvol, int strvol);
/* Set the global music/sample/stream volume levels.
musvol : MOD music global volume level (0-100, -1=leave current)
samvol : Sample global volume level (0-100, -1=leave current)
strvol : Stream global volume level (0-100, -1=leave current) */
void BASSDEF(BASS_GetGlobalVolumes)(DWORD *musvol, DWORD *samvol, DWORD *strvol);
/* Retrive the global music/sample/stream volume levels.
musvol : MOD music global volume level (NULL=don't retrieve it)
samvol : Sample global volume level (NULL=don't retrieve it)
strvol : Stream global volume level (NULL=don't retrieve it) */
void BASSDEF(BASS_SetLogCurves)(BOOL volume, BOOL pan);
/* Make the volume/panning values translate to a logarithmic curve,
or a linear "curve" (the default).
volume : volume curve (FALSE=linear, TRUE=log)
pan : panning curve (FALSE=linear, TRUE=log) */
void BASSDEF(BASS_Set3DAlgorithm)(DWORD algo);
/* Set the 3D algorithm for software mixed 3D channels (does not affect
hardware mixed channels). Changing the mode only affects subsequently
created or loaded samples/streams/musics, not those that already exist.
Requires DirectX 7 or above.
algo : algorithm flag (BASS_3DALG_xxx) */
DWORD BASSDEF(BASS_ErrorGetCode)();
/* Get the BASS_ERROR_xxx error code. Use this function to get the
reason for an error. */
void BASSDEF(BASS_SetCLSID)(GUID *clsid);
/* Set the class identifier of the object to create, that will be used
to initialize DirectSound.
clsid : Class identifier of the object to create (NULL=use default) */
BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, HWND win);
/* Initialize the digital output. This must be called before all following
BASS functions (except CD and recording functions).
device : Device to use (0=first, -1=default, -2=no sound)
freq : Output sample rate
flags : BASS_DEVICE_xxx flags (optional HIWORD=update period)
win : Owner window (0=current foreground window)
NOTE: The "no sound" device (device=-2), allows loading and "playing"
of MOD musics only (all sample/stream functions and most other functions
fail). This is so that you can still use the MOD musics as synchronizers
when there is no soundcard present. When using device -2, you should still
set the other arguments as you would do normally. */
void BASSDEF(BASS_Free)();
/* Free all resources used by the digital output, including all musics
and samples. */
void *BASSDEF(BASS_GetDSoundObject)(DWORD object);
/* Retrieve a pointer to a DirectSound interface. This can be used by
advanced users to "plugin" external functionality.
object : The interface to retrieve (BASS_OBJECT_xxx)
RETURN : A pointer to the requested interface (NULL=error) */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?