private static FMOD.RESULT ChannelCallbackMethod(IntPtr channelRaw, FMOD.CHANNEL_CALLBACKTYPE type, IntPtr cmdData1, IntPtr cmdData2) { FMODChannel channel = FMODManager.Instance.GetSoundChannel(channelRaw.ToInt32()); switch (type) { case FMOD.CHANNEL_CALLBACKTYPE.END: if (channel.SoundEnds != null) { channel.SoundEnds(channel, null); } FMODManager.Instance.RemoveChannelMapping(channelRaw.ToInt32()); break; case FMOD.CHANNEL_CALLBACKTYPE.VIRTUALVOICE: if (channel.GoesVirtual != null) { channel.GoesVirtual(channel, null); } break; default: throw new NotImplementedException(); } return(FMOD.RESULT.OK); }
private FMOD.RESULT endPlayCallbackFunction(IntPtr channelRaw, FMOD.CHANNEL_CALLBACKTYPE tipo, int comando, uint datoComando1, uint datoComando2) { lock (sequentialPlayList) { if (sequentialPlayList.Count == 0) { return(FMOD.RESULT.ERR_INVALID_PARAM); } sequentialPlayList.RemoveAt(0); try { if (sequentialPlayList.Count != 0) { if (invoker.InvokeRequired) { invoker.Invoke(new PlaySoundEventHandler(PlaySoundCallback), new object[] { houses[this.houseId][(short)this.sequentialPlayList[0]] }); } else { PlaySoundCallback(houses[this.houseId][(short)this.sequentialPlayList[0]]); } } } catch { return(FMOD.RESULT.ERR_INITIALIZATION); } return(FMOD.RESULT.OK); } }
private RESULT OnEndMusic(IntPtr channelraw, FMOD.CHANNEL_CALLBACKTYPE type, int command, uint commanddata1, uint commanddata2) { Channel = null;// en premier pour ne pas avoir erreur lors d'un MessageBox :) ; cas particulier if (EndMusic != null) { EndMusic(currentPath, new EventArgs()); } return(RESULT.OK); }
protected FMOD.RESULT soundEndCallback(IntPtr channelraw, FMOD.CHANNEL_CALLBACKTYPE type, int command, uint commanddata1, uint commanddata2) { // Is this really an error? Seems like info or even debug to me log.Debug("sound end callback called"); done = true; OnSoundDone(); return(FMOD.RESULT.OK); }
public static FMOD.RESULT channel_callback(IntPtr channelraw, FMOD.CHANNEL_CALLBACKTYPE type, IntPtr commanddata1, IntPtr commanddata2) { if (type == FMOD.CHANNEL_CALLBACKTYPE.END) { if (channel.getRaw() == channelraw) { sound.release(); channel = null; } } return(0); }
private FMOD.RESULT endPlayCallbackFunction(IntPtr channelRaw, FMOD.CHANNEL_CALLBACKTYPE tipo, int comando, uint datoComando1, uint datoComando2) { lock (syncMusicCallback) { InfoLog.WriteInfo(DateTime.Now.ToString() + " [ Before Fire music end event, Manual music end: " + manualMusicEnd, EPrefix.AudioEngine); if (MusicEnd != null && !manualMusicEnd) { MusicEnd(this, new MusicEndEventArgs(musicType)); InfoLog.WriteInfo(DateTime.Now.ToString() + " ] After Fire music end event", EPrefix.AudioEngine); } manualMusicEnd = false; return(FMOD.RESULT.OK); } }