Beispiel #1
0
 private void DoRips()
 {
     dgRips.Rows.Clear();
     FilmRip[] rips = RipService.CreateRip(film);
     for (int i = 0; i < rips.Length; i++)
     {
         dgRips.Rows.Add();
         dgRips.Rows[i].Cells[0].Value = rips[i].GetTitle();
         dgRips.Rows[i].Cells[1].Value = rips[i].GetVideo();
         dgRips.Rows[i].Cells[2].Value = rips[i].GetAudio();
         dgRips.Rows[i].Cells[3].Value = rips[i].GetSize();
     }
     dgRips.ClearSelection();
     dgRips.AutoSize = true;
 }
Beispiel #2
0
 private void btnCalc_Click(object sender, EventArgs e)
 {
     try {
         Film film = new Film
         {
             duration = dtDuration.Text,
             width    = Convert.ToInt32(tbWidth.Text),
             height   = Convert.ToInt32(tbHeight.Text),
             channels = Convert.ToInt32(tbChannels.Text)
         };
         double qualityVideo = Convert.ToDouble(tbQualityVideo.Text);
         double fps          = Convert.ToDouble(tbFPS.Text);
         int    qualityAudio = Convert.ToInt32(tbQualityAudio.Text);
         dgRips.Rows.Clear();
         FilmRip[] rips = RipService.CreateRip(film, qualityVideo, fps, qualityAudio);
         for (int i = 0; i < rips.Length; i++)
         {
             dgRips.Rows.Add();
             dgRips.Rows[i].Cells[0].Value = rips[i].GetTitle();
             dgRips.Rows[i].Cells[1].Value = rips[i].GetVideo();
             dgRips.Rows[i].Cells[2].Value = rips[i].GetAudio();
             dgRips.Rows[i].Cells[3].Value = rips[i].GetSize();
         }
         dgRips.ClearSelection();
         dgRips.AutoSize  = true;
         tbVideoKbps.Text = ((int)Math.Round((Convert.ToDouble(tbWidth.Text) * Convert.ToDouble(tbHeight.Text) *
                                              Convert.ToDouble(tbFPS.Text) / 1000.0 * Convert.ToDouble(tbQualityVideo.Text)), 0)).ToString();
         tbAudioKbps.Text = (Convert.ToInt32(tbQualityAudio.Text) * Convert.ToInt32(tbChannels.Text)).ToString();
         tbTotalKbps.Text = (Convert.ToInt32(tbVideoKbps.Text) + Convert.ToInt32(tbAudioKbps.Text)).ToString();
         label21.Top      = dgRips.Bottom; tbAdress.Top = dgRips.Bottom; btnLoad.Top = dgRips.Bottom;
         pbFrame.Width    = 880; pbFrame.Height = 495; pbFrame.Top = label21.Bottom + 10; pbFrame.Left = (Width - pbFrame.Width) / 2;
         label14.Top      = pbFrame.Bottom + 10; numLeft.Top = pbFrame.Bottom + 10;
         label15.Top      = pbFrame.Bottom + 10; numUp.Top = pbFrame.Bottom + 10;
         label16.Top      = pbFrame.Bottom + 10; numRight.Top = pbFrame.Bottom + 10;
         label17.Top      = pbFrame.Bottom + 10; numDown.Top = pbFrame.Bottom + 10;
         label19.Top      = label17.Bottom + 10; numSensitivity.Top = label17.Bottom + 10;
         btnAnalyse.Top   = pbFrame.Bottom + 10; label18.Top = pbFrame.Bottom + 10;
     }
     catch {
         MessageBox.Show(@"Проверьте корректность заполнения всех полей!");
     }
 }
Beispiel #3
0
        private void Render()
        {
            lblTitle.Text = MainForm.GetInstance().GetFilmsList().GetFilmDisplayedName(film);
            lblTitle.Left = (int)((Size.Width - lblTitle.Size.Width) / 2.0);
            pbPoster.Top  = lblTitle.Bottom + 10;
            if (pbPoster.Image != null && pbRating.Image != null)
            {
                pbPoster.ClientSize = new Size(400, (int)(pbPoster.Image.Height / (double)pbPoster.Image.Width * 400.0));
                pbPoster.SizeMode   = PictureBoxSizeMode.StretchImage;
                pbRating.Top        = pbPoster.Bottom + 10;
            }
            lblLink.Top         = pbRating.Bottom + 10;
            lblCountry.Text     = film.country; label1.Top = lblTitle.Bottom + 10; lblCountry.Top = lblTitle.Bottom + 10;
            lblGenre.Text       = film.genre; label2.Top = lblCountry.Bottom; lblGenre.Top = lblCountry.Bottom;
            lblDirector.Text    = film.director; label3.Top = lblGenre.Bottom; lblDirector.Top = lblGenre.Bottom;
            lblActors.Text      = film.actors; label4.Top = lblDirector.Bottom; lblActors.Top = lblDirector.Bottom;
            lblDescription.Text = film.description; label5.Top = lblActors.Bottom; lblDescription.Top = lblActors.Bottom;
            lblWorldDate.Text   = film.worldDate; label6.Top = lblDescription.Bottom; lblWorldDate.Top = lblDescription.Bottom;
            lblRussianDate.Text = film.russianDate; label7.Top = lblWorldDate.Bottom; lblRussianDate.Top = lblWorldDate.Bottom;
            lblDiscDate.Text    = film.discDate; label8.Top = lblRussianDate.Bottom; lblDiscDate.Top = lblRussianDate.Bottom;
            lblDuration.Text    = film.duration; label9.Top = lblDiscDate.Bottom; lblDuration.Top = lblDiscDate.Bottom;
            lblQuality.Text     = $"{film.qualityTitle} {film.qualityPixel}"; label10.Top = lblDuration.Bottom; lblQuality.Top = lblDuration.Bottom;
            lblTranslate.Text   = $"{film.translateTitle} ({film.translateComment})"; label11.Top = lblQuality.Bottom; lblTranslate.Top = lblQuality.Bottom;
            lblVideo.Text       = $"{film.videoCodec}, {film.originalWidth}x{film.originalHeight}, {film.videoKbps} Kbps, {film.fps} fps";
            label12.Top         = lblTranslate.Bottom; lblVideo.Top = lblTranslate.Bottom;
            lblAudio.Text       = $"{film.audioCodec}, {film.channels} ch, {film.audioKbps} Kbps";
            label13.Top         = lblVideo.Bottom; lblAudio.Top = lblVideo.Bottom;
            lblSize.Text        = RipService.GetRipSize(film.duration, film.videoKbps, film.audioKbps, film.originalWidth, film.originalHeight, film.fps);
            label14.Top         = lblAudio.Bottom; lblSize.Top = lblAudio.Bottom;
            int point = label14.Bottom;

            if (lblLink.Bottom > point)
            {
                point = lblLink.Bottom;
            }
            label15.Left = (int)((Size.Width - label15.Size.Width) / 2.0); label15.Top = point + 10;
            dgRips.Top   = label15.Bottom + 10;
            DoRips();
            AutoScrollPosition = new Point(0, 0);
        }
Beispiel #4
0
 public string GetSize()
 {
     return(RipService.GetRipSize(film.duration, videoKbps, audioKbps, width, height, fps));
 }