Skip to content

Commit 5bab52c

Browse files
Dutchman101ccw808
authored andcommitted
Updated BASS API's to correspondend DLL's (although it's already backwards compatible) (#203)
1 parent d64c819 commit 5bab52c

File tree

8 files changed

+288
-51
lines changed

8 files changed

+288
-51
lines changed

vendor/bass/bass.h

Lines changed: 179 additions & 30 deletions
Large diffs are not rendered by default.

vendor/bass/bass_fx.h

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*===========================================================================
2-
BASS_FX 2.4 - Copyright (c) 2002-2013 (: JOBnik! :) [Arthur Aminov, ISRAEL]
2+
BASS_FX 2.4 - Copyright (c) 2002-2018 (: JOBnik! :) [Arthur Aminov, ISRAEL]
33
[http://www.jobnik.org]
44
55
bugs/suggestions/questions:
66
forum : http://www.un4seen.com/forum/?board=1
7-
http://www.jobnik.org/smforum
7+
http://www.jobnik.org/forums
88
99
--------------------------------------------------
1010
11-
NOTE: This header will work only with BASS_FX version 2.4.10
11+
NOTE: This header will work only with BASS_FX version 2.4.12
1212
Check www.un4seen.com or www.jobnik.org for any later versions.
1313
1414
* Requires BASS 2.4 (available at http://www.un4seen.com)
@@ -25,6 +25,10 @@
2525
#define BASS_FXDEF(f) WINAPI f
2626
#endif
2727

28+
// BASS_CHANNELINFO types
29+
#define BASS_CTYPE_STREAM_TEMPO 0x1f200
30+
#define BASS_CTYPE_STREAM_REVERSE 0x1f201
31+
2832
// Tempo / Reverse / BPM / Beat flag
2933
#define BASS_FX_FREESOURCE 0x10000 // Free the source handle as well?
3034

@@ -81,7 +85,9 @@ enum {
8185
BASS_FX_BFX_COMPRESSOR2, // Compressor 2 / multi channel
8286
BASS_FX_BFX_VOLUME_ENV, // Volume envelope / multi channel
8387
BASS_FX_BFX_BQF, // BiQuad filters / multi channel
84-
BASS_FX_BFX_ECHO4 // Echo/Reverb / multi channel
88+
BASS_FX_BFX_ECHO4, // Echo 4 / multi channel
89+
BASS_FX_BFX_PITCHSHIFT, // Pitch shift using FFT / multi channel (not available on mobile)
90+
BASS_FX_BFX_FREEVERB // Reverb using "Freeverb" algo / multi channel
8591
};
8692

8793
/*
@@ -90,7 +96,7 @@ enum {
9096
BASS_FX_BFX_ECHO -> use BASS_FX_BFX_ECHO4
9197
BASS_FX_BFX_ECHO2 -> use BASS_FX_BFX_ECHO4
9298
BASS_FX_BFX_ECHO3 -> use BASS_FX_BFX_ECHO4
93-
BASS_FX_BFX_REVERB -> use BASS_FX_BFX_ECHO4 with fFeedback enabled
99+
BASS_FX_BFX_REVERB -> use BASS_FX_BFX_FREEVERB
94100
BASS_FX_BFX_FLANGER -> use BASS_FX_BFX_CHORUS
95101
BASS_FX_BFX_COMPRESSOR -> use BASS_FX_BFX_COMPRESSOR2
96102
BASS_FX_BFX_APF -> use BASS_FX_BFX_BQF with BASS_BFX_BQF_ALLPASS filter
@@ -287,7 +293,7 @@ typedef struct {
287293
int lChannel; // BASS_BFX_CHANxxx flag/s
288294
} BASS_BFX_BQF;
289295

290-
// Echo/Reverb
296+
// Echo 4
291297
typedef struct {
292298
float fDryMix; // dry (unaffected) signal mix [-2.......2]
293299
float fWetMix; // wet (affected) signal mix [-2.......2]
@@ -297,6 +303,31 @@ typedef struct {
297303
int lChannel; // BASS_BFX_CHANxxx flag/s
298304
} BASS_BFX_ECHO4;
299305

306+
// Pitch shift (not available on mobile)
307+
typedef struct {
308+
float fPitchShift; // A factor value which is between 0.5 (one octave down) and 2 (one octave up) (1 won't change the pitch) [1 default]
309+
// (fSemitones is not in use, fPitchShift has a priority over fSemitones)
310+
float fSemitones; // Semitones (0 won't change the pitch) [0 default]
311+
long lFFTsize; // Defines the FFT frame size used for the processing. Typical values are 1024, 2048 and 4096 [2048 default]
312+
// It may be any value <= 8192 but it MUST be a power of 2
313+
long lOsamp; // Is the STFT oversampling factor which also determines the overlap between adjacent STFT frames [8 default]
314+
// It should at least be 4 for moderate scaling ratios. A value of 32 is recommended for best quality (better quality = higher CPU usage)
315+
int lChannel; // BASS_BFX_CHANxxx flag/s
316+
} BASS_BFX_PITCHSHIFT;
317+
318+
// Freeverb
319+
#define BASS_BFX_FREEVERB_MODE_FREEZE 1
320+
321+
typedef struct {
322+
float fDryMix; // dry (unaffected) signal mix [0........1], def. 0
323+
float fWetMix; // wet (affected) signal mix [0........3], def. 1.0f
324+
float fRoomSize; // room size [0........1], def. 0.5f
325+
float fDamp; // damping [0........1], def. 0.5f
326+
float fWidth; // stereo width [0........1], def. 1
327+
DWORD lMode; // 0 or BASS_BFX_FREEVERB_MODE_FREEZE, def. 0 (no freeze)
328+
int lChannel; // BASS_BFX_CHANxxx flag/s
329+
} BASS_BFX_FREEVERB;
330+
300331
/*===========================================================================
301332
set dsp fx - BASS_ChannelSetFX
302333
remove dsp fx - BASS_ChannelRemoveFX
@@ -322,13 +353,18 @@ enum {
322353
enum {
323354
BASS_ATTRIB_TEMPO_OPTION_USE_AA_FILTER = 0x10010, // TRUE (default) / FALSE (default for multi-channel on mobile devices for lower CPU usage)
324355
BASS_ATTRIB_TEMPO_OPTION_AA_FILTER_LENGTH, // 32 default (8 .. 128 taps)
325-
BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO, // TRUE (default on mobile devices for loswer CPU usage) / FALSE (default)
356+
BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO, // TRUE (default on mobile devices for lower CPU usage) / FALSE (default)
326357
BASS_ATTRIB_TEMPO_OPTION_SEQUENCE_MS, // 82 default, 0 = automatic
327358
BASS_ATTRIB_TEMPO_OPTION_SEEKWINDOW_MS, // 28 default, 0 = automatic
328359
BASS_ATTRIB_TEMPO_OPTION_OVERLAP_MS, // 8 default
329360
BASS_ATTRIB_TEMPO_OPTION_PREVENT_CLICK // TRUE / FALSE (default)
330361
};
331362

363+
// tempo algorithm flags
364+
#define BASS_FX_TEMPO_ALGO_LINEAR 0x200
365+
#define BASS_FX_TEMPO_ALGO_CUBIC 0x400 // default
366+
#define BASS_FX_TEMPO_ALGO_SHANNON 0x800
367+
332368
HSTREAM BASS_FXDEF(BASS_FX_TempoCreate)(DWORD chan, DWORD flags);
333369
DWORD BASS_FXDEF(BASS_FX_TempoGetSource)(HSTREAM chan);
334370
float BASS_FXDEF(BASS_FX_TempoGetRateRatio)(HSTREAM chan);

vendor/bass/bassmix.h

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
BASSmix 2.4 C/C++ header file
3-
Copyright (c) 2005-2012 Un4seen Developments Ltd.
3+
Copyright (c) 2005-2017 Un4seen Developments Ltd.
44
55
See the BASSMIX.CHM file for more detailed documentation
66
*/
@@ -41,8 +41,16 @@ extern "C" {
4141
#define BASS_MIXER_DOWNMIX 0x400000 // downmix to stereo/mono
4242
#define BASS_MIXER_NORAMPIN 0x800000 // don't ramp-in the start
4343

44+
// mixer attributes
45+
#define BASS_ATTRIB_MIXER_LATENCY 0x15000
46+
4447
// splitter flags
4548
#define BASS_SPLIT_SLAVE 0x1000 // only read buffered data
49+
#define BASS_SPLIT_POS 0x2000
50+
51+
// splitter attributes
52+
#define BASS_ATTRIB_SPLIT_ASYNCBUFFER 0x15010
53+
#define BASS_ATTRIB_SPLIT_ASYNCPERIOD 0x15011
4654

4755
// envelope node
4856
typedef struct {
@@ -54,12 +62,15 @@ typedef struct {
5462
#define BASS_MIXER_ENV_FREQ 1
5563
#define BASS_MIXER_ENV_VOL 2
5664
#define BASS_MIXER_ENV_PAN 3
57-
#define BASS_MIXER_ENV_LOOP 0x10000 // FLAG: loop
65+
#define BASS_MIXER_ENV_LOOP 0x10000 // flag: loop
5866

5967
// additional sync type
6068
#define BASS_SYNC_MIXER_ENVELOPE 0x10200
6169
#define BASS_SYNC_MIXER_ENVELOPE_NODE 0x10201
6270

71+
// additional BASS_Mixer_ChannelSetPosition flag
72+
#define BASS_POS_MIXER_RESET 0x10000 // flag: clear mixer's playback buffer
73+
6374
// BASS_CHANNELINFO type
6475
#define BASS_CTYPE_STREAM_MIXER 0x10800
6576
#define BASS_CTYPE_STREAM_SPLIT 0x10801
@@ -69,6 +80,7 @@ DWORD BASSMIXDEF(BASS_Mixer_GetVersion)();
6980
HSTREAM BASSMIXDEF(BASS_Mixer_StreamCreate)(DWORD freq, DWORD chans, DWORD flags);
7081
BOOL BASSMIXDEF(BASS_Mixer_StreamAddChannel)(HSTREAM handle, DWORD channel, DWORD flags);
7182
BOOL BASSMIXDEF(BASS_Mixer_StreamAddChannelEx)(HSTREAM handle, DWORD channel, DWORD flags, QWORD start, QWORD length);
83+
DWORD BASSMIXDEF(BASS_Mixer_StreamGetChannels)(HSTREAM handle, DWORD *channels, DWORD count);
7284

7385
HSTREAM BASSMIXDEF(BASS_Mixer_ChannelGetMixer)(DWORD handle);
7486
DWORD BASSMIXDEF(BASS_Mixer_ChannelFlags)(DWORD handle, DWORD flags, DWORD mask);
@@ -77,16 +89,18 @@ BOOL BASSMIXDEF(BASS_Mixer_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mo
7789
QWORD BASSMIXDEF(BASS_Mixer_ChannelGetPosition)(DWORD handle, DWORD mode);
7890
QWORD BASSMIXDEF(BASS_Mixer_ChannelGetPositionEx)(DWORD channel, DWORD mode, DWORD delay);
7991
DWORD BASSMIXDEF(BASS_Mixer_ChannelGetLevel)(DWORD handle);
92+
BOOL BASSMIXDEF(BASS_Mixer_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags);
8093
DWORD BASSMIXDEF(BASS_Mixer_ChannelGetData)(DWORD handle, void *buffer, DWORD length);
8194
HSYNC BASSMIXDEF(BASS_Mixer_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user);
8295
BOOL BASSMIXDEF(BASS_Mixer_ChannelRemoveSync)(DWORD channel, HSYNC sync);
83-
BOOL BASSMIXDEF(BASS_Mixer_ChannelSetMatrix)(DWORD handle, const float *matrix);
84-
BOOL BASSMIXDEF(BASS_Mixer_ChannelGetMatrix)(DWORD handle, float *matrix);
96+
BOOL BASSMIXDEF(BASS_Mixer_ChannelSetMatrix)(DWORD handle, const void *matrix);
97+
BOOL BASSMIXDEF(BASS_Mixer_ChannelSetMatrixEx)(DWORD handle, const void *matrix, float time);
98+
BOOL BASSMIXDEF(BASS_Mixer_ChannelGetMatrix)(DWORD handle, void *matrix);
8599
BOOL BASSMIXDEF(BASS_Mixer_ChannelSetEnvelope)(DWORD handle, DWORD type, const BASS_MIXER_NODE *nodes, DWORD count);
86100
BOOL BASSMIXDEF(BASS_Mixer_ChannelSetEnvelopePos)(DWORD handle, DWORD type, QWORD pos);
87101
QWORD BASSMIXDEF(BASS_Mixer_ChannelGetEnvelopePos)(DWORD handle, DWORD type, float *value);
88102

89-
HSTREAM BASSMIXDEF(BASS_Split_StreamCreate)(DWORD channel, DWORD flags, int *chanmap);
103+
HSTREAM BASSMIXDEF(BASS_Split_StreamCreate)(DWORD channel, DWORD flags, const int *chanmap);
90104
DWORD BASSMIXDEF(BASS_Split_StreamGetSource)(HSTREAM handle);
91105
DWORD BASSMIXDEF(BASS_Split_StreamGetSplits)(DWORD handle, HSTREAM *splits, DWORD count);
92106
BOOL BASSMIXDEF(BASS_Split_StreamReset)(DWORD handle);

vendor/bass/basswma.h

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
BASSWMA 2.4 C/C++ header file
3-
Copyright (c) 2002-2010 Un4seen Developments Ltd.
3+
Copyright (c) 2002-2014 Un4seen Developments Ltd.
44
55
See the BASSWMA.CHM file for more detailed documentation
66
*/
@@ -38,6 +38,7 @@ typedef DWORD HWMENCODE; // WMA encoding handle
3838
#define BASS_CONFIG_WMA_BASSFILE 0x10103
3939
#define BASS_CONFIG_WMA_NETSEEK 0x10104
4040
#define BASS_CONFIG_WMA_VIDEO 0x10105
41+
#define BASS_CONFIG_WMA_BUFTIME 0x10106
4142

4243
// additional WMA sync types
4344
#define BASS_SYNC_WMA_CHANGE 0x10100
@@ -52,6 +53,8 @@ typedef DWORD HWMENCODE; // WMA encoding handle
5253
#define BASS_WMA_ENCODE_24BIT 0x8000 // 24-bit
5354
#define BASS_WMA_ENCODE_PCM 0x10000 // uncompressed PCM
5455
#define BASS_WMA_ENCODE_SCRIPT 0x20000 // set script (mid-stream tags) in the WMA encoding
56+
#define BASS_WMA_ENCODE_QUEUE 0x40000 // queue data to feed encoder asynchronously
57+
#define BASS_WMA_ENCODE_SOURCE 0x80000 // use a BASS channel as source
5558

5659
// Additional flag for use with BASS_WMA_EncodeGetRates
5760
#define BASS_WMA_ENCODE_RATES_VBR 0x10000 // get available VBR quality settings
@@ -95,7 +98,7 @@ HSTREAM BASSWMADEF(BASS_WMA_StreamCreateFile)(BOOL mem, const void *file, QWORD
9598
HSTREAM BASSWMADEF(BASS_WMA_StreamCreateFileAuth)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags, const char *user, const char *pass);
9699
HSTREAM BASSWMADEF(BASS_WMA_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *procs, void *user);
97100

98-
const char *BASSWMADEF(BASS_WMA_GetTags)(const void *file, DWORD flags);
101+
const char *BASSWMADEF(BASS_WMA_GetTags)(const char *file, DWORD flags);
99102

100103
const DWORD *BASSWMADEF(BASS_WMA_EncodeGetRates)(DWORD freq, DWORD chans, DWORD flags);
101104
HWMENCODE BASSWMADEF(BASS_WMA_EncodeOpen)(DWORD freq, DWORD chans, DWORD flags, DWORD bitrate, WMENCODEPROC *proc, void *user);
@@ -115,6 +118,36 @@ void *BASSWMADEF(BASS_WMA_GetWMObject)(DWORD handle);
115118

116119
#ifdef __cplusplus
117120
}
121+
122+
static inline HSTREAM BASS_WMA_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags)
123+
{
124+
return BASS_WMA_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE);
125+
}
126+
127+
static inline HSTREAM BASS_WMA_StreamCreateFileAuth(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags, const char *user, const char *pass)
128+
{
129+
return BASS_WMA_StreamCreateFileAuth(mem, (const void*)file, offset, length, flags|BASS_UNICODE, (const char*)user, (const char*)pass);
130+
}
131+
132+
static inline const char *BASS_WMA_GetTags(const WCHAR *file, DWORD flags)
133+
{
134+
return BASS_WMA_GetTags((const char*)file, flags|BASS_UNICODE);
135+
}
136+
137+
static inline HWMENCODE BASS_WMA_EncodeOpenFile(DWORD freq, DWORD chans, DWORD flags, DWORD bitrate, const WCHAR *file)
138+
{
139+
return BASS_WMA_EncodeOpenFile(freq, chans, flags|BASS_UNICODE, bitrate, (const char*)file);
140+
}
141+
142+
static inline HWMENCODE BASS_WMA_EncodeOpenPublish(DWORD freq, DWORD chans, DWORD flags, DWORD bitrate, const WCHAR *url, const WCHAR *user, const WCHAR *pass)
143+
{
144+
return BASS_WMA_EncodeOpenPublish(freq, chans, flags|BASS_UNICODE, bitrate, (const char*)url, (const char*)user, (const char*)pass);
145+
}
146+
147+
static inline HWMENCODE BASS_WMA_EncodeOpenPublishMulti(DWORD freq, DWORD chans, DWORD flags, const DWORD *bitrates, const WCHAR *url, const WCHAR *user, const WCHAR *pass)
148+
{
149+
return BASS_WMA_EncodeOpenPublishMulti(freq, chans, flags|BASS_UNICODE, bitrates, (const char*)url, (const char*)user, (const char*)pass);
150+
}
118151
#endif
119152

120153
#endif

vendor/bass/lib/bass.lib

-43.6 KB
Binary file not shown.

vendor/bass/lib/bassmix.lib

-10.7 KB
Binary file not shown.

vendor/bass/lib/tags.lib

-914 Bytes
Binary file not shown.

vendor/bass/tags.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,27 @@
1616
#ifndef _YATRL_H_W2348_H4232
1717
#define _YATRL_H_W2348_H4232
1818

19-
// c guards (hmm... just in case)
19+
#include "bass.h"
20+
2021
#ifdef __cplusplus
2122
extern "C" {
2223
#endif
2324

2425
// Current version. Just increments each release.
25-
#define TAGS_VERSION 17
26+
#define TAGS_VERSION 18
2627

27-
// returns description of the last error.
28-
const char* _stdcall TAGS_GetLastErrorDesc();
28+
// get the loaded version
29+
DWORD WINAPI TAGS_GetVersion();
30+
31+
// enable UTF-8 encoding
32+
BOOL WINAPI TAGS_SetUTF8( BOOL enable );
2933

3034
// main purpose of this library
31-
const char* _stdcall TAGS_Read( DWORD dwHandle, const char* fmt );
35+
const char* WINAPI TAGS_Read( DWORD dwHandle, const char* fmt );
36+
const char* WINAPI TAGS_ReadEx( DWORD dwHandle, const char* fmt, DWORD tagtype, int codepage );
3237

33-
// retrieves the current version
34-
DWORD _stdcall TAGS_GetVersion();
38+
// returns description of the last error.
39+
const char* WINAPI TAGS_GetLastErrorDesc();
3540

3641
#ifdef __cplusplus
3742
}

0 commit comments

Comments
 (0)