Results 1 to 5 of 5

Thread: How end wave-playing detect ?

  1. #1

    How end wave-playing detect ?

    Please how end wave-playing detect ? Similar OnExit ops: . Thanks
    Ijcro.

  2. #2
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    How end wave-playing detect ?

    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)

  3. #3

    How end wave-playing detect ?

    And how hooked the sound buffer when is cleared/destroyed ? It is possible way ? DelphiX hasn't encapsulated it well
    Ijcro.

  4. #4
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    How end wave-playing detect ?

    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)

  5. #5

    How end wave-playing detect ?

    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&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •