Example #1
0
        private void MediaInfoForm_Load(object sender, EventArgs e)
        {
            // Check for changes in screen resolution and screen changes (multi monitor support) - this HAS to be in Load and NOT in the constructor since the form has not been initiatized yet
            this.MaximumSize = Screen.FromControl(this).WorkingArea.Size; // Set the maximum size for the form based on working areas so we don't end up with dead/inaccessible locations

            LocaliseForms.LocaliseForm(this, toolTip);
        }
        private void SetSeriesId_Load(object sender, EventArgs e)
        {
            // Check for changes in screen resolution and screen changes (multi monitor support) - this HAS to be in Load and NOT in the constructor since the form has not been initiatized yet
            this.MaximumSize = Screen.FromControl(this).WorkingArea.Size; // Set the maximum size for the form based on working areas so we don't end up with dead/inaccessible locations

            // Create and populate the necessary rows
            if (_cjo.metadataCorrections != null)
            {
                for (int i = 0; i < _cjo.metadataCorrections.Length; i++)
                {
                    if (i > 0)
                    {
                        AddRow(); // add a row
                    }
                    ((TextBox)this.Controls.Find("originalTitleTxt" + i.ToString(), true)[0]).Text  = _cjo.metadataCorrections[i].originalTitle;
                    ((TextBox)this.Controls.Find("correctedTitleTxt" + i.ToString(), true)[0]).Text = _cjo.metadataCorrections[i].correctedTitle;
                    ((TextBox)this.Controls.Find("tvdbSeriesId" + i.ToString(), true)[0]).Text      = _cjo.metadataCorrections[i].tvdbSeriesId;
                    ((TextBox)this.Controls.Find("imdbSeriesId" + i.ToString(), true)[0]).Text      = _cjo.metadataCorrections[i].imdbSeriesId;
                }
            }

            airDateMatchChk.Checked   = _cjo.prioritizeOriginalBroadcastDateMatch; // Priortize matching air date
            downloadBannerChk.Checked = _cjo.downloadBanner;                       // Download banner

            LocaliseForms.LocaliseForm(this, toolTip);
        }
        private void ConversionTaskExpertSettingsForm_Load(object sender, EventArgs e)
        {
            // Check for changes in screen resolution and screen changes (multi monitor support) - this HAS to be in Load and NOT in the constructor since the form has not been initiatized yet
            this.MaximumSize = Screen.FromControl(this).WorkingArea.Size; // Set the maximum size for the form based on working areas so we don't end up with dead/inaccessible locations

            _loading = true;

            LocaliseForms.LocaliseForm(this, toolTip); // Localize form
            ReadSettings(_cjo);                        // Read settings

            _loading = false;
        }
Example #4
0
        private void ConnectionCredentials_Load(object sender, EventArgs e)
        {
            // Check for changes in screen resolution and screen changes (multi monitor support) - this HAS to be in Load and NOT in the constructor since the form has not been initiatized yet
            this.MaximumSize = Screen.FromControl(this).WorkingArea.Size; // Set the maximum size for the form based on working areas so we don't end up with dead/inaccessible locations

            LocaliseForms.LocaliseForm(this, toolTip);

            if (String.IsNullOrWhiteSpace(domainNameTxt.Text) && String.IsNullOrWhiteSpace(userNameTxt.Text) && String.IsNullOrWhiteSpace(passwordTxt.Text)) // if all are empty then use the default Guest username
            {
                userNameTxt.Text = GlobalDefs.DEFAULT_NETWORK_USERNAME;
            }
        }
Example #5
0
        private void MonitorTasksListForm_Load(object sender, EventArgs e)
        {
            // Check for changes in screen resolution and screen changes (multi monitor support) - this HAS to be in Load and NOT in the constructor since the form has not been initiatized yet
            this.MaximumSize = Screen.FromControl(this).WorkingArea.Size; // Set the maximum size for the form based on working areas so we don't end up with dead/inaccessible locations

            int count = 1;

            foreach (MonitorJobOptions mjo in _monitorTasks)
            {
                CheckBox checkBox = new System.Windows.Forms.CheckBox();
                checkBox.AutoSize = true;
                checkBox.Location = new System.Drawing.Point(43, 25 * count);
                checkBox.Name     = "mjoBox" + count.ToString();
                checkBox.Size     = new System.Drawing.Size(134, 17);
                checkBox.TabIndex = count;
                checkBox.Text     = mjo.taskName;
                checkBox.UseVisualStyleBackColor = true;

                // If nothing is there then we assume all are checked
                if (_cjo.monitorTaskNames != null)
                {
                    if (_cjo.monitorTaskNames.Contains(mjo.taskName))
                    {
                        checkBox.Checked = true;
                    }
                    else
                    {
                        checkBox.Checked = false;
                    }
                }
                else
                {
                    checkBox.Checked = true;
                }

                Controls.Add(checkBox);

                count++;
            }

            // Move the other button accordingly
            okCmd.Location     = new Point(okCmd.Location.X, okCmd.Location.Y + (25 * count));
            cancelCmd.Location = new Point(cancelCmd.Location.X, cancelCmd.Location.Y + (25 * count));

            // Localize the text
            LocaliseForms.LocaliseForm(this, toolTip);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // Check for changes in screen resolution and screen changes (multi monitor support) - this HAS to be in Load and NOT in the constructor since the form has not been initiatized yet
            this.MaxHeight = System.Windows.SystemParameters.WorkArea.Height; // Set the maximum size for the form based on working areas so we don't end up with dead/inaccessible locations
            this.MaxWidth  = System.Windows.SystemParameters.WorkArea.Width;  // Set the maximum size for the form based on working areas so we don't end up with dead/inaccessible locations

            gridWidthMargin  = this.ActualWidth - displayGrid.ActualWidth;
            gridHeightMargin = this.ActualHeight - displayGrid.ActualHeight;

            scrollBars.MaxHeight = this.MaxHeight - gridHeightMargin;
            scrollBars.MaxWidth  = this.MaxWidth - gridWidthMargin;

            LocaliseForms.LocaliseForm(this); // Localize form

            // Create a timer that will update the counters and the time slider
            _sliderUpdateTimer          = new DispatcherTimer();
            _sliderUpdateTimer.Interval = TimeSpan.FromMilliseconds(100);
            _sliderUpdateTimer.Tick    += new EventHandler(sliderTimer_Tick);

            // Create a timer that will check for load timeouts
            _mediaLoadTimer          = new DispatcherTimer();
            _mediaLoadTimer.Interval = TimeSpan.FromMilliseconds(MEDIA_LOAD_TIMEOUT); // Give it 10 seconds to timeout to load file
            _mediaLoadTimer.Tick    += new EventHandler(mediaLoadTimer_Tick);
        }
Example #7
0
        private void SettingsForm_Load(object sender, EventArgs e)
        {
            // Check for changes in screen resolution and screen changes (multi monitor support) - this HAS to be in Load and NOT in the constructor since the form has not been initiatized yet
            this.MaximumSize = Screen.FromControl(this).WorkingArea.Size; // Set the maximum size for the form based on working areas so we don't end up with dead/inaccessible locations

            LocaliseForms.LocaliseForm(this, toolTip, taskContextMenuStrip);

            foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.AllCultures))
            {
                string culture = "";
                try
                {
                    culture = CultureInfo.CreateSpecificCulture(ci.Name).DisplayName;
                    if (!localeCbo.Items.Contains(culture))
                    {
                        localeCbo.Items.Add(culture);
                    }
                }
                catch { }
            }

            ReadSettings();
            showAdvControls_Click(sender, e); // close the advanced settings section
        }
Example #8
0
        /// <summary>
        /// Show the media information
        /// </summary>
        /// <param name="mParams">MediaInfoFormParams object</param>
        public void ShowMediaInfo(object mParams)
        {
            MediaInfoFormParams mediaParams = (MediaInfoFormParams)mParams;
            string    sourceVideo           = mediaParams.sourceVideo;
            MediaInfo mediaInfo             = mediaParams.mediaInfo;
            ToolTip   toolTip = mediaParams.toolTip;

            // Video Name
            mediaSpace.SelectionAlignment = HorizontalAlignment.Center;
            mediaSpace.SelectionFont      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
            mediaSpace.AppendText(Path.GetFileName(sourceVideo) + "\n");
            mediaSpace.SelectionFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));

            // Video information
            TimeSpan t        = TimeSpan.FromSeconds(mediaInfo.VideoInfo.Duration);
            string   duration = string.Format("{0:D2}h : {1:D2}m : {2:D2}s",
                                              t.Hours,
                                              t.Minutes,
                                              t.Seconds);

            mediaSpace.AppendText("\n");
            mediaSpace.SelectionFont      = new System.Drawing.Font("Microsoft Sans Serif", 8.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
            mediaSpace.SelectionAlignment = HorizontalAlignment.Center;
            mediaSpace.AppendText(Localise.GetPhrase("Video") + "\n");
            mediaSpace.SelectionFont      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
            mediaSpace.SelectionAlignment = HorizontalAlignment.Left;
            mediaSpace.AppendText("------------------------------------------------------------------------------");
            mediaSpace.AppendText("\n" + Localise.GetPhrase("Codec") + "\t  :  " + mediaInfo.VideoInfo.VideoCodec);
            mediaSpace.AppendText("\n" + Localise.GetPhrase("Duration") + "\t  :  " + duration);
            mediaSpace.AppendText("\n" + Localise.GetPhrase("Height") + "\t  :  " + mediaInfo.VideoInfo.Height.ToString().Replace("-1", "-"));
            mediaSpace.AppendText("\n" + Localise.GetPhrase("Width") + "\t  :  " + mediaInfo.VideoInfo.Width.ToString().Replace("-1", "-"));
            mediaSpace.AppendText("\n" + Localise.GetPhrase("FPS") + "\t  :  " + mediaInfo.VideoInfo.FPS.ToString(System.Globalization.CultureInfo.InvariantCulture));

            // Audio Information
            if (mediaInfo.AudioInfo != null)
            {
                for (int i = 0; i < mediaInfo.AudioInfo.Count; i++)
                {
                    mediaSpace.AppendText("\n\n");
                    mediaSpace.SelectionFont      = new System.Drawing.Font("Microsoft Sans Serif", 8.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
                    mediaSpace.SelectionAlignment = HorizontalAlignment.Center;
                    mediaSpace.AppendText(Localise.GetPhrase("Audio") + " " + (i + 1).ToString() + "\n");
                    mediaSpace.SelectionFont      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
                    mediaSpace.SelectionAlignment = HorizontalAlignment.Left;
                    mediaSpace.AppendText("------------------------------------------------------------------------------");
                    try
                    {
                        mediaSpace.AppendText(Localise.GetPhrase("Language") + " :  " + ISO639_3.GetLanguageName(mediaInfo.AudioInfo[i].Language));
                        if (!String.IsNullOrEmpty(mediaInfo.AudioInfo[i].Language))
                        {
                            mediaSpace.AppendText("  (" + mediaInfo.AudioInfo[i].Language + ")");
                        }
                        if (mediaInfo.AudioInfo[i].Impaired)
                        {
                            mediaSpace.AppendText("  (" + Localise.GetPhrase("Impaired") + ")");
                        }
                    }
                    catch
                    {
                        mediaSpace.AppendText(Localise.GetPhrase("Language") + " :  " + Localise.GetPhrase("Unknown")); // Exception thrown if the language code is not known
                        if (mediaInfo.AudioInfo[i].Impaired)
                        {
                            mediaSpace.AppendText("  (" + Localise.GetPhrase("Impaired") + ")");
                        }
                    }
                    mediaSpace.AppendText("\n" + Localise.GetPhrase("Codec") + "\t :  " + mediaInfo.AudioInfo[i].AudioCodec);
                    mediaSpace.AppendText("\n" + Localise.GetPhrase("Channels") + "  :  " + mediaInfo.AudioInfo[i].Channels.ToString().Replace("-1", "-"));
                }
            }

            // Subtitle Information - no need to show, we don't use it in MCEBuddy
            if (mediaInfo.SubtitleInfo != null)
            {
                for (int i = 0; i < mediaInfo.SubtitleInfo.Count; i++)
                {
                    mediaSpace.AppendText("\n\n");
                    mediaSpace.SelectionFont      = new System.Drawing.Font("Microsoft Sans Serif", 8.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
                    mediaSpace.SelectionAlignment = HorizontalAlignment.Center;
                    mediaSpace.AppendText(Localise.GetPhrase("Subtitle") + " " + (i + 1).ToString() + "\n");
                    mediaSpace.SelectionFont      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
                    mediaSpace.SelectionAlignment = HorizontalAlignment.Left;
                    mediaSpace.AppendText("------------------------------------------------------------------------------");

                    try
                    {
                        mediaSpace.AppendText(Localise.GetPhrase("Language") + " :  " + ISO639_3.GetLanguageName(mediaInfo.SubtitleInfo[i].Language));
                        if (!String.IsNullOrEmpty(mediaInfo.SubtitleInfo[i].Language))
                        {
                            mediaSpace.AppendText("  (" + mediaInfo.SubtitleInfo[i].Language + ")");
                        }
                    }
                    catch
                    {
                        mediaSpace.AppendText(Localise.GetPhrase("Language") + " :  " + Localise.GetPhrase("Unknown")); // Exception thrown if the language code is not known
                    }
                    mediaSpace.AppendText("\n" + Localise.GetPhrase("Codec") + "\t :  " + mediaInfo.SubtitleInfo[i].Name);
                }
            }

            mediaSpace.Height = 170 + 78 * (mediaInfo.AudioInfo == null ? 0 : mediaInfo.AudioInfo.Count) + 60 * (mediaInfo.SubtitleInfo == null ? 0 : mediaInfo.SubtitleInfo.Count); // Name+Video 170, Audio 75, Subtitle 60 each
            this.Height       = mediaSpace.Bottom + 10;                                                                                                                              // Window height buffer from edge
            LocaliseForms.LocaliseForm(this, toolTip);                                                                                                                               // Localize the Text
            ShowDialog();
            Focus();

            return;
        }