bass.h
来自「Ion Team Lord Of The Rings Demo 模拟指环王的3」· C头文件 代码 · 共 1,189 行 · 第 1/4 页
H
1,189 行
void BASSDEF(BASS_GetInfo)(BASS_INFO *info);
/* Retrieve some information on the device being used.
info : Pointer to store info at */
BOOL BASSDEF(BASS_Update)();
/* Update the HMUSIC/HSTREAM channel buffers. */
float BASSDEF(BASS_GetCPU)();
/* Get the current CPU usage of BASS. This includes the time taken to mix
the MOD musics and sample streams, and also the time taken by any user
DSP functions. It does not include plain sample mixing which is done by
the output device (hardware accelerated) or DirectSound (emulated). Audio
CD playback requires no CPU usage.
RETURN : The CPU usage percentage (floating-point) */
BOOL BASSDEF(BASS_Start)();
/* Start the digital output. */
BOOL BASSDEF(BASS_Stop)();
/* Stop the digital output, stopping all musics/samples/streams. */
BOOL BASSDEF(BASS_Pause)();
/* Stop the digital output, pausing all musics/samples/streams. Use
BASS_Start() to resume the digital output. */
BOOL BASSDEF(BASS_SetVolume)(DWORD volume);
/* Set the digital output master volume.
volume : Desired volume level (0-100) */
int BASSDEF(BASS_GetVolume)();
/* Get the digital output master volume.
RETURN : The volume level (0-100, -1=error) */
BOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf);
/* Set the factors that affect the calculations of 3D sound.
distf : Distance factor (0.0-10.0, 1.0=use meters, 0.3=use feet, <0.0=leave current)
By default BASS measures distances in meters, you can change this
setting if you are using a different unit of measurement.
roolf : Rolloff factor, how fast the sound quietens with distance
(0.0=no rolloff, 1.0=real world, 2.0=2x real... 10.0=max, <0.0=leave current)
doppf : Doppler factor (0.0=no doppler, 1.0=real world, 2.0=2x real... 10.0=max, <0.0=leave current)
The doppler effect is the way a sound appears to change frequency when it is
moving towards or away from you. The listener and sound velocity settings are
used to calculate this effect, this "doppf" value can be used to lessen or
exaggerate the effect. */
BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf);
/* Get the factors that affect the calculations of 3D sound.
distf : Distance factor (NULL=don't get it)
roolf : Rolloff factor (NULL=don't get it)
doppf : Doppler factor (NULL=don't get it) */
BOOL BASSDEF(BASS_Set3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top);
/* Set the position/velocity/orientation of the listener (ie. the player/viewer).
pos : Position of the listener (NULL=leave current)
vel : Listener's velocity, used to calculate doppler effect (NULL=leave current)
front : Direction that listener's front is pointing (NULL=leave current)
top : Direction that listener's top is pointing (NULL=leave current)
NOTE: front & top must both be set in a single call */
BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top);
/* Get the position/velocity/orientation of the listener.
pos : Position of the listener (NULL=don't get it)
vel : Listener's velocity (NULL=don't get it)
front : Direction that listener's front is pointing (NULL=don't get it)
top : Direction that listener's top is pointing (NULL=don't get it)
NOTE: front & top must both be retrieved in a single call */
BOOL BASSDEF(BASS_Apply3D)();
/* Apply changes made to the 3D system. This must be called to apply any changes
made with BASS_Set3DFactors, BASS_Set3DPosition, BASS_ChannelSet3DAttributes or
BASS_ChannelSet3DPosition. It improves performance to have DirectSound do all the
required recalculating at the same time like this, rather than recalculating after
every little change is made. NOTE: This is automatically called when starting a 3D
sample with BASS_SamplePlay3D/Ex. */
BOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, float damp);
/* Set the type of EAX environment and it's parameters. Obviously, EAX functions
have no effect if no EAX supporting device (ie. SB Live) is used.
env : Reverb environment (EAX_ENVIRONMENT_xxx, -1=leave current)
vol : Volume of the reverb (0.0=off, 1.0=max, <0.0=leave current)
decay : Time in seconds it takes the reverb to diminish by 60dB (0.1-20.0, <0.0=leave current)
damp : The damping, high or low frequencies decay faster (0.0=high decays quickest,
1.0=low/high decay equally, 2.0=low decays quickest, <0.0=leave current) */
BOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp);
/* Get the current EAX parameters.
env : Reverb environment (NULL=don't get it)
vol : Reverb volume (NULL=don't get it)
decay : Decay duration (NULL=don't get it)
damp : The damping (NULL=don't get it) */
HMUSIC BASSDEF(BASS_MusicLoad)(BOOL mem, void *file, DWORD offset, DWORD length, DWORD flags);
/* Load a music (MO3/XM/MOD/S3M/IT/MTM). The amplification and pan
seperation are initially set to 50, use BASS_MusicSetAmplify()
and BASS_MusicSetPanSep() to adjust them.
mem : TRUE = Load music from memory
file : Filename (mem=FALSE) or memory location (mem=TRUE)
offset : File offset to load the music from (only used if mem=FALSE)
length : Data length (only used if mem=FALSE, 0=use to end of file)
flags : BASS_MUSIC_xxx flags
RETURN : The loaded music's handle (NULL=error) */
void BASSDEF(BASS_MusicFree)(HMUSIC handle);
/* Free a music's resources.
handle : Music handle */
char *BASSDEF(BASS_MusicGetName)(HMUSIC handle);
/* Retrieves a music's name.
handle : Music handle
RETURN : The music's name (NULL=error) */
DWORD BASSDEF(BASS_MusicGetLength)(HMUSIC handle, BOOL playlen);
/* Retrieves the length of a music in patterns (how many "orders" there are)
or in output bytes (requires BASS_MUSIC_CALCLEN was used with BASS_MusicLoad).
handle : Music handle
playlen: TRUE=get the playback length, FALSE=get the pattern length
RETURN : The length of the music (0xFFFFFFFF=error) */
BOOL BASSDEF(BASS_MusicPreBuf)(HMUSIC handle);
/* Pre-buffer initial sample data ready for playback.
handle : Handle of music */
BOOL BASSDEF(BASS_MusicPlay)(HMUSIC handle);
/* Play a music. Playback continues from where it was last stopped/paused.
Multiple musics may be played simultaneously.
handle : Handle of music to play */
BOOL BASSDEF(BASS_MusicPlayEx)(HMUSIC handle, DWORD pos, int flags, BOOL reset);
/* Play a music, specifying start position and playback flags.
handle : Handle of music to play
pos : Position to start playback from, LOWORD=order HIWORD=row
flags : BASS_MUSIC_xxx flags. These flags overwrite the defaults
specified when the music was loaded. (-1=use current flags)
reset : TRUE = Stop all current playing notes and reset bpm/etc... */
BOOL BASSDEF(BASS_MusicSetAmplify)(HMUSIC handle, DWORD amp);
/* Set a music's amplification level.
handle : Music handle
amp : Amplification level (0-100) */
BOOL BASSDEF(BASS_MusicSetPanSep)(HMUSIC handle, DWORD pan);
/* Set a music's pan seperation.
handle : Music handle
pan : Pan seperation (0-100, 50=linear) */
BOOL BASSDEF(BASS_MusicSetPositionScaler)(HMUSIC handle, DWORD scale);
/* Set a music's "GetPosition" scaler
When you call BASS_ChannelGetPosition, the "row" (HIWORD) will be
scaled by this value. By using a higher scaler, you can get a more
precise position indication.
handle : Music handle
scale : The scaler (1-256) */
BOOL BASSDEF(BASS_MusicSetChannelVol)(HMUSIC handle, DWORD channel, DWORD volume);
/* Set the volume level of a channel in a music
handle : Music handle
channel: Channel number (0=first)
volume : Volume level (0-100) */
int BASSDEF(BASS_MusicGetChannelVol)(HMUSIC handle, DWORD channel);
/* Get the volume level of a channel in a music
handle : Music handle
channel: Channel number (0=first)
RETURN : The channel's volume (-1=error) */
HSAMPLE BASSDEF(BASS_SampleLoad)(BOOL mem, void *file, DWORD offset, DWORD length, DWORD max, DWORD flags);
/* Load a WAV/MP3/MP2/MP1 sample. If you're loading a sample with 3D
functionality, then you should use BASS_GetInfo and BASS_SetInfo to set
the default 3D parameters. You can also use these two functions to set
the sample's default frequency/volume/pan/looping.
mem : TRUE = Load sample from memory
file : Filename (mem=FALSE) or memory location (mem=TRUE)
offset : File offset to load the sample from (only used if mem=FALSE)
length : Data length (only used if mem=FALSE, 0=use to end of file)
max : Maximum number of simultaneous playbacks (1-65535)
flags : BASS_SAMPLE_xxx flags (only the LOOP/3D/SOFTWARE/VAM/MUTEMAX/OVER_xxx flags are used)
RETURN : The loaded sample's handle (NULL=error) */
void* BASSDEF(BASS_SampleCreate)(DWORD length, DWORD freq, DWORD max, DWORD flags);
/* Create a sample. This function allows you to generate custom samples, or
load samples that are not in the WAV format. A pointer is returned to the
memory location at which you should write the sample's data. After writing
the data, call BASS_SampleCreateDone to get the new sample's handle.
length : The sample's length (in samples, NOT bytes)
freq : default sample rate
max : Maximum number of simultaneous playbacks (1-65535)
flags : BASS_SAMPLE_xxx flags
RETURN : Memory location to write the sample's data (NULL=error) */
HSAMPLE BASSDEF(BASS_SampleCreateDone)();
/* Finished creating a new sample.
RETURN : The new sample's handle (NULL=error) */
void BASSDEF(BASS_SampleFree)(HSAMPLE handle);
/* Free a sample's resources.
handle : Sample handle */
BOOL BASSDEF(BASS_SampleGetInfo)(HSAMPLE handle, BASS_SAMPLE *info);
/* Retrieve a sample's current default attributes.
handle : Sample handle
info : Pointer to store sample info */
BOOL BASSDEF(BASS_SampleSetInfo)(HSAMPLE handle, BASS_SAMPLE *info);
/* Set a sample's default attributes.
handle : Sample handle
info : Sample info, only the freq/volume/pan/3D attributes and
looping/override method flags are used */
HCHANNEL BASSDEF(BASS_SamplePlay)(HSAMPLE handle);
/* Play a sample, using the sample's default attributes.
handle : Handle of sample to play
RETURN : Handle of channel used to play the sample (NULL=error) */
HCHANNEL BASSDEF(BASS_SamplePlayEx)(HSAMPLE handle, DWORD start, int freq, int volume, int pan, BOOL loop);
/* Play a sample, using specified attributes.
handle : Handle of sample to play
start : Playback start position (in samples, not bytes)
freq : Playback rate (-1=default)
volume : Volume (-1=default, 0=silent, 100=max)
pan : Pan position (-101=default, -100=left, 0=middle, 100=right)
loop : TRUE = Loop sample (-1=default)
RETURN : Handle of channel used to play the sample (NULL=error) */
HCHANNEL BASSDEF(BASS_SamplePlay3D)(HSAMPLE handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel);
/* Play a 3D sample, setting it's 3D position, orientation and velocity.
handle : Handle of sample to play
pos : position of the sound (NULL = x/y/z=0.0)
orient : orientation of the sound, this is irrelevant if it's an
omnidirectional sound source (NULL = x/y/z=0.0)
vel : velocity of the sound (NULL = x/y/z=0.0)
RETURN : Handle of channel used to play the sample (NULL=error) */
HCHANNEL BASSDEF(BASS_SamplePlay3DEx)(HSAMPLE handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel, DWORD start, int freq, int volume, BOOL loop);
/* Play a 3D sample, using specified attributes.
handle : Handle of sample to play
pos : position of the sound (NULL = x/y/z=0.0)
orient : orientation of the sound, this is irrelevant if it's an
omnidirectional sound source (NULL = x/y/z=0.0)
vel : velocity of the sound (NULL = x/y/z=0.0)
start : Playback start position (in samples, not bytes)
freq : Playback rate (-1=default)
volume : Volume (-1=default, 0=silent, 100=max)
loop : TRUE = Loop sample (-1=default)
RETURN : Handle of channel used to play the sample (NULL=error) */
BOOL BASSDEF(BASS_SampleStop)(HSAMPLE handle);
/* Stops all instances of a sample. For example, if a sample is playing
simultaneously 3 times, calling this function will stop all 3 of them,
which is obviously simpler than calling BASS_ChannelStop() 3 times.
handle : Handle of sample to stop */
HSTREAM BASSDEF(BASS_StreamCreate)(DWORD freq, DWORD flags, STREAMPROC *proc, DWORD user);
/* Create a user sample stream.
freq : Stream playback rate (100-100000)
flags : BASS_SAMPLE_xxx flags (only the 8BITS/MONO/3D flags are used)
proc : User defined stream writing function
user : The 'user' value passed to the callback function
RETURN : The created stream's handle (NULL=error) */
HSTREAM BASSDEF(BASS_StreamCreateFile)(BOOL mem, void *file, DWORD offset, DWORD length, DWORD flags);
/* Create a sample stream from an MP3/MP2/MP1/OGG or WAV file.
mem : TRUE = Stream file from memory
file : Filename (mem=FALSE) or memory location (mem=TRUE)
offset : File offset of the stream data
length : File length (0=use whole file if mem=FALSE)
flags : Flags
RETURN : The created stream's handle (NULL=error) */
HSTREAM BASSDEF(BASS_StreamCreateURL)(char *url, DWORD offset, DWORD flags, char *save);
/* Create a sample stream from an MP3/MP2/MP1/OGG or WAV file on the internet,
optionally saving a local copy to disk.
url : The URL (beginning with "http://" or "ftp://")
offset : File offset of start streaming from
flags : Flags
save : Filename to save the streamed file as locally (NULL=don't save)
RETURN : The created stream's handle (NULL=error) */
void BASSDEF(BASS_StreamFree)(HSTREAM handle);
/* Free a sample stream's resources.
handle : Stream handle */
DWORD BASSDEF(BASS_StreamGetLength)(HSTREAM handle);
/* Retrieves the playback length (in bytes) of a file stream. It's not always
possible to 100% accurately guess the length of a stream, so the length returned
may be only an approximation when using some WAV codecs.
handle : Stream handle
RETURN : The length (0=streaming in blocks, 0xffffffff=error) */
char *BASSDEF(BASS_StreamGetTags)(HSTREAM handle, DWORD tags);
/* Retrieves the requested tags/headers, if available.
handle : Stream handle
tags : A BASS_TAG_xxx flag
RETURN : Pointer to the tags (NULL=error) */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?