[MUSIC]-[PB4]-[ uFMOD ]

Programmation d'applications complexes
Avatar de l’utilisateur
flaith
Messages : 1487
Inscription : jeu. 07/avr./2005 1:06
Localisation : Rennes
Contact :

[MUSIC]-[PB4]-[ uFMOD ]

Message par flaith »

Super light FMOD
site : ICI

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

:wink:
wolfjeremy
Messages : 1202
Inscription : sam. 31/déc./2005 23:52

Message par wolfjeremy »

Rien capter lol tu pourrais expliquer un peu le but du truc ? :?

Merci.
Avatar de l’utilisateur
flaith
Messages : 1487
Inscription : jeu. 07/avr./2005 1:06
Localisation : Rennes
Contact :

Message par flaith »

C'est une lib FMOD permettant de jouer des fichiers XM ultra léger, t'as pas testé ?
KarLKoX
Messages : 1191
Inscription : jeu. 26/févr./2004 15:36
Localisation : France
Contact :

Message par KarLKoX »

Excellent ! #good
"Qui baise trop bouffe un poil." P. Desproges
garzul
Messages : 683
Inscription : mer. 26/mai/2004 0:33

Message par garzul »

ah, génial ça ! (mini FMOD en gros ? :))
KarLKoX
Messages : 1191
Inscription : jeu. 26/févr./2004 15:36
Localisation : France
Contact :

Message par KarLKoX »

miniFMOD en mieux :!:
"Qui baise trop bouffe un poil." P. Desproges
garzul
Messages : 683
Inscription : mer. 26/mai/2004 0:33

Message 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
Avatar de l’utilisateur
flaith
Messages : 1487
Inscription : jeu. 07/avr./2005 1:06
Localisation : Rennes
Contact :

Message 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
Quantum
Messages : 3
Inscription : ven. 19/mai/2006 5:17
Contact :

Message 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!
KarLKoX
Messages : 1191
Inscription : jeu. 26/févr./2004 15:36
Localisation : France
Contact :

Message 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 :)
"Qui baise trop bouffe un poil." P. Desproges
Quantum
Messages : 3
Inscription : ven. 19/mai/2006 5:17
Contact :

Message 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.
Avatar de l’utilisateur
flaith
Messages : 1487
Inscription : jeu. 07/avr./2005 1:06
Localisation : Rennes
Contact :

Message 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:
Quantum
Messages : 3
Inscription : ven. 19/mai/2006 5:17
Contact :

Message 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!
Avatar de l’utilisateur
flaith
Messages : 1487
Inscription : jeu. 07/avr./2005 1:06
Localisation : Rennes
Contact :

Message par flaith »

Thanks to you, nice and great released :D
Avatar de l’utilisateur
flaith
Messages : 1487
Inscription : jeu. 07/avr./2005 1:06
Localisation : Rennes
Contact :

Message par flaith »

Répondre