📄 bass.h
字号:
DWORD flags; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags
DWORD ctype; // type of channel
DWORD origres; // original resolution
} BASS_CHANNELINFO;
// BASS_CHANNELINFO types
#define BASS_CTYPE_SAMPLE 1
#define BASS_CTYPE_RECORD 2
#define BASS_CTYPE_STREAM 0x10000
#define BASS_CTYPE_STREAM_WAV 0x10001
#define BASS_CTYPE_STREAM_OGG 0x10002
#define BASS_CTYPE_STREAM_MP1 0x10003
#define BASS_CTYPE_STREAM_MP2 0x10004
#define BASS_CTYPE_STREAM_MP3 0x10005
#define BASS_CTYPE_STREAM_AIFF 0x10006
#define BASS_CTYPE_MUSIC_MOD 0x20000
#define BASS_CTYPE_MUSIC_MTM 0x20001
#define BASS_CTYPE_MUSIC_S3M 0x20002
#define BASS_CTYPE_MUSIC_XM 0x20003
#define BASS_CTYPE_MUSIC_IT 0x20004
#define BASS_CTYPE_MUSIC_MO3 0x00100 // mo3 flag
// 3D vector (for 3D positions/velocities/orientations)
typedef struct BASS_3DVECTOR {
#ifdef __cplusplus
BASS_3DVECTOR() {};
BASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {};
#endif
float x; // +=right, -=left
float y; // +=up, -=down
float z; // +=front, -=behind
} BASS_3DVECTOR;
// 3D channel modes
#define BASS_3DMODE_NORMAL 0
/* normal 3D processing */
#define BASS_3DMODE_RELATIVE 1
/* The channel's 3D position (position/velocity/orientation) are relative to
the listener. When the listener's position/velocity/orientation is changed
with BASS_Set3DPosition, the channel's position relative to the listener does
not change. */
#define BASS_3DMODE_OFF 2
/* Turn off 3D processing on the channel, the sound will be played
in the center. */
#ifdef _WIN32
// EAX environments, use with BASS_SetEAXParameters
enum
{
EAX_ENVIRONMENT_GENERIC,
EAX_ENVIRONMENT_PADDEDCELL,
EAX_ENVIRONMENT_ROOM,
EAX_ENVIRONMENT_BATHROOM,
EAX_ENVIRONMENT_LIVINGROOM,
EAX_ENVIRONMENT_STONEROOM,
EAX_ENVIRONMENT_AUDITORIUM,
EAX_ENVIRONMENT_CONCERTHALL,
EAX_ENVIRONMENT_CAVE,
EAX_ENVIRONMENT_ARENA,
EAX_ENVIRONMENT_HANGAR,
EAX_ENVIRONMENT_CARPETEDHALLWAY,
EAX_ENVIRONMENT_HALLWAY,
EAX_ENVIRONMENT_STONECORRIDOR,
EAX_ENVIRONMENT_ALLEY,
EAX_ENVIRONMENT_FOREST,
EAX_ENVIRONMENT_CITY,
EAX_ENVIRONMENT_MOUNTAINS,
EAX_ENVIRONMENT_QUARRY,
EAX_ENVIRONMENT_PLAIN,
EAX_ENVIRONMENT_PARKINGLOT,
EAX_ENVIRONMENT_SEWERPIPE,
EAX_ENVIRONMENT_UNDERWATER,
EAX_ENVIRONMENT_DRUGGED,
EAX_ENVIRONMENT_DIZZY,
EAX_ENVIRONMENT_PSYCHOTIC,
EAX_ENVIRONMENT_COUNT // total number of environments
};
// EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx)
#define EAX_PRESET_GENERIC EAX_ENVIRONMENT_GENERIC,0.5F,1.493F,0.5F
#define EAX_PRESET_PADDEDCELL EAX_ENVIRONMENT_PADDEDCELL,0.25F,0.1F,0.0F
#define EAX_PRESET_ROOM EAX_ENVIRONMENT_ROOM,0.417F,0.4F,0.666F
#define EAX_PRESET_BATHROOM EAX_ENVIRONMENT_BATHROOM,0.653F,1.499F,0.166F
#define EAX_PRESET_LIVINGROOM EAX_ENVIRONMENT_LIVINGROOM,0.208F,0.478F,0.0F
#define EAX_PRESET_STONEROOM EAX_ENVIRONMENT_STONEROOM,0.5F,2.309F,0.888F
#define EAX_PRESET_AUDITORIUM EAX_ENVIRONMENT_AUDITORIUM,0.403F,4.279F,0.5F
#define EAX_PRESET_CONCERTHALL EAX_ENVIRONMENT_CONCERTHALL,0.5F,3.961F,0.5F
#define EAX_PRESET_CAVE EAX_ENVIRONMENT_CAVE,0.5F,2.886F,1.304F
#define EAX_PRESET_ARENA EAX_ENVIRONMENT_ARENA,0.361F,7.284F,0.332F
#define EAX_PRESET_HANGAR EAX_ENVIRONMENT_HANGAR,0.5F,10.0F,0.3F
#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY,0.153F,0.259F,2.0F
#define EAX_PRESET_HALLWAY EAX_ENVIRONMENT_HALLWAY,0.361F,1.493F,0.0F
#define EAX_PRESET_STONECORRIDOR EAX_ENVIRONMENT_STONECORRIDOR,0.444F,2.697F,0.638F
#define EAX_PRESET_ALLEY EAX_ENVIRONMENT_ALLEY,0.25F,1.752F,0.776F
#define EAX_PRESET_FOREST EAX_ENVIRONMENT_FOREST,0.111F,3.145F,0.472F
#define EAX_PRESET_CITY EAX_ENVIRONMENT_CITY,0.111F,2.767F,0.224F
#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
#endif
// 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);
/* 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. Set the BASS_STREAMPROC_END flag to end
the stream. */
#define BASS_STREAMPROC_END 0x80000000 // end of user stream flag
// BASS_StreamGetFilePosition modes
#define BASS_FILEPOS_CURRENT 0
#define BASS_FILEPOS_DECODE BASS_FILEPOS_CURRENT
#define BASS_FILEPOS_DOWNLOAD 1
#define BASS_FILEPOS_END 2
#define BASS_FILEPOS_START 3
// STREAMFILEPROC actions
#define BASS_FILE_CLOSE 0
#define BASS_FILE_READ 1
#define BASS_FILE_LEN 3
#define BASS_FILE_SEEK 4
typedef DWORD (CALLBACK STREAMFILEPROC)(DWORD action, DWORD param1, DWORD param2, DWORD user);
/* User file stream callback function.
action : The action to perform, one of BASS_FILE_xxx values.
param1 : Depends on "action"
param2 : Depends on "action"
user : The 'user' parameter value given when calling BASS_StreamCreate
RETURN : Depends on "action" */
typedef void (CALLBACK DOWNLOADPROC)(void *buffer, DWORD length, DWORD user);
/* Internet stream download callback function.
buffer : Buffer containing the downloaded data... NULL=end of download
length : Number of bytes in the buffer
user : The 'user' parameter value given when calling BASS_StreamCreateURL */
/* Sync types (with BASS_ChannelSetSync "param" and SYNCPROC "data"
definitions) & flags. */
#define BASS_SYNC_POS 0
/* Sync when a channel reaches a position.
param: position in bytes
data : not used */
#define BASS_SYNC_END 2
/* Sync when a channel 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_META 4
/* Sync when metadata is received in a stream.
param: not used
data : pointer to the metadata */
#define BASS_SYNC_SLIDE 5
/* Sync when an attribute slide is completed.
param: not used
data : the type of slide completed (one of the BASS_SLIDE_xxx values) */
#define BASS_SYNC_STALL 6
/* Sync when playback has stalled.
param: not used
data : 0=stalled, 1=resumed */
#define BASS_SYNC_DOWNLOAD 7
/* Sync when downloading of an internet (or "buffered" user file) stream has ended.
param: not used
data : not used */
#define BASS_SYNC_FREE 8
/* Sync when a channel is freed.
param: not used
data : not used */
#define BASS_SYNC_MUSICPOS 10
/* Sync when a MOD music reaches an order:row position.
param: LOWORD=order (0=first, -1=all) HIWORD=row (0=first, -1=all)
data : LOWORD=order HIWORD=row */
#define BASS_SYNC_MUSICINST 1
/* Sync when an instrument (sample for the non-instrument based formats)
is played in a MOD 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_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_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 as other syncs can't be processed until it has finished. If the sync
is a "mixtime" sync, then other streams and MOD musics can't 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)(HDSP 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)(HRECORD handle, void *buffer, DWORD length, DWORD user);
/* Recording callback function.
handle : The recording handle
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_AVAILABLE 0 // query how much data is buffered
#define BASS_DATA_FLOAT 0x40000000 // flag: return floating-point sample data
#define BASS_DATA_FFT512 0x80000000 // 512 sample FFT
#define BASS_DATA_FFT1024 0x80000001 // 1024 FFT
#define BASS_DATA_FFT2048 0x80000002 // 2048 FFT
#define BASS_DATA_FFT4096 0x80000003 // 4096 FFT
#define BASS_DATA_FFT_INDIVIDUAL 0x10 // FFT flag: FFT for each channel, else all combined
#define BASS_DATA_FFT_NOWINDOW 0x20 // FFT flag: no Hanning window
// BASS_StreamGetTags types : 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
#define BASS_TAG_VENDOR 9 // OGG encoder : null-terminated string
// BASS_MusicSet/GetAttribute options
#define BASS_MUSIC_ATTRIB_AMPLIFY 0
#define BASS_MUSIC_ATTRIB_PANSEP 1
#define BASS_MUSIC_ATTRIB_PSCALER 2
#define BASS_MUSIC_ATTRIB_BPM 3
#define BASS_MUSIC_ATTRIB_SPEED 4
#define BASS_MUSIC_ATTRIB_VOL_GLOBAL 5
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -