public override void UnloadContent() { gokuVidTexture.Dispose(); // gokuVidRect.Dispose(); gokuPlayer.Dispose(); base.UnloadContent(); }
} // Play /// <summary> /// Stops playing the video. /// </summary> /// <remarks>The sound instance is disposed.</remarks> public void Stop() { if (videoPlayerInstance != null) { videoPlayerInstance.Dispose(); videoPlayerInstance = null; texture.Resource = null; } } // Stop
/// <summary> /// Dispose of the video and stop playing. /// </summary> public void UnloadContent() { try { graphics = null; Stop(); player.Dispose(); player = null; } catch { // Unloads take place upon shutdown, so exceptions don't matter. } }
private void Window_Closed(object sender, EventArgs e) { Stop(); MPVInterop.Instance?.Finish(); VideoPlayer?.Dispose(); _playControl = null; }
void Game1_Exiting(object sender, EventArgs e) { Console.WriteLine("Exit"); player.Dispose(); scenemanager.exit = true; scenemanager.UnloadContent(); }
public override void Update(GameTime gameTime) { keyState = Keyboard.GetState(); if (keyState.IsKeyDown(Keys.Enter)) { ScreenManager.Instance.AddScreen(new SplashScreen()); } if (isDisposed == false) { if (supermanPlayer.State == MediaState.Stopped) { if (isDisposed == false) { // UnloadContent(); //isDisposed = true; sWinRect.X = 0; sWinRect.Y = 0; } } } keyState = Keyboard.GetState(); if (keyState.IsKeyDown(Keys.D9)) { ScreenManager.Instance.AddScreen(new SplashScreen(isLooped)); UnloadContent(); supermanPlayer.Dispose(); supermanVidTexture.Dispose(); } }
void OnDisable() { if (VideoPlayer.IsPlaying) { VideoPlayer.Stop(); } VideoPlayer.Dispose(); if (VideoRecorder.IsRecording) { VideoRecorder.Stop(); } if (adapter != null) { adapter.Close(); adapter = null; } depthFilter.Dispose(); Destroy(imageViewTexture); imageViewMaterial.mainTexture = null; Destroy(depthViewTexture); depthViewMaterial.mainTexture = null; model.Dispose(); }
public override void Destruct() { videoPlayer.Stop(); videoPlayer.Dispose(); video.Dispose(); base.Destruct(); }
public override void UnloadContent() { // Stop playback if (m_videoPlayer != null) { m_videoPlayer.Stop(); m_videoPlayer.Dispose(); m_videoPlayer = null; } m_currentVideo = ""; base.UnloadContent(); //This one causes leaks in D3D //GC.Collect(); }
/// <summary> /// Cleans up resources that dont are exclusive of the screen /// </summary> /// <param name="engine"></param> protected override void CleanUp(Engine.EngineStuff engine) { if (CleanUpWhenRemoved) { videoPlayer.Dispose(); engine.ContentManager.ReleaseAsset(location); base.CleanUp(engine); } }
public override void Deactivate() { base.Deactivate(); if (videoPlayer != null) { videoPlayer.Stop(); videoPlayer.Dispose(); } video = null; videoPlayer = null; }
void Leave() { Game.Keyboard.KeyDown -= HandleKeyDown; player.Dispose(); if ((idx + 1) >= Game.IntroMovies.Count || !inited || Game.IntroMovies.Count <= 0) { Game.ChangeState(new LoadingDataState(Game)); } else { Game.ChangeState(new IntroMovie(Game, idx + 1)); } }
public void Close() { if (_window != null) { _window?.Close(); } else { Stop(); MPVInterop.Instance?.Finish(); VideoPlayer?.Dispose(); } }
public FormBrowser(UpdaterSettings updaterSettings) { InitializeComponent(); Text = Program.BrandName; this.plugins = new PluginManager(Program.PluginPath, Program.PluginConfigFilePath); this.plugins.Reloaded += plugins_Reloaded; this.plugins.Executed += plugins_Executed; this.plugins.Reload(); this.notification = new FormNotificationTweet(this, plugins); this.notification.Show(); this.browser = new TweetDeckBrowser(this, plugins, new TweetDeckBridge(this, notification)); this.browser.PageLoaded += browser_PageLoaded; this.contextMenu = ContextMenuBrowser.CreateMenu(this); Controls.Add(new MenuStrip { Visible = false }); // fixes Alt freezing the program in Win 10 Anniversary Update Disposed += (sender, args) => { Config.MuteToggled -= Config_MuteToggled; Config.TrayBehaviorChanged -= Config_TrayBehaviorChanged; browser.Dispose(); contextMenu.Dispose(); notificationScreenshotManager?.Dispose(); soundNotification?.Dispose(); videoPlayer?.Dispose(); analytics?.Dispose(); }; Config.MuteToggled += Config_MuteToggled; this.trayIcon.ClickRestore += trayIcon_ClickRestore; this.trayIcon.ClickClose += trayIcon_ClickClose; Config.TrayBehaviorChanged += Config_TrayBehaviorChanged; UpdateTrayIcon(); this.updates = browser.CreateUpdateHandler(updaterSettings); this.updates.UpdateAccepted += updates_UpdateAccepted; this.updates.UpdateDismissed += updates_UpdateDismissed; RestoreWindow(); }
protected override void Dispose(bool disposing) { if (disposing) { components?.Dispose(); updates.Dispose(); contextMenu.Dispose(); notificationScreenshotManager?.Dispose(); videoPlayer?.Dispose(); } base.Dispose(disposing); }
protected override void Update(GameTime gameTime) { KeyboardState currentKeyState = Keyboard.GetState(); if (currentKeyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Escape) && !gameStarted) { videoplayer.Stop(); videoplayer.Dispose(); } if ((videoplayer.IsDisposed || videoplayer.State == MediaState.Stopped) && !gameStarted) { gameStarted = true; StartGame(); } base.Update(gameTime); }
public FormBrowser() { InitializeComponent(); Text = Program.BrandName; this.plugins = new PluginManager(Program.Config.Plugins, Program.PluginPath); this.plugins.Reloaded += plugins_Reloaded; this.plugins.Executed += plugins_Executed; this.plugins.Reload(); this.notification = new FormNotificationTweet(this, plugins); this.notification.Show(); this.updates = new UpdateHandler(Program.InstallerPath); this.updates.CheckFinished += updates_CheckFinished; this.updateBridge = new UpdateBridge(updates, this); this.updateBridge.UpdateAccepted += updateBridge_UpdateAccepted; this.updateBridge.UpdateDelayed += updateBridge_UpdateDelayed; this.updateBridge.UpdateDismissed += updateBridge_UpdateDismissed; this.browser = new TweetDeckBrowser(this, plugins, new TweetDeckBridge.Browser(this, notification), updateBridge); this.contextMenu = ContextMenuBrowser.CreateMenu(this); Controls.Add(new MenuStrip { Visible = false }); // fixes Alt freezing the program in Win 10 Anniversary Update Disposed += (sender, args) => { Config.MuteToggled -= Config_MuteToggled; Config.TrayBehaviorChanged -= Config_TrayBehaviorChanged; browser.Dispose(); updates.Dispose(); contextMenu.Dispose(); notificationScreenshotManager?.Dispose(); videoPlayer?.Dispose(); analytics?.Dispose(); }; Config.MuteToggled += Config_MuteToggled; this.trayIcon.ClickRestore += trayIcon_ClickRestore; this.trayIcon.ClickClose += trayIcon_ClickClose; Config.TrayBehaviorChanged += Config_TrayBehaviorChanged; UpdateTray(); if (Config.MuteNotifications) { UpdateFormIcon(); } if (Config.AllowDataCollection) { analytics = new AnalyticsManager(this, plugins, Program.AnalyticsFilePath); } RestoreWindow(); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> public override void Update(GameTime gameTime) { // Allows the game to exit keyState = Keyboard.GetState(); scrollingbackgroundtop.Update(gameTime); scrollingbackgroundbottom.Update(gameTime); validationobjectengine.Update(gameTime); validationobjectengine.validationrect = ballobjectengine.BALLPOSITIONOFTRUTH; if (gokuPlayer.State == MediaState.Stopped) { // UnloadContent(); //isDisposed = true; gWinRect.X = 0; gWinRect.Y = 0; } keyState = Keyboard.GetState(); forward.Update(gameTime); #region KEYBOARD COMMANDS TO CONTROL AFTER VIDEO JESUS IS GOD! if (keyState.IsKeyDown(Keys.Enter) && (gokuPlayer.State == MediaState.Stopped)) { // ScreenManager.Instance.AddScreen(new OpeningTitleScreen(isLooped)); UnloadContent(); gokuPlayer.Dispose(); gokuVidTexture.Dispose(); ScreenManager.Instance.AddScreen(new OpeningTitleScreen()); } if (keyState.IsKeyDown(Keys.P)) { //ScreenManager.Instance.AddScreen(new PlayVideoGameState(isLooped)); UnloadContent(); gokuPlayer.Dispose(); gokuVidTexture.Dispose(); //ScreenManager.Instance.AddScreen(new EndingTitleScreen()); } #endregion // homebase.explosionartrect.X = theball.ballrect.X; // homebase.explosionartrect.Y = theball.ballrect.Y; ballobjectengine.Update(gameTime); //homebase.Update(gameTime); timer.Update(gameTime); // collisions are in the update method. finger ocllisons with falling stuff pheonomina if ((ballobjectengine.BallPositionOfTruth.Intersects(leapcollisionmax)) || (leapcollisionmax.Intersects(ballobjectengine.BallPositionOfTruth)) || (leapcollisionmax.X == ballobjectengine.BallPositionOfTruth.X && leapcollisionmax.Y == ballobjectengine.BallPositionOfTruth.Y)) // if (leapcollisionmax.Intersects(ballobjectengine.BallPositionOfTruth)) { validationobjectengine.arttrigger = true; validationobjectengine.soundtrigger = true; if (playsound == false) { boom.Play(); playsound = true; } if (colorcontrol == false) { BallObjectEngine.objectcolor = Color.White; colorcontrol = true; } if (isscorehit == false) { score += 1; isscorehit = true; playsound = false; } } // TODO: Add your update logic here\ /* * if (bottombaserect.Intersects(theball.Ballrect)) * { * ishit = true; * } * * if (!bottombaserect.Intersects(theball.Ballrect)) * { * ishit = false; * } */ ballobjectengine.ReceiveFrom_TimeEngine(timer.SendTo_BallObjectEngine()); // theball.Ballpositionoftruth.X; }
private void FrmVideoSnap_FormClosing(object sender, FormClosingEventArgs e) { player.Dispose(); }
public void Dispose() { _player.Dispose(); }
public void Dispose() { _videoPlayer.Stop(); _videoPlayer.Dispose(); }