Commit af810089 authored by Gargaj's avatar Gargaj
Browse files

Merge branch 'drop-the-bass'

parents 77eb00a9 b1825640
...@@ -111,23 +111,23 @@ set(BZC_PROJECT_INCLUDES ${BZC_PROJECT_INCLUDES} ...@@ -111,23 +111,23 @@ set(BZC_PROJECT_INCLUDES ${BZC_PROJECT_INCLUDES}
) )
############################################################################## ##############################################################################
# BASS # mini_al
set(BZC_PROJECT_INCLUDES ${BZC_PROJECT_INCLUDES} ${CMAKE_SOURCE_DIR}/external/bass) set(BZC_PROJECT_INCLUDES ${BZC_PROJECT_INCLUDES} ${CMAKE_SOURCE_DIR}/external/mini_al)
if (APPLE)
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/libbass.dylib) ##############################################################################
elseif (UNIX) # kiss_fft
if (BONZOMATIC_64BIT) set(KISSFFT_SRCS
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/x64/libbass.so) ${CMAKE_SOURCE_DIR}/external/kiss_fft/kiss_fft.c
else () ${CMAKE_SOURCE_DIR}/external/kiss_fft/tools/kiss_fftr.c
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/x86/libbass.so) )
endif () add_library(bzc_kissfft STATIC ${KISSFFT_SRCS})
elseif (WIN32) target_include_directories(bzc_kissfft PUBLIC ${CMAKE_SOURCE_DIR}/external/kiss_fft ${CMAKE_SOURCE_DIR}/external/kiss_fft/tools)
if (BONZOMATIC_64BIT) if (MSVC)
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/x64/bass.lib) target_compile_options(bzc_kissfft PUBLIC "$<$<CONFIG:Release>:/MT>")
else ()
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/x86/bass.lib)
endif ()
endif () endif ()
set(BZC_PROJECT_INCLUDES ${BZC_PROJECT_INCLUDES} ${CMAKE_SOURCE_DIR}/external/kiss_fft)
set(BZC_PROJECT_INCLUDES ${BZC_PROJECT_INCLUDES} ${CMAKE_SOURCE_DIR}/external/kiss_fft/tools)
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} bzc_kissfft)
############################################################################## ##############################################################################
# JSONXX # JSONXX
...@@ -425,7 +425,6 @@ if (APPLE) ...@@ -425,7 +425,6 @@ if (APPLE)
set_source_files_properties(${BZC_RESOURCES_DATA} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) set_source_files_properties(${BZC_RESOURCES_DATA} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(OSX_LIB_FILES ${CMAKE_SOURCE_DIR}/external/bass/libbass.dylib)
set_source_files_properties(${OSX_LIB_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) set_source_files_properties(${OSX_LIB_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS)
set(BZC_PROJECT_SRCS ${BZC_PROJECT_SRCS} ${OSX_LIB_FILES}) set(BZC_PROJECT_SRCS ${BZC_PROJECT_SRCS} ${OSX_LIB_FILES})
...@@ -482,12 +481,7 @@ endif () ...@@ -482,12 +481,7 @@ endif ()
target_include_directories(${BZC_EXE_NAME} PUBLIC ${BZC_PROJECT_INCLUDES}) target_include_directories(${BZC_EXE_NAME} PUBLIC ${BZC_PROJECT_INCLUDES})
target_link_libraries(${BZC_EXE_NAME} ${BZC_PROJECT_LIBS}) target_link_libraries(${BZC_EXE_NAME} ${BZC_PROJECT_LIBS})
if (WIN32) if (MSVC)
if (BONZOMATIC_64BIT)
add_custom_command(TARGET ${BZC_EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/external/bass/x64/bass.dll" $<TARGET_FILE_DIR:${BZC_EXE_NAME}>)
else ()
add_custom_command(TARGET ${BZC_EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/external/bass/x86/bass.dll" $<TARGET_FILE_DIR:${BZC_EXE_NAME}>)
endif ()
if (BONZOMATIC_NDI) if (BONZOMATIC_NDI)
if (BONZOMATIC_64BIT) if (BONZOMATIC_64BIT)
add_custom_command(TARGET ${BZC_EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${NDI_SDK_DIR}/Bin/x64/Processing.NDI.Lib.x64.dll" $<TARGET_FILE_DIR:${BZC_EXE_NAME}>) add_custom_command(TARGET ${BZC_EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${NDI_SDK_DIR}/Bin/x64/Processing.NDI.Lib.x64.dll" $<TARGET_FILE_DIR:${BZC_EXE_NAME}>)
...@@ -499,11 +493,6 @@ endif () ...@@ -499,11 +493,6 @@ endif ()
## install ## install
if (UNIX AND (NOT APPLE)) if (UNIX AND (NOT APPLE))
if (BONZOMATIC_64BIT)
install(FILES "${CMAKE_SOURCE_DIR}/external/bass/x64/libbass.so" DESTINATION lib)
else ()
install(FILES "${CMAKE_SOURCE_DIR}/external/bass/x86/libbass.so" DESTINATION lib)
endif ()
install(TARGETS ${BZC_EXE_NAME} RUNTIME DESTINATION bin) install(TARGETS ${BZC_EXE_NAME} RUNTIME DESTINATION bin)
install(FILES "${CMAKE_SOURCE_DIR}/data/unix/bonzomatic.desktop" install(FILES "${CMAKE_SOURCE_DIR}/data/unix/bonzomatic.desktop"
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
......
...@@ -38,6 +38,7 @@ Create a `config.json` with e.g. the following contents: (all fields are optiona ...@@ -38,6 +38,7 @@ Create a `config.json` with e.g. the following contents: (all fields are optiona
}, },
"rendering":{ "rendering":{
"fftSmoothFactor": 0.9, // 0.0 means there's no smoothing at all, 1.0 means the FFT is completely smoothed flat "fftSmoothFactor": 0.9, // 0.0 means there's no smoothing at all, 1.0 means the FFT is completely smoothed flat
"fftAmplification": 1.0, // 1.0 means no change, larger values will result in brighter/stronger bands, smaller values in darker/weaker ones
}, },
"textures":{ // the keys below will become the shader variable names "textures":{ // the keys below will become the shader variable names
"texChecker":"textures/checker.png", "texChecker":"textures/checker.png",
...@@ -85,7 +86,8 @@ https://github.com/Gargaj/Bonzomatic/wiki/How-to-set-up-a-Live-Coding-compo ...@@ -85,7 +86,8 @@ https://github.com/Gargaj/Bonzomatic/wiki/How-to-set-up-a-Live-Coding-compo
### Libraries and other included software ### Libraries and other included software
- Scintilla editing component by the Scintilla Dev Team (http://www.scintilla.org/) - Scintilla editing component by the Scintilla Dev Team (http://www.scintilla.org/)
- OpenGL Extension Wrangler Library by Nigel Stewart (http://glew.sourceforge.net/) - OpenGL Extension Wrangler Library by Nigel Stewart (http://glew.sourceforge.net/)
- BASS.DLL by Ian Luck (http://www.un4seen.com/) - mini_al by David Reid (https://github.com/dr-soft/mini_al)
- KISSFFT by Mark Borgerding (https://github.com/mborgerding/kissfft/)
- STB Image and Truetype libraries by Sean Barrett (http://nothings.org/) - STB Image and Truetype libraries by Sean Barrett (http://nothings.org/)
- GLFW by whoever made GLFW (http://www.glfw.org/faq.html) - GLFW by whoever made GLFW (http://www.glfw.org/faq.html)
- JSON++ by Hong Jiang (https://github.com/hjiang/jsonxx) - JSON++ by Hong Jiang (https://github.com/hjiang/jsonxx)
......
...@@ -61,7 +61,6 @@ cmake --build . --config Release ...@@ -61,7 +61,6 @@ cmake --build . --config Release
mkdir ..\_package.%BNZ_OUT_DIR%\ mkdir ..\_package.%BNZ_OUT_DIR%\
del ..\_package.%BNZ_OUT_DIR%\Bonzomatic_%BNZ_PLATFORM%_%BNZ_FLAVOR%.exe del ..\_package.%BNZ_OUT_DIR%\Bonzomatic_%BNZ_PLATFORM%_%BNZ_FLAVOR%.exe
copy .\Release\Bonzomatic.exe ..\_package.%BNZ_OUT_DIR%\Bonzomatic_%BNZ_PLATFORM%_%BNZ_FLAVOR%.exe copy .\Release\Bonzomatic.exe ..\_package.%BNZ_OUT_DIR%\Bonzomatic_%BNZ_PLATFORM%_%BNZ_FLAVOR%.exe
copy .\Release\bass.dll ..\_package.%BNZ_OUT_DIR%\
copy .\Release\Processing.NDI.Lib.%BNZ_OUT_DIR%.dll ..\_package.%BNZ_OUT_DIR%\ copy .\Release\Processing.NDI.Lib.%BNZ_OUT_DIR%.dll ..\_package.%BNZ_OUT_DIR%\
cd .. cd ..
goto :eof goto :eof
/*
BASS 2.4 C/C++ header file
Copyright (c) 1999-2016 Un4seen Developments Ltd.
See the BASS.CHM file for more detailed documentation
*/
#ifndef BASS_H
#define BASS_H
#ifdef _WIN32
#include <wtypes.h>
typedef unsigned __int64 QWORD;
#else
#include <stdint.h>
#define WINAPI
#define CALLBACK
typedef uint8_t BYTE;
typedef uint16_t WORD;
typedef uint32_t DWORD;
typedef uint64_t QWORD;
#ifndef __OBJC__
typedef int BOOL;
#endif
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#define LOBYTE(a) (BYTE)(a)
#define HIBYTE(a) (BYTE)((a)>>8)
#define LOWORD(a) (WORD)(a)
#define HIWORD(a) (WORD)((a)>>16)
#define MAKEWORD(a,b) (WORD)(((a)&0xff)|((b)<<8))
#define MAKELONG(a,b) (DWORD)(((a)&0xffff)|((b)<<16))
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define BASSVERSION 0x204 // API version
#define BASSVERSIONTEXT "2.4"
#ifndef BASSDEF
#define BASSDEF(f) WINAPI f
#else
#define NOBASSOVERLOADS
#endif
typedef DWORD HMUSIC; // MOD music handle
typedef DWORD HSAMPLE; // sample handle
typedef DWORD HCHANNEL; // playing sample's channel handle
typedef DWORD HSTREAM; // sample stream handle
typedef DWORD HRECORD; // recording handle
typedef DWORD HSYNC; // synchronizer handle
typedef DWORD HDSP; // DSP handle
typedef DWORD HFX; // DX8 effect handle
typedef DWORD HPLUGIN; // Plugin handle
// Error codes returned by BASS_ErrorGetCode
#define BASS_OK 0 // all is OK
#define BASS_ERROR_MEM 1 // memory error
#define BASS_ERROR_FILEOPEN 2 // can't open the file
#define BASS_ERROR_DRIVER 3 // can't find a free/valid driver
#define BASS_ERROR_BUFLOST 4 // the sample buffer was lost
#define BASS_ERROR_HANDLE 5 // invalid handle
#define BASS_ERROR_FORMAT 6 // unsupported sample format
#define BASS_ERROR_POSITION 7 // invalid position
#define BASS_ERROR_INIT 8 // BASS_Init has not been successfully called
#define BASS_ERROR_START 9 // BASS_Start has not been successfully called
#define BASS_ERROR_SSL 10 // SSL/HTTPS support isn't available
#define BASS_ERROR_ALREADY 14 // already initialized/paused/whatever
#define BASS_ERROR_NOCHAN 18 // can't get a free channel
#define BASS_ERROR_ILLTYPE 19 // an illegal type was specified
#define BASS_ERROR_ILLPARAM 20 // an illegal parameter was specified
#define BASS_ERROR_NO3D 21 // no 3D support
#define BASS_ERROR_NOEAX 22 // no EAX support
#define BASS_ERROR_DEVICE 23 // illegal device number
#define BASS_ERROR_NOPLAY 24 // not playing
#define BASS_ERROR_FREQ 25 // illegal sample rate
#define BASS_ERROR_NOTFILE 27 // the stream is not a file stream
#define BASS_ERROR_NOHW 29 // no hardware voices available
#define BASS_ERROR_EMPTY 31 // the MOD music has no sequence data
#define BASS_ERROR_NONET 32 // no internet connection could be opened
#define BASS_ERROR_CREATE 33 // couldn't create the file
#define BASS_ERROR_NOFX 34 // effects are not available
#define BASS_ERROR_NOTAVAIL 37 // requested data is not available
#define BASS_ERROR_DECODE 38 // the channel is/isn't a "decoding channel"
#define BASS_ERROR_DX 39 // a sufficient DirectX version is not installed
#define BASS_ERROR_TIMEOUT 40 // connection timedout
#define BASS_ERROR_FILEFORM 41 // unsupported file format
#define BASS_ERROR_SPEAKER 42 // unavailable speaker
#define BASS_ERROR_VERSION 43 // invalid BASS version (used by add-ons)
#define BASS_ERROR_CODEC 44 // codec is not available/supported
#define BASS_ERROR_ENDED 45 // the channel/file has ended
#define BASS_ERROR_BUSY 46 // the device is busy
#define BASS_ERROR_UNKNOWN -1 // some other mystery problem
// BASS_SetConfig options
#define BASS_CONFIG_BUFFER 0
#define BASS_CONFIG_UPDATEPERIOD 1
#define BASS_CONFIG_GVOL_SAMPLE 4
#define BASS_CONFIG_GVOL_STREAM 5
#define BASS_CONFIG_GVOL_MUSIC 6
#define BASS_CONFIG_CURVE_VOL 7
#define BASS_CONFIG_CURVE_PAN 8
#define BASS_CONFIG_FLOATDSP 9
#define BASS_CONFIG_3DALGORITHM 10
#define BASS_CONFIG_NET_TIMEOUT 11
#define BASS_CONFIG_NET_BUFFER 12
#define BASS_CONFIG_PAUSE_NOPLAY 13
#define BASS_CONFIG_NET_PREBUF 15
#define BASS_CONFIG_NET_PASSIVE 18
#define BASS_CONFIG_REC_BUFFER 19
#define BASS_CONFIG_NET_PLAYLIST 21
#define BASS_CONFIG_MUSIC_VIRTUAL 22
#define BASS_CONFIG_VERIFY 23
#define BASS_CONFIG_UPDATETHREADS 24
#define BASS_CONFIG_DEV_BUFFER 27
#define BASS_CONFIG_VISTA_TRUEPOS 30
#define BASS_CONFIG_IOS_MIXAUDIO 34
#define BASS_CONFIG_DEV_DEFAULT 36
#define BASS_CONFIG_NET_READTIMEOUT 37
#define BASS_CONFIG_VISTA_SPEAKERS 38
#define BASS_CONFIG_IOS_SPEAKER 39
#define BASS_CONFIG_MF_DISABLE 40
#define BASS_CONFIG_HANDLES 41
#define BASS_CONFIG_UNICODE 42
#define BASS_CONFIG_SRC 43
#define BASS_CONFIG_SRC_SAMPLE 44
#define BASS_CONFIG_ASYNCFILE_BUFFER 45
#define BASS_CONFIG_OGG_PRESCAN 47
#define BASS_CONFIG_MF_VIDEO 48
#define BASS_CONFIG_AIRPLAY 49
#define BASS_CONFIG_DEV_NONSTOP 50
#define BASS_CONFIG_IOS_NOCATEGORY 51
#define BASS_CONFIG_VERIFY_NET 52
#define BASS_CONFIG_DEV_PERIOD 53
#define BASS_CONFIG_FLOAT 54
#define BASS_CONFIG_NET_SEEK 56
// BASS_SetConfigPtr options
#define BASS_CONFIG_NET_AGENT 16
#define BASS_CONFIG_NET_PROXY 17
#define BASS_CONFIG_IOS_NOTIFY 46
// BASS_Init flags
#define BASS_DEVICE_8BITS 1 // 8 bit
#define BASS_DEVICE_MONO 2 // mono
#define BASS_DEVICE_3D 4 // enable 3D functionality
#define BASS_DEVICE_16BITS 8 // limit output to 16 bit
#define BASS_DEVICE_LATENCY 0x100 // calculate device latency (BASS_INFO struct)
#define BASS_DEVICE_CPSPEAKERS 0x400 // detect speakers via Windows control panel
#define BASS_DEVICE_SPEAKERS 0x800 // force enabling of speaker assignment
#define BASS_DEVICE_NOSPEAKER 0x1000 // ignore speaker arrangement
#define BASS_DEVICE_DMIX 0x2000 // use ALSA "dmix" plugin
#define BASS_DEVICE_FREQ 0x4000 // set device sample rate
#define BASS_DEVICE_STEREO 0x8000 // limit output to stereo
// DirectSound interfaces (for use with BASS_GetDSoundObject)
#define BASS_OBJECT_DS 1 // IDirectSound
#define BASS_OBJECT_DS3DL 2 // IDirectSound3DListener
// Device info structure
typedef struct {
#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)
const wchar_t *name; // description
const wchar_t *driver; // driver
#else
const char *name; // description
const char *driver; // driver
#endif
DWORD flags;
} BASS_DEVICEINFO;
// BASS_DEVICEINFO flags
#define BASS_DEVICE_ENABLED 1
#define BASS_DEVICE_DEFAULT 2
#define BASS_DEVICE_INIT 4
#define BASS_DEVICE_TYPE_MASK 0xff000000
#define BASS_DEVICE_TYPE_NETWORK 0x01000000
#define BASS_DEVICE_TYPE_SPEAKERS 0x02000000
#define BASS_DEVICE_TYPE_LINE 0x03000000
#define BASS_DEVICE_TYPE_HEADPHONES 0x04000000
#define BASS_DEVICE_TYPE_MICROPHONE 0x05000000
#define BASS_DEVICE_TYPE_HEADSET 0x06000000
#define BASS_DEVICE_TYPE_HANDSET 0x07000000
#define BASS_DEVICE_TYPE_DIGITAL 0x08000000
#define BASS_DEVICE_TYPE_SPDIF 0x09000000
#define BASS_DEVICE_TYPE_HDMI 0x0a000000
#define BASS_DEVICE_TYPE_DISPLAYPORT 0x40000000
// BASS_GetDeviceInfo flags
#define BASS_DEVICES_AIRPLAY 0x1000000
typedef struct {
DWORD flags; // device capabilities (DSCAPS_xxx flags)
DWORD hwsize; // size of total device hardware memory
DWORD hwfree; // size of free device hardware memory
DWORD freesam; // number of free sample slots in the hardware
DWORD free3d; // number of free 3D sample slots in the hardware
DWORD minrate; // min sample rate supported by the hardware
DWORD maxrate; // max sample rate supported by the hardware
BOOL eax; // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used)
DWORD minbuf; // recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY)
DWORD dsver; // DirectSound version
DWORD latency; // delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY)
DWORD initflags; // BASS_Init "flags" parameter
DWORD speakers; // number of speakers available
DWORD freq; // current output rate
} BASS_INFO;
// BASS_INFO flags (from DSOUND.H)
#define DSCAPS_CONTINUOUSRATE 0x00000010 // supports all sample rates between min/maxrate
#define DSCAPS_EMULDRIVER 0x00000020 // device does NOT have hardware DirectSound support
#define DSCAPS_CERTIFIED 0x00000040 // device driver has been certified by Microsoft
#define DSCAPS_SECONDARYMONO 0x00000100 // mono
#define DSCAPS_SECONDARYSTEREO 0x00000200 // stereo
#define DSCAPS_SECONDARY8BIT 0x00000400 // 8 bit
#define DSCAPS_SECONDARY16BIT 0x00000800 // 16 bit
// Recording device info structure
typedef struct {
DWORD flags; // device capabilities (DSCCAPS_xxx flags)
DWORD formats; // supported standard formats (WAVE_FORMAT_xxx flags)
DWORD inputs; // number of inputs
BOOL singlein; // TRUE = only 1 input can be set at a time
DWORD freq; // current input rate
} BASS_RECORDINFO;
// BASS_RECORDINFO flags (from DSOUND.H)
#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER // device does NOT have hardware DirectSound recording support
#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED // device driver has been certified by Microsoft
// defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H)
#ifndef WAVE_FORMAT_1M08
#define WAVE_FORMAT_1M08 0x00000001 /* 11.025 kHz, Mono, 8-bit */
#define WAVE_FORMAT_1S08 0x00000002 /* 11.025 kHz, Stereo, 8-bit */
#define WAVE_FORMAT_1M16 0x00000004 /* 11.025 kHz, Mono, 16-bit */
#define WAVE_FORMAT_1S16 0x00000008 /* 11.025 kHz, Stereo, 16-bit */
#define WAVE_FORMAT_2M08 0x00000010 /* 22.05 kHz, Mono, 8-bit */
#define WAVE_FORMAT_2S08 0x00000020 /* 22.05 kHz, Stereo, 8-bit */
#define WAVE_FORMAT_2M16 0x00000040 /* 22.05 kHz, Mono, 16-bit */
#define WAVE_FORMAT_2S16 0x00000080 /* 22.05 kHz, Stereo, 16-bit */
#define WAVE_FORMAT_4M08 0x00000100 /* 44.1 kHz, Mono, 8-bit */
#define WAVE_FORMAT_4S08 0x00000200 /* 44.1 kHz, Stereo, 8-bit */
#define WAVE_FORMAT_4M16 0x00000400 /* 44.1 kHz, Mono, 16-bit */
#define WAVE_FORMAT_4S16 0x00000800 /* 44.1 kHz, Stereo, 16-bit */
#endif
// Sample info structure
typedef struct {
DWORD freq; // default playback rate
float volume; // default volume (0-1)
float pan; // default pan (-1=left, 0=middle, 1=right)
DWORD flags; // BASS_SAMPLE_xxx flags
DWORD length; // length (in bytes)
DWORD max; // maximum simultaneous playbacks
DWORD origres; // original resolution bits
DWORD chans; // number of channels
DWORD mingap; // minimum gap (ms) between creating channels
DWORD mode3d; // BASS_3DMODE_xxx mode
float mindist; // minimum distance
float maxdist; // maximum distance
DWORD iangle; // angle of inside projection cone
DWORD oangle; // angle of outside projection cone
float outvol; // delta-volume outside the projection cone
DWORD vam; // voice allocation/management flags (BASS_VAM_xxx)
DWORD priority; // priority (0=lowest, 0xffffffff=highest)
} BASS_SAMPLE;
#define BASS_SAMPLE_8BITS 1 // 8 bit
#define BASS_SAMPLE_FLOAT 256 // 32 bit floating-point
#define BASS_SAMPLE_MONO 2 // mono
#define BASS_SAMPLE_LOOP 4 // looped
#define BASS_SAMPLE_3D 8 // 3D functionality
#define BASS_SAMPLE_SOFTWARE 16 // not using hardware mixing
#define BASS_SAMPLE_MUTEMAX 32 // mute at max distance (3D only)
#define BASS_SAMPLE_VAM 64 // DX7 voice allocation & management
#define BASS_SAMPLE_FX 128 // old implementation of DX8 effects
#define BASS_SAMPLE_OVER_VOL 0x10000 // override lowest volume
#define BASS_SAMPLE_OVER_POS 0x20000 // override longest playing
#define BASS_SAMPLE_OVER_DIST 0x30000 // override furthest from listener (3D only)
#define BASS_STREAM_PRESCAN 0x20000 // enable pin-point seeking/length (MP3/MP2/MP1)
#define BASS_MP3_SETPOS BASS_STREAM_PRESCAN
#define BASS_STREAM_AUTOFREE 0x40000 // automatically free the stream when it stop/ends
#define BASS_STREAM_RESTRATE 0x80000 // restrict the download rate of internet file streams
#define BASS_STREAM_BLOCK 0x100000 // download/play internet file stream in small blocks
#define BASS_STREAM_DECODE 0x200000 // don't play the stream, only decode (BASS_ChannelGetData)
#define BASS_STREAM_STATUS 0x800000 // give server status info (HTTP/ICY tags) in DOWNLOADPROC
#define BASS_MUSIC_FLOAT BASS_SAMPLE_FLOAT
#define BASS_MUSIC_MONO BASS_SAMPLE_MONO
#define BASS_MUSIC_LOOP BASS_SAMPLE_LOOP
#define BASS_MUSIC_3D BASS_SAMPLE_3D
#define BASS_MUSIC_FX BASS_SAMPLE_FX
#define BASS_MUSIC_AUTOFREE BASS_STREAM_AUTOFREE
#define BASS_MUSIC_DECODE BASS_STREAM_DECODE
#define BASS_MUSIC_PRESCAN BASS_STREAM_PRESCAN // calculate playback length
#define BASS_MUSIC_CALCLEN BASS_MUSIC_PRESCAN
#define BASS_MUSIC_RAMP 0x200 // normal ramping
#define BASS_MUSIC_RAMPS 0x400 // sensitive ramping
#define BASS_MUSIC_SURROUND 0x800 // surround sound
#define BASS_MUSIC_SURROUND2 0x1000 // surround sound (mode 2)
#define BASS_MUSIC_FT2PAN 0x2000 // apply FastTracker 2 panning to XM files
#define BASS_MUSIC_FT2MOD 0x2000 // play .MOD as FastTracker 2 does
#define BASS_MUSIC_PT1MOD 0x4000 // play .MOD as ProTracker 1 does
#define BASS_MUSIC_NONINTER 0x10000 // non-interpolated sample mixing
#define BASS_MUSIC_SINCINTER 0x800000 // sinc interpolated sample mixing
#define BASS_MUSIC_POSRESET 0x8000 // stop all notes when moving position
#define BASS_MUSIC_POSRESETEX 0x400000 // stop all notes and reset bmp/etc when moving position
#define BASS_MUSIC_STOPBACK 0x80000 // stop the music on a backwards jump effect
#define BASS_MUSIC_NOSAMPLE 0x100000 // don't load the samples
// Speaker assignment flags
#define BASS_SPEAKER_FRONT 0x1000000 // front speakers
#define BASS_SPEAKER_REAR 0x2000000 // rear/side speakers
#define BASS_SPEAKER_CENLFE 0x3000000 // center & LFE speakers (5.1)
#define BASS_SPEAKER_REAR2 0x4000000 // rear center speakers (7.1)
#define BASS_SPEAKER_N(n) ((n)<<24) // n'th pair of speakers (max 15)
#define BASS_SPEAKER_LEFT 0x10000000 // modifier: left
#define BASS_SPEAKER_RIGHT 0x20000000 // modifier: right
#define BASS_SPEAKER_FRONTLEFT BASS_SPEAKER_FRONT|BASS_SPEAKER_LEFT
#define BASS_SPEAKER_FRONTRIGHT BASS_SPEAKER_FRONT|BASS_SPEAKER_RIGHT
#define BASS_SPEAKER_REARLEFT BASS_SPEAKER_REAR|BASS_SPEAKER_LEFT
#define BASS_SPEAKER_REARRIGHT BASS_SPEAKER_REAR|BASS_SPEAKER_RIGHT
#define BASS_SPEAKER_CENTER BASS_SPEAKER_CENLFE|BASS_SPEAKER_LEFT
#define BASS_SPEAKER_LFE BASS_SPEAKER_CENLFE|BASS_SPEAKER_RIGHT
#define BASS_SPEAKER_REAR2LEFT BASS_SPEAKER_REAR2|BASS_SPEAKER_LEFT
#define BASS_SPEAKER_REAR2RIGHT BASS_SPEAKER_REAR2|BASS_SPEAKER_RIGHT
#define BASS_ASYNCFILE 0x40000000
#define BASS_UNICODE 0x80000000
#define BASS_RECORD_PAUSE 0x8000 // start recording paused
#define BASS_RECORD_ECHOCANCEL 0x2000
#define BASS_RECORD_AGC 0x4000
// DX7 voice allocation & management flags
#define BASS_VAM_HARDWARE 1
#define BASS_VAM_SOFTWARE 2
#define BASS_VAM_TERM_TIME 4
#define BASS_VAM_TERM_DIST 8
#define BASS_VAM_TERM_PRIO 16
// Channel info structure
typedef struct {
DWORD freq; // default playback rate
DWORD chans; // channels
DWORD flags; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags
DWORD ctype; // type of channel
DWORD origres; // original resolution
HPLUGIN plugin; // plugin
HSAMPLE sample; // sample
const char *filename; // filename
} BASS_CHANNELINFO;
// BASS_CHANNELINFO types
#define BASS_CTYPE_SAMPLE 1
#define BASS_CTYPE_RECORD 2
#define BASS_CTYPE_STREAM 0x10000
#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_STREAM_CA 0x10007
#define BASS_CTYPE_STREAM_MF 0x10008
#define BASS_CTYPE_STREAM_WAV 0x40000 // WAVE flag, LOWORD=codec
#define BASS_CTYPE_STREAM_WAV_PCM 0x50001
#define BASS_CTYPE_STREAM_WAV_FLOAT 0x50003
#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
typedef struct {
DWORD ctype; // channel type
#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)
const wchar_t *name; // format description
const wchar_t *exts; // file extension filter (*.ext1;*.ext2;etc...)
#else
const char *name; // format description
const char *exts; // file extension filter (*.ext1;*.ext2;etc...)
#endif
} BASS_PLUGINFORM;
typedef struct {
DWORD version; // version (same form as BASS_GetVersion)
DWORD formatc; // number of formats
const BASS_PLUGINFORM *formats; // the array of formats
} BASS_PLUGININFO;
// 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 // position is relative to the listener
#define BASS_3DMODE_OFF 2 // no 3D processing
// software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM)
#define BASS_3DALG_DEFAULT 0
#define BASS_3DALG_OFF 1
#define BASS_3DALG_FULL 2
#define BASS_3DALG_LIGHT 3
// 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
typedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, void *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
// special STREAMPROCs
#define STREAMPROC_DUMMY (STREAMPROC*)0 // "dummy" stream
#define STREAMPROC_PUSH (STREAMPROC*)-1 // push stream
// BASS_StreamCreateFileUser file systems
#define STREAMFILE_NOBUFFER 0
#define STREAMFILE_BUFFER 1
#define STREAMFILE_BUFFERPUSH 2
// User file stream callback functions
typedef void (CALLBACK FILECLOSEPROC)(void *user);
typedef QWORD (CALLBACK FILELENPROC)(void *user);
typedef DWORD (CALLBACK FILEREADPROC)(void *buffer, DWORD length, void *user);
typedef BOOL (CALLBACK FILESEEKPROC)(QWORD offset, void *user);
typedef struct {
FILECLOSEPROC *close;
FILELENPROC *length;
FILEREADPROC *read;