Page 1 sur 3

[MUSIC]-[PB4]-[ uFMOD ]

Publié : dim. 30/avr./2006 1:25
par flaith
Super light FMOD
site : ICI

La version pour purebasic (faite à la va vite) LA

:wink:

Publié : dim. 30/avr./2006 9:05
par wolfjeremy
Rien capter lol tu pourrais expliquer un peu le but du truc ? :?

Merci.

Publié : dim. 30/avr./2006 10:21
par flaith
C'est une lib FMOD permettant de jouer des fichiers XM ultra léger, t'as pas testé ?

Publié : dim. 30/avr./2006 14:55
par KarLKoX
Excellent ! #good

Publié : dim. 30/avr./2006 21:35
par garzul
ah, génial ça ! (mini FMOD en gros ? :))

Publié : dim. 30/avr./2006 22:04
par KarLKoX
miniFMOD en mieux :!:

Publié : lun. 01/mai/2006 16:13
par garzul
ahhh j'avais pas vue que c'étaît indépendant ! :)
Ça peut être intéressant pour des intros, je vais voir ça merci

Publié : lun. 01/mai/2006 16:53
par flaith
ajout d'un petit player XM

Code : Tout sélectionner

XIncludeFile "ufmod.pbi"

#THEFILE = 0

Global theFile.s
Global sizeXM.l, hWave.l
Global playing.s

theFile = OpenFileRequester("Open XM file", "", "XM Files (*.xm)|*.xm", 0)
playing = "Playing : "+Chr(34)+GetFilePart(theFile)+Chr(34)+" !!!"

sizeXM = FileSize(theFile)
OpenFile(#THEFILE,theFile)
  *buffer = AllocateMemory(sizeXM)
  If *buffer
    ReadData(#THEFILE, *buffer, sizeXM)
  Else
    MessageRequester("*** ERROR ***","Unable to allocate memory")
    End
  EndIf
CloseFile(#THEFILE)

hWave = uFMOD_PlaySong(*buffer, sizeXM, #XM_MEMORY)
If hWave <> 0
  ; Pop-up a message box to let uFMOD play the XM till user input
	
  MessageRequester(".:PureBasic:.",Playing,#PB_MessageRequester_Ok)
  
  ; Stop playback
  uFMOD_PlaySong(0, 0, 0)
Else
  MessageRequester("*** ERROR ***","Unable to play "+Chr(34)+theFile+Chr(34)+Chr(10)+"Returned result = "+Str(hWave))
EndIf

FreeMemory(*buffer)
End
le fichier PBI :

Code : Tout sélectionner

Import "winmm.lib"
  waveOutOpen(lphWaveOut.l, uDeviceID.l, lpFormat.l, dwCallback.l, dwInstance.l, dwFlags.l)
  waveOutPrepareHeader(hWaveOut.l, lpWaveOutHdr.l, uSize.l)
  waveOutWrite(hWaveOut.l, lpWaveOutHdr.l, uSize.l)
  waveOutReset(hWaveOut.l)
  waveOutUnprepareHeader(hWaveOut.l, lpWaveOutHdr.l, uSize.l)
  waveOutClose(hWaveOut.l)
  waveOutGetPosition(hwo.l, pmmt.l, cbmmt.l)
EndImport

Import "ufmod.lib"
; The uFMOD_PlaySong function starts playing an XM song
; --------------
; HWAVEOUT* uFMOD_PlaySong(
;   LPVOID lpXM,
;   DWORD  param,
;   DWORD  fdwSong
; );
; Parameters:
;   lpXM
;      Specifies the song to play. If this parameter is NULL,
;      any currently playing song is stopped. In such a case, function
;      does not return a meaningful value
;      fdwSong parameter determines whether this value is interpreted
;      as a filename, as a resource identifier or a pointer to an image
;      of the song in memory
;   param
;      Handle to the executable file that contains the resource to be
;      loaded or size of the image of the song in memory. This parameter
;      is ignored unless XM_RESOURCE or XM_MEMORY is specified in fdwSong
;   fdwSong
;      Flags for playing the song. The following values are defined
;      Value        Meaning
;      XM_FILE      lpXM points to filename
;                   param is ignored
;      XM_MEMORY    lpXM points to an image of a song in memory
;                   param is the image size
;      XM_RESOURCE  lpXM Specifies the name of the resource
;                   param identifies the module whose executable file
;                   contains the resource
;                   The resource type must be RT_RCDATA
; Return Values:
;    Returns a pointer to HWAVEOUT on success or NULL otherwise
  uFMOD_PlaySong(lpXM.l, param.l, fdwSong.l) ;As "_uFMOD_PlaySong@12"

; The uFMOD_GetRowOrder function returns the song's current row And order
; --------------
; unsigned short uFMOD_GetRowOrder();
; Return Values:
;    Returns the song's current row in high-order byte And order
;    in low-order byte
  uFMOD_GetRowOrder() ;As "_uFMOD_GetRowOrder@0"

; The uFMOD_GetTime function returns the time in milliseconds since the
; song was started. This is useful for synchronizing purposes.
; --------------
; unsigned int uFMOD_GetTime();
; Return Values:
;    Returns the time in milliseconds since the song was started
  uFMOD_GetTime() ;As "_uFMOD_GetTime@0"
EndImport

#XM_RESOURCE = 0
#XM_MEMORY = 1
#XM_FILE = 2
:wink:

nb: si vous voulez convertir des mod en xm, un petit utilitaire en ligne de commande ICI

Publié : ven. 19/mai/2006 19:54
par Quantum
I don't speak French. Excuse me.

Latest uFMOD public release supports PureBasic v3.50 or later on both Win32 and Linux.

2 flaith:
I' d like to include your "petit player XM" in the next release, if you don't mind. It whould take about a month or so to gather enough new features for a new release.

2 KarLKoX:
miniFMOD isn't better ;) It has some critical bugs and is twice as big as uFMOD. It doesn't even support DirectSound. Well, I guess uFMOD is a lot better!

Publié : ven. 19/mai/2006 20:20
par KarLKoX
High Quantum, nice to see here :)
This is exactly what i said : uFMOD is far better than miniFMOD, the translators can't retrieve some grammatical details of our language :)

Publié : ven. 19/mai/2006 20:51
par Quantum
Sorry for my mistake. Babelfish and prompt both gave me the wrong interpretation. Gotta learn French. Chances are I'll move to Paris for the following couple of years.

Publié : ven. 19/mai/2006 20:52
par flaith
Quantum a écrit : 2 flaith:
I' d like to include your "petit player XM" in the next release, if you don't mind. It whould take about a month or so to gather enough new features for a new release.
Hi Quantum, no problemo, make yourself at home :wink:

Publié : jeu. 22/juin/2006 1:59
par Quantum
v1.16 released

Win32 changelog:
http://sourceforge.net/project/shownote ... _id=158498

Linux/BSD changelog:
http://sourceforge.net/project/shownote ... _id=158498

2 flaith:
A GUI XM player added based on your example. Merci!

Publié : jeu. 22/juin/2006 8:19
par flaith
Thanks to you, nice and great released :D

Publié : ven. 14/juil./2006 19:34
par flaith