public void Stop() { if (CheckException.CheckNull(this.DirectAudio)) { this.DirectAudio.Stop(); } }
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); } }
/// <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; } }
public static void HandleBarMovementAudio( CustomControls.CustomSlider slider, DirectXAllias::Audio audio) { if (CheckException.CheckNull(audio)) { audio.CurrentPosition = slider.Value; } }
public void Close() { if (CheckException.CheckNull(this.DirectAudio)) { this.DirectAudio.Dispose(); this.DirectAudio = null; } }
/// <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; } } }
/// <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; } }
public void FastForward() { if (CheckException.CheckNull(this.DirectAudio)) { if (this.DirectAudio.CurrentPosition + this.PlayBackSpeed > 0) { this.DirectAudio.CurrentPosition += this.PlayBackSpeed; } } }
/// <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); } } }
/// <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); } } }
/// <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; } }
/// <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; } }
/// <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(); } }
/// <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(); }
/// <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(); } }
/// <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(); } } }
/// <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; } }
/// <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; }
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); } } }