miniFMOD v1.70 for PureBasic > 3.92
I don't think this is a good idea.KarLKoX wrote:Put somewhere in the sourcecode :
Code: Select all
int _ftol2;
There's a compiler switch (/QIfist) to suppress calls to ftol2.
Good programmers don't comment their code. It was hard to write, should be hard to read.
Never got problem using this even with intensive cpu task.
Btw, you can find the obj file here.
Btw, you can find the obj file here.
Good morning!
Don't know if this is useful to anyone but here's a small example on how
to use Minifmod 1.7 without the wrapper (PB4.0) :
Sadly it doesn't work out of the box, you still need to recompile the
original minifmod.lib as the library in the original zip-archive only
works in VC.
Well, you'll want to adjust xmeffects.h to your needs anyway.
Here's what to do in order to make it work outside VC:
Original sound.h, line 160:
Changed sound.h, line 160:
Don't know if this is useful to anyone but here's a small example on how
to use Minifmod 1.7 without the wrapper (PB4.0) :
Code: Select all
ImportC "winmm.lib"
EndImport
ImportC "minifmod.lib"
; Initialization / Global functions.
FSOUND_File_SetCallbacks(OpenCallback.l, CloseCallback.l, ReadCallback.l, SeekCallback.l, TellCallback.l)
; Song management / playback functions.
FMUSIC_LoadSong(name.s, sampleloadcallback.l = #Null)
FMUSIC_FreeSong(mod.l)
FMUSIC_PlaySong(mod.l)
FMUSIC_StopSong(mod.l)
; Runtime song information.
FMUSIC_GetOrder(mod.l)
FMUSIC_GetRow(mod.l)
FMUSIC_GetTime(mod.l)
EndImport
;
;
;
ProcedureC _fileopen(name.s)
ProcedureReturn ReadFile(#PB_Any, name)
EndProcedure
ProcedureC _fileclose(handle.l)
CloseFile(handle)
EndProcedure
ProcedureC _fileread(*buffer.l, size.l, handle.l)
ProcedureReturn ReadData(handle, *buffer, size)
EndProcedure
ProcedureC _fileseek(handle.l, pos.l, mode.l)
Select mode
Case #SEEK_SET
FileSeek(handle, pos)
Case #SEEK_CUR
FileSeek(handle, Loc(handle)+pos)
EndSelect
EndProcedure
ProcedureC _filetell(handle.l)
ProcedureReturn Loc(handle)
EndProcedure
;
;
;
FSOUND_File_SetCallbacks(@_fileopen(), @_fileclose(), @_fileread(), @_fileseek(), @_filetell())
mod.l = FMUSIC_LoadSong("YourFavoriteXMhere.XM")
If mod
FMUSIC_PlaySong(mod)
MessageRequester("minifmod", "playing...")
FMUSIC_FreeSong(mod)
EndIf
original minifmod.lib as the library in the original zip-archive only
works in VC.
Well, you'll want to adjust xmeffects.h to your needs anyway.
Here's what to do in order to make it work outside VC:
Original sound.h, line 160:
Code: Select all
//= VARIABLE EXTERNS ==========================================================================
#ifdef __cplusplus
extern "C"
{
#endif
FSOUND_CHANNEL FSOUND_Channel[];
int FSOUND_MixRate;
int FSOUND_BufferSize; // software buffersize
int FSOUND_BufferSizeMs;
HWAVEOUT FSOUND_WaveOutHandle;
FSOUND_SoundBlock FSOUND_MixBlock;
// mixing info
signed char * FSOUND_MixBufferMem; // mix buffer memory block
signed char * FSOUND_MixBuffer; // mix output buffer (16bit or 32bit)
unsigned int FSOUND_MixerAddress; // actual address of the function
int FSOUND_HWMixOffset; // the offset in the output buffer to mix into in bytes
float FSOUND_OOMixRate; // mixing rate in hz.
int FSOUND_BufferSize; // size of 1 'latency' ms buffer in bytes
int FSOUND_BlockSize; // LATENCY ms worth of samples
volatile signed char FSOUND_Software_Exit; // mixing thread termination flag
volatile signed char FSOUND_Software_UpdateMutex;
volatile signed char FSOUND_Software_ThreadFinished;
volatile HANDLE FSOUND_Software_hThread;
volatile int FSOUND_Software_FillBlock;
volatile int FSOUND_Software_RealBlock;
DWORD FSOUND_Software_DoubleBufferThread(LPDWORD lpdwParam);
void FSOUND_Software_Fill();
#ifdef __cplusplus
}
#endif
Changed sound.h, line 160:
Code: Select all
//= VARIABLE EXTERNS ==========================================================================
#ifdef __cplusplus
extern "C"
{
#endif
extern FSOUND_CHANNEL FSOUND_Channel[];
extern int FSOUND_MixRate;
extern int FSOUND_BufferSize; // software buffersize
extern int FSOUND_BufferSizeMs;
extern HWAVEOUT FSOUND_WaveOutHandle;
extern FSOUND_SoundBlock FSOUND_MixBlock;
// mixing info
extern signed char * FSOUND_MixBufferMem; // mix buffer memory block
extern signed char * FSOUND_MixBuffer; // mix output buffer (16bit or 32bit)
extern unsigned int FSOUND_MixerAddress; // actual address of the function
extern int FSOUND_HWMixOffset; // the offset in the output buffer to mix into in bytes
extern float FSOUND_OOMixRate; // mixing rate in hz.
extern int FSOUND_BufferSize; // size of 1 'latency' ms buffer in bytes
extern int FSOUND_BlockSize; // LATENCY ms worth of samples
extern volatile signed char FSOUND_Software_Exit; // mixing thread termination flag
extern volatile signed char FSOUND_Software_UpdateMutex;
extern volatile signed char FSOUND_Software_ThreadFinished;
extern volatile HANDLE FSOUND_Software_hThread;
extern volatile int FSOUND_Software_FillBlock;
extern volatile int FSOUND_Software_RealBlock;
DWORD FSOUND_Software_DoubleBufferThread(LPDWORD lpdwParam);
void FSOUND_Software_Fill();
#ifdef __cplusplus
}
#endif
Good programmers don't comment their code. It was hard to write, should be hard to read.
You can't reply? Strange...Shannara wrote:Reference: http://purebasic.fr/english/viewtopic.p ... highlight=
Since, for some reason, the forums do not allow me to reply to this unlocked topic ... I will continue discussions here ...
Can anybody compile that into a library to be used with PB4.0?
Anyway, it should work in PB4.0 straight as it is. What happens (and what
about using the Import/EndImport way instead?) ?
Good programmers don't comment their code. It was hard to write, should be hard to read.