コード例 #1
0
 internal void showPlayer()
 {
     if (player != null)
     {
         player.Show();
     }
 }
コード例 #2
0
        /// <summary>
        /// opens the AviSynth preview for a given AviSynth script
        /// gets the properties of the video, registers the callbacks, updates the video bitrate (we know the lenght of the video now) and updates the commandline
        /// with the scriptname
        /// </summary>
        /// <param name="fileName">the AviSynth script to be opened</param>
        private void openAvisynthScript(string fileName)
        {
            if (this.player != null) // make sure only one preview window is open at all times
            {
                player.Close();
            }
            player   = new VideoPlayer();
            info.DAR = null; // to be sure to initialize DAR values
            bool videoLoaded = player.loadVideo(mainForm, fileName, PREVIEWTYPE.CREDITS, true);

            if (videoLoaded)
            {
                info.DAR   = info.DAR ?? player.File.Info.DAR;
                player.DAR = info.DAR;


                player.IntroCreditsFrameSet += new IntroCreditsFrameSetCallback(player_IntroCreditsFrameSet);
                player.Closed += new EventHandler(player_Closed);
                player.Show();
                if (mainForm.Settings.AlwaysOnTop)
                {
                    player.TopMost = true;
                }
            }
        }
コード例 #3
0
 private void showVideoButton_Click(object sender, System.EventArgs e)
 {
     if (!this.videoInput.Equals(""))
     {
         if (player == null)
         {
             player = new VideoPlayer();
             bool videoLoaded = player.loadVideo(mainForm, videoInput, PREVIEWTYPE.CHAPTERS, false);
             if (videoLoaded)
             {
                 player.Closed     += new EventHandler(player_Closed);
                 player.ChapterSet += new ChapterSetCallback(player_ChapterSet);
                 if (introEndFrame > 0)
                 {
                     player.IntroEnd = this.introEndFrame;
                 }
                 if (creditsStartFrame > 0)
                 {
                     player.CreditsStart = this.creditsStartFrame;
                 }
                 player.Show();
                 player.SetScreenSize();
                 this.TopMost = player.TopMost = true;
                 if (!mainForm.Settings.AlwaysOnTop)
                 {
                     this.TopMost = player.TopMost = false;
                 }
             }
             else
             {
                 return;
             }
         }
         if (chapterListView.SelectedItems.Count == 1 && chapterListView.SelectedItems[0].Tag != null) // a zone has been selected, show that zone
         {
             Chapter chap        = (Chapter)chapterListView.SelectedItems[0].Tag;
             int     time        = Util.getTimeCode(chap.timecode);
             double  framerate   = player.Framerate;
             int     frameNumber = Util.convertTimecodeToFrameNumber(time, framerate);
             player.CurrentFrame = frameNumber;
         }
         else                 // no chapter has been selected.. but if start time is configured, show the frame in the preview
         {
             if (!startTime.Text.Equals(""))
             {
                 int    time        = Util.getTimeCode(startTime.Text);
                 double framerate   = player.Framerate;
                 int    frameNumber = Util.convertTimecodeToFrameNumber(time, framerate);
                 player.CurrentFrame = frameNumber;
             }
         }
     }
     else
     {
         MessageBox.Show("Please configure video input first", "No video input found", MessageBoxButtons.OK, MessageBoxIcon.Stop);
     }
 }
コード例 #4
0
ファイル: ZonesControl.cs プロジェクト: huannguyenfit/MeGUI
 private void showVideoButton_Click(object sender, System.EventArgs e)
 {
     if (!this.input.Equals(""))
     {
         if (player == null)
         {
             player = new VideoPlayer();
             bool videoLoaded = player.loadVideo(mainForm, input, PREVIEWTYPE.ZONES, false);
             if (videoLoaded)
             {
                 player.ZoneSet += new ZoneSetCallback(player_ZoneSet);
                 player.Closed  += new EventHandler(player_Closed);
                 if (introEndFrame > 0)
                 {
                     player.IntroEnd = this.introEndFrame;
                 }
                 if (creditsStartFrame > 0)
                 {
                     player.CreditsStart = this.creditsStartFrame;
                 }
                 player.Show();
                 player.SetScreenSize();
             }
             else
             {
                 return;
             }
         }
         if (zoneListView.SelectedItems.Count == 1) // a zone has been selected, show that zone
         {
             Zone zone = (Zone)zoneListView.SelectedItems[0].Tag;
             player.ZoneStart = zone.startFrame;
             player.ZoneEnd   = zone.endFrame;
         }
         else // no zone has been selected.. but if start and / or end frame have been configured show them in the preview
         {
             if (!startFrame.Text.Equals(""))
             {
                 player.ZoneStart = Int32.Parse(startFrame.Text);
             }
             if (!endFrame.Text.Equals(""))
             {
                 player.ZoneEnd = Int32.Parse(endFrame.Text);
             }
         }
     }
     else
     {
         MessageBox.Show("Please configure video input first", "No video input found", MessageBoxButtons.OK, MessageBoxIcon.Stop);
     }
 }
コード例 #5
0
        /// <summary>
        /// opens the AviSynth preview for a given AviSynth script
        /// gets the properties of the video, registers the callbacks, updates the video bitrate (we know the lenght of the video now) and updates the commandline
        /// with the scriptname
        /// </summary>
        /// <param name="fileName">the AviSynth scrip to be opened</param>
        private void openAvisynthScript(string fileName)
        {
            if (this.player != null) // make sure only one preview window is open at all times
            {
                player.Close();
            }
            player = new VideoPlayer();
            bool videoLoaded = player.loadVideo(mainForm, fileName, PREVIEWTYPE.CREDITS, true);

            if (videoLoaded)
            {
                if (info.DARX < 1 || info.DARY < 1)
                {
                    info.DARX = player.File.DARX;
                    info.DARY = player.File.DARY;
                }
                player.PARX = info.DARX;
                player.PARY = info.DARY;
                player.IntroCreditsFrameSet += new IntroCreditsFrameSetCallback(player_IntroCreditsFrameSet);
                player.Closed += new EventHandler(player_Closed);
                player.Show();
            }
        }
コード例 #6
0
ファイル: ZonesControl.cs プロジェクト: RoDaniel/featurehouse
 private void showVideoButton_Click(object sender, System.EventArgs e)
 {
     if (!this.input.Equals(""))
     {
         if (player == null)
         {
             player = new VideoPlayer();
             bool videoLoaded = player.loadVideo(mainForm, input, PREVIEWTYPE.ZONES, false);
             if (videoLoaded)
             {
                 player.ZoneSet += new ZoneSetCallback(player_ZoneSet);
                 player.Closed += new EventHandler(player_Closed);
                 if (introEndFrame > 0)
                     player.IntroEnd = this.introEndFrame;
                 if (creditsStartFrame > 0)
                     player.CreditsStart = this.creditsStartFrame;
                 player.Show();
             }
             else
                 return;
         }
         if (zoneListView.SelectedItems.Count == 1) // a zone has been selected, show that zone
         {
             Zone zone = (Zone)zoneListView.SelectedItems[0].Tag;
             player.ZoneStart = zone.startFrame;
             player.ZoneEnd = zone.endFrame;
         }
         else // no zone has been selected.. but if start and / or end frame have been configured show them in the preview
         {
             if (!startFrame.Text.Equals(""))
             {
                 player.ZoneStart = Int32.Parse(startFrame.Text);
             }
             if (!endFrame.Text.Equals(""))
             {
                 player.ZoneEnd = Int32.Parse(endFrame.Text);
             }
         }
     }
     else
         MessageBox.Show("Please configure video input first", "No video input found", MessageBoxButtons.OK, MessageBoxIcon.Stop);
 }
コード例 #7
0
        /// <summary>
        /// opens the AviSynth preview for a given AviSynth script
        /// gets the properties of the video, registers the callbacks, updates the video bitrate (we know the lenght of the video now) and updates the commandline
        /// with the scriptname
        /// </summary>
        /// <param name="fileName">the AviSynth script to be opened</param>
        private void openAvisynthScript(string fileName)
        {
            if (this.player != null) // make sure only one preview window is open at all times
                player.Close();
            player = new VideoPlayer();
            info.DAR = null; // to be sure to initialize DAR values
            bool videoLoaded = player.loadVideo(mainForm, fileName, PREVIEWTYPE.CREDITS, true);
            if (videoLoaded)
            {
                info.DAR = info.DAR ?? player.File.Info.DAR;
                player.DAR = info.DAR;

                player.IntroCreditsFrameSet += new IntroCreditsFrameSetCallback(player_IntroCreditsFrameSet);
                player.Closed += new EventHandler(player_Closed);
                player.Show();
                if (mainForm.Settings.AlwaysOnTop) player.TopMost = true;
            }
        }
コード例 #8
0
        private void showVideoButton_Click(object sender, System.EventArgs e)
        {
            if (String.IsNullOrEmpty(this.videoInput) || player == null)
            {
                using (OpenFileDialog d = new OpenFileDialog())
                {
                    d.Filter      = "AviSynth Script|*.avs";
                    d.Multiselect = false;
                    if (!String.IsNullOrEmpty(this.videoInput))
                    {
                        d.FileName = videoInput;
                    }
                    if (d.ShowDialog() != DialogResult.OK)
                    {
                        MessageBox.Show("Please configure video input first", "No video input found", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        return;
                    }

                    this.videoInput = d.FileName;
                }
            }

            if (player == null)
            {
                player = new VideoPlayer();
            }

            if (player.loadVideo(MainForm.Instance, videoInput, PREVIEWTYPE.CHAPTERS, false))
            {
                player.Closed     += new EventHandler(player_Closed);
                player.ChapterSet += new ChapterSetCallback(player_ChapterSet);
                if (IntroEndFrame > 0)
                {
                    player.IntroEnd = this.IntroEndFrame;
                }
                if (CreditsStartFrame > 0)
                {
                    player.CreditsStart = this.CreditsStartFrame;
                }
                player.Show();
                player.SetScreenSize();
                this.TopMost = player.TopMost = true;
                if (!MainForm.Instance.Settings.AlwaysOnTop)
                {
                    player.TopMost = false;
                }
                if (!chkOnTop.Checked)
                {
                    this.TopMost = false;
                }

                bNoUpdates          = true;
                fpsChooserOut.Value = (decimal)player.Framerate;
                if (fpsChooserIn.Value == null || !bInputFPSKnown)
                {
                    fpsChooserIn.Value = (decimal)player.Framerate;
                }
                bNoUpdates = false;
            }
            else
            {
                return;
            }

            if (chapterListView.SelectedItems.Count == 1 && chapterListView.SelectedItems[0].Tag != null)
            {
                // a chapter has been selected, show that chapter
                SetPlayerPosition(pgc.Chapters[chapterListView.SelectedIndices[0]]);
            }
            else if (pgc.HasChapters)
            {
                // select first non 00:00:00 chapter
                Chapter chapter = pgc.Chapters[0];
                if (pgc.Chapters[0].Time.TotalMilliseconds == 0 && pgc.Chapters.Count > 1)
                {
                    chapter = pgc.Chapters[1];
                }
                SetPlayerPosition(chapter);
            }
        }
コード例 #9
0
        private void showVideoButton_Click(object sender, System.EventArgs e)
        {
            if (!this.videoInput.Equals(""))
            {
                if (player == null)
                {
                    player = new VideoPlayer();
                    bool videoLoaded = player.loadVideo(mainForm, videoInput, PREVIEWTYPE.CHAPTERS, false);
                    if (videoLoaded)
                    {
                        player.Closed += new EventHandler(player_Closed);
                        player.ChapterSet += new ChapterSetCallback(player_ChapterSet);
                        if (introEndFrame > 0)
                            player.IntroEnd = this.introEndFrame;
                        if (creditsStartFrame > 0)
                            player.CreditsStart = this.creditsStartFrame;
                        player.Show();
                    }
                    else
                        return;
                }
                if (chapterListView.SelectedItems.Count == 1) // a zone has been selected, show that zone
                {
                    Chapter chap = (Chapter)chapterListView.SelectedItems[0].Tag;
                    int time = Util.getTimeCode(chap.timecode);
                    double framerate = player.Framerate;
                    int frameNumber = Util.convertTimecodeToFrameNumber(time, framerate);
                    player.CurrentFrame = frameNumber;

                }
                else // no chapter has been selected.. but if start time is configured, show the frame in the preview
                {
                    if (!startTime.Text.Equals(""))
                    {
                        int time = Util.getTimeCode(startTime.Text);
                        double framerate = player.Framerate;
                        int frameNumber = Util.convertTimecodeToFrameNumber(time, framerate);
                        player.CurrentFrame = frameNumber;
                    }
                }
            }
            else
                MessageBox.Show("Please configure video input first", "No video input found", MessageBoxButtons.OK, MessageBoxIcon.Stop);
        }