Please how end wave-playing detect ? Similar OnExit ops: . Thanks
Please how end wave-playing detect ? Similar OnExit ops: . Thanks
Ijcro.
I was not able to find a way of doing it so I just make a sound object that knows when it started and how long the sound is. When the time is up it triggers an event.
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
And how hooked the sound buffer when is cleared/destroyed ? It is possible way ? DelphiX hasn't encapsulated it well
Ijcro.
My object was seperate from the buffer.
Here is an example fo what I mean typed straight into the editor so possible errors in syntax and class names.
[pascal]TSoundMonitor = Class
Sound : TDXWAVCollectionItem;
StartTime : Cardinal;
SoundLength : Cardinal;
OnEnd : TNotifyEvent;
Procedure Play;
Procedure Check;
End;
Procedure TSoundMonitor.Play;
Begin
StartTime := GetTickCount;
Sound.Play;
End;
Procedure TSoundMonitor.Check;
Begin
If GetTickCount-StartTime > SoundLength then
If Assigned(OnEnd) then
OnEnd(Self);
End;
--------------------
Procedure TForm1.Timer1Time(Sender : TObject);
Begin
// Draw Screen
For I := 0 to SoundItems.Count-1 do
TSoundMonitor(SoundItems[I]).Check;
End;
Procedure TForm1.PlaySound(NewSound : TDXWAVCollectionItem; NewSoundLength : Cardinal);
Begin
Sound := TSoundMonitor.Create;
Sound.Sound := NewSound;
Sound.SoundLength := NewSoundLength;
Sound.Play;
End;[/pascal]
Hope that makes it more clear.
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
Take a look at DSPack components. It capsulates all the DirectShow stuff in components. And it also has events when files end.
http://sourceforge.net/projects/dspack
Greetings,
Dirk
<a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>
Bookmarks