Posted: Thu Aug 04, 2005 1:59 am
DevC++ and Pelle's C can import msvc workspaces.
http://www.purebasic.com
https://www.purebasic.fr/english/
I don't think this is a good idea.KarLKoX wrote:Put somewhere in the sourcecode :
Code: Select all
int _ftol2;
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
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
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
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?