Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new J-Jax cue.
        /// </summary>
        /// <param name="info">The info file for the J-Jax Cue.</param>
        /// <param name="position">The position from where the sound will be played from.</param>
        public JJaxCue(CueInfo info, Vector3 position)
        {
            if (info != null)
            {
                this.name   = info.Name;
                this.volume = info.Volume;
                this.loop   = info.Loop;

                is3DPlaying = true;

                song = (Common.ContentManager.Load
                        <SoundEffect>(info.Filepath)).CreateInstance();

                AudioListener listner = AudioManager.listener;

                emitter          = new AudioEmitter();
                emitter.Position = position;

                song.Apply3D(listner, emitter);

                song.Volume   = volume;
                song.IsLooped = loop;
            }
            else
            {
                throw new ArgumentNullException("The given JSongInfo is null.");
            }

            currentState = MediaStates.Paused;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new J-Jax cue.
        /// </summary>
        /// <param name="info">The info file for the J-Jax Cue.</param>
        public JJaxCue(CueInfo info)
        {
            if (info != null)
            {
                this.name   = info.Name;
                this.volume = info.Volume;
                this.loop   = info.Loop;

                song = (Common.ContentManager.Load
                        <SoundEffect>(info.Filepath)).CreateInstance();

                song.Volume   = volume;
                song.IsLooped = loop;
            }
            else
            {
                throw new ArgumentNullException("The given JSongInfo is null.");
            }

            currentState = MediaStates.Paused;
        }