Пример #1
0
        public override void Notify()
        {
            Debug.WriteLine(" Snd_Observer: {0} {1}", this.pSubject.pObjA, this.pSubject.pObjB);

            pSndEngine.SoundVolume = 0.2f;
            IrrKlang.ISound pSnd = pSndEngine.Play2D("fastinvader1.wav");
        }
Пример #2
0
 public void setFirst(string mupath, bool isGoing)
 {
     if (isGoing)
         Stop();
     curMusic = player.Play2D(mupath);
     Stop();
 }
Пример #3
0
        public override void Notify()
        {
            //Debug.WriteLine(" Sound_Observer: {0} {1}", this.pSubject.pObjA, this.pSubject.pObjB);

            pSndEngine.SoundVolume = 0.2f;
            IrrKlang.ISound pSnd = pSndEngine.Play2D(this.pSndName);
        }
Пример #4
0
 public override void execute(float deltaTime)
 {
     IrrKlang.ISound music = null;
     //MoveGrid
     grid.moveGrid();
     //Play Sound
     if (count == 0)
     {
         music = soundEngine.Play2D("fastinvader4.wav");
         count++;
     }
     else if (count == 1)
     {
         music = soundEngine.Play2D("fastinvader3.wav");
         count++;
     }
     else if (count == 2)
     {
         music = soundEngine.Play2D("fastinvader2.wav");
         count++;
     }
     else if (count == 3)
     {
         music = soundEngine.Play2D("fastinvader1.wav");
         count = 0;
     }
     music.Volume = 0.2f;
     TimerManager.sortedAdd(TimerEvent.TimerEventName.SpriteAnimation, this, Unit.AlienGridMoveEventTime);
 }
Пример #5
0
 public IrrklangSound(IrrKlang.ISound sound)
 {
     if (sound == null)
     {
         throw new ArgumentNullException("sound");
     }
     this.sound = sound;
 }
Пример #6
0
 //----------------------------------------------------------------------------------
 // Play It
 //----------------------------------------------------------------------------------
 public void Play(float volInput = 0.2f)
 {
     IrrKlang.ISound music = engine.Play2D(this.source, false, false, false);
     if (music != null)
     {
         music.Volume = volInput;
     }
 }
Пример #7
0
 public override void execute(float deltaTime)
 {
     IrrKlang.ISoundEngine soundEngine = FactoryManager.getSoundEngine();
     if (ufo.launch)
     {
         IrrKlang.ISound music = soundEngine.Play2D("ufo_lowpitch.wav");
         music.Volume = 0.2f;
         TimerManager.sortedAdd(TimerEvent.TimerEventName.UFOPlaySound, this, 2.2f);
     }
 }
        public override void Execute(float deltaTime)
        {
            String pCurrSound;

            // Select sound
            switch (currSoundIndex)
            {
            case 0:
                pCurrSound = pFastInvader1;
                break;

            case 1:
                pCurrSound = pFastInvader2;
                break;

            case 2:
                pCurrSound = pFastInvader3;
                break;

            case 3:
                pCurrSound = pFastInvader4;
                break;

            default:
                // something is wrong
                Debug.Assert(false);
                pCurrSound = "";
                break;
            }

            // Play current sound
            IrrKlang.ISound pSnd = SoundEngineManager.GetSoundEngine().Play2D(pCurrSound);

            // Increment sound index
            if (currSoundIndex == 3)
            {
                this.currSoundIndex = 0;
            }
            else
            {
                this.currSoundIndex += 1;
            }

            // If there is still at least one alien
            if (GameStateManager.GetGame().GetStateCompositeManager().Find(Composite.CompositeName.AlienGrid).GetFirstChild() != null)
            {
                Debug.Print("Adding GridMovementSound ({0}) back to timer - Delta: {1}", this.GetHashCode(), GameStateManager.GetGame().GetStateAlienGridSpeed());

                // Add itself back to timer
                TimerManager.Add(TimeEvent.Name.AlienGridMovementSound, this, GameStateManager.GetGame().GetStateAlienGridSpeed());
            }
        }
Пример #9
0
        void timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            string        prefix = @"./Content/SampleBMS/";
            List <string> temp   = 시간들[timeflag];

            for (int i = 0; i < temp.Count; i++)
            {
                Debug.WriteLine("B: T={0}, i={1}, C={2}", timeflag, i, temp.Count);
                재생중음원 = 사운드엔진.Play2D(prefix + temp[i], false);
                Debug.WriteLine("A: T={0}, i={1}, C={2}", timeflag, i, temp.Count);
            }
            timeflag++;
        }
Пример #10
0
        public override void ShootMissile(CoreCannon pShip)
        {
            // Activate and position missile
            Missile pMissile = GameStateManager.GetGame().GetStateCoreCannonManager().ActivateMissile();

            pMissile.SetPos(pShip.GetX(), pShip.GetY() + 20);
            pMissile.SetActive(true);

            // Play shoot sound
            IrrKlang.ISound pSnd = SoundEngineManager.GetSoundEngine().Play2D("shoot.wav");

            // switch states
            this.Handle(pShip);
        }
Пример #11
0
        //-----------------------------------------------------------------------------
        // Game::LoadContent()
        //		Allows you to load all content needed for your engine,
        //	    such as objects, graphics, etc.
        //-----------------------------------------------------------------------------
        public override void LoadContent()
        {
            //---------------------------------------------------------------------------------------------------------
            // Audio
            //---------------------------------------------------------------------------------------------------------

            // Create the Audio Engine
            AudioEngine = new IrrKlang.ISoundEngine();

            // Play a sound file
            music        = AudioEngine.Play2D("theme.wav", true);
            music.Volume = 0.2f;

            // Resident loads
            srcShoot = AudioEngine.AddSoundSourceFromFile("shoot.wav");
            sndShoot = AudioEngine.Play2D(srcShoot, false, false, false);
            sndShoot.Stop();

            //---------------------------------------------------------------------------------------------------------
            // Setup Font
            //---------------------------------------------------------------------------------------------------------

            // Font - texture
            pFont = new Azul.Texture("consolas20pt.tga");
            Debug.Assert(pFont != null);

            GlyphMan.AddXml("Consolas20pt.xml", pFont);

            //---------------------------------------------------------------------------------------------------------
            // Load the Textures
            //---------------------------------------------------------------------------------------------------------

            // Red bird texture
            pText = new Azul.Texture("unsorted.tga");
            Debug.Assert(pText != null);

            //---------------------------------------------------------------------------------------------------------
            // Create Sprites
            //---------------------------------------------------------------------------------------------------------

            pRedBird = new Azul.Sprite(pText, new Azul.Rect(903.0f, 797.0f, 46.0f, 46.0f), new Azul.Rect(300.0f, 100.0f, 30.0f, 30.0f));
            Debug.Assert(pRedBird != null);

            //---------------------------------------------------------------------------------------------------------
            // Demo variables
            //---------------------------------------------------------------------------------------------------------

            stats = new GameStats();
        }
Пример #12
0
        public static IrrKlang.ISound PlaySound(Sound.Name name, bool loop = false)
        {
            Sound pSound = Find(name);

            Debug.Assert(pSound != null);

            SoundManager pMan = SoundManager.PrivGetInstance();

            Debug.Assert(pMan != null);
            Debug.Assert(pMan.poSndEngine != null);

            IrrKlang.ISound hardwareSound = pMan.poSndEngine.Play2D(pSound.GetSound(), loop, false, false);

            return(hardwareSound);
        }
Пример #13
0
        public static void PlaySound(Sound.Name name, float volume = 1.0f)
        {
            Debug.Assert(name != Sound.Name.Uninitialized);
            SoundMan sMan  = SoundMan.privGetInstance();
            Sound    pHead = (Sound)sMan.pActive;

            while (pHead != null)
            {
                if (pHead.name == name)
                {
                    IrrKlang.ISound sound = sMan.engine.Play2D(pHead.source, false, false, false);
                }

                pHead = (Sound)pHead.pNext;
            }
        }
Пример #14
0
        public override void shoot(CannonShip ship)
        {
            // Debug.WriteLine("ShipReadyState shoot");
            StraightMissile missile = ShipManager.activateMissile();

            Debug.Assert(missile != null);

            missile.x = ship.x;
            missile.y = ship.y;
            missile.launchMissile();

            IrrKlang.ISoundEngine sndEngine = FactoryManager.getSoundEngine();
            IrrKlang.ISound       music     = sndEngine.Play2D("shoot.wav");
            music.Volume = 0.2f;

            this.handle(ship);
        }
Пример #15
0
        protected override void DoAction()
        {
            //Debug.WriteLine("Attempting to Spawen an Alien!!!");
            if (this.poUfo == null || this.poUfo.bMarkForDeath == true)
            {
                int UfoDirection = this.pRandom.Next(0, 2);
                //Debug.WriteLine("Random direction is: " + UfoDirection);
                this.poUfo = (UFO)this.poUfoIF.ActiveCreate(GameObject.Type.UFO, Constants.UFOPosXPos, Constants.UFOYPos);
                if (UfoDirection == 0)
                {
                    this.poUfo.speedX *= -1.0f;
                    this.poUfo.x       = Constants.UFONegXPos;
                }
                IrrKlang.ISound pHardwareSound = SoundManager.PlaySound(Sound.Name.UFOLowPitch, true);

                ColPair pMissile_UFOColPair = ColPairManager.Add(ColPair.Name.Missile_UFO, this.pMissile, this.poUfo);
                Debug.Assert(pMissile_UFOColPair != null);

                ColPair pUFO_WallLeftColPair = ColPairManager.Add(ColPair.Name.UFO_WallLeft, this.poUfo, this.pWallMan.GetWallLeft());
                Debug.Assert(pUFO_WallLeftColPair != null);

                ColPair pUFO_WallRightColPair = ColPairManager.Add(ColPair.Name.UFO_WallRight, this.poUfo, this.pWallMan.GetWallRight());
                Debug.Assert(pUFO_WallRightColPair != null);

                // Set up missile UFO collsions
                pMissile_UFOColPair.Attach(new RemoveCollisionPairObserver(pMissile_UFOColPair));
                pMissile_UFOColPair.Attach(new RemoveCollisionPairObserver(pUFO_WallLeftColPair));
                pMissile_UFOColPair.Attach(new RemoveCollisionPairObserver(pUFO_WallRightColPair));
                pMissile_UFOColPair.Attach(new ShipMissileReadyObserver());
                pMissile_UFOColPair.Attach(new ShipRemoveMissileObserver());
                pMissile_UFOColPair.Attach(new RemoveUFOObserver(pHardwareSound));
                pMissile_UFOColPair.Attach(new AwardPointsObserver());

                // Set up UFO left wall collision
                pUFO_WallLeftColPair.Attach(new RemoveCollisionPairObserver(pUFO_WallLeftColPair));
                pUFO_WallLeftColPair.Attach(new RemoveCollisionPairObserver(pUFO_WallRightColPair));
                pUFO_WallLeftColPair.Attach(new RemoveCollisionPairObserver(pMissile_UFOColPair));
                pUFO_WallLeftColPair.Attach(new RemoveUFOObserver(pHardwareSound));

                // Set up UFO Right wall collision
                pUFO_WallRightColPair.Attach(new RemoveCollisionPairObserver(pUFO_WallRightColPair));
                pUFO_WallRightColPair.Attach(new RemoveCollisionPairObserver(pUFO_WallLeftColPair));
                pUFO_WallRightColPair.Attach(new RemoveCollisionPairObserver(pMissile_UFOColPair));
                pUFO_WallRightColPair.Attach(new RemoveUFOObserver(pHardwareSound));
            }
        }
Пример #16
0
        public override void Execute(float deltaTime)
        {
            Composite pFlyingSaucerRoot = GameStateManager.GetGame().GetStateCompositeManager().Find(Composite.CompositeName.FlyingSaucerRoot);

            IrrKlang.ISoundEngine pSoundEngine = SoundEngineManager.GetSoundEngine();

            // If flying saucer is active
            if (pFlyingSaucerRoot.GetFirstChild() != null)
            {
                // Check to see if sound is currently playing
                if (!pSoundEngine.IsCurrentlyPlaying("ufo_lowpitch.wav"))
                {
                    IrrKlang.ISound pSnd = pSoundEngine.Play2D("ufo_lowpitch.wav");
                }

                base.Execute(deltaTime);
            }
        }
Пример #17
0
        // plays filename selected in edit box
        void playSelectedFile()
        {
            // stop currently playing sound

            if (currentlyPlayingSound != null)
            {
                currentlyPlayingSound.Stop();
            }

            // start new sound

            currentlyPlayingSound = irrKlangEngine.Play2D(filenameTextBox.Text, true);

            // update controls to display the playing file

            UpdatePauseButtonText();

            volumeTrackBar.Value = 100;
        }
Пример #18
0
 public void PlayPause(string Mode, bool isGoing, string curMusicPath)
 {
     if (!isGoing)
     {
         curMusic = player.Play2D(curMusicPath);
         curMusic.Volume = curVol;
     }
     else
     {
         if (Mode.Equals("||"))
         {
             curMusic.Paused = true;
         }
         else
         {
             curMusic.Paused = false;
         }
     }
 }
Пример #19
0
        // Author: Brandon Wegner
        public override void LoadContent()
        {
            AudioEngine = new IrrKlang.ISoundEngine();

            music        = AudioEngine.Play2D("theme.wav", true);
            music.Volume = 0.2f;

            srcShoot = AudioEngine.AddSoundSourceFromFile("shoot.wav");
            sndShoot = AudioEngine.Play2D(srcShoot, false, false, false);
            sndShoot.Stop();

            pFont = new Azul.Texture("consolas20pt.tga");

            GlyphMan.AddXml("Consolas20pt.xml", pFont);

            pText = new Azul.Texture("unsorted.tga");

            pRedBird = new Azul.Sprite(pText, new Azul.Rect(903.0f, 797.0f, 46.0f, 46.0f),
                                       new Azul.Rect(300.0f, 100.0f, 30.0f, 30.0f));
        }
Пример #20
0
 public void PlaySound()
 {
     this.pISnd = this.pSnd.PlaySound();
 }
Пример #21
0
 public RemoveUFOObserver(IrrKlang.ISound pHardwareSound)
 {
     this.pInvader       = null;
     this.pHardwareSound = pHardwareSound;
 }
Пример #22
0
 public IrrKlang.ISound StartUFO()
 {
     UFOSound = sndEngine.Play2D(sndUFO, true, false, true);
     return(UFOSound);
 }
Пример #23
0
		// plays filename selected in edit box
		void playSelectedFile()
		{
			// stop currently playing sound

			if (currentlyPlayingSound != null)
				currentlyPlayingSound.Stop();

			// start new sound

			currentlyPlayingSound = irrKlangEngine.Play2D(filenameTextBox.Text, true);

			// update controls to display the playing file

			UpdatePauseButtonText();
			
            volumeTrackBar.Value = 100;
		}
Пример #24
0
        // plays filename selected in edit box
        void playSelectedFile()
        {
            // stop currently playing sound

            if (currentlyPlayingSound != null)
                currentlyPlayingSound.Stop();

            // start new sound

            currentlySelectedIndex = listBox1.SelectedIndex;
            currentlyPlayingSound = irrKlangEngine.Play2D(filepath + "\\" + listBox1.SelectedItem as String, false);

            // update controls to display the playing file

            System.Threading.Timer timer = new System.Threading.Timer(callback, "hello", TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(2));
            UpdatePauseButtonText();

            volumeTrackBar.Value = 100;
        }
Пример #25
0
 private void callback(object state)
 {
     if (currentlyPlayingSound != null)
     {
         if (currentlyPlayingSound.Finished)
         {
             currentlySelectedIndex += 1;
             string nextSong = listBox1.Items[currentlySelectedIndex].ToString();
             currentlyPlayingSound = irrKlangEngine.Play2D(filepath + "\\" + nextSong as String, false);
         }
     }
 }
Пример #26
0
 public void getnext(string mupath)
 {
     curMusic = player.Play2D(mupath);
 }
Пример #27
0
 public void rotateSound()
 {
     sndRotate = AudioEngine.Play2D("line.wav");
     sndShoot  = AudioEngine.Play2D(srcLine, false, false, false);
 }
Пример #28
0
 //Prebacivanje u mod "Snimanje"
 private void button13_Click(object sender, EventArgs e)
 {
     ZaustaviReprodukciju(); //Zaustavljanje reprodukcije
     clear_Click(sender, e); //Èišæenje liste
     postaviDugme(false);
     panel4_MouseEnter(sender, e); //povlaèenje pokretnog menija
     currentlyPlayingSound = null;
 }
Пример #29
0
 public override void notify()
 {
     IrrKlang.ISound music = soundEngine.Play2D(soundName);
     music.Volume = 0.2f;
 }
Пример #30
0
 public override void Notify()
 {
     IrrKlang.ISound pSnd = SoundEngineManager.GetSoundEngine().Play2D("invaderkilled.wav");
 }
Пример #31
0
 public void themeSong()
 {
     music        = AudioEngine.Play2D("theme.wav", true);
     music.Volume = 0.2f;
 }
Пример #32
0
 /// <summary>
 /// Stop button click action
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void StopButton_Click(object sender, System.EventArgs e)
 {
     if (currentlyPlayingSound != null)
     {
         currentlyPlayingSound.Stop();
         currentlyPlayingSound = null;
     }
 }
Пример #33
0
 public IrrKlang.ISound PlaySound()
 {
     pSndEngine.SoundVolume = this.volumn;
     IrrKlang.ISound pSnd = pSndEngine.Play2D(this.soundFile, this.isLoop);
     return(pSnd);
 }
Пример #34
0
        private void PlaySelectedFile()
        {
            // stop currently playing sound

            if (currentlyPlayingSound != null)
                currentlyPlayingSound.Stop();

            // start new sound

            currentlyPlayingSound = irrKlangEngine.Play2D(currentPathname, true);
        }
Пример #35
0
 public void fastPlace()
 {
     soundEffect = AudioEngine.Play2D("shoot.wav");
     sndShoot    = AudioEngine.Play2D(srcShoot, false, false, false);
 }
Пример #36
0
 public void normalPlace()
 {
     soundEffect = AudioEngine.Play2D("selection.wav");
     sndShoot    = AudioEngine.Play2D(srcSelection, false, false, false);
 }
Пример #37
0
        /// <summary>
        /// Play the selected file using the path
        /// </summary>
        /// <param name="filename"></param>
        void playSelectedFile(string filename)
        {
            if (currentlyPlayingSound != null)
            {
                currentlyPlayingSound.Stop();
            }

            currentlyPlayingSound = irrKlangEngine.Play2D(filename, true);

            UpdatePauseButtonText();
        }
Пример #38
0
 public void gameOver()
 {
     soundEffect = AudioEngine.Play2D("fall.wav");
     sndShoot    = AudioEngine.Play2D(srcFall, false, false, false);
 }
Пример #39
0
 public override void Notify()
 {
     //Debug.WriteLine(" Snd_Observer: {0} {1}", this.pSubject.pObjA, this.pSubject.pObjB);
     pSndEngine.SoundVolume = this.volumn;
     IrrKlang.ISound pSnd = pSndEngine.Play2D(this.soundFile, this.isLoop);
 }
Пример #40
0
 public void setFirst(string mupath)
 {
     curMusic = player.Play2D(mupath);
     Stop();
 }
Пример #41
0
 public void completeLine()
 {
     soundEffect = AudioEngine.Play2D("clear.wav");
     sndShoot    = AudioEngine.Play2D(srcClear, false, false, false);
 }
Пример #42
0
        private void PokreniReprodukciju()
        {
            try
            {
                if (!reprodukcija)
                {
                    currentlyPlayingSound = irrKlangEngine.Play2D(aktuelnaPjesma, false, true);
                    currentlyPlayingSound.PlaybackSpeed = 1;

                    brzina.Text = "Brzina: 1";
                    interval = 500;
                    jacinaZvuka();
                    reprodukcija = true;
                }

                format.Text = "Format: " + vratiFormat(aktuelnaPjesma);
                formatPjesme = vratiFormat(aktuelnaPjesma);
                play.Visible = false;
                pauza.Visible = true;
                currentlyPlayingSound.Paused = false;
                timer.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ne postoji datoteka \n\nError: " + ex.Message.ToString(),
                                "Greška", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }