protected virtual void OnSoundFinished() { Finished = true; playingAsync = false; SoundFinished?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Starts the current sound with the specified start flags /// and sets the callback that is called when the current sound stops. /// </summary> /// <param name="startFlags">Specific flags used to start the sound.</param> /// <param name="finishedCallback">The delegate that will be called /// when the current sound stops playing.</param> /// <returns>true if the sound was successfully started; /// false otherwise</returns> /// <remarks> /// The <see cref="T:Sims3.SimIFace.Sound.SoundFinished"/> instance /// given to this function will be kept in the scope of this class /// and prevented from being garbaged collect until it has been called /// by the unmanaged game engine, in order to prevent an access violation. /// </remarks> public bool Start(SoundStartFlags startFlags, SoundFinished finishedCallback) { return(this.Start((uint)startFlags, finishedCallback)); }