/// <summary> /// Dispose IDisposable members. /// </summary> public void Dispose() { GC.SuppressFinalize(this); _audioEngine.Dispose(); _waveBank.Dispose(); _soundBank.Dispose(); }
/// <summary> /// Clean up the component when it is disposing. /// </summary> protected override void Dispose(bool disposing) { try { if (disposing) { if (soundBank != null) { soundBank.Dispose(); soundBank = null; } if (waveBank != null) { waveBank.Dispose(); waveBank = null; } if (audioEngine != null) { audioEngine.Dispose(); audioEngine = null; } } } finally { base.Dispose(disposing); } }
protected override void Dispose(bool disposing) { try { if (disposing) { if (_aSoundBank != null) { _aSoundBank.Dispose(); _aSoundBank = null; } if (_seWaveBank != null) { _seWaveBank.Dispose(); _seWaveBank = null; } if (_bgmWaveBank != null) { _bgmWaveBank.Dispose(); _bgmWaveBank = null; } if (_audioEngine != null) { _audioEngine.Dispose(); _audioEngine = null; } } } finally { base.Dispose(disposing); } }
/// <summary> /// Disposes of all of the music. /// </summary> public void Dispose(bool finalize) { if (PlayingAnything()) { StopAll(); } if (audioEngine != null) { audioEngine.Dispose(); audioEngine = null; } if (soundBank != null) { soundBank.Dispose(); soundBank = null; } if (waveBank != null) { waveBank.Dispose(); waveBank = null; } }
protected override void Dispose(bool disposing) { if (disposing) { _screenManager.Dispose(); _console.Dispose(); _consoleLoggerTarget.Dispose(); _inputManager.Dispose(); if (_spriteBatch != null) { _spriteBatch.Dispose(); } if (_audioEngine != null) { _audioEngine.Dispose(); } if (_waveBank != null) { _waveBank.Dispose(); } if (_soundBank != null) { _soundBank.Dispose(); } } base.Dispose(disposing); }
/// <summary> /// Clean up the component when it is disposing. /// </summary> protected override void Dispose(bool disposing) { try { if (disposing) { StopMusic(); if (sounds != null) { sounds.Dispose(); sounds = null; } if (waves != null) { waves.Dispose(); waves = null; } if (engine != null) { engine.Dispose(); engine = null; } } } finally { base.Dispose(disposing); } }
} // Dispose(someObject) /// <summary> /// Dispose /// </summary> /// <param name="someObject">Some object</param> public static void Dispose(ref SoundBank someObject) { if (someObject != null) { someObject.Dispose(); } someObject = null; } // Dispose(someObject)
public static void Unload() { if (!Loaded) { return; } soundBank.Dispose(); waveBank.Dispose(); audioEngine.Dispose(); }
protected override void Dispose(bool disposing) { try { if (disposing) { SoundBank.Dispose(); WaveBank.Dispose(); Engine.Dispose(); } } finally { base.Dispose(disposing); } }
/// <summary> /// Unloads the sound bank and the wave bank which are currently loaded /// to make room for a new one or just to shut down. /// </summary> protected void UnloadBank() { if (m_soundBank != null) { m_soundBank.Dispose(); m_soundBank = null; } if (m_waveBank != null) { m_waveBank.Dispose(); m_waveBank = null; } }
//* ────________________________________* //* methods ───────────────────────────────-* //* -----------------------------------------------------------------------* /// <summary> /// アンマネージ リソースの解放およびリセットに関連付けられている /// アプリケーション定義のタスクを実行します。 /// </summary> public void Dispose() { CLogger.add("音響リソースの解放をしています..."); string strErr = ""; try { if (cueBGM != null) { cueBGM.Dispose(); } } catch (Exception e) { strErr += e.ToString() + "\r\n"; } try { if (soundBank != null) { soundBank.Dispose(); } } catch (Exception e) { strErr += e.ToString() + "\r\n"; } try { if (waveBankBGM != null) { waveBankBGM.Dispose(); } } catch (Exception e) { strErr += e.ToString() + "\r\n"; } try { if (waveBankSE != null) { waveBankSE.Dispose(); } } catch (Exception e) { strErr += e.ToString() + "\r\n"; } try { if (engine != null) { engine.Dispose(); } } catch (Exception e) { strErr += e.ToString() + "\r\n"; } if (strErr.Length > 0) { CLogger.add( "音響処理の解放に失敗しました。" + Environment.NewLine + "完全に終了しないうちにウィンドウを非アクティブにするとこの現象が起きやすいです。" + Environment.NewLine + Environment.NewLine + strErr); } soundBank = null; cueBGM = null; waveBankBGM = null; waveBankSE = null; engine = null; CLogger.add("音響リソースの解放完了。"); }
/// <summary> /// stops every sound and removes every sound member. /// </summary> public void Dispose() { if (soundOn == false) { return; } StopSound(); audioCategories.Clear(); SoundBank.Dispose(); WaveBank.Dispose(); AudioEngine.Dispose(); }
/// <summary> /// Shuts down the sound code tidily /// </summary> public void Shutdown() { if (soundbank != null) { soundbank.Dispose(); } if (wavebank != null) { wavebank.Dispose(); } if (engine != null) { engine.Dispose(); } }
protected override void Dispose(bool disposing) { soundBank.Dispose(); waveBank.Dispose(); engine.Dispose(); playList = null; currentlyPlaying = null; cues = null; soundBank = null; waveBank = null; engine = null; base.Dispose(disposing); }
/// <summary> /// Removes a sound bank /// </summary> /// <param name="soundBankFile">The sound bank to remove</param> #endregion public static void RemoveSoundBank(string soundBankFile) { if (mXnaSoundBanks.ContainsKey(soundBankFile)) { SoundBank sb = mXnaSoundBanks[soundBankFile]; mXnaSoundBanks.Remove(soundBankFile); sb.Dispose(); if (mDefaultSoundBank == soundBankFile) { if (mXnaSoundBanks.Count > 0) { mDefaultSoundBank = mXnaSoundBanks.Keys.GetEnumerator().Current; } else { mDefaultSoundBank = string.Empty; } } } }
/// <summary> /// Garbage collection. /// </summary> protected override void Dispose(bool disposing) { try { if (disposing) { if (_MusicCue1 != null) { _MusicCue1.Dispose(); _MusicCue1 = null; } if (_MusicCue2 != null) { _MusicCue2.Dispose(); _MusicCue2 = null; } if (_SoundBank != null) { _SoundBank.Dispose(); _SoundBank = null; } if (_WaveBank != null) { _WaveBank.Dispose(); _WaveBank = null; } if (_AudioEngine != null) { _AudioEngine.Dispose(); _AudioEngine = null; } } } finally { base.Dispose(disposing); } }
public void SoundBankCtor() { Assert.Throws <ArgumentNullException>(() => new SoundBank(null, null)); Assert.Throws <ArgumentNullException>(() => new SoundBank(_audioEngine, null)); Assert.Throws <ArgumentNullException>(() => new SoundBank(_audioEngine, "")); //Assert.Throws<DirectoryNotFoundException>(() => new SoundBank(_audioEngine, @"This\Does\Not\Exist.xsb")); Assert.Throws <FileNotFoundException>(() => new SoundBank(_audioEngine, @"Assets\Audio\Win\NotTheFile.xsb")); var soundBank = new SoundBank(_audioEngine, @"Assets\Audio\Win\Tests.xsb"); Assert.False(soundBank.IsInUse); Assert.False(soundBank.IsDisposed); var cue = soundBank.GetCue("blast_mono"); Assert.True(soundBank.IsInUse); cue.Dispose(); //Assert.False(soundBank.IsInUse); // MonoGame Fail soundBank.Dispose(); Assert.True(soundBank.IsDisposed); Assert.False(soundBank.IsInUse); }
protected override void Dispose(bool disposing) { if (!disposed && disposing) { //Save the settings Settings.Default.Save(); //Do the disposing if (m_currentMusic != null) { m_currentMusic.Dispose(); } m_musicCategory = new AudioCategory(); m_soundCategory = new AudioCategory(); m_engine.Dispose(); m_waveBank.Dispose(); m_soundBank.Dispose(); disposed = true; } }
public void TearDown() { _soundBank.Dispose(); _waveBank.Dispose(); _audioEngine.Dispose(); }
public static void Shutdown() { soundbank.Dispose(); wavebank.Dispose(); engine.Dispose(); }
public void Dispose() { soundBank.Dispose(); }
public void Shutdown() { waveBank.Dispose(); soundBank.Dispose(); audioEngine.Dispose(); }
/// <summary> /// Shuts down the sound code tidily /// </summary> public void Shutdown() { _soundbank.Dispose(); _wavebank.Dispose(); _engine.Dispose(); }
public void Dispose() { audioEngine.Dispose(); soundBank.Dispose(); waveBank.Dispose(); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); if (gameMode == GameMode.Game) { if (levelIndex > 5) { return; } spriteBatch.Begin(SpriteBlendMode.AlphaBlend); spriteBatch.Draw(backgrounds[levelIndex], new Vector2(0, 0), Color.White); spriteBatch.End(); spriteBatch.Begin(); level.Draw(gameTime, spriteBatch); DrawGameString(); spriteBatch.End(); } else if (gameMode == GameMode.Menu) { spriteBatch.Begin(SpriteBlendMode.AlphaBlend); spriteBatch.Draw(gameStartBackgroud, Vector2.Zero, Color.White); spriteBatch.Draw(gamestart, ExtermePongLogoExterme, ExtermePongLogoExterme, Color.White); spriteBatch.Draw(gamestart, ExtermePongLogoPong, ExtermePongLogoPong, Color.White); timef += gameTime.ElapsedGameTime.Milliseconds; if (2000 >= timef && timef >= 1000) { spriteBatch.Draw(gamestart, ExtermePongLogoSmall, ExtermePongLogoSmall, Color.White); } else if (timef > 2000) { timef = 0f; } last = Keyboard.GetState(); // if (last.IsKeyDown(Keys.Down)&&keybs.IsKeyUp(Keys.Down)) if (last.IsKeyDown(dict["down"]) && keybs.IsKeyUp(dict["down"])) { currentItem = (currentItem + 1) % 2; soundBank.PlayCue("plop"); } // if(last.IsKeyDown(Keys.Up)&&keybs.IsKeyUp(Keys.Up)) if (last.IsKeyDown(dict["up"]) && keybs.IsKeyUp(dict["up"])) { currentItem = (currentItem + 1) % 2; soundBank.PlayCue("plop"); } if (last.IsKeyDown(Keys.Enter) && keybs.IsKeyUp(Keys.Enter)) { if (currentItem == 0) { gameMode = GameMode.Game; LoadNextLevel(); } else if (currentItem == 1) { gameMode = GameMode.Help; } } keybs = last; spriteBatch.Draw(gamestart, gameMenuStart, gameMenuStart, currentItem == 0?Color.Orange:Color.White); spriteBatch.Draw(gamestart, gameMenuHelp, gameMenuHelp, currentItem == 1?Color.Orange:Color.White); spriteBatch.End(); } else if (gameMode == GameMode.GameOver) { soundBank.Dispose(); playBackGround = false; spriteBatch.Begin(); spriteBatch.Draw(gameStartBackgroud, Vector2.Zero, Color.White); // DrawShadowedString(hudFont,"Game Over",new Vector2(200,40),Color.Red); spriteBatch.Draw(Content.Load <Texture2D>("GameMenu\\gameover"), new Vector2(200, 50), Color.White); for (int i = 0; i < 9; i++) { DrawShadowedString(hudFont, (i + 1).ToString() + " " + scoreList[i].ToString(), new Vector2(270, 120 + 20 * i), Color.Orange); } DrawShadowedString(hudFont, "Press B Back to Menu", new Vector2(210, 330), Color.Red); spriteBatch.End(); } else if (gameMode == GameMode.Help) { spriteBatch.Begin(); spriteBatch.Draw(help, Vector2.Zero, Color.White); spriteBatch.End(); last = Keyboard.GetState(); if (last.IsKeyDown(Keys.Q) && keybs.IsKeyUp(Keys.Q)) { gameMode = GameMode.Menu; } keybs = last; } else if (gameMode == GameMode.iniFileError) { spriteBatch.Begin(); spriteBatch.DrawString(hudFont, "The ini file is parsered incorrectly.Please close the game and check again.", new Vector2(0, graphics.PreferredBackBufferHeight / 2), Color.White); spriteBatch.End(); } /* spriteBatch.Begin(); * spriteBatch.DrawString(hudFont,"Game Over",new Vector2(graphics.PreferredBackBufferWidth/2,graphics.PreferredBackBufferHeight/2),Color.White); * spriteBatch.End();*/ // TODO: Add your drawing code here base.Draw(gameTime); }
public static void StopSound(int index) { soundBank.Dispose(); }
/// <summary> /// Shuts down the sound code tidily /// </summary> public void shutdown() { _soundBank.Dispose(); _waveBank.Dispose(); _engine.Dispose(); }
/** @fn void CleanUp() * @brief clean up the XACT objects */ public void CleanUp() { m_audioEngine.Dispose(); m_soundBank.Dispose(); m_waveBank.Dispose(); }