Pause() 공개 메소드

Pauses playback of a SoundEffectInstance.
Paused instances can be resumed with SoundEffectInstance.Play() or SoundEffectInstance.Resume().
public Pause ( ) : void
리턴 void
예제 #1
0
 public override void Pause()
 {
     if (_wav != null)
     {
         _wav.Pause();
     }
 }
예제 #2
0
 public void Pause()
 {
     if (complexSound)
     {
         foreach (XactClip clip in soundClips)
         {
             clip.Pause();
         }
     }
     else
     {
         wave.Pause();
     }
 }
예제 #3
0
파일: Flyer.cs 프로젝트: GarethIW/LD29
        public Flyer(Texture2D spritesheet, Rectangle hitbox, List<Vector2> hitPolyPoints, Vector2 hitboxoffset)
            : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset)
        {
            _idleAnim = new SpriteAnim(spritesheet, 0, 1, 16, 16, 100, new Vector2(8, 8), false, false, 0);
            _idleAnim.Pause();
            _hitAnim = new SpriteAnim(spritesheet, 6, 1, 16, 16, 100, new Vector2(8, 8), false, false, _idleAnim.CurrentFrame);
            _hitAnim.Pause();

            _faceDir = Helper.Random.Next(2) == 0 ? -1 : 1;

            gunLoop = AudioController.CreateInstance("minigun");
            gunLoop.IsLooped = true;
            gunLoop.Volume = 0f;
            gunLoop.Play();
            gunLoop.Pause();
        }
예제 #4
0
파일: Turret.cs 프로젝트: GarethIW/LD29
        public Turret(Texture2D spritesheet, Rectangle hitbox, List<Vector2> hitPolyPoints, Vector2 hitboxoffset)
            : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset)
        {
            _idleAnim = new SpriteAnim(spritesheet, 4, 2, 16, 16, 200, new Vector2(8, 8), true, false, 0);
            _idleAnim.Play();
            _hitAnim = new SpriteAnim(spritesheet, 10, 2, 16, 16, 200, new Vector2(8, 8), true, false, _idleAnim.CurrentFrame);
            _hitAnim.Play();

            gunLoop = AudioController.CreateInstance("minigun");
            gunLoop.IsLooped = true;
            gunLoop.Volume = 0f;
            gunLoop.Play();
            gunLoop.Pause();

            Speed.X = Helper.Random.Next(2) == 0 ? -0.1f : 0.1f;
        }
예제 #5
0
파일: Boss.cs 프로젝트: GarethIW/LD29
        public Boss(Texture2D spritesheet, Rectangle hitbox, List<Vector2> hitPolyPoints, Vector2 hitboxoffset)
            : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset)
        {
            _idleAnim = new SpriteAnim(spritesheet, 0, 1, 32, 32, 0, new Vector2(16,16));
            _hitAnim = new SpriteAnim(spritesheet, 5, 1, 32, 32, 0, new Vector2(16, 16));

            _headGobAnim = new SpriteAnim(spritesheet, 1, 2, 32, 32, 0, new Vector2(16, 16));
            _headGobAnimHit = new SpriteAnim(spritesheet, 6, 2, 32, 32, 0, new Vector2(16, 16));
            _headEyeAnim = new SpriteAnim(spritesheet, 2, 6, 32, 32, 0, new Vector2(16, 16));
            _headEyeAnimHit = new SpriteAnim(spritesheet, 7, 6, 32, 32, 0, new Vector2(16, 16));
            _bodyAnim = new SpriteAnim(spritesheet, 3, 1, 32, 32, 0, new Vector2(16, 16));
            _bodyAnimHit = new SpriteAnim(spritesheet, 8, 1, 32, 32, 0, new Vector2(16, 16));
            _tailAnim = new SpriteAnim(spritesheet, 4, 1, 32, 32, 0, new Vector2(16, 16));
            _tailAnimHit = new SpriteAnim(spritesheet, 9, 1, 32, 32, 0, new Vector2(16, 16));

            laughLoop = AudioController.CreateInstance("boss");
            laughLoop.Volume = 0f;
            laughLoop.Pause();
        }
예제 #6
0
 public void Pause()
 {
     if (_complexSound)
     {
         foreach (var sound in _soundClips)
         {
             if (sound.State == SoundState.Playing)
             {
                 sound.Pause();
             }
         }
     }
     else
     {
         if (_wave != null && _wave.State == SoundState.Playing)
         {
             _wave.Pause();
         }
     }
 }
예제 #7
0
파일: Ship.cs 프로젝트: GarethIW/LD29
        public Ship(Texture2D spritesheet, Rectangle hitbox, List<Vector2> hitPolyPoints, Vector2 hitboxoffset)
            : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset)
        {
            Instance = this;

            engineLoop = AudioController.CreateInstance("boost");
            engineLoop.Volume = 0f;
            engineLoop.IsLooped = true;
            engineLoop.Play();
            engineLoop.Pause();
            engineLoop.Volume = 0.3f;
            gunLoop = AudioController.CreateInstance("minigun");
            gunLoop.IsLooped = true;
            gunLoop.Volume = 0f;
            gunLoop.Play();
            gunLoop.Pause();
            gunLoop.Volume = 0.3f;
            hitLoop = AudioController.CreateInstance("shiphit");
            hitLoop.IsLooped = false;
            hitLoop.Volume = 1f;

            _idleAnim = new SpriteAnim(spritesheet, 0, 1, 16, 16, 100, new Vector2(8, 8));
            _idleAnim.Play();
            _upAnim = new SpriteAnim(spritesheet, 1, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0);
            _upAnim.Pause();
            _downAnim = new SpriteAnim(spritesheet, 2, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0);
            _downAnim.Pause();

            _idleHitAnim = new SpriteAnim(spritesheet, 3, 1, 16, 16, 100, new Vector2(8, 8));
            _idleHitAnim.Play();
            _upHitAnim = new SpriteAnim(spritesheet, 4, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0);
            _upHitAnim.Pause();
            _downHitAnim = new SpriteAnim(spritesheet, 5, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0);
            _downHitAnim.Pause();

            Active = true;
        }
예제 #8
0
 public bool updateState(KeyboardState State, KeyboardState oldState, ref bool songPlaying, ref SoundEffectInstance song) {
     if (gameState == "Playing" && State.IsKeyDown(Keys.Escape) && oldState.IsKeyUp(Keys.Escape)) {
         try {
             song.Pause();
             gameState = "Paused";
             CheckGameState();
         } catch (GameStateNotFoundException e) {
             Console.WriteLine(e.ToString());
             gameState = "";
         }
         return false;
     } else if (gameState == "Paused") {
         if (State.IsKeyDown(Keys.Escape) && oldState.IsKeyUp(Keys.Escape)) {
             try {
                 song.Resume();
                 gameState = "Playing";
                 CheckGameState();
             } catch (GameStateNotFoundException e) {
                 Console.WriteLine(e.ToString());
                 gameState = "";
             }
         }
         return false;
     }
     if (gameState == "Loading" && isLoading) {
         isLoading = true;
         return true;
     }
     return false;
 }
예제 #9
0
 public override void Pause()
 {
     wave.Pause();
 }
예제 #10
0
파일: Player.cs 프로젝트: timfel/dash
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(Game.GraphicsDevice);

            sprites.Add("run-1", new Frame(new Microsoft.Xna.Framework.Rectangle(0, 0, 200, 230), Game.Content.Load<Texture2D>("Dash-1")));
            sprites.Add("run-2", new Frame(new Microsoft.Xna.Framework.Rectangle(0, 0, 200, 230), Game.Content.Load<Texture2D>("Dash-2")));
            sprites.Add("run-3", new Frame(new Microsoft.Xna.Framework.Rectangle(0, 0, 200, 230), Game.Content.Load<Texture2D>("Dash-3")));

            sprites.Add("duck-1", new Frame(new Microsoft.Xna.Framework.Rectangle(0, 0, 200, 230), Game.Content.Load<Texture2D>("Dash-Slide-1")));
            sprites.Add("duck-2", new Frame(new Microsoft.Xna.Framework.Rectangle(0, 0, 200, 230), Game.Content.Load<Texture2D>("Dash-Slide-2")));

            sprites.Add("jump-1", new Frame(new Microsoft.Xna.Framework.Rectangle(0, 0, 200, 230), Game.Content.Load<Texture2D>("Dash-Jump-1")));
            sprites.Add("jump-2", new Frame(new Microsoft.Xna.Framework.Rectangle(0, 0, 200, 230), Game.Content.Load<Texture2D>("Dash-Jump-2")));

            sprites.Add("broom", new Frame(new Microsoft.Xna.Framework.Rectangle(0, 0, 300, 77), Game.Content.Load<Texture2D>("Besen")));

            sprites.Add("buttons", new Frame(new Microsoft.Xna.Framework.Rectangle(0, 0, 800, 480), Game.Content.Load<Texture2D>("Buttons")));

            sprites.Add("poof", new Frame(new Microsoft.Xna.Framework.Rectangle(0, 0, 200, 200), Game.Content.Load<Texture2D>("poof")));

            defaultAnimation.Add(sprites["run-1"].Copy());
            defaultAnimation.Add(sprites["run-2"].Copy());
            defaultAnimation.Add(sprites["run-3"].Copy());

            jumpAnimation.Add(sprites["jump-2"].Copy(0, -50));
            jumpAnimation.Add(sprites["jump-1"].Copy(0, -100));
            jumpAnimation.Add(sprites["jump-1"].Copy(0, -100));
            jumpAnimation.Add(sprites["jump-1"].Copy(0, -100));
            jumpAnimation.Add(sprites["jump-1"].Copy(0, -100));
            jumpAnimation.Add(sprites["jump-1"].Copy(0, -100));
            jumpAnimation.Add(sprites["jump-2"].Copy(0, -50));

            duckAnimation.Add(sprites["duck-1"].Copy());
            duckAnimation.Add(sprites["duck-2"].Copy());
            duckAnimation.Add(sprites["duck-1"].Copy());
            duckAnimation.Add(sprites["duck-2"].Copy());

            int flyOffset = -25;
            flyAnimation.Add(sprites["poof"].Copy(0, flyOffset + 50));
            flyAnimation.Add(sprites["broom"].Copy(0, flyOffset));
            flyAnimation.Add(sprites["broom"].Copy(0, flyOffset));
            flyAnimation.Add(sprites["broom"].Copy(0, flyOffset));
            flyAnimation.Add(sprites["broom"].Copy(0, flyOffset));
            flyAnimation.Add(sprites["broom"].Copy(0, flyOffset));
            flyAnimation.Add(sprites["poof"].Copy(0, flyOffset + 50));

            pos.X = 50;
            pos.Y = 370;

            gallopSound = sound.Loop("gallop");
            gallopSound.Volume = 1.0f;
            gallopSound.Pause();

            base.LoadContent();
        }
        public void PauseSoundEffect(string soundEffectName)
        {
            soundEffect = gestionnaireDeSoundEffect.Find(soundEffectName);
            if (!(listeSound.Contains(soundEffectName)))
            {
                listeSound.Add(soundEffectName);
                soundEffectInstanceList.Add(soundEffect.CreateInstance());
            }
            for (int i = 0; i < listeSound.Count; ++i)
            {
                test = string.Compare(listeSound[i], soundEffectName) == 0;
                if (test)
                {
                    index = i;
                    break;
                }

            }
            test = false;
            soundEffectInstance = soundEffectInstanceList[index];
            soundEffectInstance.Pause();
        }
예제 #12
0
        public void Initialize()
        {
            if (_engineOnLow != null)
            {
                return;
            }

            _isActive = true;

            SoundEffect temp;
            temp = Engine.Instance.ContentManager.Load<SoundEffect>(String.Format(BasePath + "/Vehicles/{0}/engine-on-low", _car.Descriptor.Name));
            _engineOnLow = temp.CreateInstance();
            //.Play(0.3f, 0, 0);
            temp = Engine.Instance.ContentManager.Load<SoundEffect>(String.Format(BasePath + "/Vehicles/{0}/engine-on-high", _car.Descriptor.Name));
            _engineOnHigh = temp.CreateInstance(); // temp.Play(0.3f, 0, 0);
            temp = Engine.Instance.ContentManager.Load<SoundEffect>(String.Format(BasePath + "/Vehicles/{0}/engine-off-low", _car.Descriptor.Name));
            _engineOffLow = temp.CreateInstance(); //temp.Play(0.3f, 0, 0);
            temp = Engine.Instance.ContentManager.Load<SoundEffect>(String.Format(BasePath + "/Vehicles/{0}/engine-off-high", _car.Descriptor.Name));
            _engineOffHigh = temp.CreateInstance(); //temp.Play(0.3f, 0, 0);

            temp = Engine.Instance.ContentManager.Load<SoundEffect>(BasePath + "/Vehicles/common/grass_slide");
            _offRoadInstance = temp.CreateInstance(); //temp.Play(0.3f, 0, 0, true);
            _offRoadInstance.Pause();

            _skids.Add(Engine.Instance.ContentManager.Load<SoundEffect>(BasePath + "/Vehicles/common/skid1"));
            _skids.Add(Engine.Instance.ContentManager.Load<SoundEffect>(BasePath + "/Vehicles/common/skid2"));
            _skids.Add(Engine.Instance.ContentManager.Load<SoundEffect>(BasePath + "/Vehicles/common/skid3"));

            _engineOnLow.Pause();
            _engineOnHigh.Pause();
            _engineOffLow.Pause();
            _engineOffHigh.Pause();

            _gearChange = Engine.Instance.ContentManager.Load<SoundEffect>(String.Format(BasePath + "/Vehicles/{0}/gear-change", _car.Descriptor.Name));
        }