public override void UnloadContent()
        {
            gokuVidTexture.Dispose();
            //  gokuVidRect.Dispose();
            gokuPlayer.Dispose();

            base.UnloadContent();
        }
예제 #2
0
        } // 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
예제 #3
0
 /// <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.
     }
 }
예제 #4
0
 private void Window_Closed(object sender, EventArgs e)
 {
     Stop();
     MPVInterop.Instance?.Finish();
     VideoPlayer?.Dispose();
     _playControl = null;
 }
예제 #5
0
파일: Game1.cs 프로젝트: jafework/CS461
 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();
            }
        }
예제 #7
0
    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();
        }
예제 #10
0
 /// <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);
     }
 }
예제 #11
0
        public override void Deactivate()
        {
            base.Deactivate();

            if (videoPlayer != null)
            {
                videoPlayer.Stop();
                videoPlayer.Dispose();
            }
            video       = null;
            videoPlayer = null;
        }
예제 #12
0
 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));
     }
 }
예제 #13
0
 public void Close()
 {
     if (_window != null)
     {
         _window?.Close();
     }
     else
     {
         Stop();
         MPVInterop.Instance?.Finish();
         VideoPlayer?.Dispose();
     }
 }
예제 #14
0
        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();
        }
예제 #15
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                components?.Dispose();

                updates.Dispose();
                contextMenu.Dispose();

                notificationScreenshotManager?.Dispose();
                videoPlayer?.Dispose();
            }

            base.Dispose(disposing);
        }
예제 #16
0
        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);
        }
예제 #17
0
        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();
        }
예제 #18
0
        /// <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;
        }
예제 #19
0
 private void FrmVideoSnap_FormClosing(object sender, FormClosingEventArgs e)
 {
     player.Dispose();
 }
예제 #20
0
 public void Dispose()
 {
     _player.Dispose();
 }
예제 #21
0
 public void Dispose()
 {
     _videoPlayer.Stop();
     _videoPlayer.Dispose();
 }