New FB release coming up

For other topics related to the FreeBASIC project or its community.
Gonzo
Posts: 722
Joined: Dec 11, 2005 22:46

Re: New FB release coming up

Postby Gonzo » Aug 26, 2013 5:24

Just an FYI, with regular mingw64 i had problems compiling for both m32 and m64
(i even tried really hard to complete the missing libraries)
with tdm-gcc that problem went away :)

I'm using tdm64-gcc-4.7.1-3 (even though mingw64 uses 4.8.1 from using mingw-builds project)

Are you actively working on 64-bit support?

And about static building on linux... that's a very deep hole :)
dkl
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: New FB release coming up

Postby dkl » Aug 26, 2013 6:26

The 64bit support is almost finished in the development version in Git, but I think that should be announced later eventually, when there are preview builds for testing.
counting_pine
Site Admin
Posts: 6173
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: New FB release coming up

Postby counting_pine » Aug 26, 2013 6:35

fxm wrote:
dodicat wrote:The disphelper :
ld.exe: cannot find -ldisphelper

dkl wrote:The external libraries are now separate packages again, and I think this way could work quite well.
fxm wrote:At the two download pages (http://www.freebasic.net/get and viewtopic.php?f=1&t=21321), you could perhaps add the both links to 'Libraries' and 'Add-ons', and this for each of Win32/Linux/DOS binaries?

Example for win32:
Add-ons
Libraries

I've provisionally added links to the Libraries downloads to http://www.freebasic.net/get. I don't know if they could be described better. They perhaps belong in their own section, but perhaps it's important they stay near the compiler so people can see the link more easily.

I don't know where the best place is to put addons, or how to describe them.

EDIT: Same additions to dkl's post at viewtopic.php?f=1&p=189313#p189313 too.
dkl
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: New FB release coming up

Postby dkl » Aug 26, 2013 6:49

The "Add-ons" are gcc.exe for use with -gen gcc, and gcc/binutils .exe's for cross-compiling.
fxm
Posts: 9258
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: New FB release coming up

Postby fxm » Aug 26, 2013 7:09

Thank counting_pine (since the time I suggested this!)

dkl wrote:The "Add-ons" are gcc.exe for use with -gen gcc, and gcc/binutils .exe's for cross-compiling.
Yes dkl,
Why not add also the two Add-ons links (for win32 and DOS) at these two download pages. They are mandatory to complete installing in order to use gcc and cross-compiling.
VANYA
Posts: 1324
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: New FB release coming up

Postby VANYA » Aug 26, 2013 11:53

I hope someone will write a guide to cross-compile.
fxm
Posts: 9258
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: New FB release coming up

Postby fxm » Aug 26, 2013 13:28

dkl,

By using With "FB-win32-dos-binutils-2.23.2.zip", I do not succeed to cross-compile for DOS.
It seems that the files ".exe" of "FB-win32-dos-binutils-2.23.2.zip" are not compatible (no more with the "lib\dos" of the DOS package)!

With fbc installation as following:
FreeBASIC-0.90.1-win32.7z
+ FB-win32-gcc-4.7.3.zip
+ FB-win32-dos-gcc-4.7.3.zip
+ FB-win32-dos-binutils-2.23.2.zip
+ lib\dos of FreeBASIC-0.90.1-dos.zip
=> Weird error message (search filename: "D:Prgfbclibdosi386go32.x" instead of "D:Prg\fbc\lib\dos\i386go32.x"):

Code: Select all

Command executed:
"D:\Prg\fbc\fbc.exe" "D:\Prg\fbc\FBIDETEMP.bas" -gen gas -target dos

Compiler output:
D:\Prg\fbc\bin\dos\ld.exe: cannot open linker script file D:Prgfbclibdosi386go32.x: No such file or directory
or:

Code: Select all

Command executed:
"D:\Prg\fbc\fbc.exe" "D:\Prg\fbc\FBIDETEMP.bas" -gen gcc -target dos

Compiler output:
D:\Prg\fbc\bin\dos\ld.exe: cannot open linker script file D:Prgfbclibdosi386go32.x: No such file or directory

At present time I continue to use my old installation principle for cross-compilation for DOS:
use the only two directories "bin\dos" and "lib\dos" of the Dos package, by adding these into the Windows package.
Last edited by fxm on Sep 01, 2013 7:01, edited 12 times in total.
podvornyak
Posts: 148
Joined: Nov 12, 2007 11:46
Location: Russia

Re: New FB release coming up

Postby podvornyak » Aug 26, 2013 13:33

dkl wrote:The 64bit support is almost finished...
Wow. It is amaising! Cant wait to lay my hands on it. Final step to... TAKE OVER THE WORLD! ... brain brain brain... XD
petan
Posts: 683
Joined: Feb 16, 2010 15:34
Location: Europe
Contact:

Re: New FB release coming up

Postby petan » Aug 26, 2013 22:35

Just playing with '#libpath' command and found troubles. (FB-musl 0.901)
-libfbgfx.a and TinyDialog.so moved into the folder 'TRIALone' and moved variously in filesystem.

1.Q - How to print contents of place where '#libpath' shows to ? ( relative paths problem)

2.Q - When used '#libpath /media' for storing static and dynamic libs, only static are accepted.(Only from /usr/lib are both accepted.Looks like there are some internal compiler rules for blocking this.)
In other words - if any normal user (without root privileges) want to tests some FB app + ' .a & .so' libs added for correct funcionality - so which locations are allowed for '#libpath' ??, because /tmp or/media or /opt are not funcional.

3.Q - what is situation for second question in FB 0901 normal install ?
Which places are recognized by '#libpath' for static and dynamic libs for ANY user testing final executable FB app ?
dkl
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: New FB release coming up

Postby dkl » Aug 27, 2013 8:24

The paths given to -p or #libpath are simply passed on to ld as library search directories (ld -L). FB does not make any restrictions about them. Relative paths are relative to the current directory when the fbc command is run because fbc invokes ld without changing the current directory.

As far as I know, /tmp and other directories should work just fine. I don't have trouble using -p:
~$ cat 2.bas
sub test( )
print "test"
end sub
~$ fbc 2.bas -dll
~$ mv lib2.so /tmp/
~$ cat 1.bas
#inclib "2"
declare sub test( )
test( )
~$ fbc 1.bas
ld: cannot find -l2
~$ fbc 1.bas -p /tmp/
~$ ./1
./1: error while loading shared libraries: lib2.so: cannot open shared object file: No such file or directory
~$ LD_LIBRARY_PATH=/tmp ./1
test


That's with FB-linux on Xubuntu 13.04. With FB-linuxmusl I get the same results except that the last command still causes the Inconsistency detected by ld.so: ... error as noted in the TinyDialog thread, indicating that FB-linuxmusl perhaps doesn't work with .so's properly.

You can add -Wl --verbose to the fbc command line to tell ld to print out which libraries filenames exactly it tries to open.

~$ fbc 1.bas -p /test/path/1 -p /test/path/2 -p /tmp -Wl --verbose
...
attempt to open /test/path/1/lib2.so failed
attempt to open /test/path/1/lib2.a failed
attempt to open /test/path/2/lib2.so failed
attempt to open /test/path/2/lib2.a failed
attempt to open /tmp/lib2.so succeeded
-l2 (/tmp/lib2.so)
...


ld also supports encoding runtime shared library search directories into ELF binaries, I think this might be a better solution than LD_LIBRARY_PATH:
# Same 1.bas/2.bas as above, lib2.so moved into /tmp
$ fbc 1.bas -p /tmp/ -Wl -rpath=/tmp
$ ./1
test
$ readelf -d ./1 | grep RPATH
0x0000000f (RPATH) Library rpath: [/tmp]
petan
Posts: 683
Joined: Feb 16, 2010 15:34
Location: Europe
Contact:

Re: New FB release coming up

Postby petan » Aug 28, 2013 15:14

Nice tips dkl, I see interesting infos, thx.
Well, 0.90.1 installed & works, so tests slowly started, but - I have all (0.24+0.90.1+0.90.1_musl) on the same linux and install way of 0.24 really forgotten.Hoping no troubles 'll happened due that.

Are here some hints for multiinstall of different FB versions on the same distro, dkl ?
dkl
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: New FB release coming up

Postby dkl » Aug 28, 2013 15:49

With the release packages currently the only option is to put them in different directories. Even though you could rename the fbc to fbc-0.24 and fbc-0.90.1 or similar, the include/freebasic/ and lib/freebasic/ directories would still conflict (their names are hardcoded into fbc, so can't be renamed as easily).

However when building FB from sources, it's possible to use a "name suffix" for everything, for example: bin/fbc-0.90.1, include/freebasic-0.90.1/, lib/freebasic-0.90.1/. (if I remember correctly this wasn't working correctly with 0.24 sources, so they may need patching, but with 0.90 it should work)
oog
Posts: 124
Joined: Jul 08, 2011 20:34

Re: New FB release coming up

Postby oog » Aug 30, 2013 11:15

I have a problem using bass.bi

For Tilecity I use bass.bi /dll for the online radio function and eSpeakSynth.bi /dll as speech syntesizer.
I tried to compile with the new FreeBASIC 0.90.1 and got 2 problems.

1. There is a conflict (Duplicated definition) when I use bass.bi together with windows.bi and win/mmsystem.bi, which are used by eSpeakSynth.bi.

Test Program:

Code: Select all

#include once "windows.bi"
#include once "win/mmsystem.bi"
#Include once "bass.bi"


Compiler result:
    P:\work\TileCity\tc>\fb0-901\fbc.exe -s console -v testbass.bas
    FreeBASIC Compiler - Version 0.90.1 (07-17-2013) for win32
    Copyright (C) 2004-2013 The FreeBASIC development team.
    standalone
    compiling: testbass.bas -o testbass.asm (main module)
    P:\fb0-901\inc\bass.bi(165) error 4: Duplicated definition, WAVE_FORMAT_1M08 in
    '#define WAVE_FORMAT_1M08 &h00000001'
    P:\fb0-901\inc\bass.bi(166) error 4: Duplicated definition, WAVE_FORMAT_1S08 in
    '#define WAVE_FORMAT_1S08 &h00000002'
    P:\fb0-901\inc\bass.bi(167) error 4: Duplicated definition, WAVE_FORMAT_1M16 in
    '#define WAVE_FORMAT_1M16 &h00000004'
    P:\fb0-901\inc\bass.bi(168) error 4: Duplicated definition, WAVE_FORMAT_1S16 in
    '#define WAVE_FORMAT_1S16 &h00000008'
    P:\fb0-901\inc\bass.bi(169) error 4: Duplicated definition, WAVE_FORMAT_2M08 in
    '#define WAVE_FORMAT_2M08 &h00000010'
    P:\fb0-901\inc\bass.bi(170) error 4: Duplicated definition, WAVE_FORMAT_2S08 in
    '#define WAVE_FORMAT_2S08 &h00000020'
    P:\fb0-901\inc\bass.bi(171) error 4: Duplicated definition, WAVE_FORMAT_2M16 in
    '#define WAVE_FORMAT_2M16 &h00000040'
    P:\fb0-901\inc\bass.bi(172) error 4: Duplicated definition, WAVE_FORMAT_2S16 in
    '#define WAVE_FORMAT_2S16 &h00000080'
    P:\fb0-901\inc\bass.bi(173) error 4: Duplicated definition, WAVE_FORMAT_4M08 in
    '#define WAVE_FORMAT_4M08 &h00000100'
    P:\fb0-901\inc\bass.bi(174) error 4: Duplicated definition, WAVE_FORMAT_4S08 in
    '#define WAVE_FORMAT_4S08 &h00000200'
    P:\fb0-901\inc\bass.bi(174) error 125: Too many errors, exiting

This problem is solved since I got a modified bass.bi (from Joshy I think, long time ago).
When I use the modified bass.bi, this works with FreeBASIC 0.24 without problems. With FreeBASIC 0.90.1 it compiles, but I get a linker error.


2. Linker error with FreeBASIC 0.90.1 (compiles without problems with FB 0.24)

    P:\work\TileCity\tc>\fb0-901\fbc.exe -s console -v testbass.bas
    FreeBASIC Compiler - Version 0.90.1 (07-17-2013) for win32
    Copyright (C) 2004-2013 The FreeBASIC development team.
    standalone
    compiling: testbass.bas -o testbass.asm (main module)
    assembling: P:\fb0-901\bin\win32\as.exe --32 --strip-local-absolute "testbass.
    asm" -o "testbass.o"
    linking: P:\fb0-901\bin\win32\ld.exe -o "testbass.exe" -subsystem console "
    P:\fb0-901\lib\win32\fbextra.x" --stack 1048576,1048576 -s -L "P:\fb0-901\lib\wi
    n32" -L "." "P:\fb0-901\lib\win32\crt2.o" "P:\fb0-901\lib\win32\crtbegin.o" "P:\
    fb0-901\lib\win32\fbrt0.o" "testbass.o" "-(" -lkernel32 -lgdi32 -luser32 -lversi
    on -ladvapi32 -lwinmm -lbass -lfb -lgcc -lmsvcrt -lmingw32 -lmingwex -lmoldname
    -lsupc++ -lgcc_eh "-)" "P:\fb0-901\lib\win32\crtend.o"
    ./bass.dll: file not recognized: File format not recognized
    linking failed: 'P:\fb0-901\bin\win32\ld.exe' terminated with exit code 1

How can I solve the linker problem with FB0.90.1?

I suggest to include the fixed bass.bi into next version of FB.

Fixed version of bass.bi:

Code: Select all

/'
   BASS 2.4 FreeBasic header file
   Copyright (c) 1999-2011 Un4seen Developments Ltd.
*** adapted for FreeBasic by  electrik

   See the BASS.CHM file for more detailed documentation
'/

#ifndef __bass_bi__
#define __bass_bi__
#inclib "bass"
#ifdef __FB_WIN32__
# include once "win/wtypes.bi"
#else
type BYTE as ubyte
type WORD as ushort
type DWORD as uinteger
type BOOL as integer
type float as single
# define TRUE 1
# define FALSE 0
#define MAKEWORD(a,b) cushort( cubyte(a) or (cushort(cubyte(b)) shl 8) )
#define MAKELONG(a,b) cint( cushort(a) or (cuint(cushort(b)) shl 16) )
#endif '' __FB_WIN32__


type QWORD as ulongint

#define BASSVERSION         &h204   ' API version
#define BASSVERSIONTEXT      "2.4"


type as DWORD HMUSIC      ' MOD music handle
type as DWORD HSAMPLE      ' sample handle
type as DWORD HCHANNEL      ' playing sample's channel handle
type as DWORD HSTREAM      ' sample stream handle
type as DWORD HRECORD      ' recording handle
type as DWORD HSYNC      ' synchronizer handle
type as DWORD HDSP         ' DSP handle
type as DWORD HFX         ' DX8 effect handle
type as DWORD HPLUGIN      ' Plugin handle

' Error codes returned by BASS_ErrorGetCode
#define BASS_OK            0   ' all is OK
#define BASS_ERROR_MEM      1   ' memory error
#define BASS_ERROR_FILEOPEN   2   ' can't open the file
#define BASS_ERROR_DRIVER   3   ' can't find a free/valid driver
#define BASS_ERROR_BUFLOST   4   ' the sample buffer was lost
#define BASS_ERROR_HANDLE   5   ' invalid handle
#define BASS_ERROR_FORMAT   6   ' unsupported sample format
#define BASS_ERROR_POSITION   7   ' invalid position
#define BASS_ERROR_INIT      8   ' BASS_Init has not been successfully called
#define BASS_ERROR_START   9   ' BASS_Start has not been successfully called
#define BASS_ERROR_ALREADY   14   ' already initialized/paused/whatever
#define BASS_ERROR_NOCHAN   18   ' can't get a free channel
#define BASS_ERROR_ILLTYPE   19   ' an illegal type was specified
#define BASS_ERROR_ILLPARAM   20   ' an illegal parameter was specified
#define BASS_ERROR_NO3D      21   ' no 3D support
#define BASS_ERROR_NOEAX   22   ' no EAX support
#define BASS_ERROR_DEVICE   23   ' illegal device number
#define BASS_ERROR_NOPLAY   24   ' not playing
#define BASS_ERROR_FREQ      25   ' illegal sample rate
#define BASS_ERROR_NOTFILE   27   ' the stream is not a file stream
#define BASS_ERROR_NOHW      29   ' no hardware voices available
#define BASS_ERROR_EMPTY   31   ' the MOD music has no sequence data
#define BASS_ERROR_NONET   32   ' no internet connection could be opened
#define BASS_ERROR_CREATE   33   ' couldn't create the file
#define BASS_ERROR_NOFX      34   ' effects are not available
#define BASS_ERROR_NOTAVAIL   37   ' requested data is not available
#define BASS_ERROR_DECODE   38   ' the channel is a "decoding channel"
#define BASS_ERROR_DX      39   ' a sufficient DirectX version is not installed
#define BASS_ERROR_TIMEOUT   40   ' connection timedout
#define BASS_ERROR_FILEFORM   41   ' unsupported file format
#define BASS_ERROR_SPEAKER   42   ' unavailable speaker
#define BASS_ERROR_VERSION   43   ' invalid BASS version (used by add-ons)
#define BASS_ERROR_CODEC   44   ' codec is not available/supported
#define BASS_ERROR_ENDED   45   ' the channel/file has ended
#define BASS_ERROR_BUSY      46   ' the device is busy
#define BASS_ERROR_UNKNOWN   -1   ' some other mystery problem

' BASS_SetConfig options
#define BASS_CONFIG_BUFFER         0
#define BASS_CONFIG_UPDATEPERIOD   1
#define BASS_CONFIG_GVOL_SAMPLE      4
#define BASS_CONFIG_GVOL_STREAM      5
#define BASS_CONFIG_GVOL_MUSIC      6
#define BASS_CONFIG_CURVE_VOL      7
#define BASS_CONFIG_CURVE_PAN      8
#define BASS_CONFIG_FLOATDSP      9
#define BASS_CONFIG_3DALGORITHM      10
#define BASS_CONFIG_NET_TIMEOUT      11
#define BASS_CONFIG_NET_BUFFER      12
#define BASS_CONFIG_PAUSE_NOPLAY   13
#define BASS_CONFIG_NET_PREBUF      15
#define BASS_CONFIG_NET_PASSIVE      18
#define BASS_CONFIG_REC_BUFFER      19
#define BASS_CONFIG_NET_PLAYLIST   21
#define BASS_CONFIG_MUSIC_VIRTUAL   22
#define BASS_CONFIG_VERIFY         23
#define BASS_CONFIG_UPDATETHREADS   24
#define BASS_CONFIG_DEV_BUFFER      27
#define BASS_CONFIG_IOS_MIXAUDIO   34
#define BASS_CONFIG_DEV_DEFAULT      36
#define BASS_CONFIG_NET_READTIMEOUT   37
#define BASS_CONFIG_IOS_SPEAKER      39

' BASS_SetConfigPtr options
#define BASS_CONFIG_NET_AGENT      16
#define BASS_CONFIG_NET_PROXY      17

' BASS_Init flags
#define BASS_DEVICE_8BITS      1   ' use 8 bit resolution, else 16 bit
#define BASS_DEVICE_MONO      2   ' use mono, else stereo
#define BASS_DEVICE_3D         4   ' enable 3D functionality
#define BASS_DEVICE_LATENCY      256   ' calculate device latency (BASS_INFO struct)
#define BASS_DEVICE_CPSPEAKERS   1024 ' detect speakers via Windows control panel
#define BASS_DEVICE_SPEAKERS   2048 ' force enabling of speaker assignment
#define BASS_DEVICE_NOSPEAKER   4096 ' ignore speaker arrangement
#ifdef __FB_LINUX__
#define BASS_DEVICE_DMIX      8192 ' use ALSA "dmix" plugin
#endif

' DirectSound interfaces (for use with BASS_GetDSoundObject)
#define BASS_OBJECT_DS      1   ' IDirectSound
#define BASS_OBJECT_DS3DL   2   ' IDirectSound3DListener

' Device info structure
type BASS_DEVICEINFO
   as const ZString ptr name   ' description
   as const ZString ptr driver   ' driver
as DWORD flags
end type

' BASS_DEVICEINFO flags
#define BASS_DEVICE_ENABLED      1
#define BASS_DEVICE_DEFAULT      2
#define BASS_DEVICE_INIT      4

type BASS_INFO
as DWORD flags   ' device capabilities (DSCAPS_xxx flags)
as DWORD hwsize   ' size of total device hardware memory
as DWORD hwfree   ' size of free device hardware memory
as DWORD freesam   ' number of free sample slots in the hardware
as DWORD free3d   ' number of free 3D sample slots in the hardware
as DWORD minrate   ' min sample rate supported by the hardware
as DWORD maxrate   ' max sample rate supported by the hardware
as BOOL eax      ' device supports EAX? (always FALSE if BASS_DEVICE_3D was not used)
as DWORD minbuf   ' recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY)
as DWORD dsver   ' DirectSound version
as DWORD latency   ' delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY)
as DWORD initflags ' BASS_Init "flags" parameter
as DWORD speakers ' number of speakers available
as DWORD freq      ' current output rate (Vista/OSX only)
end type

' BASS_INFO flags (from DSOUND.H)
#Ifndef __win_dsound_bi__
#define DSCAPS_CONTINUOUSRATE   &h00000010   ' supports all sample rates between min/maxrate
#define DSCAPS_EMULDRIVER      &h00000020   ' device does NOT have hardware DirectSound support
#define DSCAPS_CERTIFIED      &h00000040   ' device driver has been certified by Microsoft
#define DSCAPS_SECONDARYMONO   &h00000100   ' mono
#define DSCAPS_SECONDARYSTEREO   &h00000200   ' stereo
#define DSCAPS_SECONDARY8BIT   &h00000400   ' 8 bit
#define DSCAPS_SECONDARY16BIT   &h00000800   ' 16 bit
#endif

' Recording device info structure
type BASS_RECORDINFO
as DWORD flags   ' device capabilities (DSCCAPS_xxx flags)
as DWORD formats   ' supported standard formats (WAVE_FORMAT_xxx flags)
as DWORD inputs   ' number of inputs
as BOOL singlein   ' TRUE = only 1 input can be set at a time
as DWORD freq      ' current input rate (Vista/OSX only)
end type

' BASS_RECORDINFO flags (from DSOUND.H)
#Ifndef __win_dsound_bi__
#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
#EndIf
' defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H)
#ifndef WAVE_FORMAT_1M08
#define WAVE_FORMAT_1M08       &h00000001       /' 11.025 kHz, Mono,   8-bit  '/
#define WAVE_FORMAT_1S08       &h00000002       /' 11.025 kHz, Stereo, 8-bit  '/
#define WAVE_FORMAT_1M16       &h00000004       /' 11.025 kHz, Mono,   16-bit '/
#define WAVE_FORMAT_1S16       &h00000008       /' 11.025 kHz, Stereo, 16-bit '/
#define WAVE_FORMAT_2M08       &h00000010       /' 22.05  kHz, Mono,   8-bit  '/
#define WAVE_FORMAT_2S08       &h00000020       /' 22.05  kHz, Stereo, 8-bit  '/
#define WAVE_FORMAT_2M16       &h00000040       /' 22.05  kHz, Mono,   16-bit '/
#define WAVE_FORMAT_2S16       &h00000080       /' 22.05  kHz, Stereo, 16-bit '/
#define WAVE_FORMAT_4M08       &h00000100       /' 44.1   kHz, Mono,   8-bit  '/
#define WAVE_FORMAT_4S08       &h00000200       /' 44.1   kHz, Stereo, 8-bit  '/
#define WAVE_FORMAT_4M16       &h00000400       /' 44.1   kHz, Mono,   16-bit '/
#define WAVE_FORMAT_4S16       &h00000800       /' 44.1   kHz, Stereo, 16-bit '/
#endif

' Sample info structure
type BASS_SAMPLE
as DWORD freq      ' default playback rate
as float volume   ' default volume (0-1)
as float pan      ' default pan (-1=left, 0=middle, 1=right)
as DWORD flags   ' BASS_SAMPLE_xxx flags
as DWORD length   ' length (in bytes)
as DWORD max      ' maximum simultaneous playbacks
as DWORD origres   ' original resolution bits
as DWORD chans   ' number of channels
as DWORD mingap   ' minimum gap (ms) between creating channels
as DWORD mode3d   ' BASS_3DMODE_xxx mode
as float mindist   ' minimum distance
as float maxdist   ' maximum distance
as DWORD iangle   ' angle of inside projection cone
as DWORD oangle   ' angle of outside projection cone
as float outvol   ' delta-volume outside the projection cone
as DWORD vam      ' voice allocation/management flags (BASS_VAM_xxx)
as DWORD priority   ' priority (0=lowest, &hffffffff=highest)
end type

#define BASS_SAMPLE_8BITS      1   ' 8 bit
#define BASS_SAMPLE_FLOAT      256   ' 32-bit floating-point
#define BASS_SAMPLE_MONO      2   ' mono
#define BASS_SAMPLE_LOOP      4   ' looped
#define BASS_SAMPLE_3D         8   ' 3D functionality
#define BASS_SAMPLE_SOFTWARE   16   ' not using hardware mixing
#define BASS_SAMPLE_MUTEMAX      32   ' mute at max distance (3D only)
#define BASS_SAMPLE_VAM         64   ' DX7 voice allocation & management
#define BASS_SAMPLE_FX         128   ' old implementation of DX8 effects
#define BASS_SAMPLE_OVER_VOL   &h10000   ' override lowest volume
#define BASS_SAMPLE_OVER_POS   &h20000   ' override longest playing
#define BASS_SAMPLE_OVER_DIST   &h30000 ' override furthest from listener (3D only)

#define BASS_STREAM_PRESCAN      &h20000 ' enable pin-point seeking/length (MP3/MP2/MP1)
#define BASS_MP3_SETPOS         BASS_STREAM_PRESCAN
#define BASS_STREAM_AUTOFREE   &h40000   ' automatically free the stream when it stop/ends
#define BASS_STREAM_RESTRATE   &h80000   ' restrict the download rate of internet file streams
#define BASS_STREAM_BLOCK      &h100000 ' download/play internet file stream in small blocks
#define BASS_STREAM_DECODE      &h200000 ' don't play the stream, only decode (BASS_ChannelGetData)
#define BASS_STREAM_STATUS      &h800000 ' give server status info (HTTP/ICY tags) in DOWNLOADPROC

#define BASS_MUSIC_FLOAT      BASS_SAMPLE_FLOAT
#define BASS_MUSIC_MONO         BASS_SAMPLE_MONO
#define BASS_MUSIC_LOOP         BASS_SAMPLE_LOOP
#define BASS_MUSIC_3D         BASS_SAMPLE_3D
#define BASS_MUSIC_FX         BASS_SAMPLE_FX
#define BASS_MUSIC_AUTOFREE      BASS_STREAM_AUTOFREE
#define BASS_MUSIC_DECODE      BASS_STREAM_DECODE
#define BASS_MUSIC_PRESCAN      BASS_STREAM_PRESCAN   ' calculate playback length
#define BASS_MUSIC_CALCLEN      BASS_MUSIC_PRESCAN
#define BASS_MUSIC_RAMP         &h200   ' normal ramping
#define BASS_MUSIC_RAMPS      &h400   ' sensitive ramping
#define BASS_MUSIC_SURROUND      &h800   ' surround sound
#define BASS_MUSIC_SURROUND2   &h1000   ' surround sound (mode 2)
#define BASS_MUSIC_FT2MOD      &h2000   ' play .MOD as FastTracker 2 does
#define BASS_MUSIC_PT1MOD      &h4000   ' play .MOD as ProTracker 1 does
#define BASS_MUSIC_NONINTER      &h10000   ' non-interpolated sample mixing
#define BASS_MUSIC_SINCINTER   &h800000 ' sinc interpolated sample mixing
#define BASS_MUSIC_POSRESET      &h8000   ' stop all notes when moving position
#define BASS_MUSIC_POSRESETEX   &h400000 ' stop all notes and reset bmp/etc when moving position
#define BASS_MUSIC_STOPBACK      &h80000   ' stop the music on a backwards jump effect
#define BASS_MUSIC_NOSAMPLE      &h100000 ' don't load the samples

' Speaker assignment flags
#define BASS_SPEAKER_FRONT   &h1000000   ' front speakers
#define BASS_SPEAKER_REAR   &h2000000   ' rear/side speakers
#define BASS_SPEAKER_CENLFE   &h3000000   ' center & LFE speakers (5.1)
#define BASS_SPEAKER_REAR2   &h4000000   ' rear center speakers (7.1)
#define BASS_SPEAKER_N(n)   ((n) shl 24)   ' 'n'th pair of speakers (max 15)
#define BASS_SPEAKER_LEFT   &h10000000   ' modifier: left
#define BASS_SPEAKER_RIGHT   &h20000000   ' modifier: right
#define BASS_SPEAKER_FRONTLEFT   BASS_SPEAKER_FRONT or BASS_SPEAKER_LEFT
#define BASS_SPEAKER_FRONTRIGHT   BASS_SPEAKER_FRONT or BASS_SPEAKER_RIGHT
#define BASS_SPEAKER_REARLEFT   BASS_SPEAKER_REAR or BASS_SPEAKER_LEFT
#define BASS_SPEAKER_REARRIGHT   BASS_SPEAKER_REAR or BASS_SPEAKER_RIGHT
#define BASS_SPEAKER_CENTER      BASS_SPEAKER_CENLFE or BASS_SPEAKER_LEFT
#define BASS_SPEAKER_LFE      BASS_SPEAKER_CENLFE or BASS_SPEAKER_RIGHT
#define BASS_SPEAKER_REAR2LEFT   BASS_SPEAKER_REAR2 or BASS_SPEAKER_LEFT
#define BASS_SPEAKER_REAR2RIGHT   BASS_SPEAKER_REAR2 or BASS_SPEAKER_RIGHT

#define BASS_UNICODE         &h80000000

#define BASS_RECORD_PAUSE      &h8000   ' start recording paused

' DX7 voice allocation & management flags
#define BASS_VAM_HARDWARE      1
#define BASS_VAM_SOFTWARE      2
#define BASS_VAM_TERM_TIME      4
#define BASS_VAM_TERM_DIST      8
#define BASS_VAM_TERM_PRIO      16

' Channel info structure
type BASS_CHANNELINFO
as DWORD freq      ' default playback rate
as DWORD chans   ' channels
as DWORD flags   ' BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags
as DWORD ctype   ' type of channel
as DWORD origres   ' original resolution
as HPLUGIN plugin   ' plugin
as HSAMPLE sample ' sample
as const ZString ptr filename ' filename
end type

' BASS_CHANNELINFO types
#define BASS_CTYPE_SAMPLE      1
#define BASS_CTYPE_RECORD      2
#define BASS_CTYPE_STREAM      &h10000
#define BASS_CTYPE_STREAM_OGG   &h10002
#define BASS_CTYPE_STREAM_MP1   &h10003
#define BASS_CTYPE_STREAM_MP2   &h10004
#define BASS_CTYPE_STREAM_MP3   &h10005
#define BASS_CTYPE_STREAM_AIFF   &h10006
#define BASS_CTYPE_STREAM_CA   &h10007
#define BASS_CTYPE_STREAM_MF   &h10008
#define BASS_CTYPE_STREAM_WAV   &h40000 ' WAVE flag, LOWORD=codec
#define BASS_CTYPE_STREAM_WAV_PCM   &h50001
#define BASS_CTYPE_STREAM_WAV_FLOAT   &h50003
#define BASS_CTYPE_MUSIC_MOD   &h20000
#define BASS_CTYPE_MUSIC_MTM   &h20001
#define BASS_CTYPE_MUSIC_S3M   &h20002
#define BASS_CTYPE_MUSIC_XM      &h20003
#define BASS_CTYPE_MUSIC_IT      &h20004
#define BASS_CTYPE_MUSIC_MO3   &h00100 ' MO3 flag

type BASS_PLUGINFORM
as DWORD ctype      ' channel type
as const ZString ptr name   ' format description
as const ZString ptr exts   ' file extension filter (*.ext1*.ext2etc...)
end type

type BASS_PLUGININFO
as DWORD version               ' version (same form as BASS_GetVersion)
as DWORD formatc               ' number of formats
as const BASS_PLUGINFORM ptr formats   ' the array of formats
end type

' 3D vector (for 3D positions/velocities/orientations)
type BASS_3DVECTOR
as float x   ' +=right, -=left
as float y   ' +=up, -=down
as float z   ' +=front, -=behind
end type

' 3D channel modes
#define BASS_3DMODE_NORMAL      0   ' normal 3D processing
#define BASS_3DMODE_RELATIVE   1   ' position is relative to the listener
#define BASS_3DMODE_OFF         2   ' no 3D processing

' software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM)
#define BASS_3DALG_DEFAULT   0
#define BASS_3DALG_OFF      1
#define BASS_3DALG_FULL      2
#define BASS_3DALG_LIGHT   3

' EAX environments, use with BASS_SetEAXParameters
enum
    EAX_ENVIRONMENT_GENERIC
    EAX_ENVIRONMENT_PADDEDCELL
    EAX_ENVIRONMENT_ROOM
    EAX_ENVIRONMENT_BATHROOM
    EAX_ENVIRONMENT_LIVINGROOM
    EAX_ENVIRONMENT_STONEROOM
    EAX_ENVIRONMENT_AUDITORIUM
    EAX_ENVIRONMENT_CONCERTHALL
    EAX_ENVIRONMENT_CAVE
    EAX_ENVIRONMENT_ARENA
    EAX_ENVIRONMENT_HANGAR
    EAX_ENVIRONMENT_CARPETEDHALLWAY
    EAX_ENVIRONMENT_HALLWAY
    EAX_ENVIRONMENT_STONECORRIDOR
    EAX_ENVIRONMENT_ALLEY
    EAX_ENVIRONMENT_FOREST
    EAX_ENVIRONMENT_CITY
    EAX_ENVIRONMENT_MOUNTAINS
    EAX_ENVIRONMENT_QUARRY
    EAX_ENVIRONMENT_PLAIN
    EAX_ENVIRONMENT_PARKINGLOT
    EAX_ENVIRONMENT_SEWERPIPE
    EAX_ENVIRONMENT_UNDERWATER
    EAX_ENVIRONMENT_DRUGGED
    EAX_ENVIRONMENT_DIZZY
    EAX_ENVIRONMENT_PSYCHOTIC

    EAX_ENVIRONMENT_COUNT         ' total number of environments
end enum

' EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx)
#define EAX_PRESET_GENERIC         EAX_ENVIRONMENT_GENERIC,0.5,1.493,0.5
#define EAX_PRESET_PADDEDCELL      EAX_ENVIRONMENT_PADDEDCELL,0.25,0.1,0.0
#define EAX_PRESET_ROOM            EAX_ENVIRONMENT_ROOM,0.417,0.4,0.666
#define EAX_PRESET_BATHROOM        EAX_ENVIRONMENT_BATHROOM,0.653,1.499,0.166
#define EAX_PRESET_LIVINGROOM      EAX_ENVIRONMENT_LIVINGROOM,0.208,0.478,0.0
#define EAX_PRESET_STONEROOM       EAX_ENVIRONMENT_STONEROOM,0.5,2.309,0.888
#define EAX_PRESET_AUDITORIUM      EAX_ENVIRONMENT_AUDITORIUM,0.403,4.279,0.5
#define EAX_PRESET_CONCERTHALL     EAX_ENVIRONMENT_CONCERTHALL,0.5,3.961,0.5
#define EAX_PRESET_CAVE            EAX_ENVIRONMENT_CAVE,0.5,2.886,1.304
#define EAX_PRESET_ARENA           EAX_ENVIRONMENT_ARENA,0.361,7.284,0.332
#define EAX_PRESET_HANGAR          EAX_ENVIRONMENT_HANGAR,0.5,10.0,0.3
#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY,0.153,0.259,2.0
#define EAX_PRESET_HALLWAY         EAX_ENVIRONMENT_HALLWAY,0.361,1.493,0.0
#define EAX_PRESET_STONECORRIDOR   EAX_ENVIRONMENT_STONECORRIDOR,0.444,2.697,0.638
#define EAX_PRESET_ALLEY           EAX_ENVIRONMENT_ALLEY,0.25,1.752,0.776
#define EAX_PRESET_FOREST          EAX_ENVIRONMENT_FOREST,0.111,3.145,0.472
#define EAX_PRESET_CITY            EAX_ENVIRONMENT_CITY,0.111,2.767,0.224
#define EAX_PRESET_MOUNTAINS       EAX_ENVIRONMENT_MOUNTAINS,0.194,7.841,0.472
#define EAX_PRESET_QUARRY          EAX_ENVIRONMENT_QUARRY,1.0,1.499,0.5
#define EAX_PRESET_PLAIN           EAX_ENVIRONMENT_PLAIN,0.097,2.767,0.224
#define EAX_PRESET_PARKINGLOT      EAX_ENVIRONMENT_PARKINGLOT,0.208,1.652,1.5
#define EAX_PRESET_SEWERPIPE       EAX_ENVIRONMENT_SEWERPIPE,0.652,2.886,0.25
#define EAX_PRESET_UNDERWATER      EAX_ENVIRONMENT_UNDERWATER,1.0,1.499,0.0
#define EAX_PRESET_DRUGGED         EAX_ENVIRONMENT_DRUGGED,0.875,8.392,1.388
#define EAX_PRESET_DIZZY           EAX_ENVIRONMENT_DIZZY,0.139,17.234,0.666
#define EAX_PRESET_PSYCHOTIC       EAX_ENVIRONMENT_PSYCHOTIC,0.486,7.563,0.806

type STREAMPROC as function (byval handle as HSTREAM, byval buffer as any ptr, byval length as DWORD , byval user as any ptr) as DWORD
/' User stream callback function. NOTE: A stream function should obviously be as quick
as possible, other streams (and MOD musics) can't be mixed until it's finished.
handle : The stream that needs writing
buffer : Buffer to write the samples in
length : Number of bytes to write
user   : The 'user' parameter value given when calling BASS_StreamCreate
RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end
         the stream. '/

#define BASS_STREAMPROC_END      &h80000000   ' end of user stream flag

' special STREAMPROCs
#define STREAMPROC_DUMMY      0      ' "dummy" stream
#define STREAMPROC_PUSH         -1      ' push stream

' BASS_StreamCreateFileUser file systems
#define STREAMFILE_NOBUFFER      0
#define STREAMFILE_BUFFER      1
#define STREAMFILE_BUFFERPUSH   2

' User file stream callback functions
type  FILECLOSEPROC as sub (byval user as any ptr)
type FILELENPROC as function (byval user as any ptr) as QWORD
type FILEREADPROC as function (byval buffer as any ptr, length as DWORD, byval user as any ptr) as DWORD
type FILESEEKPROC as function (byval offset as QWORD , byval user as any ptr) as BOOL

type BASS_FILEPROCS
   as FILECLOSEPROC ptr close
   as FILELENPROC ptr length
   as FILEREADPROC ptr read
   as FILESEEKPROC ptr seek
end type

' BASS_StreamPutFileData options
#define BASS_FILEDATA_END      0   ' end & close the file

' BASS_StreamGetFilePosition modes
#define BASS_FILEPOS_CURRENT   0
#define BASS_FILEPOS_DECODE      BASS_FILEPOS_CURRENT
#define BASS_FILEPOS_DOWNLOAD   1
#define BASS_FILEPOS_END      2
#define BASS_FILEPOS_START      3
#define BASS_FILEPOS_CONNECTED   4
#define BASS_FILEPOS_BUFFER      5
#define BASS_FILEPOS_SOCKET      6

type DOWNLOADPROC as sub (byval buffer as const any ptr, byval length as DWORD, byval user as any ptr)
/' Internet stream download callback function.
buffer : Buffer containing the downloaded data... NULL=end of download
length : Number of bytes in the buffer
user   : The 'user' parameter value given when calling BASS_StreamCreateURL '/

' BASS_ChannelSetSync types
#define BASS_SYNC_POS         0
#define BASS_SYNC_END         2
#define BASS_SYNC_META         4
#define BASS_SYNC_SLIDE         5
#define BASS_SYNC_STALL         6
#define BASS_SYNC_DOWNLOAD      7
#define BASS_SYNC_FREE         8
#define BASS_SYNC_SETPOS      11
#define BASS_SYNC_MUSICPOS      10
#define BASS_SYNC_MUSICINST      1
#define BASS_SYNC_MUSICFX      3
#define BASS_SYNC_OGG_CHANGE   12
#define BASS_SYNC_MIXTIME      &h40000000   ' FLAG: sync at mixtime, else at playtime
#define BASS_SYNC_ONETIME      &h80000000   ' FLAG: sync only once, else continuously

type SYNCPROC as sub (byval HSYNC  as handle, byval channel as DWORD , byval data as DWORD, byval user as any ptr)
/' Sync callback function. NOTE: a sync callback function should be very
quick as other syncs can't be processed until it has finished. If the sync
is a "mixtime" sync, then other streams and MOD musics can't be mixed until
it's finished either.
handle : The sync that has occured
channel: Channel that the sync occured in
data   : Additional data associated with the sync's occurance
user   : The 'user' parameter given when calling BASS_ChannelSetSync '/

type DSPPROC as sub(byval handle as HDSP, byval channel as DWORD, byval buffer as any ptr, byval length as DWORD, byval user as any ptr)
/' DSP callback function. NOTE: A DSP function should obviously be as quick as
possible... other DSP functions, streams and MOD musics can not be processed
until it's finished.
handle : The DSP handle
channel: Channel that the DSP is being applied to
buffer : Buffer to apply the DSP to
length : Number of bytes in the buffer
user   : The 'user' parameter given when calling BASS_ChannelSetDSP '/

type RECORDPROC as function (byval handle as HRECORD, byval buffer as const any ptr, byval length as DWORD, byval user as any ptr) as BOOL
/' Recording callback function.
handle : The recording handle
buffer : Buffer containing the recorded sample data
length : Number of bytes
user   : The 'user' parameter value given when calling BASS_RecordStart
RETURN : TRUE = continue recording, FALSE = stop '/

' BASS_ChannelIsActive return values
#define BASS_ACTIVE_STOPPED   0
#define BASS_ACTIVE_PLAYING   1
#define BASS_ACTIVE_STALLED   2
#define BASS_ACTIVE_PAUSED   3

' Channel attributes
#define BASS_ATTRIB_FREQ         1
#define BASS_ATTRIB_VOL            2
#define BASS_ATTRIB_PAN            3
#define BASS_ATTRIB_EAXMIX         4
#define BASS_ATTRIB_NOBUFFER      5
#define BASS_ATTRIB_CPU            7
#define BASS_ATTRIB_MUSIC_AMPLIFY   &h100
#define BASS_ATTRIB_MUSIC_PANSEP   &h101
#define BASS_ATTRIB_MUSIC_PSCALER   &h102
#define BASS_ATTRIB_MUSIC_BPM      &h103
#define BASS_ATTRIB_MUSIC_SPEED      &h104
#define BASS_ATTRIB_MUSIC_VOL_GLOBAL &h105
#define BASS_ATTRIB_MUSIC_VOL_CHAN   &h200 ' + channel #
#define BASS_ATTRIB_MUSIC_VOL_INST   &h300 ' + instrument #

' BASS_ChannelGetData flags
#define BASS_DATA_AVAILABLE   0         ' query how much data is buffered
#define BASS_DATA_FLOAT      &h40000000   ' flag: return floating-point sample data
#define BASS_DATA_FFT256   &h80000000   ' 256 sample FFT
#define BASS_DATA_FFT512   &h80000001   ' 512 FFT
#define BASS_DATA_FFT1024   &h80000002   ' 1024 FFT
#define BASS_DATA_FFT2048   &h80000003   ' 2048 FFT
#define BASS_DATA_FFT4096   &h80000004   ' 4096 FFT
#define BASS_DATA_FFT8192   &h80000005   ' 8192 FFT
#define BASS_DATA_FFT16384   &h80000006   ' 16384 FFT
#define BASS_DATA_FFT_INDIVIDUAL &h10   ' FFT flag: FFT for each channel, else all combined
#define BASS_DATA_FFT_NOWINDOW   &h20   ' FFT flag: no Hanning window
#define BASS_DATA_FFT_REMOVEDC   &h40   ' FFT flag: pre-remove DC bias

' BASS_ChannelGetTags types : what's returned
#define BASS_TAG_ID3      0   ' ID3v1 tags : TAG_ID3 structure
#define BASS_TAG_ID3V2      1   ' ID3v2 tags : variable length block
#define BASS_TAG_OGG      2   ' OGG comments : series of null-terminated UTF-8 strings
#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_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_RIFF_INFO   &h100 ' RIFF "INFO" tags : series of null-terminated ANSI strings
#define BASS_TAG_RIFF_BEXT   &h101 ' RIFF/BWF "bext" tags : TAG_BEXT structure
#define BASS_TAG_RIFF_CART   &h102 ' RIFF/BWF "cart" tags : TAG_CART structure
#define BASS_TAG_RIFF_DISP   &h103 ' RIFF "DISP" text tag : ANSI string
#define BASS_TAG_APE_BINARY   &h1000   ' + index #, binary APE tag : TAG_APE_BINARY structure
#define BASS_TAG_MUSIC_NAME      &h10000   ' MOD music name : ANSI string
#define BASS_TAG_MUSIC_MESSAGE   &h10001   ' MOD message : ANSI string
#define BASS_TAG_MUSIC_ORDERS   &h10002   ' MOD order list : BYTE array of pattern numbers
#define BASS_TAG_MUSIC_INST      &h10100   ' + instrument #, MOD instrument name : ANSI string
#define BASS_TAG_MUSIC_SAMPLE   &h10300   ' + sample #, MOD sample name : ANSI string

' ID3v1 tag structure
type TAG_ID3
   as zstring * 3 id
   as zstring * 30 title
   as zstring * 30 artist
   as zstring * 30 album
   as zstring * 4 year
   as zstring * 30 comment
   as BYTE genre
end type

' Binary APE tag structure
type TAG_APE_BINARY
as    const zstring ptr key
   as const any ptr data
   as DWORD length
end type

' BWF "bext" tag structure
type TAG_BEXT
   as zstring * 256 Description         ' description
   as zstring * 32 Originator         ' name of the originator
   as zstring * 32 OriginatorReference   ' reference of the originator
   as zstring * 10 OriginationDate      ' date of creation (yyyy-mm-dd)
   as zstring * 8 OriginationTime      ' time of creation (hh-mm-ss)
   as QWORD TimeReference         ' first sample count since midnight (little-endian)
   as WORD Version               ' BWF version (little-endian)
   as BYTE UMID(64-1)               ' SMPTE UMID
   as BYTE Reserved(190-1)
   as zstring * 1 CodingHistory         ' history
end type

' BWF "cart" tag structures
type TAG_CART_TIMER
   as DWORD dwUsage               ' FOURCC timer usage ID
   as DWORD dwValue               ' timer value in samples from head
end type

type TAG_CART
   as zstring * 4 Version            ' version of the data structure
   as zstring * 64 Title               ' title of cart audio sequence
   as zstring * 64 Artist            ' artist or creator name
   as zstring * 64 CutID               ' cut number identification
   as zstring * 64 ClientID            ' client identification
   as zstring * 64 Category            ' category ID, PSA, NEWS, etc
   as zstring * 64  Classification      ' classification or auxiliary key
   as zstring * 64 OutCue            ' out cue text
   as zstring * 10 StartDate            ' yyyy-mm-dd
   as zstring * 8 StartTime            ' hh:mm:ss
   as zstring * 10  EndDate            ' yyyy-mm-dd
   as zstring * 8 EndTime            ' hh:mm:ss
   as zstring * 64 ProducerAppID         ' name of vendor or application
   as zstring * 64 ProducerAppVersion   ' version of producer application
   as zstring * 64 UserDef            ' user defined text
   as DWORD dwLevelReference         ' sample value for 0 dB reference
   as TAG_CART_TIMER PostTimer(8-1)   ' 8 time markers after head
   as zstring * 276 Reserved
   as zstring * 1024 URL               ' uniform resource locator
   as zstring * 1 TagText            ' free form text for scripts or tags
end type

' CoreAudio codec info structure
type TAG_CA_CODEC
   as DWORD ftype               ' file format
   as DWORD atype               ' audio format
   as const zstring ptr name            ' description
end type

' 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_DECODE         &h10000000 ' flag: get the decoding (not playing) position
#define BASS_POS_DECODETO      &h20000000 ' flag: decode to the position instead of seeking

' BASS_RecordSetInput flags
#define BASS_INPUT_OFF      &h10000
#define BASS_INPUT_ON      &h20000

#define BASS_INPUT_TYPE_MASK      &hff000000
#define BASS_INPUT_TYPE_UNDEF      &h00000000
#define BASS_INPUT_TYPE_DIGITAL      &h01000000
#define BASS_INPUT_TYPE_LINE      &h02000000
#define BASS_INPUT_TYPE_MIC         &h03000000
#define BASS_INPUT_TYPE_SYNTH      &h04000000
#define BASS_INPUT_TYPE_CD         &h05000000
#define BASS_INPUT_TYPE_PHONE      &h06000000
#define BASS_INPUT_TYPE_SPEAKER      &h07000000
#define BASS_INPUT_TYPE_WAVE      &h08000000
#define BASS_INPUT_TYPE_AUX         &h09000000
#define BASS_INPUT_TYPE_ANALOG      &h0a000000

' DX8 effect types, use with BASS_ChannelSetFX
enum
   BASS_FX_DX8_CHORUS
   BASS_FX_DX8_COMPRESSOR
   BASS_FX_DX8_DISTORTION
   BASS_FX_DX8_ECHO
   BASS_FX_DX8_FLANGER
   BASS_FX_DX8_GARGLE
   BASS_FX_DX8_I3DL2REVERB
   BASS_FX_DX8_PARAMEQ
   BASS_FX_DX8_REVERB
end enum

type BASS_DX8_CHORUS
 as   float       fWetDryMix
 as    float       fDepth
 as    float       fFeedback
 as    float       fFrequency
 as    DWORD       lWaveform   ' 0=triangle, 1=sine
 as    float       fDelay
 as    DWORD       lPhase      ' BASS_DX8_PHASE_xxx
end type

type BASS_DX8_COMPRESSOR
as    float   fGain
as    float   fAttack
as    float   fRelease
as    float   fThreshold
as    float   fRatio
as    float   fPredelay
end type

type BASS_DX8_DISTORTION
as    float   fGain
as    float   fEdge
as    float   fPostEQCenterFrequency
as    float   fPostEQBandwidth
as    float   fPreLowpassCutoff
end type

type BASS_DX8_ECHO
as    float   fWetDryMix
as    float   fFeedback
as    float   fLeftDelay
as    float   fRightDelay
as    BOOL    lPanDelay
end type

type BASS_DX8_FLANGER
as    float       fWetDryMix
as    float       fDepth
as    float       fFeedback
as    float       fFrequency
as    DWORD       lWaveform   ' 0=triangle, 1=sine
as    float       fDelay
as    DWORD       lPhase      ' BASS_DX8_PHASE_xxx
end type

type BASS_DX8_GARGLE
as    DWORD       dwRateHz               ' Rate of modulation in hz
as    DWORD       dwWaveShape            ' 0=triangle, 1=square
end type

type BASS_DX8_I3DL2REVERB
as    integer     lRoom                  ' [-10000, 0]      default: -1000 mB
as    integer     lRoomHF                ' [-10000, 0]      default: 0 mB
as    float   flRoomRolloffFactor    ' [0.0, 10.0]      default: 0.0
as    float   flDecayTime            ' [0.1, 20.0]      default: 1.49s
as    float   flDecayHFRatio         ' [0.1, 2.0]       default: 0.83
as    integer     lReflections           ' [-10000, 1000]   default: -2602 mB
as    float   flReflectionsDelay     ' [0.0, 0.3]       default: 0.007 s
as    integer     lReverb                ' [-10000, 2000]   default: 200 mB
as    float   flReverbDelay          ' [0.0, 0.1]       default: 0.011 s
as    float   flDiffusion            ' [0.0, 100.0]     default: 100.0 %
as    float   flDensity              ' [0.0, 100.0]     default: 100.0 %
as    float   flHFReference          ' [20.0, 20000.0]  default: 5000.0 Hz
end type

type BASS_DX8_PARAMEQ
as    float   fCenter
as    float   fBandwidth
as    float   fGain
end type

type BASS_DX8_REVERB
as    float   fInGain                ' [-96.0,0.0]            default: 0.0 dB
as    float   fReverbMix             ' [-96.0,0.0]            default: 0.0 db
as    float   fReverbTime            ' [0.001,3000.0]         default: 1000.0 ms
as    float   fHighFreqRTRatio       ' [0.001,0.999]          default: 0.001
end type

#define BASS_DX8_PHASE_NEG_180        0
#define BASS_DX8_PHASE_NEG_90         1
#define BASS_DX8_PHASE_ZERO           2
#define BASS_DX8_PHASE_90             3
#define BASS_DX8_PHASE_180            4


declare function BASS_SetConfig alias "BASS_SetConfig"(byval option as DWORD, byval value as DWORD ) as BOOL
declare function BASS_GetConfig alias "BASS_GetConfig"(byval option as DWORD ) as DWORD
declare function BASS_SetConfigPtr alias "BASS_SetConfigPtr"(byval option as DWORD, byval value as any ptr) as BOOL
declare function BASS_GetConfigPtr alias "BASS_GetConfigPtr"(byval option as DWORD) as any ptr
declare function BASS_GetVersion alias "BASS_GetVersion"() as DWORD
declare function BASS_ErrorGetCode alias "BASS_ErrorGetCode"() as integer
declare function BASS_GetDeviceInfo alias "BASS_GetDeviceInfo"(byval device as DWORD, byval info as BASS_DEVICEINFO ptr) as BOOL 
#ifdef __FB_WIN32__
declare function BASS_Init alias "BASS_Init"(byval device as integer, byval freq as DWORD, byval flags as DWORD, byval win as HWND, byval dsguid as const GUID ptr) as BOOL
#else
declare function BASS_Init alias "BASS_Init"(byval device as integer, byval freq as DWORD , byval flags as DWORD , byval win as any ptr, byval dsguid as any ptr) as BOOL
#endif
declare function BASS_SetDevice alias "BASS_SetDevice"(byval device as DWORD) as BOOL
declare function BASS_GetDevice alias "BASS_GetDevice"() as DWORD
declare function BASS_Free alias "BASS_Free"() as BOOL
#ifdef __FB_WIN32__
declare function BASS_GetDSoundObject alias "BASS_GetDSoundObject"(byval object as DWORD) as any ptr
#endif
declare function BASS_GetInfo alias "BASS_GetInfo"(byval info as BASS_INFO  ptr) as BOOL
declare function BASS_Update alias "BASS_Update"(byval length as DWORD) as BOOL
declare function BASS_GetCPU alias "BASS_GetCPU"() as float
declare function BASS_Start alias "BASS_Start"() as BOOL
declare function BASS_Stop alias "BASS_Stop"() as BOOL
declare function BASS_Pause alias "BASS_Pause"() as BOOL
declare function BASS_SetVolume alias "BASS_SetVolume"(byval volume as float ) as BOOL
declare function BASS_GetVolume alias "BASS_GetVolume"() as float

declare function BASS_PluginLoad alias "BASS_PluginLoad"(byval file as const any ptr, byval flags as DWORD) as HPLUGIN
declare function BASS_PluginFree alias "BASS_PluginFree"(byval handle as HPLUGIN) as BOOL
declare function BASS_PluginGetInfo alias "BASS_PluginGetInfo"(byval handle as HPLUGIN) as const BASS_PLUGININFO ptr

declare function BASS_Set3DFactors alias "BASS_Set3DFactors"(byval distf as FLOAT, byval rollf as float, byval doppf as float ) as BOOL
declare function BASS_Get3DFactors alias "BASS_Get3DFactors"(byval distf as float ptr, byval rollf as float ptr, byval doppf as float ptr) as BOOL
declare function BASS_Set3DPosition alias "BASS_Set3DPosition"(byval pos as const BASS_3DVECTOR ptr, byval vel as const BASS_3DVECTOR ptr, byval front as const BASS_3DVECTOR ptr, byval top as const BASS_3DVECTOR ptr) as BOOL
declare function BASS_Get3DPosition alias "BASS_Get3DPosition"(byval pos as BASS_3DVECTOR ptr, byval vel as BASS_3DVECTOR ptr, byval front as BASS_3DVECTOR ptr, byval top as BASS_3DVECTOR ptr) as BOOL
declare sub  BASS_Apply3D alias "BASS_Apply3D"()
#ifdef __FB_WIN32__
declare function BASS_SetEAXParameters alias "BASS_SetEAXParameters"(byval env as integer, byval vol as float, byval decay as float, byval damp as float) as BOOL
declare function BASS_GetEAXParameters alias "BASS_GetEAXParameters"(byval env as DWORD ptr, byval vol as float ptr, byval decay as float ptr, byval damp as float ptr) as BOOL
#endif

declare function BASS_MusicLoad alias "BASS_MusicLoad"(byval mem as BOOL, byval file as const any ptr, byval offset as QWORD, byval length as DWORD, byval flags as DWORD, byval freq as DWORD) as HMUSIC
declare function BASS_MusicFree alias "BASS_MusicFree"(byval handle as HMUSIC) as BOOL

declare function BASS_SampleLoad alias "BASS_SampleLoad"(byval mem as BOOL, byval file as const any ptr, byval offset as QWORD, byval length as DWORD, byval max as DWORD , byval flags as DWORD) as HSAMPLE
declare function BASS_SampleCreate alias "BASS_SampleCreate"(byval length as DWORD, byval freq as DWORD, byval chans as DWORD , byval max as DWORD, byval flags as DWORD) as HSAMPLE
declare function BASS_SampleFree alias "BASS_SampleFree"(byval handle as HSAMPLE) as BOOL
declare function BASS_SampleSetData alias "BASS_SampleSetData"(byval handle as HSAMPLE , byval buffer as const any ptr) as BOOL
declare function BASS_SampleGetData alias "BASS_SampleGetData"(byval handle as HSAMPLE, byval buffer as any ptr) as BOOL
declare function BASS_SampleGetInfo alias "BASS_SampleGetInfo"(byval handle as HSAMPLE, byval info as BASS_SAMPLE ptr) as BOOL
declare function BASS_SampleSetInfo alias "BASS_SampleSetInfo"(byval handle as HSAMPLE, byval info as const BASS_SAMPLE ptr) as BOOL
declare function BASS_SampleGetChannel alias "BASS_SampleGetChannel"(byval handle as HSAMPLE, byval onlynew as BOOL) as HCHANNEL
declare function BASS_SampleGetChannels alias "BASS_SampleGetChannels"(byval handle as HSAMPLE, byval channels as HCHANNEL ptr) as DWORD
declare function BASS_SampleStop alias "BASS_SampleStop"(byval handle as HSAMPLE) as BOOL

declare function BASS_StreamCreate alias "BASS_StreamCreate"(byval freq as DWORD, byval chans as DWORD, byval flags as DWORD , byval proc as STREAMPROC ptr, byval user as any ptr) as HSTREAM
declare function BASS_StreamCreateFile alias "BASS_StreamCreateFile"(byval mem as BOOL , byval file as any ptr, byval offset as QWORD, byval length as QWORD, byval flags as DWORD ) as HSTREAM
declare function BASS_StreamCreateURL alias "BASS_StreamCreateURL"(byval url as zstring ptr, byval offset as DWORD, byval flags as DWORD, byval proc as DOWNLOADPROC ptr, byval user as any ptr) as HSTREAM
declare function BASS_StreamCreateFileUser alias "BASS_StreamCreateFileUser"(byval system as DWORD, byval flags as DWORD, byval proc as const BASS_FILEPROCS ptr, byval user as any ptr) as HSTREAM
declare function BASS_StreamFree alias "BASS_StreamFree"(byval handle as HSTREAM) as BOOL

declare function BASS_StreamGetFilePosition alias "BASS_StreamGetFilePosition"(byval handle as HSTREAM, byval mode as DWORD) as QWORD
declare function BASS_StreamPutData alias "BASS_StreamPutData"(byval handle as HSTREAM, byval buffer as any ptr, byval length as DWORD) as DWORD
declare function BASS_StreamPutFileData alias "BASS_StreamPutFileData"(byval handle as HSTREAM, byval buffer as const any ptr, byval length as DWORD) as DWORD

declare function BASS_RecordGetDeviceInfo alias "BASS_RecordGetDeviceInfo"(byval device as DWORD , byval info as BASS_DEVICEINFO ptr) as BOOL
declare function BASS_RecordInit alias "BASS_RecordInit"(byval device as integer) as BOOL
declare function BASS_RecordSetDevice alias "BASS_RecordSetDevice"(byval device as DWORD) as BOOL
declare function BASS_RecordGetDevice alias "BASS_RecordGetDevice"() as DWORD
declare function BASS_RecordFree alias "BASS_RecordFree"() as BOOL
declare function BASS_RecordGetInfo alias "BASS_RecordGetInfo"(byval info as BASS_RECORDINFO ptr) as BOOL
declare function BASS_RecordGetInputName alias "BASS_RecordGetInputName"(byval input as integer) as zstring ptr
declare function BASS_RecordSetInput alias "BASS_RecordSetInput"(byval input as integer, byval flags as DWORD, byval volume as float) as BOOL
declare function BASS_RecordGetInput alias "BASS_RecordGetInput"(byval input as integer, byval volume as float ptr) as DWORD
declare function BASS_RecordStart alias "BASS_RecordStart"(byval freq as DWORD, byval chans as DWORD, byval flags as DWORD, byval proc as RECORDPROC ptr, byval user as any ptr) as HRECORD

declare function BASS_ChannelBytes2Seconds alias "BASS_ChannelBytes2Seconds"(byval handle as DWORD , byval pos as QWORD) as double
declare function BASS_ChannelSeconds2Bytes alias "BASS_ChannelSeconds2Bytes"(byval handle as DWORD, byval pos as double) as QWORD
declare function BASS_ChannelGetDevice alias "BASS_ChannelGetDevice"(byval handle as DWORD) as DWORD
declare function BASS_ChannelSetDevice alias "BASS_ChannelSetDevice"(byval handle as DWORD, byval device as DWORD) as BOOL
declare function BASS_ChannelIsActive alias "BASS_ChannelIsActive"(byval handle as DWORD) as DWORD
declare function BASS_ChannelGetInfo alias "BASS_ChannelGetInfo"(byval handle as DWORD, byval info as BASS_CHANNELINFO ptr) as BOOL
declare function BASS_ChannelGetTags alias "BASS_ChannelGetTags"(byval handle as DWORD, byval tags as DWORD) as zstring ptr
declare function BASS_ChannelFlags alias "BASS_ChannelFlags"(byval handle as DWORD, byval flags as DWORD, byval mask as DWORD) as DWORD
declare function BASS_ChannelUpdate alias "BASS_ChannelUpdate"(byval handle as DWORD, byval length as DWORD) as BOOL
declare function BASS_ChannelLock alias "BASS_ChannelLock"(byval handle as DWORD, byval lock as BOOL) as BOOL
declare function BASS_ChannelPlay alias "BASS_ChannelPlay"(byval handle as DWORD, byval restart as BOOL) as BOOL
declare function BASS_ChannelStop alias "BASS_ChannelStop"(byval handle as DWORD) as BOOL
declare function BASS_ChannelPause alias "BASS_ChannelPause"(byval handle as DWORD) as BOOL
declare function BASS_ChannelSetAttribute alias "BASS_ChannelSetAttribute"(byval handle as DWORD, byval attrib as DWORD, byval value as float) as BOOL
declare function BASS_ChannelGetAttribute alias "BASS_ChannelGetAttribute"(byval handle as DWORD, byval attrib as DWORD, byval value as float ptr) as BOOL
declare function BASS_ChannelSlideAttribute alias "BASS_ChannelSlideAttribute"(byval handle as DWORD, byval attrib as DWORD, byval value as float, byval time as DWORD) as BOOL
declare function BASS_ChannelIsSliding alias "BASS_ChannelIsSliding"(byval handle as DWORD, byval attrib as DWORD) as BOOL
declare function BASS_ChannelSet3DAttributes alias "BASS_ChannelSet3DAttributes"(byval handle as DWORD, byval mode as integer, byval min as float, byval max as float, byval iangle as integer, byval oangle as integer, byval outvol as float) as BOOL
declare function BASS_ChannelGet3DAttributes alias "BASS_ChannelGet3DAttributes"(byval handle as DWORD, byval mode as DWORD ptr, byval min as float ptr, byval max as float ptr, byval iangle as DWORD ptr, byval oangle as DWORD ptr, byval outvol as float ptr) as BOOL
declare function BASS_ChannelSet3DPosition alias "BASS_ChannelSet3DPosition"(byval handle as DWORD, byval pos as const BASS_3DVECTOR ptr, byval orient as const BASS_3DVECTOR ptr, byval vel as const BASS_3DVECTOR ptr) as BOOL
declare function BASS_ChannelGet3DPosition alias "BASS_ChannelGet3DPosition"(byval handle as DWORD, byval pos as BASS_3DVECTOR ptr, byval orient as BASS_3DVECTOR ptr, byval vel as BASS_3DVECTOR ptr) as BOOL
declare function BASS_ChannelGetLength alias "BASS_ChannelGetLength"(byval handle as DWORD, byval mode as DWORD) as QWORD
declare function BASS_ChannelSetPosition alias "BASS_ChannelSetPosition"(byval handle as DWORD, byval pos as QWORD, byval mode as DWORD) as BOOL
declare function BASS_ChannelGetPosition alias "BASS_ChannelGetPosition"(byval handle as DWORD, byval mode as DWORD) as QWORD
declare function BASS_ChannelGetLevel alias "BASS_ChannelGetLevel"(byval handle as DWORD) as DWORD
declare function BASS_ChannelGetData alias "BASS_ChannelGetData"(byval handle as DWORD, byval buffer as any ptr, byval length as DWORD) as DWORD
declare function BASS_ChannelSetSync alias "BASS_ChannelSetSync"(byval handle as DWORD, byval type as DWORD, byval param as QWORD, byval proc as SYNCPROC ptr, byval user as any ptr) as HSYNC
declare function BASS_ChannelRemoveSync alias "BASS_ChannelRemoveSync"(byval handle as DWORD, byval sync as HSYNC) as BOOL
declare function BASS_ChannelSetDSP alias "BASS_ChannelSetDSP"(byval handle as DWORD, byval proc as DSPPROC ptr, byval user as any ptr, byval priority as integer) as HDSP
declare function BASS_ChannelRemoveDSP alias "BASS_ChannelRemoveDSP"(byval handle as DWORD, byval dsp as HDSP) as BOOL
declare function BASS_ChannelSetLink alias "BASS_ChannelSetLink"(byval handle as DWORD , byval chan as DWORD) as BOOL
declare function BASS_ChannelRemoveLink alias "BASS_ChannelRemoveLink"(byval handle as DWORD, byval chan as DWORD) as BOOL
declare function BASS_ChannelSetFX alias "BASS_ChannelSetFX"(byval handle as DWORD, byval type as DWORD, byval priority as integer) as HFX
declare function BASS_ChannelRemoveFX alias "BASS_ChannelRemoveFX"(byval handle as DWORD, byval fx as HFX) as BOOL

declare function BASS_FXSetParameters alias "BASS_FXSetParameters"(byval handle as HFX, byval params as const any ptr) as BOOL
declare function BASS_FXGetParameters alias "BASS_FXGetParameters"(byval handle as HFX, byval params as any ptr) as BOOL
declare function BASS_FXReset alias "BASS_FXReset"(byval handle as HFX) as BOOL

#endif
dkl
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: New FB release coming up

Postby dkl » Aug 30, 2013 16:02

Yea, the bass.bi is known to have conflicts with the Win32 headers, because it contains declaration from there which it shouldn't.

As for the linking problem: Download the libbass.dll.a import library and put it into the FreeBASIC/lib/win32 directory. It seems like ld is unable to link to the bass.dll directly, so a libbass.dll.a import library is needed.
fxm
Posts: 9258
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: New FB release coming up

Postby fxm » Aug 31, 2013 5:21

I have not had any response to this previous post: viewtopic.php?p=190582#p190582

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests