示例#1
0
 private void TimerForVideoProgress_Tick(object sender, EventArgs e)
 {
     if (CheckException.CheckNull(this.video) ||
         CheckException.CheckNull(this.audio))
     {
         if (CheckException.CheckNull(this.video) &&
             CheckException.CheckNull(this.video.DirectVideo))
         {
             HolderForm.HandleVideoProgress(this.VideoSlider, this.video.DirectVideo);
         }
         else if (CheckException.CheckNull(this.audio) &&
                  CheckException.CheckNull(this.audio.DirectAudio))
         {
             HolderForm.HandleAudioProgress(this.VideoSlider, this.audio.DirectAudio);
         }
         else
         {
             this.timerForSubs.Stop();
             this.timerForSubsSync.Stop();
             this.timerForProgress.Stop();
         }
     }
     else
     {
         this.timerForSubs.Stop();
         this.timerForSubsSync.Stop();
         this.timerForProgress.Stop();
     }
 }
示例#2
0
        /// <summary>
        /// Slider moves, video changes appropriately
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CustomSlider1_MouseClick(object sender, MouseEventArgs e)
        {
            if (CheckException.CheckNull(this.video))
            {
                HolderForm.HandleBarMovemenetVideo(
                    this.VideoSlider, this.video.DirectVideo);
            }

            if (CheckException.CheckNull(this.audio))
            {
                HolderForm.HandleBarMovementAudio(
                    this.VideoSlider, this.audio.DirectAudio);
            }
        }
示例#3
0
        private void TimerForMenuBar_Tick(object sender, EventArgs e)
        {
            int          screenWidth          = Screen.PrimaryScreen.WorkingArea.Width;
            int          screenHeight         = Screen.PrimaryScreen.WorkingArea.Height;
            const int    MenuBarPadding       = 100;
            const double ScreenToMenuBarRatio = 3.7;

            if (CheckException.CheckNull(video.DirectVideo) &&
                !HolderForm.FormForVideo.IsDisposed)
            {
                if (Cursor.Position.Y > screenHeight - MenuBarPadding)
                {
                    if (!menuBar.IsDisposed)
                    {
                        if (this.IsActive(HolderForm.FormForVideo.Handle) ||
                            this.IsActive(menuBar.Handle) ||
                            this.IsActive(this.subForm.Handle))
                        {
                            menuBar.Show();
                            menuBar.BringToFront();
                            menuBar.TopMost  = true;
                            menuBar.Location = new Point(Convert.ToInt32(
                                                             screenWidth / ScreenToMenuBarRatio),
                                                         screenHeight - 10);
                        }
                    }
                    else
                    {
                        timerForMenuBar.Stop();
                        menuBar = null;
                    }
                }
                else
                {
                    menuBar.Hide();
                }
            }
            else
            {
                if (HolderForm.FormForVideo.IsDisposed)
                {
                    timerForProgress.Stop();
                }

                timerForMenuBar.Stop();
                menuBar.Dispose();
                menuBar = null;
            }
        }
示例#4
0
        /// <summary>
        /// rewind and fast forward fix up;
        /// event method
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TimerForRF_Tick(object sender, EventArgs e)
        {
            if (this.fastForwardFired)
            {
                if (CheckException.CheckNull(this.video) &&
                    CheckException.CheckNull(this.video.DirectVideo))
                {
                    this.video.FastForward();
                    if (video.PlayBackSpeed == 0)
                    {
                        this.timerForRF.Stop();
                    }
                }

                if (CheckException.CheckNull(this.audio) &&
                    CheckException.CheckNull(this.audio.DirectAudio))
                {
                    this.audio.FastForward();
                    if (this.audio.PlayBackSpeed == 0)
                    {
                        this.timerForRF.Stop();
                    }
                }
            }

            if (this.rewindFired)
            {
                if (CheckException.CheckNull(this.video) &&
                    CheckException.CheckNull(this.video.DirectVideo))
                {
                    this.video.Rewind();
                    if (this.video.PlayBackSpeed == 0)
                    {
                        this.timerForRF.Stop();
                    }
                }

                if (CheckException.CheckNull(this.audio) &&
                    CheckException.CheckNull(this.audio.DirectAudio))
                {
                    this.audio.Rewind();
                    if (this.audio.PlayBackSpeed == 0)
                    {
                        this.timerForRF.Stop();
                    }
                }
            }
        }
示例#5
0
        private void VolumeProgress_ValueChanged(object sender, decimal value)
        {
            if (CheckException.CheckNull(MainScreenInstance.video) &&
                CheckException.CheckNull(MainScreenInstance.video.DirectVideo))
            {
                AudioControl.VolumeInit(
                    MainScreenInstance.video.DirectVideo.Audio,
                    this.VolumeProgress);
            }

            if (CheckException.CheckNull(MainScreenInstance.audio) &&
                CheckException.CheckNull(
                    MainScreenInstance.audio.DirectAudio))
            {
                AudioControl.VolumeInit(
                    MainScreenInstance.audio.DirectAudio, this.VolumeProgress);
            }
        }
示例#6
0
 private void VolumeUp_MouseDown(object sender, EventArgs e)
 {
     if (CheckException.CheckNull(MainScreenInstance.video))
     {
         MainScreenInstance.video.VolumeUp(this.VolumeProgress);
     }
     else if (CheckException.CheckNull(this.MainScreenInstance.audio) &&
              CheckException.CheckNull(this.MainScreenInstance.audio.DirectAudio))
     {
         this.MainScreenInstance.audio.VolumeUp(this.VolumeProgress);
     }
     else
     {
         if (this.VolumeProgress.Value < this.VolumeProgress.Maximum)
         {
             this.VolumeProgress.Value += VolumeStep;
         }
     }
 }