0
0

Hello! C# User here!
I just want to know the easiest way of knowing when an event has finnished playing. As i see it, the Event.getState() doesn’t provide such a state?
The reason why I want to do this is because I’m storing all events that are active and playing in an array (to be able to apply parameters and get references to them), but when they are stopped, I remove them from the list. here is How I’m currently doing it:

[code:1wmsnx07]
ChannelGroup cg = new ChannelGroup();
tempsound.eventA.getChannelGroup(ref cg);
Channel c = new Channel();
cg.getChannel(0, ref c);
bool lol = false;

            c.isPlaying(ref lol);
            if (!lol)
            {
                try
                {
                        eventList.Remove(tempName);
                        NUMEVENTS = eventList.Count;
                }
                catch (Exception e)
                {
                    //System.Diagnostics.Trace.WriteLine(e.Data);
                }
                return;
            }[/code:1wmsnx07]

I think this looks way too complicated.. I tried an approach with Event.getState() too, it lookedl ike this, but didn’t work at all:

[code:1wmsnx07]
EVENT_STATE states = EVENT_STATE.READY;
tempsound.eventA.getState(ref states);

            if (states != EVENT_STATE.PLAYING && states != EVENT_STATE.CHANNELSACTIVE)
            {
                try
                {
                        eventList.Remove(tempName);
                        NUMEVENTS = eventList.Count;
                }
                catch (Exception e)
                {
                    //System.Diagnostics.Trace.WriteLine(e.Data);
                }
                return;
            }[/code:1wmsnx07]
  • You must to post comments
0
0

Have you tried just with channels active?

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.