|
-
Apr 20th, 2000, 07:43 PM
#1
Thread Starter
Frenzied Member
Hey guys,
I copied this code from MS's website to play a midi in the background:
Public gObjDX As New DirectX7
Public gObjDMLoader As DirectMusicLoader
Public gObjDMPerformance As DirectMusicPerformance
Dim objSegState As DirectMusicSegmentState
Dim objSeg As DirectMusicSegment
Set gObjDMLoader = gObjDX.DirectMusicLoaderCreate
Set gObjDMPerformance = gObjDX.DirectMusicPerformanceCreate
Call gObjDMPerformance.Init(Nothing, hWnd)
Call gObjDMPerformance.SetPort(-1, 1)
strMIDI = CurDir & "\Directory\music.mid"
Set objSeg = gObjDMLoader.LoadSegment(strMIDI)
Call gObjDMPerformance.SetMasterAutoDownload(True)
Call objSeg.Download(gObjDMPerformance)
Call gObjDMPerformance.PlaySegment(objSeg, 0, 0)
'Set objSegState = gObjDMPerformance.PlaySegment(gObjPrimarySeg, 0, 0)
SO what is the command to stop the music? Does anybody know this one?
-
Apr 21st, 2000, 02:18 AM
#2
Hyperactive Member
indeed:
DirectMusicPerformance.Stop
parameters:
segment - the segment to stop
segmentstate - the segment state of the above segment (you dont need this)
time - when to stop, set to 0 for immediately
flags - set to 0 probably (the other values are a bit obscure, you wont need them).
buzzwords are the language of fools
-
Apr 21st, 2000, 09:12 AM
#3
Thread Starter
Frenzied Member
Segment
Sorry Kenny, but one last question.....
which is the segment to stop:
objSeg
strMIDI
?
I haven't gottten either one to work..
-
Apr 21st, 2000, 07:41 PM
#4
Hyperactive Member
the segment object!
eg
Call DmPer.Stop(segment, nothing, 0, 0)
that should work.
buzzwords are the language of fools
-
Apr 21st, 2000, 11:40 PM
#5
Thread Starter
Frenzied Member
got it, thanks
Right.
I got that this afternoon.
I guess I should have spent more time trying to figure it out myself before posting
The part I was missing was the 2nd one (nothing). So my game is pretty much complete.
Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|