2023-03-10 02:23:12 +07:00
|
|
|
/*
|
|
|
|
* bass.dll
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "bass_dll.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(bass);
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
static LIN_BOOL wine_bass_first_call_done = FALSE;
|
|
|
|
static void wine_bass_first_call(void) {
|
|
|
|
if (wine_bass_first_call_done) return;
|
|
|
|
wine_bass_first_call_done = TRUE;
|
|
|
|
#if BASSDLLVER <= BASSDLLVER_2415
|
|
|
|
BASS_SetConfig(BASS_CONFIG_DEV_DEFAULT, FALSE);
|
|
|
|
#endif
|
|
|
|
#if BASSDLLVER <= BASSDLLVER_2416
|
|
|
|
BASS_SetConfig(BASS_CONFIG_REC_DEFAULT, FALSE);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline const char *wine_bass_error_string(int code) {
|
|
|
|
switch (code) {
|
|
|
|
case BASS_OK: return "";
|
|
|
|
case BASS_ERROR_MEM: return "BASS_ERROR_MEM:";
|
|
|
|
case BASS_ERROR_FILEOPEN: return "BASS_ERROR_FILEOPEN:";
|
|
|
|
case BASS_ERROR_DRIVER: return "BASS_ERROR_DRIVER:";
|
|
|
|
case BASS_ERROR_BUFLOST: return "BASS_ERROR_BUFLOST:";
|
|
|
|
case BASS_ERROR_HANDLE: return "BASS_ERROR_HANDLE:";
|
|
|
|
case BASS_ERROR_FORMAT: return "BASS_ERROR_FORMAT:";
|
|
|
|
case BASS_ERROR_POSITION: return "BASS_ERROR_POSITION:";
|
|
|
|
case BASS_ERROR_INIT: return "BASS_ERROR_INIT:";
|
|
|
|
case BASS_ERROR_START: return "BASS_ERROR_START:";
|
|
|
|
case BASS_ERROR_SSL: return "BASS_ERROR_SSL:";
|
|
|
|
case BASS_ERROR_REINIT: return "BASS_ERROR_REINIT:";
|
|
|
|
case BASS_ERROR_ALREADY: return "BASS_ERROR_ALREADY:";
|
|
|
|
case BASS_ERROR_NOTAUDIO: return "BASS_ERROR_NOTAUDIO:";
|
|
|
|
case BASS_ERROR_NOCHAN: return "BASS_ERROR_NOCHAN:";
|
|
|
|
case BASS_ERROR_ILLTYPE: return "BASS_ERROR_ILLTYPE:";
|
|
|
|
case BASS_ERROR_ILLPARAM: return "BASS_ERROR_ILLPARAM:";
|
|
|
|
case BASS_ERROR_NO3D: return "BASS_ERROR_NO3D:";
|
|
|
|
case BASS_ERROR_NOEAX: return "BASS_ERROR_NOEAX:";
|
|
|
|
case BASS_ERROR_DEVICE: return "BASS_ERROR_DEVICE:";
|
|
|
|
case BASS_ERROR_NOPLAY: return "BASS_ERROR_NOPLAY:";
|
|
|
|
case BASS_ERROR_FREQ: return "BASS_ERROR_FREQ:";
|
|
|
|
case BASS_ERROR_NOTFILE: return "BASS_ERROR_NOTFILE:";
|
|
|
|
case BASS_ERROR_NOHW: return "BASS_ERROR_NOHW:";
|
|
|
|
case BASS_ERROR_EMPTY: return "BASS_ERROR_EMPTY:";
|
|
|
|
case BASS_ERROR_NONET: return "BASS_ERROR_NONET:";
|
|
|
|
case BASS_ERROR_CREATE: return "BASS_ERROR_CREATE:";
|
|
|
|
case BASS_ERROR_NOFX: return "BASS_ERROR_NOFX:";
|
|
|
|
case BASS_ERROR_NOTAVAIL: return "BASS_ERROR_NOTAVAIL:";
|
|
|
|
case BASS_ERROR_DECODE: return "BASS_ERROR_DECODE:";
|
|
|
|
case BASS_ERROR_DX: return "BASS_ERROR_DX:";
|
|
|
|
case BASS_ERROR_TIMEOUT: return "BASS_ERROR_TIMEOUT:";
|
|
|
|
case BASS_ERROR_FILEFORM: return "BASS_ERROR_FILEFORM:";
|
|
|
|
case BASS_ERROR_SPEAKER: return "BASS_ERROR_SPEAKER:";
|
|
|
|
case BASS_ERROR_VERSION: return "BASS_ERROR_VERSION:";
|
|
|
|
case BASS_ERROR_CODEC: return "BASS_ERROR_CODEC:";
|
|
|
|
case BASS_ERROR_ENDED: return "BASS_ERROR_ENDED:";
|
|
|
|
case BASS_ERROR_BUSY: return "BASS_ERROR_BUSY:";
|
|
|
|
case BASS_ERROR_UNSTREAMABLE: return "BASS_ERROR_UNSTREAMABLE:";
|
|
|
|
case BASS_ERROR_PROTOCOL: return "BASS_ERROR_PROTOCOL:";
|
|
|
|
case BASS_ERROR_DENIED: return "BASS_ERROR_DENIED:";
|
|
|
|
default: return "BASS_ERROR_UNKNOWN:";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#define STATIC_ASSERT3(COND,MSG) typedef char static_assertion_##MSG[(!!(COND))*2-1]
|
|
|
|
#define STATIC_ASSERT2(X,L) STATIC_ASSERT3(X, at_line_##L)
|
|
|
|
#define STATIC_ASSERT1(X,L) STATIC_ASSERT2(X, L)
|
|
|
|
#define STATIC_ASSERT(X) STATIC_ASSERT1(X, __LINE__)
|
|
|
|
|
|
|
|
#define STATIC_ASSERT_BASIC(X) _Static_assert(X, "static assertion failed")
|
|
|
|
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(double) == 8);
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WIN_QWORD) == sizeof(LIN_QWORD));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(DWORD) == sizeof(LIN_DWORD));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WORD) == sizeof(LIN_WORD));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(BYTE) == sizeof(LIN_BYTE));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(BOOL) == sizeof(LIN_BOOL));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WIN_HCHANNEL) == sizeof(HCHANNEL));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WIN_BASS_RECORDINFO) == sizeof(BASS_RECORDINFO));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WIN_BASS_SAMPLE) == sizeof(BASS_SAMPLE));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WIN_BASS_PLUGININFO) == sizeof(BASS_PLUGININFO));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WIN_BASS_PLUGINFORM) == sizeof(BASS_PLUGINFORM));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WIN_BASS_INFO) == sizeof(BASS_INFO));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WIN_BASS_DEVICEINFO) == sizeof(BASS_DEVICEINFO));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WIN_BASS_CHANNELINFO) == sizeof(BASS_CHANNELINFO));
|
|
|
|
STATIC_ASSERT_BASIC(sizeof(WIN_BASS_3DVECTOR) == sizeof(BASS_3DVECTOR));
|
|
|
|
|
|
|
|
// this is only supported as a compiler extension (in both clang and gcc), and issues a warning that seemingly CAN'T be disabled
|
|
|
|
// uncomment the following line to enable the checks
|
|
|
|
//#define BASS_CHECK_LAYOUT
|
|
|
|
|
|
|
|
#ifdef BASS_CHECK_LAYOUT
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_3DVECTOR*)NULL)->x == &((BASS_3DVECTOR*)NULL)->x);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_3DVECTOR*)NULL)->y == &((BASS_3DVECTOR*)NULL)->y);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_3DVECTOR*)NULL)->z == &((BASS_3DVECTOR*)NULL)->z);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_CHANNELINFO*)NULL)->freq == &((BASS_CHANNELINFO*)NULL)->freq);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_CHANNELINFO*)NULL)->chans == &((BASS_CHANNELINFO*)NULL)->chans);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_CHANNELINFO*)NULL)->flags == &((BASS_CHANNELINFO*)NULL)->flags);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_CHANNELINFO*)NULL)->ctype == &((BASS_CHANNELINFO*)NULL)->ctype);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_CHANNELINFO*)NULL)->origres == &((BASS_CHANNELINFO*)NULL)->origres);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_CHANNELINFO*)NULL)->plugin == &((BASS_CHANNELINFO*)NULL)->plugin);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_CHANNELINFO*)NULL)->sample == &((BASS_CHANNELINFO*)NULL)->sample);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_CHANNELINFO*)NULL)->filename == &((BASS_CHANNELINFO*)NULL)->filename);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_DEVICEINFO*)NULL)->name == &((BASS_DEVICEINFO*)NULL)->name);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_DEVICEINFO*)NULL)->driver == &((BASS_DEVICEINFO*)NULL)->driver);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_DEVICEINFO*)NULL)->flags == &((BASS_DEVICEINFO*)NULL)->flags);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->flags == &((BASS_INFO*)NULL)->flags);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->hwsize == &((BASS_INFO*)NULL)->hwsize);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->hwfree == &((BASS_INFO*)NULL)->hwfree);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->freesam == &((BASS_INFO*)NULL)->freesam);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->free3d == &((BASS_INFO*)NULL)->free3d);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->minrate == &((BASS_INFO*)NULL)->minrate);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->maxrate == &((BASS_INFO*)NULL)->maxrate);
|
|
|
|
STATIC_ASSERT((LIN_BOOL*)&((WIN_BASS_INFO*)NULL)->eax == &((BASS_INFO*)NULL)->eax);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->minbuf == &((BASS_INFO*)NULL)->minbuf);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->dsver == &((BASS_INFO*)NULL)->dsver);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->latency == &((BASS_INFO*)NULL)->latency);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->initflags == &((BASS_INFO*)NULL)->initflags);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->speakers == &((BASS_INFO*)NULL)->speakers);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_INFO*)NULL)->freq == &((BASS_INFO*)NULL)->freq);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_RECORDINFO*)NULL)->flags == &((BASS_RECORDINFO*)NULL)->flags);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_RECORDINFO*)NULL)->formats == &((BASS_RECORDINFO*)NULL)->formats);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_RECORDINFO*)NULL)->inputs == &((BASS_RECORDINFO*)NULL)->inputs);
|
|
|
|
STATIC_ASSERT((LIN_BOOL*)&((WIN_BASS_RECORDINFO*)NULL)->singlein == &((BASS_RECORDINFO*)NULL)->singlein);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_RECORDINFO*)NULL)->freq == &((BASS_RECORDINFO*)NULL)->freq);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->freq == &((BASS_SAMPLE*)NULL)->freq);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_SAMPLE*)NULL)->volume == &((BASS_SAMPLE*)NULL)->volume);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_SAMPLE*)NULL)->pan == &((BASS_SAMPLE*)NULL)->pan);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->flags == &((BASS_SAMPLE*)NULL)->flags);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->length == &((BASS_SAMPLE*)NULL)->length);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->max == &((BASS_SAMPLE*)NULL)->max);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->origres == &((BASS_SAMPLE*)NULL)->origres);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->chans == &((BASS_SAMPLE*)NULL)->chans);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->mingap == &((BASS_SAMPLE*)NULL)->mingap);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->mode3d == &((BASS_SAMPLE*)NULL)->mode3d);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_SAMPLE*)NULL)->mindist == &((BASS_SAMPLE*)NULL)->mindist);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_SAMPLE*)NULL)->maxdist == &((BASS_SAMPLE*)NULL)->maxdist);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->iangle == &((BASS_SAMPLE*)NULL)->iangle);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->oangle == &((BASS_SAMPLE*)NULL)->oangle);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_SAMPLE*)NULL)->outvol == &((BASS_SAMPLE*)NULL)->outvol);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->vam == &((BASS_SAMPLE*)NULL)->vam);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_SAMPLE*)NULL)->priority == &((BASS_SAMPLE*)NULL)->priority);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_PLUGININFO*)NULL)->version == &((BASS_PLUGININFO*)NULL)->version);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_PLUGININFO*)NULL)->formatc == &((BASS_PLUGININFO*)NULL)->formatc);
|
|
|
|
STATIC_ASSERT((const BASS_PLUGINFORM**)&((WIN_BASS_PLUGININFO*)NULL)->formats == &((BASS_PLUGININFO*)NULL)->formats);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_PLUGINFORM*)NULL)->exts == &((BASS_PLUGINFORM*)NULL)->exts);
|
|
|
|
STATIC_ASSERT(&((WIN_BASS_PLUGINFORM*)NULL)->name == &((BASS_PLUGINFORM*)NULL)->name);
|
|
|
|
STATIC_ASSERT((LIN_DWORD*)&((WIN_BASS_PLUGINFORM*)NULL)->ctype == &((BASS_PLUGINFORM*)NULL)->ctype);
|
|
|
|
#endif
|
|
|
|
|
2023-03-10 02:23:12 +07:00
|
|
|
#define BASS_STRINGIFY(S) #S
|
2023-03-11 20:20:25 +07:00
|
|
|
#define PRINT2(X) {\
|
2023-03-10 02:23:12 +07:00
|
|
|
pthread_mutex_lock(&FILE_MUTEX); \
|
|
|
|
while (!filkdwkowe) filkdwkowe = fopen("/tmp/bass.txt", "w"); \
|
|
|
|
pid_t tid = GetCurrentThreadId(); \
|
2023-03-11 20:20:25 +07:00
|
|
|
sprintf(FILEBUFFF, "%d:%s", tid, wine_bass_error_string(BASS_ErrorGetCode())); \
|
2023-03-10 02:23:12 +07:00
|
|
|
fwrite(FILEBUFFF, strlen(FILEBUFFF), 1, filkdwkowe); \
|
|
|
|
fwrite(X, strlen(X), 1, filkdwkowe); \
|
|
|
|
ZEROOOOO = '\n'; \
|
|
|
|
fwrite(&ZEROOOOO, 1, 1, filkdwkowe); \
|
|
|
|
fflush(filkdwkowe); \
|
|
|
|
pthread_mutex_unlock(&FILE_MUTEX); \
|
2023-03-11 20:20:25 +07:00
|
|
|
}
|
2023-03-10 02:23:12 +07:00
|
|
|
|
|
|
|
#define PRINT(X) \
|
|
|
|
PRINT2(BASS_STRINGIFY(X));
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
#define PRINT3(X, ...) {\
|
2023-03-10 02:23:12 +07:00
|
|
|
sprintf(FILEBUFFF2, X, __VA_ARGS__); \
|
|
|
|
PRINT2(FILEBUFFF2);\
|
2023-03-11 20:20:25 +07:00
|
|
|
}
|
2023-03-10 02:23:12 +07:00
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
#define BASS_RETURN(T, X) {\
|
|
|
|
T ret = X; \
|
|
|
|
PRINT(X); \
|
|
|
|
return ret; \
|
|
|
|
}
|
|
|
|
#define BASS_RETURNBOOL(X) {\
|
|
|
|
LIN_BOOL ret = X; \
|
2023-03-10 02:23:12 +07:00
|
|
|
PRINT(X); \
|
2023-03-11 20:20:25 +07:00
|
|
|
return ret ? TRUE : FALSE; \
|
|
|
|
}
|
|
|
|
#define BASS_RETURNVOID(X) {\
|
|
|
|
X; \
|
|
|
|
PRINT(X); \
|
|
|
|
return; \
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
#define BASS_START(X) {\
|
2023-03-11 20:20:25 +07:00
|
|
|
wine_bass_first_call(); \
|
|
|
|
/*PRINT2("start:" BASS_STRINGIFY(X));*/ \
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
static char FILEBUFFF2[8192];
|
|
|
|
static char FILEBUFFF[8192];
|
2023-03-10 02:23:12 +07:00
|
|
|
static char ZEROOOOO = '\n';
|
|
|
|
static pthread_mutex_t FILE_MUTEX;
|
|
|
|
static FILE *filkdwkowe;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DWORD key;
|
|
|
|
DWORD altKey;
|
|
|
|
void *val;
|
|
|
|
DWORD freeAge;
|
|
|
|
} UserDataEntry;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
size_t count;
|
|
|
|
size_t capacity;
|
|
|
|
UserDataEntry *data;
|
|
|
|
pthread_mutex_t mutex;
|
|
|
|
} UserDataStorage;
|
|
|
|
|
|
|
|
static UserDataStorage WINE_BASS_DATA_STORAGE;
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL __stdcall wine_bass_user_data_add_ex(DWORD key, DWORD altKey, void *val) {
|
2023-03-10 02:23:12 +07:00
|
|
|
return FALSE;
|
|
|
|
pthread_mutex_lock(&WINE_BASS_DATA_STORAGE.mutex);
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL ret = 1;
|
2023-03-10 02:23:12 +07:00
|
|
|
if (WINE_BASS_DATA_STORAGE.count == WINE_BASS_DATA_STORAGE.capacity) {
|
|
|
|
if (WINE_BASS_DATA_STORAGE.capacity == 0) {
|
|
|
|
WINE_BASS_DATA_STORAGE.data = malloc(64 * sizeof(UserDataEntry));
|
|
|
|
WINE_BASS_DATA_STORAGE.capacity = 64;
|
|
|
|
} else {
|
2023-03-10 03:22:26 +07:00
|
|
|
void *new = realloc(WINE_BASS_DATA_STORAGE.data, 2 * WINE_BASS_DATA_STORAGE.capacity * sizeof(UserDataEntry));
|
|
|
|
if (new) {
|
|
|
|
WINE_BASS_DATA_STORAGE.data = new;
|
|
|
|
WINE_BASS_DATA_STORAGE.capacity *= 2;
|
|
|
|
}
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
}
|
2023-03-10 03:22:26 +07:00
|
|
|
if (!WINE_BASS_DATA_STORAGE.data || WINE_BASS_DATA_STORAGE.count == WINE_BASS_DATA_STORAGE.capacity) {
|
2023-03-10 02:23:12 +07:00
|
|
|
goto CLEANUP;
|
|
|
|
}
|
|
|
|
UserDataEntry entry = {
|
|
|
|
.key = key,
|
|
|
|
.altKey = altKey,
|
|
|
|
.val = val,
|
|
|
|
.freeAge = 0,
|
|
|
|
};
|
|
|
|
WINE_BASS_DATA_STORAGE.data[WINE_BASS_DATA_STORAGE.count] = entry;
|
|
|
|
++WINE_BASS_DATA_STORAGE.count;
|
|
|
|
CLEANUP:
|
|
|
|
pthread_mutex_unlock(&WINE_BASS_DATA_STORAGE.mutex);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL wine_bass_user_data_add(DWORD key, void *val) {
|
2023-03-10 02:23:12 +07:00
|
|
|
return wine_bass_user_data_add_ex(key, 0, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wine_bass_user_data_cleanup() {
|
|
|
|
// around 400kb
|
|
|
|
// why? to (almost) make sure I don't accidentally nuke anything
|
|
|
|
if (WINE_BASS_DATA_STORAGE.count > 16384) {
|
|
|
|
UserDataEntry *end = &WINE_BASS_DATA_STORAGE.data[WINE_BASS_DATA_STORAGE.count];
|
|
|
|
for (UserDataEntry *entry = WINE_BASS_DATA_STORAGE.data; entry < end; ++entry) {
|
|
|
|
// only remove 8192 oldest entries
|
|
|
|
while (entry->freeAge > 8192) {
|
|
|
|
free(entry->val);
|
|
|
|
if (WINE_BASS_DATA_STORAGE.count > 1) {
|
|
|
|
*entry = WINE_BASS_DATA_STORAGE.data[WINE_BASS_DATA_STORAGE.count - 1];
|
|
|
|
} else {
|
|
|
|
entry->freeAge = 0;
|
|
|
|
}
|
|
|
|
--WINE_BASS_DATA_STORAGE.count;
|
|
|
|
--end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void wine_bass_user_data_remove(DWORD key) {
|
|
|
|
return;
|
|
|
|
pthread_mutex_lock(&WINE_BASS_DATA_STORAGE.mutex);
|
|
|
|
UserDataEntry *end = &WINE_BASS_DATA_STORAGE.data[WINE_BASS_DATA_STORAGE.count];
|
|
|
|
for (UserDataEntry *entry = WINE_BASS_DATA_STORAGE.data; entry < end; ++entry) {
|
|
|
|
if (entry->freeAge || (entry->key == key || entry->altKey == key)) {
|
|
|
|
++entry->freeAge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wine_bass_user_data_cleanup();
|
|
|
|
pthread_mutex_unlock(&WINE_BASS_DATA_STORAGE.mutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
void __stdcall wine_bass_user_data_remove_ex(DWORD key, DWORD altKey) {
|
|
|
|
return;
|
|
|
|
pthread_mutex_lock(&WINE_BASS_DATA_STORAGE.mutex);
|
|
|
|
UserDataEntry *end = &WINE_BASS_DATA_STORAGE.data[WINE_BASS_DATA_STORAGE.count];
|
|
|
|
for (UserDataEntry *entry = WINE_BASS_DATA_STORAGE.data; entry < end; ++entry) {
|
|
|
|
if (entry->freeAge || (entry->key == key && entry->altKey == altKey)) {
|
|
|
|
++entry->freeAge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wine_bass_user_data_cleanup();
|
|
|
|
pthread_mutex_unlock(&WINE_BASS_DATA_STORAGE.mutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
void wine_bass_user_data_free(UserDataStorage *store) {
|
|
|
|
return;
|
|
|
|
pthread_mutex_lock(&WINE_BASS_DATA_STORAGE.mutex);
|
|
|
|
WINE_BASS_DATA_STORAGE.capacity = 0;
|
|
|
|
WINE_BASS_DATA_STORAGE.count = 0;
|
|
|
|
free(WINE_BASS_DATA_STORAGE.data);
|
|
|
|
WINE_BASS_DATA_STORAGE.data = NULL;
|
|
|
|
pthread_mutex_unlock(&WINE_BASS_DATA_STORAGE.mutex);
|
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
static inline char *wine_bass_to_linux_filename(const void *file, DWORD flags) {
|
2023-03-10 02:23:12 +07:00
|
|
|
char *ret = NULL;
|
|
|
|
if (flags & BASS_UNICODE) {
|
|
|
|
const WCHAR *filename = file;
|
|
|
|
ret = wine_get_unix_file_name(filename);
|
|
|
|
} else {
|
|
|
|
const char *filename = file;
|
|
|
|
int lenA = lstrlenA(filename);
|
|
|
|
int lenW = MultiByteToWideChar(CP_ACP, 0, filename, lenA, NULL, 0);
|
|
|
|
if (lenW > 0) {
|
|
|
|
WCHAR *filename16 = malloc(lenW * 2);
|
2023-03-10 07:05:52 +07:00
|
|
|
memset(filename16, 0, lenW * 2);
|
|
|
|
if (filename16) {
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, filename, lenA, filename16, lenW);
|
|
|
|
ret = wine_get_unix_file_name(filename16);
|
|
|
|
free(filename16);
|
|
|
|
}
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Apply3D (BASS.1)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
void __stdcall WIN_BASS_Apply3D(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_Apply3D(void));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNVOID(BASS_Apply3D());
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelBytes2Seconds (BASS.2)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
double __stdcall WIN_BASS_ChannelBytes2Seconds(DWORD handle, WIN_QWORD pos) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelBytes2Seconds(DWORD handle, WIN_QWORD pos));
|
2023-03-11 20:20:25 +07:00
|
|
|
double ret = 0.0;
|
|
|
|
ret = BASS_ChannelBytes2Seconds(handle, pos);
|
|
|
|
if (ret >= 0.0) {
|
|
|
|
const unsigned char *tmp = (void*)&ret;
|
|
|
|
PRINT3("BASS_ChannelBytes2Seconds(%u, %lu) = %f[%02x%02x%02x%02x%02x%02x%02x%02x]", handle, pos, ret,
|
|
|
|
(int)tmp[0],
|
|
|
|
(int)tmp[1],
|
|
|
|
(int)tmp[2],
|
|
|
|
(int)tmp[3],
|
|
|
|
(int)tmp[4],
|
|
|
|
(int)tmp[5],
|
|
|
|
(int)tmp[6],
|
|
|
|
(int)tmp[7]
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
PRINT3("BASS_ChannelBytes2Seconds(%u, %lu) failed!!", handle, pos);
|
|
|
|
}
|
|
|
|
return ret;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelFlags (BASS.3)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_ChannelFlags(DWORD handle, DWORD flags, DWORD mask) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelFlags(DWORD handle, DWORD flags, DWORD mask));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(LIN_DWORD, BASS_ChannelFlags(handle, flags, mask));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGet3DAttributes (BASS.4)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelGet3DAttributes(DWORD handle, DWORD * mode, float * min, float * max, DWORD * iangle, DWORD * oangle, float * outvol) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGet3DAttributes(DWORD handle, DWORD * mode, float * min, float * max, DWORD * iangle, DWORD * oangle, float * outvol));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelGet3DAttributes(handle, (LIN_DWORD*)mode, min, max, (LIN_DWORD*)iangle, (LIN_DWORD*)oangle, outvol));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGet3DPosition (BASS.5)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelGet3DPosition(DWORD handle, WIN_BASS_3DVECTOR * pos, WIN_BASS_3DVECTOR * orient, WIN_BASS_3DVECTOR * vel) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGet3DPosition(DWORD handle, WIN_BASS_3DVECTOR * pos, WIN_BASS_3DVECTOR * orient, WIN_BASS_3DVECTOR * vel));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelGet3DPosition(handle, (BASS_3DVECTOR*)pos, (BASS_3DVECTOR*)orient, (BASS_3DVECTOR*)vel));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGetAttribute (BASS.6)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
const char *wine_bass_attrib_name(DWORD attrib) {
|
|
|
|
switch (attrib) {
|
|
|
|
case BASS_ATTRIB_BITRATE: return "BASS_ATTRIB_BITRATE";
|
|
|
|
case BASS_ATTRIB_BUFFER: return "BASS_ATTRIB_BUFFER";
|
|
|
|
case BASS_ATTRIB_CPU: return "BASS_ATTRIB_CPU";
|
|
|
|
case BASS_ATTRIB_DOWNLOADPROC: return "BASS_ATTRIB_DOWNLOADPROC";
|
|
|
|
case BASS_ATTRIB_EAXMIX: return "BASS_ATTRIB_EAXMIX";
|
|
|
|
case BASS_ATTRIB_FREQ: return "BASS_ATTRIB_FREQ";
|
|
|
|
case BASS_ATTRIB_GRANULE: return "BASS_ATTRIB_GRANULE";
|
|
|
|
case BASS_ATTRIB_MUSIC_ACTIVE: return "BASS_ATTRIB_MUSIC_ACTIVE";
|
|
|
|
case BASS_ATTRIB_MUSIC_AMPLIFY: return "BASS_ATTRIB_MUSIC_AMPLIFY";
|
|
|
|
case BASS_ATTRIB_MUSIC_BPM: return "BASS_ATTRIB_MUSIC_BPM";
|
|
|
|
case BASS_ATTRIB_MUSIC_PANSEP: return "BASS_ATTRIB_MUSIC_PANSEP";
|
|
|
|
case BASS_ATTRIB_MUSIC_PSCALER: return "BASS_ATTRIB_MUSIC_PSCALER";
|
|
|
|
case BASS_ATTRIB_MUSIC_SPEED: return "BASS_ATTRIB_MUSIC_SPEED";
|
|
|
|
case BASS_ATTRIB_MUSIC_VOL_CHAN: return "BASS_ATTRIB_MUSIC_VOL_CHAN";
|
|
|
|
case BASS_ATTRIB_MUSIC_VOL_GLOBAL: return "BASS_ATTRIB_MUSIC_VOL_GLOBAL";
|
|
|
|
case BASS_ATTRIB_MUSIC_VOL_INST: return "BASS_ATTRIB_MUSIC_VOL_INST";
|
|
|
|
case BASS_ATTRIB_NET_RESUME: return "BASS_ATTRIB_NET_RESUME";
|
|
|
|
case BASS_ATTRIB_NOBUFFER: return "BASS_ATTRIB_NOBUFFER";
|
|
|
|
case BASS_ATTRIB_NORAMP: return "BASS_ATTRIB_NORAMP";
|
|
|
|
case BASS_ATTRIB_PAN: return "BASS_ATTRIB_PAN";
|
|
|
|
case BASS_ATTRIB_PUSH_LIMIT: return "BASS_ATTRIB_PUSH_LIMIT";
|
|
|
|
case BASS_ATTRIB_SCANINFO: return "BASS_ATTRIB_SCANINFO";
|
|
|
|
case BASS_ATTRIB_SRC: return "BASS_ATTRIB_SRC";
|
|
|
|
case BASS_ATTRIB_TAIL: return "BASS_ATTRIB_TAIL";
|
|
|
|
case BASS_ATTRIB_USER: return "BASS_ATTRIB_USER";
|
|
|
|
case BASS_ATTRIB_VBR: return "BASS_ATTRIB_VBR";
|
|
|
|
case BASS_ATTRIB_VOL: return "BASS_ATTRIB_VOL";
|
|
|
|
case BASS_ATTRIB_VOLDSP: return "BASS_ATTRIB_VOLDSP";
|
|
|
|
case BASS_ATTRIB_VOLDSP_PRIORITY: return "BASS_ATTRIB_VOLDSP_PRIORITY";
|
|
|
|
// from bass_fx
|
|
|
|
case 0x10000: return "BASSFX_ATTRIB_TEMPO";
|
|
|
|
case 0x10001: return "BASSFX_ATTRIB_TEMPO_PITCH";
|
|
|
|
case 0x10002: return "BASSFX_ATTRIB_TEMPO_FREQ";
|
|
|
|
case 0x10010: return "BASSFX_ATTRIB_TEMPO_OPTION_USE_AA_FILTER";
|
|
|
|
case 0x10011: return "BASSFX_ATTRIB_TEMPO_OPTION_AA_FILTER_LENGTH";
|
|
|
|
case 0x10012: return "BASSFX_ATTRIB_TEMPO_OPTION_USE_QUICKALGO";
|
|
|
|
case 0x10013: return "BASSFX_ATTRIB_TEMPO_OPTION_SEQUENCE_MS";
|
|
|
|
case 0x10014: return "BASSFX_ATTRIB_TEMPO_OPTION_SEEKWINDOW_MS";
|
|
|
|
case 0x10015: return "BASSFX_ATTRIB_TEMPO_OPTION_OVERLAP_MS";
|
|
|
|
case 0x10016: return "BASSFX_ATTRIB_TEMPO_OPTION_PREVENT_CLICK";
|
|
|
|
case 0x11010: return "BASSFX_ATTRIB_REVERSE_DIR";
|
|
|
|
default: return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
BOOL __stdcall WIN_BASS_ChannelGetAttribute(DWORD handle, DWORD attrib, float * value) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGetAttribute(DWORD handle, DWORD attrib, float * value));
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL ret = BASS_ChannelGetAttribute(handle, attrib, value);
|
|
|
|
const char *name = wine_bass_attrib_name(attrib);
|
|
|
|
if (ret && value) {
|
|
|
|
if (name) {
|
|
|
|
PRINT3("BASS_ChannelGetAttribute(%u, %s) = %f", handle, name, *value);
|
|
|
|
} else {
|
|
|
|
PRINT3("BASS_ChannelGetAttribute(%u, %u) = %f", handle, attrib, *value);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (name) {
|
|
|
|
PRINT3("BASS_ChannelGetAttribute(%u, %s) failed!", handle, name);
|
|
|
|
} else {
|
|
|
|
PRINT3("BASS_ChannelGetAttribute(%u, %u) failed!", handle, attrib);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret ? TRUE : FALSE;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGetAttributeEx (BASS.7)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_ChannelGetAttributeEx(DWORD handle, DWORD attrib, void * value, DWORD size) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGetAttributeEx(DWORD handle, DWORD attrib, void * value, DWORD size));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(LIN_DWORD, BASS_ChannelGetAttributeEx(handle, attrib, value, size));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGetData (BASS.8)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD wine_bass_length_flags(DWORD length, char *flags) {
|
|
|
|
flags[0] = '\0';
|
|
|
|
DWORD n = length;
|
|
|
|
if (BASS_DATA_FLOAT & n) {
|
|
|
|
n &= ~BASS_DATA_FLOAT;
|
|
|
|
strcat(flags, "|BASS_DATA_FLOAT");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT32768 & n) {
|
|
|
|
n &= ~BASS_DATA_FFT32768;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT32768");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT16384 & n) {
|
|
|
|
n &= ~BASS_DATA_FFT16384;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT16384");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT8192 & n) {
|
|
|
|
n &= ~BASS_DATA_FFT8192;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT8192");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT4096 & n) {
|
|
|
|
n &= ~BASS_DATA_FFT4096;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT4096");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT2048 & n) {
|
|
|
|
n &= ~BASS_DATA_FFT2048;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT2048");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT1024 & n) {
|
|
|
|
n &= ~BASS_DATA_FFT1024;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT1024");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT512 & n) {
|
|
|
|
n &= ~BASS_DATA_FFT512;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT512");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT256 & n) {
|
|
|
|
n &= ~BASS_DATA_FFT256;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT256");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT_COMPLEX & n) {
|
|
|
|
n &= ~BASS_DATA_FFT_COMPLEX;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT_COMPLEX");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT_INDIVIDUAL & n) {
|
|
|
|
n &= ~BASS_DATA_FFT_INDIVIDUAL;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT_INDIVIDUAL");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT_NOWINDOW & n) {
|
|
|
|
n &= ~BASS_DATA_FFT_NOWINDOW;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT_NOWINDOW");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT_NYQUIST & n) {
|
|
|
|
n &= ~BASS_DATA_FFT_NYQUIST;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT_NYQUIST");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_FFT_REMOVEDC & n) {
|
|
|
|
n &= ~BASS_DATA_FFT_REMOVEDC;
|
|
|
|
strcat(flags, "|BASS_DATA_FFT_REMOVEDC");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_NOREMOVE & n) {
|
|
|
|
n &= ~BASS_DATA_NOREMOVE;
|
|
|
|
strcat(flags, "|BASS_DATA_NOREMOVE");
|
|
|
|
}
|
|
|
|
if (BASS_DATA_AVAILABLE & n) {
|
|
|
|
n &= ~BASS_DATA_AVAILABLE;
|
|
|
|
strcat(flags, "|BASS_DATA_AVAILABLE");
|
|
|
|
}
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
DWORD __stdcall WIN_BASS_ChannelGetData(DWORD handle, void * buffer, DWORD length) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGetData(DWORD handle, void * buffer, DWORD length));
|
2023-03-11 20:20:25 +07:00
|
|
|
char buf[512];
|
|
|
|
DWORD bytes = wine_bass_length_flags(length, buf);
|
2023-03-10 02:23:12 +07:00
|
|
|
DWORD ret = BASS_ChannelGetData(handle, buffer, length);
|
2023-03-11 20:20:25 +07:00
|
|
|
if (bytes || !buf[0]) {
|
|
|
|
PRINT3("ChannelGetData(%u, %p, %u%s) = %u", handle, buffer, bytes, buf, ret);
|
|
|
|
} else {
|
|
|
|
PRINT3("ChannelGetData(%u, %p, %s) = %u", handle, buffer, &buf[1], ret);
|
|
|
|
}
|
2023-03-10 02:23:12 +07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGetDevice (BASS.9)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_ChannelGetDevice(DWORD handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGetDevice(DWORD handle));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(LIN_DWORD, BASS_ChannelGetDevice(handle));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGetInfo (BASS.10)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelGetInfo(DWORD handle, WIN_BASS_CHANNELINFO * info) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGetInfo(DWORD handle, WIN_BASS_CHANNELINFO * info));
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL ret = BASS_ChannelGetInfo(handle, (BASS_CHANNELINFO*)info);
|
|
|
|
if (ret && info && info->filename) {
|
|
|
|
info->filename = wine_bass_to_linux_filename(info->filename, info->flags);
|
|
|
|
if (info->filename) wine_bass_user_data_add(handle, (void*)info->filename);
|
|
|
|
else ret = FALSE;
|
|
|
|
}
|
|
|
|
if (ret) {
|
|
|
|
PRINT3("BASS_ChannelGetInfo(%u, ...) = { freq: %u, chans: %u, flags: %u, ctype: %u, origres: %u, plugin: %u, sample: %u, filename: %s }", handle,
|
|
|
|
info->freq,
|
|
|
|
info->chans,
|
|
|
|
info->flags,
|
|
|
|
info->ctype,
|
|
|
|
info->origres,
|
|
|
|
info->plugin,
|
|
|
|
info->sample,
|
|
|
|
info->filename
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
PRINT3("BASS_ChannelGetInfo(%u, ...) failed!", handle);
|
|
|
|
}
|
|
|
|
return ret ? TRUE : FALSE;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGetLength (BASS.11)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_QWORD __stdcall WIN_BASS_ChannelGetLength(DWORD handle, DWORD mode) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGetLength(DWORD handle, DWORD mode));
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_QWORD ret = BASS_ChannelGetLength(handle, mode);
|
|
|
|
PRINT3("BASS_ChannelGetLength(%u, %u) = %lu", handle, mode, ret);
|
|
|
|
return ret;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGetLevel (BASS.12)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_ChannelGetLevel(DWORD handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGetLevel(DWORD handle));
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD ret = BASS_ChannelGetLevel(handle);
|
|
|
|
PRINT3("BASS_ChannelGetLevel(%u) = MAKEWORD(%u, %u)", handle, LOWORD(ret), HIWORD(ret));
|
|
|
|
return ret;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGetLevelEx (BASS.13)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelGetLevelEx(DWORD handle, float * levels, float length, DWORD flags) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGetLevelEx(DWORD handle, float * levels, float length, DWORD flags));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelGetLevelEx(handle, levels, length, flags));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGetPosition (BASS.14)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
const char *wine_bass_get_mode_name(DWORD mode) {
|
|
|
|
switch (mode) {
|
|
|
|
case BASS_POS_BYTE: return "BASS_POS_BYTE";
|
|
|
|
case BASS_POS_MUSIC_ORDER: return "BASS_POS_MUSIC_ORDER";
|
|
|
|
case BASS_POS_OGG: return "BASS_POS_OGG";
|
|
|
|
case BASS_POS_END: return "BASS_POS_END";
|
|
|
|
case BASS_POS_LOOP: return "BASS_POS_LOOP";
|
|
|
|
case BASS_POS_FLUSH: return "BASS_POS_FLUSH";
|
|
|
|
case BASS_POS_RESET: return "BASS_POS_RESET";
|
|
|
|
case BASS_POS_RELATIVE: return "BASS_POS_RELATIVE";
|
|
|
|
case BASS_POS_INEXACT: return "BASS_POS_INEXACT";
|
|
|
|
case BASS_POS_DECODE: return "BASS_POS_DECODE";
|
|
|
|
case BASS_POS_DECODETO: return "BASS_POS_DECODETO";
|
|
|
|
case BASS_POS_SCAN: return "BASS_POS_SCAN";
|
|
|
|
default: return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
WIN_QWORD __stdcall WIN_BASS_ChannelGetPosition(DWORD handle, DWORD mode) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGetPosition(DWORD handle, DWORD mode));
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_QWORD ret = BASS_ChannelGetPosition(handle, mode);
|
|
|
|
{
|
|
|
|
const char *name = wine_bass_get_mode_name(mode);
|
|
|
|
if (name) {
|
|
|
|
PRINT3("BASS_ChannelGetPosition(%u, %s) = %lu", handle, name, ret);
|
|
|
|
} else {
|
|
|
|
PRINT3("BASS_ChannelGetPosition(%u, %u) = %lu", handle, mode, ret);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelGetTags (BASS.15)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
const char * __stdcall WIN_BASS_ChannelGetTags(DWORD handle, DWORD tags) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelGetTags(DWORD handle, DWORD tags));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(const char*, BASS_ChannelGetTags(handle, tags));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelIsActive (BASS.16)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_ChannelIsActive(DWORD handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelIsActive(DWORD handle));
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD ret = BASS_ChannelIsActive(handle);
|
|
|
|
PRINT3("BASS_ChannelIsActive(%u) = %u", handle, ret);
|
|
|
|
return ret;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelIsSliding (BASS.17)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelIsSliding(DWORD handle, DWORD attrib) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelIsSliding(DWORD handle, DWORD attrib));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelIsSliding(handle, attrib));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelLock (BASS.18)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelLock(DWORD handle, BOOL lock) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelLock(DWORD handle, BOOL lock));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelLock(handle, lock));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelPause (BASS.19)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelPause(DWORD handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelPause(DWORD handle));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelPause(handle));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelPlay (BASS.20)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelPlay(DWORD handle, BOOL restart) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelPlay(DWORD handle, BOOL restart));
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL ret = BASS_ChannelPlay(handle, restart);
|
|
|
|
DWORD retu = ret ? 1 : 0;
|
|
|
|
PRINT3("BASS_ChannelPlay(%u, %u) = %u", handle, restart, retu);
|
|
|
|
return ret ? TRUE : FALSE;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelRemoveDSP (BASS.21)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelRemoveDSP(DWORD handle, WIN_HDSP dsp) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelRemoveDSP(DWORD handle, WIN_HDSP dsp));
|
|
|
|
wine_bass_user_data_remove(dsp);
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelRemoveDSP(handle, dsp));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelRemoveFX (BASS.22)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelRemoveFX(DWORD handle, WIN_HFX fx) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelRemoveFX(DWORD handle, WIN_HFX fx));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelRemoveFX(handle, fx));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelRemoveLink (BASS.23)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelRemoveLink(DWORD handle, DWORD chan) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelRemoveLink(DWORD handle, DWORD chan));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelRemoveLink(handle, chan));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelRemoveSync (BASS.24)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelRemoveSync(DWORD handle, WIN_HSYNC sync) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelRemoveSync(DWORD handle, WIN_HSYNC sync));
|
|
|
|
wine_bass_user_data_remove(sync);
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelRemoveSync(handle, sync));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSeconds2Bytes (BASS.25)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_QWORD __stdcall WIN_BASS_ChannelSeconds2Bytes(DWORD handle, double pos) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSeconds2Bytes(DWORD handle, double pos));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(LIN_QWORD, BASS_ChannelSeconds2Bytes(handle, pos));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSet3DAttributes (BASS.26)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelSet3DAttributes(DWORD handle, int mode, float min, float max, int iangle, int oangle, float outvol) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSet3DAttributes(DWORD handle, int mode, float min, float max, int iangle, int oangle, float outvol));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelSet3DAttributes(handle, mode, min, max, iangle, oangle, outvol));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSet3DPosition (BASS.27)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelSet3DPosition(DWORD handle, const WIN_BASS_3DVECTOR * pos, const WIN_BASS_3DVECTOR * orient, const WIN_BASS_3DVECTOR * vel) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSet3DPosition(DWORD handle, WIN_BASS_3DVECTOR * pos, WIN_BASS_3DVECTOR * orient, WIN_BASS_3DVECTOR * vel));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelSet3DPosition(handle, (BASS_3DVECTOR*)pos, (BASS_3DVECTOR*)orient, (BASS_3DVECTOR*)vel));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSetAttribute (BASS.28)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelSetAttribute(DWORD handle, DWORD attrib, float value) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSetAttribute(DWORD handle, DWORD attrib, float value));
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL ret = BASS_ChannelSetAttribute(handle, attrib, value);
|
|
|
|
{
|
|
|
|
const char *name = wine_bass_attrib_name(attrib);
|
|
|
|
const char *success = ret ? "" : " failed!";
|
|
|
|
if (name) {
|
|
|
|
PRINT3("BASS_ChannelSetAttribute(%u, %s, %f)%s", handle, name, value, success);
|
|
|
|
} else {
|
|
|
|
PRINT3("BASS_ChannelSetAttribute(%u, %u, %f)%s", handle, attrib, value, success);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret ? TRUE : FALSE;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSetAttributeEx (BASS.29)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelSetAttributeEx(DWORD handle, DWORD attrib, void * value, DWORD size) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSetAttributeEx(DWORD handle, DWORD attrib, void * value, DWORD size));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelSetAttributeEx(handle, attrib, value, size));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSetDSP (BASS.30)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
WIN_DSPPROC *proc;
|
|
|
|
void *user;
|
|
|
|
} DspUserData;
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
void wine_bass_dspproc_wrapper(HDSP handle, LIN_DWORD channel, void *buffer, LIN_DWORD length, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
DspUserData *user_new = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNVOID(user_new->proc(handle, channel, buffer, length, user_new->user));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
void wine_bass_dspproc_wrapper_nouser(HDSP handle, LIN_DWORD channel, void *buffer, LIN_DWORD length, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
WIN_DSPPROC *proc = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNVOID(proc(handle, channel, buffer, length, NULL));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HDSP __stdcall WIN_BASS_ChannelSetDSP(DWORD handle, WIN_DSPPROC * proc, void * user, int priority) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSetDSP(DWORD handle, WIN_DSPPROC * proc, void * user, int priority));
|
|
|
|
if (user) {
|
|
|
|
DspUserData *user_new = malloc(sizeof(DspUserData));
|
|
|
|
user_new->proc = proc;
|
|
|
|
user_new->user = user;
|
|
|
|
WIN_HDSP ret = BASS_ChannelSetDSP(handle, wine_bass_dspproc_wrapper, user_new, priority);
|
|
|
|
if (ret) wine_bass_user_data_add_ex(ret, handle, user_new);
|
|
|
|
else free(user_new);
|
|
|
|
PRINT(BASS_ChannelSetDSP);
|
|
|
|
return ret;
|
|
|
|
} else {
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HDSP, BASS_ChannelSetDSP(handle, wine_bass_dspproc_wrapper_nouser, proc, priority));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSetDevice (BASS.31)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelSetDevice(DWORD handle, DWORD device) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSetDevice(DWORD handle, DWORD device));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelSetDevice(handle, device));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSetFX (BASS.32)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HFX __stdcall WIN_BASS_ChannelSetFX(DWORD handle, DWORD type, int priority) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSetFX(DWORD handle, DWORD type, int priority));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HFX, BASS_ChannelSetFX(handle, type, priority));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSetLink (BASS.33)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelSetLink(DWORD handle, DWORD chan) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSetLink(DWORD handle, DWORD chan));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelSetLink(handle, chan));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSetPosition (BASS.34)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelSetPosition(DWORD handle, WIN_QWORD pos, DWORD mode) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSetPosition(DWORD handle, WIN_QWORD pos, DWORD mode));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelSetPosition(handle, pos, mode));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSetSync (BASS.35)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
WIN_SYNCPROC *proc;
|
|
|
|
void *user;
|
|
|
|
} SyncUserData;
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
void wine_bass_syncproc_wrapper(HSYNC handle, LIN_DWORD channel, LIN_DWORD data, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
SyncUserData *user_new = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNVOID(user_new->proc(handle, channel, data, user_new->user));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
void wine_bass_syncproc_wrapper_nouser(HSYNC handle, LIN_DWORD channel, LIN_DWORD data, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
WIN_SYNCPROC *proc = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNVOID(proc(handle, channel, data, NULL));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HSYNC __stdcall WIN_BASS_ChannelSetSync(DWORD handle, DWORD type, WIN_QWORD param, WIN_SYNCPROC * proc, void * user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSetSync(DWORD handle, DWORD type, WIN_QWORD param, WIN_SYNCPROC * proc, void * user));
|
|
|
|
if (user) {
|
|
|
|
SyncUserData *user_new = malloc(sizeof(SyncUserData));
|
|
|
|
user_new->proc = proc;
|
|
|
|
user_new->user = user;
|
|
|
|
WIN_HSYNC ret = BASS_ChannelSetSync(handle, type, param, wine_bass_syncproc_wrapper, user_new);
|
|
|
|
if (ret) wine_bass_user_data_add_ex(ret, handle, user_new);
|
|
|
|
else free(user_new);
|
|
|
|
PRINT(BASS_ChannelSetSync);
|
|
|
|
return ret;
|
|
|
|
} else {
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HSYNC, BASS_ChannelSetSync(handle, type, param, wine_bass_syncproc_wrapper_nouser, proc));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelSlideAttribute (BASS.36)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelSlideAttribute(DWORD handle, DWORD attrib, float value, DWORD time) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelSlideAttribute(DWORD handle, DWORD attrib, float value, DWORD time));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelSlideAttribute(handle, attrib, value, time));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelStop (BASS.37)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelStop(DWORD handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelStop(DWORD handle));
|
|
|
|
wine_bass_user_data_remove(handle);
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelStop(handle));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ChannelUpdate (BASS.38)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_ChannelUpdate(DWORD handle, DWORD length) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ChannelUpdate(DWORD handle, DWORD length));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_ChannelUpdate(handle, length));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_ErrorGetCode (BASS.39)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
int __stdcall WIN_BASS_ErrorGetCode(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_ErrorGetCode(void));
|
|
|
|
int ret = BASS_ErrorGetCode();
|
2023-03-11 20:20:25 +07:00
|
|
|
if (ret) {
|
|
|
|
// WINE_ERR("BASS_ErrorGetCode() = %i", ret);
|
|
|
|
}
|
|
|
|
PRINT3("BASS_ErrorGetCode() = %i", ret);
|
2023-03-10 02:23:12 +07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_FXGetParameters (BASS.40)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_FXGetParameters(WIN_HFX handle, void * params) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_FXGetParameters(WIN_HFX handle, void * params));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_FXGetParameters(handle, params));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_FXReset (BASS.41)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_FXReset(DWORD handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_FXReset(DWORD handle));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_FXReset(handle));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_FXSetParameters (BASS.42)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_FXSetParameters(WIN_HFX handle, const void * params) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_FXSetParameters(WIN_HFX handle, void * params));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_FXSetParameters(handle, params));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_FXSetPriority (BASS.43)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_FXSetPriority(WIN_HFX handle, int priority) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_FXSetPriority(WIN_HFX handle, int priority));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_FXSetPriority(handle, priority));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Free (BASS.44)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_Free(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_Free(void));
|
|
|
|
wine_bass_user_data_free(&WINE_BASS_DATA_STORAGE);
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_Free());
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Get3DFactors (BASS.45)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_Get3DFactors(float * distf, float * rollf, float * doppf) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_Get3DFactors(float * distf, float * rollf, float * doppf));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_Get3DFactors(distf, rollf, doppf));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Get3DPosition (BASS.46)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_Get3DPosition(WIN_BASS_3DVECTOR * pos, WIN_BASS_3DVECTOR * vel, WIN_BASS_3DVECTOR * front, WIN_BASS_3DVECTOR * top) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_Get3DPosition(WIN_BASS_3DVECTOR * pos, WIN_BASS_3DVECTOR * vel, WIN_BASS_3DVECTOR * front, WIN_BASS_3DVECTOR * top));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_Get3DPosition((BASS_3DVECTOR*)pos, (BASS_3DVECTOR*)vel, (BASS_3DVECTOR*)front, (BASS_3DVECTOR*)top));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_GetCPU (BASS.47)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
float __stdcall WIN_BASS_GetCPU(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_GetCPU(void));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(float, BASS_GetCPU());
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_GetConfig (BASS.48)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_GetConfig(DWORD option) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_GetConfig(DWORD option));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(LIN_DWORD, BASS_GetConfig(option));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_GetConfigPtr (BASS.49)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
#if BASSDLLVER >= BASSDLLVER_2417
|
|
|
|
const
|
|
|
|
#endif
|
|
|
|
void * __stdcall WIN_BASS_GetConfigPtr(DWORD option) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_GetConfigPtr(DWORD option));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(
|
|
|
|
#if BASSDLLVER >= BASSDLLVER_2417
|
|
|
|
const
|
|
|
|
#endif
|
|
|
|
void*,
|
|
|
|
#if BASSDLLVER <= BASSDLLVER_2415
|
|
|
|
(void*)
|
|
|
|
#endif
|
|
|
|
BASS_GetConfigPtr(option));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_GetDSoundObject (BASS.50)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
void * __stdcall WIN_BASS_GetDSoundObject(DWORD object) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_GetDSoundObject(DWORD object));
|
|
|
|
WINE_FIXME("stub (there's no BASS_GetDSoundObject on Linux)");
|
2023-03-11 20:20:25 +07:00
|
|
|
return NULL;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_GetDevice (BASS.51)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_GetDevice(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_GetDevice(void));
|
|
|
|
DWORD ret = BASS_GetDevice();
|
|
|
|
// WINE_TRACE("BASS_GetDevice() = %u", ret);
|
2023-03-11 20:20:25 +07:00
|
|
|
PRINT3("BASS_GetDevice() = %u", ret);
|
2023-03-10 02:23:12 +07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_GetDeviceInfo (BASS.52)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_GetDeviceInfo(DWORD device, WIN_BASS_DEVICEINFO * info) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_GetDeviceInfo(DWORD device, WIN_BASS_DEVICEINFO * info));
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL ret = BASS_GetDeviceInfo(device, (BASS_DEVICEINFO*)info);
|
|
|
|
if (ret) {
|
|
|
|
PRINT3("BASS_GetDeviceInfo(%u, ...) = { name: %s, driver: %s, flags: %u }", device, info->name, info->driver, info->flags);
|
2023-03-10 02:23:12 +07:00
|
|
|
} else {
|
2023-03-11 20:20:25 +07:00
|
|
|
PRINT3("BASS_GetDeviceInfo(%u, ...) failed!", device);
|
|
|
|
}
|
|
|
|
return ret ? TRUE : FALSE;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_GetEAXParameters (BASS.53)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
#if BASSDLLVER <= BASSDLLVER_2415
|
|
|
|
BOOL __stdcall WIN_BASS_GetEAXParameters(DWORD * env, float * vol, float * decay, float * damp) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_GetEAXParameters(DWORD * env, float * vol, float * decay, float * damp));
|
|
|
|
WINE_FIXME("stub (there's no BASS_GetEAXParameters on Linux)");
|
2023-03-11 20:20:25 +07:00
|
|
|
return FALSE;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
2023-03-11 20:20:25 +07:00
|
|
|
#endif
|
2023-03-10 02:23:12 +07:00
|
|
|
/******************************************************************
|
|
|
|
* BASS_GetInfo (BASS.54)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_GetInfo(WIN_BASS_INFO * info) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_GetInfo(WIN_BASS_INFO * info));
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL ret = BASS_GetInfo((BASS_INFO*)info);
|
|
|
|
if (ret) {
|
|
|
|
PRINT3("BASS_GetInfo(...) = { flags: %u, minbuf: %u, latency: %u, initflags: %u, speakers: %u, freq: %u }", info->flags, info->minbuf, info->latency, info->initflags, info->speakers, info->freq);
|
|
|
|
} else {
|
|
|
|
PRINT2("BASS_GetInfo failed!");
|
|
|
|
}
|
|
|
|
return ret ? TRUE : FALSE;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_GetVersion (BASS.55)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_GetVersion(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_GetVersion(void));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(LIN_DWORD, BASS_GetVersion());
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_GetVolume (BASS.56)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
float __stdcall WIN_BASS_GetVolume(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_GetVolume(void));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(float, BASS_GetVolume());
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Init (BASS.57)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_Init(int device, DWORD freq, DWORD flags, HWND win, const
|
|
|
|
#if BASSDLLVER <= BASSDLLVER_2415
|
|
|
|
GUID
|
|
|
|
#elif BASSDLLVER >= BASSDLLVER_2417
|
|
|
|
void
|
|
|
|
#endif
|
|
|
|
*dsguid) {
|
|
|
|
BASS_START(BASS_Init(int device, DWORD freq, DWORD flags, HWND win, const void * dsguid));
|
|
|
|
DWORD origFlags = flags;
|
|
|
|
if (flags & BASS_DEVICE_DSOUND) {
|
|
|
|
flags &= ~BASS_DEVICE_DSOUND;
|
|
|
|
}
|
|
|
|
LIN_BOOL ret = BASS_Init(device, freq, flags, 0, dsguid);
|
|
|
|
DWORD retu = ret ? 1 : 0;
|
|
|
|
PRINT3("BASS_Init(%d, %u, %u, %p, %p) = %u", device, freq, origFlags, win, dsguid, retu);
|
|
|
|
return ret ? TRUE : FALSE;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_IsStarted (BASS.58)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
#if BASSDLLVER <= BASSDLLVER_2415
|
|
|
|
BOOL
|
|
|
|
#elif BASSDLLVER >= BASSDLLVER_2417
|
|
|
|
DWORD
|
|
|
|
#endif
|
|
|
|
__stdcall WIN_BASS_IsStarted(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_IsStarted(void));
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD ret = BASS_IsStarted();
|
|
|
|
PRINT3("BASS_IsStarted() = %u", ret);
|
|
|
|
return ret
|
|
|
|
#if BASSDLLVER <= BASSDLLVER_2415
|
|
|
|
? TRUE : FALSE
|
|
|
|
#endif
|
|
|
|
;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_MusicFree (BASS.59)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_MusicFree(WIN_HMUSIC handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_MusicFree(WIN_HMUSIC handle));
|
|
|
|
wine_bass_user_data_remove(handle);
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_MusicFree(handle));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_MusicLoad (BASS.60)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HMUSIC __stdcall WIN_BASS_MusicLoad(BOOL mem, const void * file, WIN_QWORD offset, DWORD length, DWORD flags, DWORD freq) {
|
|
|
|
BASS_START(BASS_MusicLoad(BOOL mem, const void * file, WIN_QWORD offset, DWORD length, DWORD flags, DWORD freq));
|
2023-03-10 02:23:12 +07:00
|
|
|
if (mem) {
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HMUSIC, BASS_MusicLoad(mem, file, offset, length, flags, freq));
|
2023-03-10 02:23:12 +07:00
|
|
|
} else {
|
|
|
|
char *linuxname = wine_bass_to_linux_filename(file, flags);
|
|
|
|
if (linuxname) {
|
|
|
|
DWORD flags2 = flags & ~BASS_UNICODE;
|
|
|
|
WIN_HSTREAM ret = BASS_MusicLoad(mem, linuxname, offset, length, flags2, freq);
|
|
|
|
if (linuxname)
|
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, linuxname);
|
|
|
|
PRINT(BASS_MusicLoad);
|
|
|
|
return ret;
|
|
|
|
} else {
|
|
|
|
WINE_FIXME("BASS_MusicLoad: couldn't wine_get_unix_file_name!");
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HMUSIC, BASS_MusicLoad(mem, file, offset, length, flags, freq));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Pause (BASS.61)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_Pause(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_Pause(void));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_Pause());
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_PluginFree (BASS.62)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_PluginFree(WIN_HPLUGIN handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_PluginFree(WIN_HPLUGIN handle));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_PluginFree(handle));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_PluginGetInfo (BASS.63)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
|
|
|
|
const WIN_BASS_PLUGININFO * __stdcall WIN_BASS_PluginGetInfo(WIN_HPLUGIN handle) {
|
|
|
|
BASS_START(PLUGININFO * __stdcall WIN_BASS_PluginGetInfo(WIN_HPLUGIN handle));
|
|
|
|
BASS_RETURN(const WIN_BASS_PLUGININFO*, (const WIN_BASS_PLUGININFO*)BASS_PluginGetInfo(handle));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_PluginLoad (BASS.64)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HPLUGIN __stdcall WIN_BASS_PluginLoad(const char * file, DWORD flags) {
|
|
|
|
BASS_START(BASS_PluginLoad(const char * file, DWORD flags));
|
2023-03-10 02:23:12 +07:00
|
|
|
if (flags & BASS_UNICODE)
|
|
|
|
WINE_FIXME("BASS_PluginLoad: This might not work!");
|
|
|
|
if (flags & BASS_PLUGIN_PROC)
|
|
|
|
WINE_FIXME("BASS_PluginLoad: Using BASS_PLUGIN_PROC! This will most likely result in a crash!");
|
|
|
|
else
|
|
|
|
WINE_FIXME("BASS_PluginLoad: loading %s. This might not work!", file);
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HPLUGIN, BASS_PluginLoad(file, flags));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_RecordFree (BASS.65)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_RecordFree(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_RecordFree(void));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_RecordFree());
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_RecordGetDevice (BASS.66)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_RecordGetDevice(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_RecordGetDevice(void));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(LIN_DWORD, BASS_RecordGetDevice());
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_RecordGetDeviceInfo (BASS.67)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_RecordGetDeviceInfo(DWORD device, WIN_BASS_DEVICEINFO * info) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_RecordGetDeviceInfo(DWORD device, WIN_BASS_DEVICEINFO * info));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_RecordGetDeviceInfo(device, (BASS_DEVICEINFO*)info));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_RecordGetInfo (BASS.68)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_RecordGetInfo(WIN_BASS_RECORDINFO * info) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_RecordGetInfo(WIN_BASS_RECORDINFO * info));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_RecordGetInfo((BASS_RECORDINFO*)info));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_RecordGetInput (BASS.69)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_RecordGetInput(int input, float * volume) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_RecordGetInput(int input, float * volume));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(LIN_DWORD, BASS_RecordGetInput(input, volume));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_RecordGetInputName (BASS.70)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
const char * __stdcall WIN_BASS_RecordGetInputName(int input) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_RecordGetInputName(int input));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(const char*, BASS_RecordGetInputName(input));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_RecordInit (BASS.71)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_RecordInit(int device) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_RecordInit(int device));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_RecordInit(device));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_RecordSetDevice (BASS.72)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_RecordSetDevice(DWORD device) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_RecordSetDevice(DWORD device));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_RecordSetDevice(device));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_RecordSetInput (BASS.73)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_RecordSetInput(int input, DWORD flags, float volume) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_RecordSetInput(int input, DWORD flags, float volume));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_RecordSetInput(input, flags, volume));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_RecordStart (BASS.74)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
WIN_RECORDPROC *proc;
|
|
|
|
void *user;
|
|
|
|
} RecordUserData;
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL wine_bass_recordproc_wrapper(HRECORD handle, const void *buffer, LIN_DWORD length, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
RecordUserData *user_new = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
PRINT(user_new->proc(handle, buffer, length, user_new->user));
|
|
|
|
BOOL ret = user_new->proc(handle, buffer, length, user_new->user);
|
|
|
|
return ret ? 1 : 0;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL wine_bass_recordproc_wrapper_nouser(HRECORD handle, const void *buffer, LIN_DWORD length, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
WIN_RECORDPROC *proc = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
PRINT(proc(handle, buffer, length, NULL));
|
|
|
|
BOOL ret = proc(handle, buffer, length, NULL);
|
|
|
|
return ret ? 1 : 0;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HRECORD __stdcall WIN_BASS_RecordStart(DWORD freq, DWORD chans, DWORD flags, WIN_RECORDPROC * proc, void * user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_RecordStart(DWORD freq, DWORD chans, DWORD flags, WIN_RECORDPROC * proc, void * user));
|
|
|
|
if (user) {
|
|
|
|
RecordUserData *user_new = malloc(sizeof(RecordUserData));
|
|
|
|
user_new->proc = proc;
|
|
|
|
user_new->user = user;
|
|
|
|
WIN_HRECORD ret = BASS_RecordStart(freq, chans, flags, wine_bass_recordproc_wrapper, user_new);
|
|
|
|
if (ret) wine_bass_user_data_add(ret, user_new);
|
|
|
|
else free(user_new);
|
|
|
|
PRINT(BASS_RecordStart);
|
|
|
|
return ret;
|
|
|
|
} else {
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HRECORD, BASS_RecordStart(freq, chans, flags, wine_bass_recordproc_wrapper_nouser, proc));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SampleCreate (BASS.75)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HSAMPLE __stdcall WIN_BASS_SampleCreate(DWORD length, DWORD freq, DWORD chans, DWORD max, DWORD flags) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SampleCreate(DWORD length, DWORD freq, DWORD chans, DWORD max, DWORD flags));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HSAMPLE, BASS_SampleCreate(length, freq, chans, max, flags));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SampleFree (BASS.76)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_SampleFree(WIN_HSAMPLE handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SampleFree(WIN_HSAMPLE handle));
|
|
|
|
wine_bass_user_data_remove(handle);
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_SampleFree(handle));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SampleGetChannel (BASS.77)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_SampleGetChannel(WIN_HSAMPLE handle,
|
|
|
|
#if BASSDLLVER <= BASSDLLVER_2415
|
|
|
|
BOOL onlynew
|
|
|
|
#elif BASSDLLVER >= BASSDLLVER_2417
|
|
|
|
DWORD flags
|
|
|
|
#endif
|
|
|
|
) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SampleGetChannel(WIN_HSAMPLE handle, DWORD flags));
|
2023-03-11 20:20:25 +07:00
|
|
|
#if BASSDLLVER <= BASSDLLVER_2415
|
|
|
|
DWORD flags = 0;
|
|
|
|
if (onlynew) flags |= BASS_SAMCHAN_NEW;
|
|
|
|
#endif
|
|
|
|
BASS_RETURN(LIN_DWORD, BASS_SampleGetChannel(handle, flags));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SampleGetChannels (BASS.78)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_SampleGetChannels(WIN_HSAMPLE handle, WIN_HCHANNEL * channels) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SampleGetChannels(WIN_HSAMPLE handle, WIN_HCHANNEL * channels));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(LIN_DWORD, BASS_SampleGetChannels(handle, (HCHANNEL*)channels));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SampleGetData (BASS.79)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_SampleGetData(WIN_HSAMPLE handle, void * buffer) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SampleGetData(WIN_HSAMPLE handle, void * buffer));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_SampleGetData(handle, buffer));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SampleGetInfo (BASS.80)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_SampleGetInfo(WIN_HSAMPLE handle, WIN_BASS_SAMPLE * info) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SampleGetInfo(WIN_HSAMPLE handle, WIN_BASS_SAMPLE * info));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_SampleGetInfo(handle, (BASS_SAMPLE*)info));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SampleLoad (BASS.81)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HSAMPLE __stdcall WIN_BASS_SampleLoad(BOOL mem, const void * file, WIN_QWORD offset, DWORD length, DWORD max, DWORD flags) {
|
|
|
|
BASS_START(BASS_SampleLoad(BOOL mem, const void * file, WIN_QWORD offset, DWORD length, DWORD max, DWORD flags));
|
2023-03-10 02:23:12 +07:00
|
|
|
if (mem) {
|
2023-03-11 20:20:25 +07:00
|
|
|
PRINT3("BASS_SampleLoad(mem=1, flags=%u)", flags);
|
|
|
|
return BASS_SampleLoad(mem, file, offset, length, max, flags);
|
2023-03-10 02:23:12 +07:00
|
|
|
} else {
|
|
|
|
char *linuxname = wine_bass_to_linux_filename(file, flags);
|
|
|
|
if (linuxname) {
|
|
|
|
DWORD flags2 = flags & ~BASS_UNICODE;
|
|
|
|
WIN_HSAMPLE ret = BASS_SampleLoad(mem, linuxname, offset, length, max, flags2);
|
|
|
|
if (linuxname)
|
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, linuxname);
|
2023-03-11 20:20:25 +07:00
|
|
|
PRINT3("BASS_SampleLoad(mem=0, fn=%s, flags=%u)", linuxname, flags);
|
2023-03-10 02:23:12 +07:00
|
|
|
return ret;
|
|
|
|
} else {
|
|
|
|
WINE_FIXME("BASS_SampleLoad: couldn't wine_get_unix_file_name!");
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HSAMPLE, BASS_SampleLoad(mem, file, offset, length, max, flags));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SampleSetData (BASS.82)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_SampleSetData(WIN_HSAMPLE handle, const void * buffer) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SampleSetData(WIN_HSAMPLE handle, void * buffer));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_SampleSetData(handle, buffer));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SampleSetInfo (BASS.83)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_SampleSetInfo(WIN_HSAMPLE handle, const WIN_BASS_SAMPLE * info) {
|
|
|
|
BASS_START(BASS_SampleSetInfo(WIN_HSAMPLE handle, const WIN_BASS_SAMPLE * info));
|
|
|
|
BASS_RETURNBOOL(BASS_SampleSetInfo(handle, (BASS_SAMPLE*)info));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SampleStop (BASS.84)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_SampleStop(WIN_HSAMPLE handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SampleStop(WIN_HSAMPLE handle));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_SampleStop(handle));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Set3DFactors (BASS.85)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_Set3DFactors(float distf, float rollf, float doppf) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_Set3DFactors(float distf, float rollf, float doppf));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_Set3DFactors(distf, rollf, doppf));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Set3DPosition (BASS.86)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_Set3DPosition(const WIN_BASS_3DVECTOR * pos, const WIN_BASS_3DVECTOR * vel, const WIN_BASS_3DVECTOR * front, const WIN_BASS_3DVECTOR * top) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_Set3DPosition(WIN_BASS_3DVECTOR * pos, WIN_BASS_3DVECTOR * vel, WIN_BASS_3DVECTOR * front, WIN_BASS_3DVECTOR * top));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_Set3DPosition((BASS_3DVECTOR*)pos, (BASS_3DVECTOR*)vel, (BASS_3DVECTOR*)front, (BASS_3DVECTOR*)top));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SetConfig (BASS.87)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
STATIC_ASSERT_BASIC(BASS_CONFIG_IOS_MIXAUDIO == BASS_CONFIG_IOS_SESSION);
|
|
|
|
static inline const char *wine_bass_option_name(DWORD option, BOOL *thread) {
|
|
|
|
if (option & BASS_CONFIG_THREAD) {
|
|
|
|
option &= ~BASS_CONFIG_THREAD;
|
|
|
|
*thread = TRUE;
|
|
|
|
} else {
|
|
|
|
*thread = FALSE;
|
|
|
|
}
|
|
|
|
switch (option) {
|
|
|
|
case BASS_CONFIG_3DALGORITHM: return "BASS_CONFIG_3DALGORITHM";
|
|
|
|
case BASS_CONFIG_AIRPLAY: return "BASS_CONFIG_AIRPLAY";
|
|
|
|
case BASS_CONFIG_AM_DISABLE: return "BASS_CONFIG_AM_DISABLE";
|
|
|
|
case BASS_CONFIG_ANDROID_AAUDIO: return "BASS_CONFIG_ANDROID_AAUDIO";
|
|
|
|
case BASS_CONFIG_ANDROID_SESSIONID: return "BASS_CONFIG_ANDROID_SESSIONID";
|
|
|
|
case BASS_CONFIG_ANDROID_JAVAVM: return "BASS_CONFIG_ANDROID_JAVAVM";
|
|
|
|
case BASS_CONFIG_ASYNCFILE_BUFFER: return "BASS_CONFIG_ASYNCFILE_BUFFER";
|
|
|
|
case BASS_CONFIG_BUFFER: return "BASS_CONFIG_BUFFER";
|
|
|
|
case BASS_CONFIG_CURVE_PAN: return "BASS_CONFIG_CURVE_PAN";
|
|
|
|
case BASS_CONFIG_CURVE_VOL: return "BASS_CONFIG_CURVE_VOL";
|
|
|
|
case BASS_CONFIG_DEV_BUFFER: return "BASS_CONFIG_DEV_BUFFER";
|
|
|
|
case BASS_CONFIG_DEV_DEFAULT: return "BASS_CONFIG_DEV_DEFAULT";
|
|
|
|
case BASS_CONFIG_DEV_NONSTOP: return "BASS_CONFIG_DEV_NONSTOP";
|
|
|
|
case BASS_CONFIG_DEV_PERIOD: return "BASS_CONFIG_DEV_PERIOD";
|
|
|
|
case 70: return "BASS_CONFIG_DEV_TIMEOUT";
|
|
|
|
case BASS_CONFIG_FILENAME: return "BASS_CONFIG_FILENAME";
|
|
|
|
case BASS_CONFIG_FLOAT: return "BASS_CONFIG_FLOAT";
|
|
|
|
case BASS_CONFIG_FLOATDSP: return "BASS_CONFIG_FLOATDSP";
|
|
|
|
case BASS_CONFIG_GVOL_MUSIC: return "BASS_CONFIG_GVOL_MUSIC";
|
|
|
|
case BASS_CONFIG_GVOL_SAMPLE: return "BASS_CONFIG_GVOL_SAMPLE";
|
|
|
|
case BASS_CONFIG_GVOL_STREAM: return "BASS_CONFIG_GVOL_STREAM";
|
|
|
|
case BASS_CONFIG_HANDLES: return "BASS_CONFIG_HANDLES";
|
|
|
|
case BASS_CONFIG_IOS_MIXAUDIO: return "BASS_CONFIG_IOS_MIXAUDIO/BASS_CONFIG_IOS_SESSION";
|
|
|
|
case BASS_CONFIG_IOS_NOCATEGORY: return "BASS_CONFIG_IOS_NOCATEGORY";
|
|
|
|
case BASS_CONFIG_IOS_NOTIFY: return "BASS_CONFIG_IOS_NOTIFY";
|
|
|
|
case BASS_CONFIG_IOS_SPEAKER: return "BASS_CONFIG_IOS_SPEAKER";
|
|
|
|
case BASS_CONFIG_LIBSSL: return "BASS_CONFIG_LIBSSL";
|
|
|
|
case BASS_CONFIG_MF_DISABLE: return "BASS_CONFIG_MF_DISABLE";
|
|
|
|
case BASS_CONFIG_MF_VIDEO: return "BASS_CONFIG_MF_VIDEO";
|
|
|
|
case 68: return "BASS_CONFIG_MP3_OLDGAPS";
|
|
|
|
case BASS_CONFIG_MUSIC_VIRTUAL: return "BASS_CONFIG_MUSIC_VIRTUAL";
|
|
|
|
case BASS_CONFIG_NET_AGENT: return "BASS_CONFIG_NET_AGENT";
|
|
|
|
case BASS_CONFIG_NET_BUFFER: return "BASS_CONFIG_NET_BUFFER";
|
|
|
|
case BASS_CONFIG_NET_META: return "BASS_CONFIG_NET_META";
|
|
|
|
case BASS_CONFIG_NET_PASSIVE: return "BASS_CONFIG_NET_PASSIVE";
|
|
|
|
case BASS_CONFIG_NET_PLAYLIST: return "BASS_CONFIG_NET_PLAYLIST";
|
|
|
|
case BASS_CONFIG_NET_PLAYLIST_DEPTH: return "BASS_CONFIG_NET_PLAYLIST_DEPTH";
|
|
|
|
case BASS_CONFIG_NET_PROXY: return "BASS_CONFIG_NET_PROXY";
|
|
|
|
case BASS_CONFIG_NET_PREBUF: return "BASS_CONFIG_NET_PREBUF";
|
|
|
|
case BASS_CONFIG_NET_PREBUF_WAIT: return "BASS_CONFIG_NET_PREBUF_WAIT";
|
|
|
|
case BASS_CONFIG_NET_READTIMEOUT: return "BASS_CONFIG_NET_READTIMEOUT";
|
|
|
|
case BASS_CONFIG_NET_RESTRATE: return "BASS_CONFIG_NET_RESTRATE";
|
|
|
|
case BASS_CONFIG_NET_SEEK: return "BASS_CONFIG_NET_SEEK";
|
|
|
|
case BASS_CONFIG_NET_TIMEOUT: return "BASS_CONFIG_NET_TIMEOUT";
|
|
|
|
case BASS_CONFIG_NORAMP: return "BASS_CONFIG_NORAMP";
|
|
|
|
case BASS_CONFIG_OGG_PRESCAN: return "BASS_CONFIG_OGG_PRESCAN";
|
|
|
|
case BASS_CONFIG_PAUSE_NOPLAY: return "BASS_CONFIG_PAUSE_NOPLAY";
|
|
|
|
case BASS_CONFIG_REC_BUFFER: return "BASS_CONFIG_REC_BUFFER";
|
|
|
|
case BASS_CONFIG_REC_DEFAULT: return "BASS_CONFIG_REC_DEFAULT";
|
|
|
|
case BASS_CONFIG_REC_LOOPBACK: return "BASS_CONFIG_REC_LOOPBACK";
|
|
|
|
case BASS_CONFIG_REC_WASAPI: return "BASS_CONFIG_REC_WASAPI";
|
|
|
|
case BASS_CONFIG_SAMPLE_ONEHANDLE: return "BASS_CONFIG_SAMPLE_ONEHANDLE";
|
|
|
|
case BASS_CONFIG_SRC: return "BASS_CONFIG_SRC";
|
|
|
|
case BASS_CONFIG_SRC_SAMPLE: return "BASS_CONFIG_SRC_SAMPLE";
|
|
|
|
case BASS_CONFIG_UNICODE: return "BASS_CONFIG_UNICODE";
|
|
|
|
case BASS_CONFIG_UPDATEPERIOD: return "BASS_CONFIG_UPDATEPERIOD";
|
|
|
|
case BASS_CONFIG_UPDATETHREADS: return "BASS_CONFIG_UPDATETHREADS";
|
|
|
|
case BASS_CONFIG_VERIFY: return "BASS_CONFIG_VERIFY";
|
|
|
|
case BASS_CONFIG_VERIFY_NET: return "BASS_CONFIG_VERIFY_NET";
|
|
|
|
case BASS_CONFIG_VISTA_SPEAKERS: return "BASS_CONFIG_VISTA_SPEAKERS";
|
|
|
|
case BASS_CONFIG_VISTA_TRUEPOS: return "BASS_CONFIG_VISTA_TRUEPOS";
|
|
|
|
case BASS_CONFIG_WASAPI_PERSIST: return "BASS_CONFIG_WASAPI_PERSIST";
|
|
|
|
default: return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
BOOL __stdcall WIN_BASS_SetConfig(DWORD option, DWORD value) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SetConfig(DWORD option, DWORD value));
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL ret;
|
|
|
|
switch (option) {
|
|
|
|
case BASS_CONFIG_MF_DISABLE:
|
|
|
|
WINE_FIXME("stub: BASS_CONFIG_MF_DISABLE not supported!");
|
|
|
|
return TRUE;
|
|
|
|
case BASS_CONFIG_MF_VIDEO:
|
|
|
|
WINE_FIXME("stub: BASS_CONFIG_MF_VIDEO not supported!");
|
|
|
|
return TRUE;
|
|
|
|
case BASS_CONFIG_REC_WASAPI:
|
|
|
|
WINE_FIXME("stub: BASS_CONFIG_REC_WASAPI not supported!");
|
|
|
|
return TRUE;
|
|
|
|
case BASS_CONFIG_WASAPI_PERSIST:
|
|
|
|
WINE_FIXME("stub: BASS_CONFIG_WASAPI_PERSIST not supported!");
|
|
|
|
return TRUE;
|
|
|
|
default:
|
|
|
|
ret = BASS_SetConfig(option, value);
|
|
|
|
{
|
|
|
|
LIN_BOOL thread;
|
|
|
|
const char *name = wine_bass_option_name(option, &thread);
|
|
|
|
DWORD retu = ret ? 1 : 0;
|
|
|
|
if (name) {
|
|
|
|
const char *threads = thread ? "|BASS_CONFIG_THREAD" : "";
|
|
|
|
PRINT3("BASS_SetConfig(%s%s, %u) = %u", name, threads, value, retu);
|
|
|
|
} else {
|
|
|
|
PRINT3("BASS_SetConfig(%u, %u) = %u", option, value, retu);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret ? TRUE : FALSE;
|
|
|
|
}
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SetConfigPtr (BASS.88)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_SetConfigPtr(DWORD option, const void * value) {
|
|
|
|
BASS_START(BASS_SetConfigPtr(DWORD option, const void * value));
|
|
|
|
BASS_RETURNBOOL(BASS_SetConfigPtr(option, value));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SetDevice (BASS.89)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_SetDevice(DWORD device) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SetDevice(DWORD device));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_SetDevice(device));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_SetEAXParameters (BASS.90)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
#if BASSDLLVER <= BASSDLLVER_2415
|
|
|
|
BOOL __stdcall WIN_BASS_SetEAXParameters(int env, float vol, float decay, float damp) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SetEAXParameters(int env, float vol, float decay, float damp));
|
|
|
|
WINE_FIXME("stub (there's no BASS_SetEAXParameters on Linux)");
|
2023-03-11 20:20:25 +07:00
|
|
|
return FALSE;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
2023-03-11 20:20:25 +07:00
|
|
|
#endif
|
2023-03-10 02:23:12 +07:00
|
|
|
/******************************************************************
|
|
|
|
* BASS_SetVolume (BASS.91)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_SetVolume(float volume) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_SetVolume(float volume));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_SetVolume(volume));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Start (BASS.92)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_Start(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_Start(void));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_Start());
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Stop (BASS.93)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_Stop(void) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_Stop(void));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_Stop());
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_StreamCreate (BASS.94)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
WIN_STREAMPROC *proc;
|
|
|
|
void *user;
|
|
|
|
} StreamUserData;
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_DWORD wine_bass_streamproc_wrapper(HSTREAM handle, void *buffer, LIN_DWORD length, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
StreamUserData *user_new = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(DWORD, user_new->proc(handle, buffer, length, user_new->user));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_DWORD wine_bass_streamproc_wrapper_nouser(HSTREAM handle, void *buffer, LIN_DWORD length, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
WIN_STREAMPROC *proc = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(DWORD, proc(handle, buffer, length, NULL));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HSTREAM __stdcall WIN_BASS_StreamCreate(DWORD freq, DWORD chans, DWORD flags, WIN_STREAMPROC * proc, void * user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_StreamCreate(DWORD freq, DWORD chans, DWORD flags, WIN_STREAMPROC * proc, void * user));
|
|
|
|
if (user) {
|
|
|
|
StreamUserData *user_new = malloc(sizeof(StreamUserData));
|
|
|
|
user_new->proc = proc;
|
|
|
|
user_new->user = user;
|
|
|
|
WIN_HSTREAM ret = BASS_StreamCreate(freq, chans, flags, wine_bass_streamproc_wrapper, user_new);
|
|
|
|
if (ret) wine_bass_user_data_add(ret, user_new);
|
|
|
|
else free(user_new);
|
|
|
|
PRINT(BASS_StreamCreate);
|
|
|
|
return ret;
|
|
|
|
} else {
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HSTREAM, BASS_StreamCreate(freq, chans, flags, wine_bass_streamproc_wrapper_nouser, proc));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_StreamCreateFile (BASS.95)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HSTREAM __stdcall WIN_BASS_StreamCreateFile(BOOL mem, const void * file, WIN_QWORD offset, WIN_QWORD length, DWORD flags) {
|
|
|
|
BASS_START(BASS_StreamCreateFile(BOOL mem, const void * file, WIN_QWORD offset, WIN_QWORD length, DWORD flags));
|
2023-03-10 02:23:12 +07:00
|
|
|
if (mem) {
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HSTREAM, BASS_StreamCreateFile(mem, file, offset, length, flags));
|
2023-03-10 02:23:12 +07:00
|
|
|
} else {
|
|
|
|
char *linuxname = wine_bass_to_linux_filename(file, flags);
|
|
|
|
if (linuxname) {
|
|
|
|
DWORD flags2 = flags & ~BASS_UNICODE;
|
|
|
|
WIN_HSTREAM ret = BASS_StreamCreateFile(mem, linuxname, offset, length, flags2);
|
|
|
|
if (linuxname)
|
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, linuxname);
|
|
|
|
PRINT(BASS_StreamCreateFile);
|
|
|
|
return ret;
|
|
|
|
} else {
|
|
|
|
WINE_FIXME("BASS_StreamCreateFile: couldn't wine_get_unix_file_name!");
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HSTREAM, BASS_StreamCreateFile(mem, file, offset, length, flags));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_StreamCreateFileUser (BASS.96)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
WIN_BASS_FILEPROCS procs;
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_QWORD current_pos;
|
|
|
|
WIN_QWORD max_length;
|
2023-03-10 02:23:12 +07:00
|
|
|
void *user;
|
|
|
|
} FileUserData;
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
static FILE *fileproc_file;
|
2023-03-10 02:23:12 +07:00
|
|
|
void wine_bass_fileproc_close_wrapper(void *user) {
|
|
|
|
FileUserData *user_new = user;
|
|
|
|
WIN_FILECLOSEPROC *proc = user_new->procs.close;
|
|
|
|
void *user2 = user_new->user;
|
|
|
|
free(user_new);
|
2023-03-11 20:20:25 +07:00
|
|
|
if (fileproc_file) fclose(fileproc_file);
|
|
|
|
fileproc_file = NULL;
|
|
|
|
PRINT3("file->close(%p)", user2);
|
|
|
|
return proc(user2);
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_QWORD wine_bass_fileproc_length_wrapper(void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
FileUserData *user_new = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_QWORD ret = user_new->procs.length(user_new->user);
|
|
|
|
PRINT3("file->length(%p) = %lu", user_new->user, ret);
|
|
|
|
if (user_new->max_length == -1 && ret && fileproc_file) {
|
|
|
|
PRINT2("check succeeded");
|
|
|
|
user_new->max_length = ret;
|
|
|
|
LIN_QWORD tmp = ret;
|
|
|
|
if (user_new->procs.seek(0, user_new->user)) {
|
|
|
|
PRINT2("check2 succeeded");
|
|
|
|
char *buf = malloc(ret);
|
|
|
|
char *buf2 = buf;
|
|
|
|
char *bufend = &buf[ret];
|
|
|
|
while ((buf2 += user_new->procs.read(buf2, bufend - buf2, user_new->user)) != bufend);
|
|
|
|
tmp = ret;
|
|
|
|
if (user_new->procs.seek(0, user_new->user)) {
|
|
|
|
while (tmp -= fwrite(buf, 1, tmp, fileproc_file));
|
|
|
|
fclose(fileproc_file);
|
|
|
|
PRINT2("check3 succeeded");
|
|
|
|
fileproc_file = NULL;
|
|
|
|
} else {
|
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
free(buf);
|
|
|
|
} else {
|
|
|
|
char buf[8192];
|
|
|
|
memset(buf, 0, 8192);
|
|
|
|
while (tmp) {
|
|
|
|
size_t to_write = tmp > 8192 ? 8192 : tmp;
|
|
|
|
tmp -= fwrite(buf, 1, to_write, fileproc_file);
|
|
|
|
}
|
|
|
|
fseek(fileproc_file, 0, SEEK_CUR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_DWORD wine_bass_fileproc_read_wrapper(void *buffer, LIN_DWORD length, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
FileUserData *user_new = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_DWORD max_length = user_new->max_length <= user_new->current_pos ? 0 : user_new->max_length - user_new->current_pos;
|
|
|
|
DWORD actual_length = length > max_length ? max_length : length;
|
|
|
|
DWORD ret = user_new->procs.read(buffer, actual_length, user_new->user);
|
|
|
|
PRINT3("file->read(%p)(%p, %u) = %u / wrote at pos %lu", user_new->user, buffer, length, ret, user_new->current_pos);
|
|
|
|
user_new->current_pos += ret;
|
|
|
|
if (fileproc_file) fwrite(buffer, ret, 1, fileproc_file);
|
|
|
|
return ret;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL wine_bass_fileproc_seek_wrapper(LIN_QWORD offset, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
FileUserData *user_new = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
LIN_BOOL ret = user_new->procs.seek(offset, user_new->user);
|
|
|
|
DWORD retu = ret ? 1 : 0;
|
|
|
|
PRINT3("file->seek(%p)(%lu) = %u", user_new->user, offset, retu);
|
|
|
|
if (ret) {
|
|
|
|
user_new->current_pos = offset;
|
|
|
|
if (fileproc_file) fseek(fileproc_file, offset, SEEK_SET);
|
|
|
|
}
|
|
|
|
return ret ? TRUE : FALSE;
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
static BASS_FILEPROCS WINE_FILE_PROC_WRAPPERS = {
|
|
|
|
.close = wine_bass_fileproc_close_wrapper,
|
|
|
|
.length = wine_bass_fileproc_length_wrapper,
|
|
|
|
.read = wine_bass_fileproc_read_wrapper,
|
|
|
|
.seek = wine_bass_fileproc_seek_wrapper,
|
|
|
|
};
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HSTREAM __stdcall WIN_BASS_StreamCreateFileUser(DWORD system, DWORD flags, const WIN_BASS_FILEPROCS * proc, void * user) {
|
|
|
|
if (!proc && !user) BASS_RETURN(HSTREAM, BASS_StreamCreateFileUser(system, flags, NULL, NULL));
|
|
|
|
BASS_START(BASS_StreamCreateFileUser(DWORD system, DWORD flags, const WIN_BASS_FILEPROCS * proc, void * user));
|
2023-03-10 02:23:12 +07:00
|
|
|
FileUserData *user_new = malloc(sizeof(FileUserData));
|
2023-03-10 07:05:52 +07:00
|
|
|
user_new->procs = *proc;
|
2023-03-10 02:23:12 +07:00
|
|
|
user_new->user = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
user_new->current_pos = 0;
|
|
|
|
user_new->max_length = -1;
|
|
|
|
fileproc_file = fopen("/tmp/bass_file.bin", "wb");
|
2023-03-10 02:23:12 +07:00
|
|
|
WIN_HSTREAM ret = BASS_StreamCreateFileUser(system, flags, &WINE_FILE_PROC_WRAPPERS, user_new);
|
|
|
|
if (!ret) free(user_new);
|
2023-03-11 20:20:25 +07:00
|
|
|
PRINT3("BASS_StreamCreateFileUser(%u, %u, %p, %p) = %u", system, flags, proc, user, ret);
|
2023-03-10 02:23:12 +07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_StreamCreateURL (BASS.97)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
WIN_DOWNLOADPROC *proc;
|
|
|
|
void *user;
|
|
|
|
} DownloadUserData;
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
void wine_bass_downloadproc_wrapper(const void *buffer, LIN_DWORD length, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
DownloadUserData *user_new = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNVOID(user_new->proc(buffer, length, user_new->user));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
void wine_bass_downloadproc_wrapper_nouser(const void *buffer, LIN_DWORD length, void *user) {
|
2023-03-10 02:23:12 +07:00
|
|
|
WIN_DOWNLOADPROC *proc = user;
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNVOID(proc(buffer, length, NULL));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_HSTREAM __stdcall WIN_BASS_StreamCreateURL(const char * url, DWORD offset, DWORD flags, WIN_DOWNLOADPROC * proc, void * user) {
|
|
|
|
BASS_START(BASS_StreamCreateURL(const char * url, DWORD offset, DWORD flags, WIN_DOWNLOADPROC * proc, void * user));
|
2023-03-10 02:23:12 +07:00
|
|
|
if (user) {
|
|
|
|
DownloadUserData *user_new = malloc(sizeof(DownloadUserData));
|
|
|
|
user_new->proc = proc;
|
|
|
|
user_new->user = user;
|
|
|
|
WIN_HSTREAM ret = BASS_StreamCreateURL(url, offset, flags, wine_bass_downloadproc_wrapper, user_new);
|
|
|
|
if (ret) wine_bass_user_data_add(ret, user_new);
|
|
|
|
else free(user_new);
|
|
|
|
PRINT(BASS_StreamCreateUrl);
|
|
|
|
return ret;
|
|
|
|
} else {
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(HSTREAM, BASS_StreamCreateURL(url, offset, flags, wine_bass_downloadproc_wrapper_nouser, proc));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_StreamFree (BASS.98)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_StreamFree(WIN_HSTREAM handle) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_StreamFree(WIN_HSTREAM handle));
|
|
|
|
wine_bass_user_data_remove(handle);
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_StreamFree(handle));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_StreamGetFilePosition (BASS.99)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
WIN_QWORD __stdcall WIN_BASS_StreamGetFilePosition(WIN_HSTREAM handle, DWORD mode) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_StreamGetFilePosition(WIN_HSTREAM handle, DWORD mode));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURN(LIN_QWORD, BASS_StreamGetFilePosition(handle, mode));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_StreamPutData (BASS.100)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_StreamPutData(WIN_HSTREAM handle, const void * buffer, DWORD length) {
|
|
|
|
BASS_START(BASS_StreamPutData(WIN_HSTREAM handle, const void * buffer, DWORD length));
|
|
|
|
BASS_RETURN(LIN_QWORD, BASS_StreamPutData(handle, buffer, length));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_StreamPutFileData (BASS.101)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
DWORD __stdcall WIN_BASS_StreamPutFileData(WIN_HSTREAM handle, const void * buffer, DWORD length) {
|
|
|
|
BASS_START(BASS_StreamPutFileData(WIN_HSTREAM handle, const void * buffer, DWORD length));
|
|
|
|
BASS_RETURN(LIN_DWORD, BASS_StreamPutFileData(handle, buffer, length));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|
|
|
|
/******************************************************************
|
|
|
|
* BASS_Update (BASS.102)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2023-03-11 20:20:25 +07:00
|
|
|
BOOL __stdcall WIN_BASS_Update(DWORD length) {
|
2023-03-10 02:23:12 +07:00
|
|
|
BASS_START(BASS_Update(DWORD length));
|
2023-03-11 20:20:25 +07:00
|
|
|
BASS_RETURNBOOL(BASS_Update(length));
|
2023-03-10 02:23:12 +07:00
|
|
|
}
|