diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-22 17:13:43 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-22 17:13:43 +0000 |
commit | a882eddcba5fd22adab1454c8d2ff9c224bc7aa7 (patch) | |
tree | 02421e6d4cbf7920d094138af2afcc09fa95f5e2 | |
parent | e2c2a1f5a84c6c9b705dc85c6a2dd1f97edd57e4 (diff) |
standard /delayload functionality enabled for bass.dll
git-svn-id: http://svn.miranda-ng.org/main/trunk@13759 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/BASS_interface/Bass_interface.vcxproj | 5 | ||||
-rw-r--r-- | plugins/BASS_interface/src/Bass.h | 336 | ||||
-rw-r--r-- | plugins/BASS_interface/src/Main.cpp | 82 | ||||
-rw-r--r-- | plugins/BASS_interface/src/bass.lib | bin | 0 -> 24746 bytes | |||
-rw-r--r-- | plugins/BASS_interface/src/bass64.lib | bin | 0 -> 23062 bytes |
5 files changed, 218 insertions, 205 deletions
diff --git a/plugins/BASS_interface/Bass_interface.vcxproj b/plugins/BASS_interface/Bass_interface.vcxproj index c5c5d7aeea..8b485b9c49 100644 --- a/plugins/BASS_interface/Bass_interface.vcxproj +++ b/plugins/BASS_interface/Bass_interface.vcxproj @@ -25,4 +25,9 @@ <ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\..\build\vc.common\common.props" />
</ImportGroup>
+ <ItemDefinitionGroup>
+ <Link>
+ <DelayLoadDLLs>bass.dll</DelayLoadDLLs>
+ </Link>
+ </ItemDefinitionGroup>
</Project>
\ No newline at end of file diff --git a/plugins/BASS_interface/src/Bass.h b/plugins/BASS_interface/src/Bass.h index 1f48d77f61..c96cfee071 100644 --- a/plugins/BASS_interface/src/Bass.h +++ b/plugins/BASS_interface/src/Bass.h @@ -93,7 +93,7 @@ typedef DWORD HPLUGIN; // Plugin handle #define BASS_ERROR_VERSION 43 // invalid BASS version (used by add-ons) #define BASS_ERROR_CODEC 44 // codec is not available/supported #define BASS_ERROR_ENDED 45 // the channel/file has ended -#define BASS_ERROR_BUSY 46 // the device is busy
+#define BASS_ERROR_BUSY 46 // the device is busy #define BASS_ERROR_UNKNOWN -1 // some other mystery problem // BASS_SetConfig options @@ -117,29 +117,29 @@ typedef DWORD HPLUGIN; // Plugin handle #define BASS_CONFIG_VERIFY 23 #define BASS_CONFIG_UPDATETHREADS 24 #define BASS_CONFIG_DEV_BUFFER 27 -#define BASS_CONFIG_VISTA_TRUEPOS 30
-#define BASS_CONFIG_IOS_MIXAUDIO 34
-#define BASS_CONFIG_DEV_DEFAULT 36
-#define BASS_CONFIG_NET_READTIMEOUT 37
-#define BASS_CONFIG_VISTA_SPEAKERS 38
-#define BASS_CONFIG_IOS_SPEAKER 39
-#define BASS_CONFIG_MF_DISABLE 40
-#define BASS_CONFIG_HANDLES 41
-#define BASS_CONFIG_UNICODE 42
-#define BASS_CONFIG_SRC 43
-#define BASS_CONFIG_SRC_SAMPLE 44
-#define BASS_CONFIG_ASYNCFILE_BUFFER 45
-#define BASS_CONFIG_OGG_PRESCAN 47
-#define BASS_CONFIG_MF_VIDEO 48
-#define BASS_CONFIG_AIRPLAY 49
-#define BASS_CONFIG_DEV_NONSTOP 50
-#define BASS_CONFIG_IOS_NOCATEGORY 51
+#define BASS_CONFIG_VISTA_TRUEPOS 30 +#define BASS_CONFIG_IOS_MIXAUDIO 34 +#define BASS_CONFIG_DEV_DEFAULT 36 +#define BASS_CONFIG_NET_READTIMEOUT 37 +#define BASS_CONFIG_VISTA_SPEAKERS 38 +#define BASS_CONFIG_IOS_SPEAKER 39 +#define BASS_CONFIG_MF_DISABLE 40 +#define BASS_CONFIG_HANDLES 41 +#define BASS_CONFIG_UNICODE 42 +#define BASS_CONFIG_SRC 43 +#define BASS_CONFIG_SRC_SAMPLE 44 +#define BASS_CONFIG_ASYNCFILE_BUFFER 45 +#define BASS_CONFIG_OGG_PRESCAN 47 +#define BASS_CONFIG_MF_VIDEO 48 +#define BASS_CONFIG_AIRPLAY 49 +#define BASS_CONFIG_DEV_NONSTOP 50 +#define BASS_CONFIG_IOS_NOCATEGORY 51 #define BASS_CONFIG_VERIFY_NET 52 // BASS_SetConfigPtr options #define BASS_CONFIG_NET_AGENT 16 #define BASS_CONFIG_NET_PROXY 17 -#define BASS_CONFIG_IOS_NOTIFY 46
+#define BASS_CONFIG_IOS_NOTIFY 46 // BASS_Init flags #define BASS_DEVICE_8BITS 1 // 8 bit resolution, else 16 bit @@ -150,7 +150,7 @@ typedef DWORD HPLUGIN; // Plugin handle #define BASS_DEVICE_SPEAKERS 0x800 // force enabling of speaker assignment #define BASS_DEVICE_NOSPEAKER 0x1000 // ignore speaker arrangement #define BASS_DEVICE_DMIX 0x2000 // use ALSA "dmix" plugin -#define BASS_DEVICE_FREQ 0x4000 // set device sample rate
+#define BASS_DEVICE_FREQ 0x4000 // set device sample rate // DirectSound interfaces (for use with BASS_GetDSoundObject) #define BASS_OBJECT_DS 1 // IDirectSound @@ -174,21 +174,21 @@ typedef struct { #define BASS_DEVICE_INIT 4 #define BASS_DEVICE_TYPE_MASK 0xff000000 -#define BASS_DEVICE_TYPE_NETWORK 0x01000000
-#define BASS_DEVICE_TYPE_SPEAKERS 0x02000000
-#define BASS_DEVICE_TYPE_LINE 0x03000000
-#define BASS_DEVICE_TYPE_HEADPHONES 0x04000000
-#define BASS_DEVICE_TYPE_MICROPHONE 0x05000000
-#define BASS_DEVICE_TYPE_HEADSET 0x06000000
-#define BASS_DEVICE_TYPE_HANDSET 0x07000000
-#define BASS_DEVICE_TYPE_DIGITAL 0x08000000
-#define BASS_DEVICE_TYPE_SPDIF 0x09000000
-#define BASS_DEVICE_TYPE_HDMI 0x0a000000
-#define BASS_DEVICE_TYPE_DISPLAYPORT 0x40000000
- -// BASS_GetDeviceInfo flags
-#define BASS_DEVICES_AIRPLAY 0x1000000
-
+#define BASS_DEVICE_TYPE_NETWORK 0x01000000 +#define BASS_DEVICE_TYPE_SPEAKERS 0x02000000 +#define BASS_DEVICE_TYPE_LINE 0x03000000 +#define BASS_DEVICE_TYPE_HEADPHONES 0x04000000 +#define BASS_DEVICE_TYPE_MICROPHONE 0x05000000 +#define BASS_DEVICE_TYPE_HEADSET 0x06000000 +#define BASS_DEVICE_TYPE_HANDSET 0x07000000 +#define BASS_DEVICE_TYPE_DIGITAL 0x08000000 +#define BASS_DEVICE_TYPE_SPDIF 0x09000000 +#define BASS_DEVICE_TYPE_HDMI 0x0a000000 +#define BASS_DEVICE_TYPE_DISPLAYPORT 0x40000000 + +// BASS_GetDeviceInfo flags +#define BASS_DEVICES_AIRPLAY 0x1000000 + typedef struct { DWORD flags; // device capabilities (DSCAPS_xxx flags) DWORD hwsize; // size of total device hardware memory @@ -226,7 +226,7 @@ typedef struct { // BASS_RECORDINFO flags (from DSOUND.H) #define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER // device does NOT have hardware DirectSound recording support -#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED // device driver has been certified by Microsoft
+#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED // device driver has been certified by Microsoft // defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H) #ifndef WAVE_FORMAT_1M08 @@ -325,12 +325,12 @@ typedef struct { #define BASS_SPEAKER_REAR2LEFT BASS_SPEAKER_REAR2|BASS_SPEAKER_LEFT #define BASS_SPEAKER_REAR2RIGHT BASS_SPEAKER_REAR2|BASS_SPEAKER_RIGHT -#define BASS_ASYNCFILE 0x40000000
+#define BASS_ASYNCFILE 0x40000000 #define BASS_UNICODE 0x80000000 #define BASS_RECORD_PAUSE 0x8000 // start recording paused -#define BASS_RECORD_ECHOCANCEL 0x2000
-#define BASS_RECORD_AGC 0x4000
+#define BASS_RECORD_ECHOCANCEL 0x2000 +#define BASS_RECORD_AGC 0x4000 // DX7 voice allocation & management flags #define BASS_VAM_HARDWARE 1 @@ -361,7 +361,7 @@ typedef struct { #define BASS_CTYPE_STREAM_MP3 0x10005 #define BASS_CTYPE_STREAM_AIFF 0x10006 #define BASS_CTYPE_STREAM_CA 0x10007 -#define BASS_CTYPE_STREAM_MF 0x10008
+#define BASS_CTYPE_STREAM_MF 0x10008 #define BASS_CTYPE_STREAM_WAV 0x40000 // WAVE flag, LOWORD=codec #define BASS_CTYPE_STREAM_WAV_PCM 0x50001 #define BASS_CTYPE_STREAM_WAV_FLOAT 0x50003 @@ -518,7 +518,7 @@ typedef struct { #define BASS_FILEPOS_CONNECTED 4 #define BASS_FILEPOS_BUFFER 5 #define BASS_FILEPOS_SOCKET 6 -#define BASS_FILEPOS_ASYNCBUF 7
+#define BASS_FILEPOS_ASYNCBUF 7 #define BASS_FILEPOS_SIZE 8 typedef void (CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, void *user); @@ -582,12 +582,12 @@ RETURN : TRUE = continue recording, FALSE = stop */ #define BASS_ATTRIB_VOL 2 #define BASS_ATTRIB_PAN 3 #define BASS_ATTRIB_EAXMIX 4 -#define BASS_ATTRIB_NOBUFFER 5
-#define BASS_ATTRIB_VBR 6
-#define BASS_ATTRIB_CPU 7
-#define BASS_ATTRIB_SRC 8
-#define BASS_ATTRIB_NET_RESUME 9
-#define BASS_ATTRIB_SCANINFO 10
+#define BASS_ATTRIB_NOBUFFER 5 +#define BASS_ATTRIB_VBR 6 +#define BASS_ATTRIB_CPU 7 +#define BASS_ATTRIB_SRC 8 +#define BASS_ATTRIB_NET_RESUME 9 +#define BASS_ATTRIB_SCANINFO 10 #define BASS_ATTRIB_MUSIC_AMPLIFY 0x100 #define BASS_ATTRIB_MUSIC_PANSEP 0x101 #define BASS_ATTRIB_MUSIC_PSCALER 0x102 @@ -608,16 +608,16 @@ RETURN : TRUE = continue recording, FALSE = stop */ #define BASS_DATA_FFT2048 0x80000003 // 2048 FFT #define BASS_DATA_FFT4096 0x80000004 // 4096 FFT #define BASS_DATA_FFT8192 0x80000005 // 8192 FFT -#define BASS_DATA_FFT16384 0x80000006 // 16384 FFT
+#define BASS_DATA_FFT16384 0x80000006 // 16384 FFT #define BASS_DATA_FFT_INDIVIDUAL 0x10 // FFT flag: FFT for each channel, else all combined #define BASS_DATA_FFT_NOWINDOW 0x20 // FFT flag: no Hanning window #define BASS_DATA_FFT_REMOVEDC 0x40 // FFT flag: pre-remove DC bias -#define BASS_DATA_FFT_COMPLEX 0x80 // FFT flag: return complex data
+#define BASS_DATA_FFT_COMPLEX 0x80 // FFT flag: return complex data // BASS_ChannelGetLevelEx flags -#define BASS_LEVEL_MONO 1
-#define BASS_LEVEL_STEREO 2
-#define BASS_LEVEL_RMS 4
+#define BASS_LEVEL_MONO 1 +#define BASS_LEVEL_STEREO 2 +#define BASS_LEVEL_RMS 4 // BASS_ChannelGetTags types : what's returned #define BASS_TAG_ID3 0 // ID3v1 tags : TAG_ID3 structure @@ -626,24 +626,24 @@ RETURN : TRUE = continue recording, FALSE = stop */ #define BASS_TAG_HTTP 3 // HTTP headers : series of null-terminated ANSI strings #define BASS_TAG_ICY 4 // ICY headers : series of null-terminated ANSI strings #define BASS_TAG_META 5 // ICY metadata : ANSI string -#define BASS_TAG_APE 6 // APE tags : series of null-terminated UTF-8 strings
-#define BASS_TAG_MP4 7 // MP4/iTunes metadata : series of null-terminated UTF-8 strings
+#define BASS_TAG_APE 6 // APE tags : series of null-terminated UTF-8 strings +#define BASS_TAG_MP4 7 // MP4/iTunes metadata : series of null-terminated UTF-8 strings #define BASS_TAG_VENDOR 9 // OGG encoder : UTF-8 string #define BASS_TAG_LYRICS3 10 // Lyric3v2 tag : ASCII string #define BASS_TAG_CA_CODEC 11 // CoreAudio codec info : TAG_CA_CODEC structure -#define BASS_TAG_MF 13 // Media Foundation tags : series of null-terminated UTF-8 strings
-#define BASS_TAG_WAVEFORMAT 14 // WAVE format : WAVEFORMATEEX structure
+#define BASS_TAG_MF 13 // Media Foundation tags : series of null-terminated UTF-8 strings +#define BASS_TAG_WAVEFORMAT 14 // WAVE format : WAVEFORMATEEX structure #define BASS_TAG_RIFF_INFO 0x100 // RIFF "INFO" tags : series of null-terminated ANSI strings #define BASS_TAG_RIFF_BEXT 0x101 // RIFF/BWF "bext" tags : TAG_BEXT structure -#define BASS_TAG_RIFF_CART 0x102 // RIFF/BWF "cart" tags : TAG_CART structure
-#define BASS_TAG_RIFF_DISP 0x103 // RIFF "DISP" text tag : ANSI string
-#define BASS_TAG_APE_BINARY 0x1000 // + index #, binary APE tag : TAG_APE_BINARY structure
+#define BASS_TAG_RIFF_CART 0x102 // RIFF/BWF "cart" tags : TAG_CART structure +#define BASS_TAG_RIFF_DISP 0x103 // RIFF "DISP" text tag : ANSI string +#define BASS_TAG_APE_BINARY 0x1000 // + index #, binary APE tag : TAG_APE_BINARY structure #define BASS_TAG_MUSIC_NAME 0x10000 // MOD music name : ANSI string #define BASS_TAG_MUSIC_MESSAGE 0x10001 // MOD message : ANSI string #define BASS_TAG_MUSIC_ORDERS 0x10002 // MOD order list : BYTE array of pattern numbers #define BASS_TAG_MUSIC_INST 0x10100 // + instrument #, MOD instrument name : ANSI string #define BASS_TAG_MUSIC_SAMPLE 0x10300 // + sample #, MOD sample name : ANSI string -
+ // ID3v1 tag structure typedef struct { char id[3]; @@ -654,15 +654,15 @@ typedef struct { char comment[30]; BYTE genre; } TAG_ID3; -
+ // Binary APE tag structure -typedef struct {
- const char *key;
- const void *data;
- DWORD length;
-} TAG_APE_BINARY;
-
-// BWF "bext" tag structure
+typedef struct { + const char *key; + const void *data; + DWORD length; +} TAG_APE_BINARY; + +// BWF "bext" tag structure #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4200) @@ -686,48 +686,48 @@ typedef struct { char CodingHistory[1]; // history #endif } TAG_BEXT; -#pragma pack(pop)
-
-// BWF "cart" tag structures
-typedef struct
-{
- DWORD dwUsage; // FOURCC timer usage ID
- DWORD dwValue; // timer value in samples from head
-} TAG_CART_TIMER;
-
-typedef struct
-{
- char Version[4]; // version of the data structure
- char Title[64]; // title of cart audio sequence
- char Artist[64]; // artist or creator name
- char CutID[64]; // cut number identification
- char ClientID[64]; // client identification
- char Category[64]; // category ID, PSA, NEWS, etc
- char Classification[64]; // classification or auxiliary key
- char OutCue[64]; // out cue text
- char StartDate[10]; // yyyy-mm-dd
- char StartTime[8]; // hh:mm:ss
- char EndDate[10]; // yyyy-mm-dd
- char EndTime[8]; // hh:mm:ss
- char ProducerAppID[64]; // name of vendor or application
- char ProducerAppVersion[64]; // version of producer application
- char UserDef[64]; // user defined text
- DWORD dwLevelReference; // sample value for 0 dB reference
- TAG_CART_TIMER PostTimer[8]; // 8 time markers after head
- char Reserved[276];
- char URL[1024]; // uniform resource locator
-#if defined(__GNUC__) && __GNUC__<3
- char TagText[0]; // free form text for scripts or tags
-#elif 1 // change to 0 if compiler fails the following line
- char TagText[]; // free form text for scripts or tags
-#else
- char TagText[1]; // free form text for scripts or tags
-#endif
-} TAG_CART;
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
+#pragma pack(pop) + +// BWF "cart" tag structures +typedef struct +{ + DWORD dwUsage; // FOURCC timer usage ID + DWORD dwValue; // timer value in samples from head +} TAG_CART_TIMER; + +typedef struct +{ + char Version[4]; // version of the data structure + char Title[64]; // title of cart audio sequence + char Artist[64]; // artist or creator name + char CutID[64]; // cut number identification + char ClientID[64]; // client identification + char Category[64]; // category ID, PSA, NEWS, etc + char Classification[64]; // classification or auxiliary key + char OutCue[64]; // out cue text + char StartDate[10]; // yyyy-mm-dd + char StartTime[8]; // hh:mm:ss + char EndDate[10]; // yyyy-mm-dd + char EndTime[8]; // hh:mm:ss + char ProducerAppID[64]; // name of vendor or application + char ProducerAppVersion[64]; // version of producer application + char UserDef[64]; // user defined text + DWORD dwLevelReference; // sample value for 0 dB reference + TAG_CART_TIMER PostTimer[8]; // 8 time markers after head + char Reserved[276]; + char URL[1024]; // uniform resource locator +#if defined(__GNUC__) && __GNUC__<3 + char TagText[0]; // free form text for scripts or tags +#elif 1 // change to 0 if compiler fails the following line + char TagText[]; // free form text for scripts or tags +#else + char TagText[1]; // free form text for scripts or tags +#endif +} TAG_CART; +#ifdef _MSC_VER +#pragma warning(pop) +#endif + // CoreAudio codec info structure typedef struct { DWORD ftype; // file format @@ -735,31 +735,31 @@ typedef struct { const char *name; // description } TAG_CA_CODEC; -#ifndef _WAVEFORMATEX_
-#define _WAVEFORMATEX_
-#pragma pack(push,1)
-typedef struct tWAVEFORMATEX
-{
- WORD wFormatTag;
- WORD nChannels;
- DWORD nSamplesPerSec;
- DWORD nAvgBytesPerSec;
- WORD nBlockAlign;
- WORD wBitsPerSample;
- WORD cbSize;
-} WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX;
-typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
-#pragma pack(pop)
-#endif
-
+#ifndef _WAVEFORMATEX_ +#define _WAVEFORMATEX_ +#pragma pack(push,1) +typedef struct tWAVEFORMATEX +{ + WORD wFormatTag; + WORD nChannels; + DWORD nSamplesPerSec; + DWORD nAvgBytesPerSec; + WORD nBlockAlign; + WORD wBitsPerSample; + WORD cbSize; +} WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX; +typedef const WAVEFORMATEX *LPCWAVEFORMATEX; +#pragma pack(pop) +#endif + // BASS_ChannelGetLength/GetPosition/SetPosition modes #define BASS_POS_BYTE 0 // byte position #define BASS_POS_MUSIC_ORDER 1 // order.row position, MAKELONG(order,row) -#define BASS_POS_OGG 3 // OGG bitstream number
+#define BASS_POS_OGG 3 // OGG bitstream number #define BASS_POS_INEXACT 0x8000000 // flag: allow seeking to inexact position #define BASS_POS_DECODE 0x10000000 // flag: get the decoding (not playing) position -#define BASS_POS_DECODETO 0x20000000 // flag: decode to the position instead of seeking
-#define BASS_POS_SCAN 0x40000000 // flag: scan to the position
+#define BASS_POS_DECODETO 0x20000000 // flag: decode to the position instead of seeking +#define BASS_POS_SCAN 0x40000000 // flag: scan to the position // BASS_RecordSetInput flags #define BASS_INPUT_OFF 0x10000 @@ -875,13 +875,13 @@ typedef struct { #define BASS_DX8_PHASE_ZERO 2 #define BASS_DX8_PHASE_90 3 #define BASS_DX8_PHASE_180 4 -
-typedef void (CALLBACK IOSNOTIFYPROC)(DWORD status);
-/* iOS notification callback function.
-status : The notification (BASS_IOSNOTIFY_xxx) */
-
-#define BASS_IOSNOTIFY_INTERRUPT 1 // interruption started
-#define BASS_IOSNOTIFY_INTERRUPT_END 2 // interruption ended
+ +typedef void (CALLBACK IOSNOTIFYPROC)(DWORD status); +/* iOS notification callback function. +status : The notification (BASS_IOSNOTIFY_xxx) */ + +#define BASS_IOSNOTIFY_INTERRUPT 1 // interruption started +#define BASS_IOSNOTIFY_INTERRUPT_END 2 // interruption ended BOOL BASSDEF(BASS_SetConfig)(DWORD option, DWORD value); DWORD BASSDEF(BASS_GetConfig)(DWORD option); @@ -898,7 +898,7 @@ BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, void *win, void *ds BOOL BASSDEF(BASS_SetDevice)(DWORD device); DWORD BASSDEF(BASS_GetDevice)(); BOOL BASSDEF(BASS_Free)(); -#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)
+#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) void *BASSDEF(BASS_GetDSoundObject)(DWORD object); #endif BOOL BASSDEF(BASS_GetInfo)(BASS_INFO *info); @@ -919,7 +919,7 @@ BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf); BOOL BASSDEF(BASS_Set3DPosition)(const BASS_3DVECTOR *pos, const BASS_3DVECTOR *vel, const BASS_3DVECTOR *front, const BASS_3DVECTOR *top); BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top); void BASSDEF(BASS_Apply3D)(); -#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)
+#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) BOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, float damp); BOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp); #endif @@ -985,7 +985,7 @@ QWORD BASSDEF(BASS_ChannelGetLength)(DWORD handle, DWORD mode); BOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mode); QWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle, DWORD mode); DWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle); -BOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags);
+BOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags); DWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length); HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user); BOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync); @@ -999,36 +999,36 @@ BOOL BASSDEF(BASS_ChannelRemoveFX)(DWORD handle, HFX fx); BOOL BASSDEF(BASS_FXSetParameters)(HFX handle, const void *params); BOOL BASSDEF(BASS_FXGetParameters)(HFX handle, void *params); BOOL BASSDEF(BASS_FXReset)(HFX handle); -
+ #ifdef __cplusplus } -
-#if defined(_WIN32) && !defined(NOBASSOVERLOADS)
-static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags)
-{
- return BASS_PluginLoad((const char*)file, flags|BASS_UNICODE);
-}
-
-static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq)
-{
- return BASS_MusicLoad(mem, (const void*)file, offset, length, flags|BASS_UNICODE, freq);
-}
-
-static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags)
-{
- return BASS_SampleLoad(mem, (const void*)file, offset, length, max, flags|BASS_UNICODE);
-}
-
-static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags)
-{
- return BASS_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE);
-}
-
-static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user)
-{
- return BASS_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user);
-}
-#endif
+ +#if defined(_WIN32) && !defined(NOBASSOVERLOADS) +static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) +{ + return BASS_PluginLoad((const char*)file, flags|BASS_UNICODE); +} + +static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq) +{ + return BASS_MusicLoad(mem, (const void*)file, offset, length, flags|BASS_UNICODE, freq); +} + +static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags) +{ + return BASS_SampleLoad(mem, (const void*)file, offset, length, max, flags|BASS_UNICODE); +} + +static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags) +{ + return BASS_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE); +} + +static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user) +{ + return BASS_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user); +} +#endif #endif #endif diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index 05cb137467..d15a16a7a0 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -3,10 +3,27 @@ Copyright (C) 2010, 2011 tico-tico */
#include "stdafx.h"
-#define BASSDEF(f) (WINAPI *f)
+
+#include <delayimp.h>
#include "bass.h"
-#define LOADBASSFUNCTION(f) (*((void**)&f)=(void*)GetProcAddress(hBass,#f))
+#pragma comment(lib, "delayimp.lib")
+#ifdef _WIN64
+ #pragma comment(lib, "src\\bass64.lib")
+#else
+ #pragma comment(lib, "src\\bass.lib")
+#endif
+
+static HINSTANCE hBass = NULL;
+
+FARPROC WINAPI delayHook(unsigned dliNotify, PDelayLoadInfo)
+{
+ if (dliNotify == dliNotePreLoadLibrary)
+ return (FARPROC)hBass;
+ return NULL;
+}
+
+extern "C" PfnDliHook __pfnDliNotifyHook2 = &delayHook;
HINSTANCE hInst;
int hLangpack;
@@ -25,8 +42,6 @@ PLUGININFOEX pluginInfo = { { 0x2f07ea05, 0x05b5, 0x4ff0, { 0x87, 0x5d, 0xc5, 0x90, 0xda, 0x2d, 0xda, 0xc1 } }
};
-static HINSTANCE hBass = NULL;
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
@@ -482,46 +497,39 @@ void LoadBassLibrary(TCHAR CurrBassPath[MAX_PATH]) {
hBass = LoadLibrary(CurrBassPath);
if (hBass != NULL) {
- if (LOADBASSFUNCTION(BASS_Init) != NULL && LOADBASSFUNCTION(BASS_SetConfig) != NULL &&
- LOADBASSFUNCTION(BASS_ChannelPlay) != NULL && LOADBASSFUNCTION(BASS_StreamCreateFile) != NULL &&
- LOADBASSFUNCTION(BASS_GetVersion) != NULL && LOADBASSFUNCTION(BASS_StreamFree) != NULL &&
- LOADBASSFUNCTION(BASS_GetDeviceInfo) != NULL && LOADBASSFUNCTION(BASS_Free))
- {
- BASS_DEVICEINFO info;
+ newBass = (BASS_SetConfig(BASS_CONFIG_DEV_DEFAULT, TRUE) != 0); // will use new "Default" device
- newBass = (BASS_SetConfig(BASS_CONFIG_DEV_DEFAULT, TRUE) != 0); // will use new "Default" device
+ DBVARIANT dbv = { 0 };
- DBVARIANT dbv = { 0 };
+ BASS_DEVICEINFO info;
+ if (!db_get_ts(NULL, ModuleName, OPT_OUTDEVICE, &dbv))
+ for (int i = 1; BASS_GetDeviceInfo(i, &info); i++)
+ if (!mir_tstrcmp(dbv.ptszVal, _A2T(info.name)))
+ device = i;
- if (!db_get_ts(NULL, ModuleName, OPT_OUTDEVICE, &dbv))
- for (int i = 1; BASS_GetDeviceInfo(i, &info); i++)
- if (!mir_tstrcmp(dbv.ptszVal, _A2T(info.name)))
- device = i;
-
- db_free(&dbv);
+ db_free(&dbv);
- sndLimSnd = db_get_b(NULL, ModuleName, OPT_MAXCHAN, MAXCHAN);
- if (sndLimSnd > MAXCHAN)
- sndLimSnd = MAXCHAN;
- TimeWrd1 = db_get_w(NULL, ModuleName, OPT_TIME1, 0);
- TimeWrd2 = db_get_w(NULL, ModuleName, OPT_TIME2, 0);
- QuietTime = db_get_b(NULL, ModuleName, OPT_QUIETTIME, 0);
- EnPreview = db_get_b(NULL, ModuleName, OPT_PREVIEW, 0);
+ sndLimSnd = db_get_b(NULL, ModuleName, OPT_MAXCHAN, MAXCHAN);
+ if (sndLimSnd > MAXCHAN)
+ sndLimSnd = MAXCHAN;
+ TimeWrd1 = db_get_w(NULL, ModuleName, OPT_TIME1, 0);
+ TimeWrd2 = db_get_w(NULL, ModuleName, OPT_TIME2, 0);
+ QuietTime = db_get_b(NULL, ModuleName, OPT_QUIETTIME, 0);
+ EnPreview = db_get_b(NULL, ModuleName, OPT_PREVIEW, 0);
- StatMask = db_get_w(NULL, ModuleName, OPT_STATUS, 0x3ff);
+ StatMask = db_get_w(NULL, ModuleName, OPT_STATUS, 0x3ff);
- ClistHWND = (HWND)CallService("CLUI/GetHwnd", 0, 0);
- BASS_Init(device, 44100, 0, ClistHWND, NULL);
+ ClistHWND = (HWND)CallService("CLUI/GetHwnd", 0, 0);
+ BASS_Init(device, 44100, 0, ClistHWND, NULL);
- Volume = db_get_b(NULL, ModuleName, OPT_VOLUME, 33);
- BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume * 100);
- hPlaySound = HookEvent(ME_SKIN_PLAYINGSOUND, OnPlaySnd);
- CreateFrame();
- }
- else {
- FreeLibrary(hBass);
- hBass = NULL;
- }
+ Volume = db_get_b(NULL, ModuleName, OPT_VOLUME, 33);
+ BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume * 100);
+ hPlaySound = HookEvent(ME_SKIN_PLAYINGSOUND, OnPlaySnd);
+ CreateFrame();
+ }
+ else {
+ FreeLibrary(hBass);
+ hBass = NULL;
}
}
diff --git a/plugins/BASS_interface/src/bass.lib b/plugins/BASS_interface/src/bass.lib Binary files differnew file mode 100644 index 0000000000..b98960a728 --- /dev/null +++ b/plugins/BASS_interface/src/bass.lib diff --git a/plugins/BASS_interface/src/bass64.lib b/plugins/BASS_interface/src/bass64.lib Binary files differnew file mode 100644 index 0000000000..b10bc7f511 --- /dev/null +++ b/plugins/BASS_interface/src/bass64.lib |