示例#1
0
        // Event inherited from SoundStopEvent interface
        void SoundStopEvent.OnSoundStopped(Sound sound, StopEventCause reason, object userData)
        {
            /*if (this.owner.InvokeRequired)
             * {
             *  this.owner.Invoke(new MethodInvoker(delegate
             *  {*/
            // called when the sound has ended playing
            switch (reason)
            {
            case StopEventCause.SoundFinishedPlaying:
                // The sound finished playing.
                //this.CurrentTrack = this.CurrentTrack.Next;
                SongEnded = true;
                //this.PlayTrack();
                break;

            case StopEventCause.SoundStoppedBySourceRemoval:
                // The sound was stopped because its sound source was removed or the engine was shut down
                //this.CurrentTrack = this.CurrentTrack.Next;
                //this.PlayTrack();
                break;

            case StopEventCause.SoundStoppedByUser:
                // The sound was stopped because the user called ISound::stop().
                // So we do nothing
                break;

            default:
                // herp derp, this should not happen..
                // TODO: Log to error file, try to play next track if available
                Program.LogWrite("PlayControl::SoundStopEvent.OnSoundStopped(): Invalid reason => " + reason.ToString());
                break;
            }

            /*    }));
             * }*/
        }
示例#2
0
 public SoundWrapper(Sound sound)
 {
     this.sound = sound;
 }