Exemplo n.º 1
0
 public void Stop()
 {
     if (CheckException.CheckNull(this.DirectAudio))
     {
         this.DirectAudio.Stop();
     }
 }
Exemplo n.º 2
0
 public void Pause()
 {
     if (CheckException.CheckNull(this.DirectAudio))
     {
         this.DirectAudio.Pause();
     }
 }
 /// <summary>
 /// Occurs when videos lider value changes
 /// </summary>
 /// <param name="sender">Method for</param>
 /// <param name="e">delegate </param>
 private void VideoSlider_Click(object sender, EventArgs e)
 {
     if (CheckException.CheckNull(this.MainScreenInstance.video))
     {
         HolderForm.HandleBarMovemenetVideo(this.videoSlider, this.MainScreenInstance.video.DirectVideo);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Handles slider movement
 /// </summary>
 /// <param name="slider">A custom slider object</param>
 /// <param name="video">A DirectX video</param>
 public static void HandleBarMovemenetVideo(
     CustomControls.CustomSlider slider, DirectXAllias::Video video)
 {
     if (CheckException.CheckNull(video))
     {
         video.CurrentPosition = slider.Value;
     }
 }
Exemplo n.º 5
0
 public static void HandleBarMovementAudio(
     CustomControls.CustomSlider slider, DirectXAllias::Audio audio)
 {
     if (CheckException.CheckNull(audio))
     {
         audio.CurrentPosition = slider.Value;
     }
 }
Exemplo n.º 6
0
 public void Close()
 {
     if (CheckException.CheckNull(this.DirectAudio))
     {
         this.DirectAudio.Dispose();
         this.DirectAudio = null;
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Moves back the current position of the video with x
 /// </summary>
 public void Rewind()
 {
     if (CheckException.CheckNull(this.DirectVideo))
     {
         if (this.DirectVideo.CurrentPosition + this.PlayBackSpeed > 0)
         {
             this.DirectVideo.CurrentPosition += this.PlayBackSpeed;
         }
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// Fast forwards the video
 /// </summary>
 /// <param name="button">Button to set styles to</param>
 public void FastForward(Button button, IPlayable playable)
 {
     this.SwitchButtonStyle(button);
     if (CheckException.CheckNull(playable))
     {
         this.MainScreenInstance.timerForRF.Start();
         playable.PlayBackSpeed += 5;
         this.MainScreenInstance.fastForwardFired = true;
     }
 }
Exemplo n.º 9
0
 public void FastForward()
 {
     if (CheckException.CheckNull(this.DirectAudio))
     {
         if (this.DirectAudio.CurrentPosition + this.PlayBackSpeed > 0)
         {
             this.DirectAudio.CurrentPosition += this.PlayBackSpeed;
         }
     }
 }
Exemplo n.º 10
0
 /// <summary>
 /// Decreases volume by a step
 /// and adjusts the progress bar
 /// </summary>
 /// <param name="video">A video object</param>
 /// <param name="slider">A custom slider object</param>
 public static void VolumeDown(DirectXAudioAllias audio, CustomSlider slider)
 {
     if (slider.Value > slider.Minimum)
     {
         slider.Value -= VolumeStep;
         if (CheckException.CheckNull(audio))
         {
             HandleAudio(audio, slider.Value);
         }
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// Increases volume with a step
 /// and adjusts the progress bar
 /// </summary>
 /// <param name="video">A video object</param>
 /// <param name="slider">A custom slider object</param>
 public static void VolumeUp(DirectXAudioAllias audio, CustomSlider slider)
 {
     if (slider.Value < MaxProgressBarValue)
     {
         slider.Value += VolumeStep;
         if (CheckException.CheckNull(audio))
         {
             HandleAudio(audio, slider.Value);
         }
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// Opens a video
 /// </summary>
 public void Open(Button button)
 {
     this.SwitchButtonStyle(button);
     this.VideoName = ChooseVideoDialog.TakePathToVideo();
     if (CheckException.CheckNull(this.VideoName))
     {
         this.Open(this.VideoName);
     }
     else if (CheckException.CheckNull(this.MainScreenInstance.video))
     {
         this.VideoName = this.MainScreenInstance.video.PathToSource;
     }
 }
Exemplo n.º 13
0
        /// <summary>
        /// Kills the video and everything
        /// associated with it
        /// </summary>
        /// <param name="video">DirectX video</param>
        public static void NullVideoAndForm(DirectXAllias::Video video)
        {
            if (CheckException.CheckNull(FormForVideo))
            {
                FormForVideo.Dispose();
                FormForVideo = null;
            }

            if (CheckException.CheckNull(video))
            {
                video.Dispose();
                video = null;
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Stops the video
        /// </summary>
        /// <param name="button">Button to set styles to</param>
        public void Stop(Button button, IPlayable playable)
        {
            this.SwitchButtonStyle(button);
            if (CheckException.CheckNull(playable))
            {
                this.MainScreenInstance.timerForRF.Stop();
                playable.Stop();
            }

            if (this.MainScreenInstance.timerForProgress.Enabled)
            {
                this.MainScreenInstance.timerForProgress.Stop();
                this.MainScreenInstance.WriteVideoTime();
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// Closes the video player
        /// </summary>
        /// <param name="button">Button to set styles to</param>
        public void ExitVideoPlayer(Button button)
        {
            this.SwitchButtonStyle(button);
            this.MainScreenInstance.Close();
            if (CheckException.CheckNull(this.MainScreenInstance.video))
            {
                this.MainScreenInstance.video.Close();
            }

            if (CheckException.CheckNull(this.MainScreenInstance.audio))
            {
                this.MainScreenInstance.audio.Close();
            }

            this.MainScreenInstance.Dispose();
        }
Exemplo n.º 16
0
 /// <summary>
 /// Occurs on video progress timer tick
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TimerForVideoProgress_Tick(object sender, EventArgs e)
 {
     if (CheckException.CheckNull(MainScreenInstance.video))
     {
         if (CheckException.CheckNull(MainScreenInstance.video.DirectVideo))
         {
             HolderForm.HandleVideoProgress(this.videoSlider, MainScreenInstance.video.DirectVideo);
         }
         else
         {
             timerForVideoProgress.Stop();
         }
     }
     else
     {
         timerForVideoProgress.Stop();
     }
 }
Exemplo n.º 17
0
 /// <summary>
 /// Goes to full screen
 /// </summary>
 /// <param name="button">Button to set styles to</param>
 public void FullScreenVideo(Button button)
 {
     this.SwitchButtonStyle(button);
     if (CheckException.CheckNull(this.MainScreenInstance.video))
     {
         this.MainScreenInstance.video.OpenVideoInFullScreen();
         this.MainScreenInstance.video.IsFullScreen = true;
     }
     if (CheckException.CheckNull(this.MainScreenInstance.video))
     {
         if (this.MainScreenInstance.video.IsFullScreen)
         {
             this.MainScreenInstance.menuBar = new MenuBarFullScreenForm();
             this.MainScreenInstance.menuBar.MainScreenInstance = MainScreen.Instance;
             this.MainScreenInstance.timerForMenuBar.Start();
         }
     }
 }
Exemplo n.º 18
0
        /// <summary>
        /// Plays the video
        /// </summary>
        /// <param name="button">Button to set styles to</param>
        public void Play(Button button, IPlayable playable)
        {
            this.SwitchButtonStyle(button);
            if (CheckException.CheckNull(playable))
            {
                if (!this.MainScreenInstance.timerForProgress.Enabled)
                {
                    this.MainScreenInstance.timerForProgress.Start();
                }

                playable.Play();
            }

            if (this.MainScreenInstance.timerForRF.Enabled)
            {
                this.MainScreenInstance.timerForRF.Stop();
                playable.PlayBackSpeed = 0;
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// Closes the video
        /// </summary>
        /// <param name="button">Button to set styles to</param>
        public void Close(Button button)
        {
            this.SwitchButtonStyle(button);

            if (CheckException.CheckNull(this.MainScreenInstance.video))
            {
                HolderForm.NullVideoAndForm(this.MainScreenInstance.video.DirectVideo);
            }

            if (CheckException.CheckNull(this.MainScreenInstance.audio))
            {
                this.MainScreenInstance.audio.DirectAudio.Dispose();
                this.MainScreenInstance.audio = null;
            }

            this.MainScreenInstance.GetSlider().Value   = 0;
            this.MainScreenInstance.GetSlider().Enabled = false;
            this.MainScreenInstance.timerForProgress.Stop();
            this.MainScreenInstance.timerForSubsSync.Stop();
            this.MainScreenInstance.GetLabel().Text = string.Empty;
        }
Exemplo n.º 20
0
 public void LoadSubs(Button button, Subtitles subtitles)
 {
     if (CheckException.CheckNull(this.VideoName))
     {
         OpenFileDialog Dialog1 = new OpenFileDialog();
         Dialog1.InitialDirectory = "c:\\";
         Dialog1.Filter           = Formats;
         Dialog1.FilterIndex      = 2;
         Dialog1.RestoreDirectory = true;
         if (Dialog1.ShowDialog() == DialogResult.OK)
         {
             if (Dialog1.OpenFile() != null)
             {
                 this.SubsName = Dialog1.FileName;
             }
         }
         if (CheckException.CheckNull(this.SubsName))
         {
             subtitles.Load(this.SubsName);
         }
     }
 }