Ejemplo n.º 1
0
        /// <summary>
        /// Renames and moved the Remuxed file
        /// </summary>
        /// <returns></returns>
        private bool ReplaceTempRemuxed()
        {
            string newName = Path.Combine(_workingPath, Path.GetFileNameWithoutExtension(_originalFile) + _remuxTo);

            _jobLog.WriteEntry(this, Localise.GetPhrase("Changing rexumed file names") + " \nOriginalFile : " + _originalFile + " \nReMuxedFile : " + RemuxedTempFile + " \nConvertedFile : " + newName, Log.LogEntryType.Debug);
            try
            {
                FileIO.TryFileDelete(newName);                              // Incase it exists, delete it
                FileIO.MoveAndInheritPermissions(RemuxedTempFile, newName); // Change the name of the remuxed file

                // If the original file is in the working temp directory, then delete it
                if (Path.GetDirectoryName(_originalFile).ToLower() == _workingPath.ToLower())
                {
                    Util.FileIO.TryFileDelete(_originalFile);
                }

                _remuxedFile = newName; // Point it to the renamed file
            }
            catch (Exception e)
            {
                _jobLog.WriteEntry(this, Localise.GetPhrase("Unable to move remuxed file") + " " + RemuxedTempFile + "\r\nError : " + e.ToString(), Log.LogEntryType.Error);
                _jobStatus.ErrorMsg           = "Unable to move remux file";
                _jobStatus.PercentageComplete = 0;
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        private void conversionCbo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (profileCbo.SelectedItem.ToString().Contains("-----"))
            {
                MessageBox.Show(Localise.GetPhrase("Please select a valid profile"), Localise.GetPhrase("Invalid Profile"));
                profileCbo.SelectedIndex = 0;
                return;
            }

            foreach (string[] profileSummary in StatusForm.profilesSummary)
            {
                if (profileCbo.SelectedItem.ToString() == profileSummary[0])
                {
                    conversionDescriptionTxt.Text = profileSummary[1];

                    // Check if we need scroll bars
                    Size tS = TextRenderer.MeasureText(conversionDescriptionTxt.Text, conversionDescriptionTxt.Font, new Size(conversionDescriptionTxt.Width, int.MaxValue), (TextFormatFlags.WordBreak | TextFormatFlags.TextBoxControl));

                    if (tS.Height > conversionDescriptionTxt.Height)
                    {
                        conversionDescriptionTxt.ScrollBars = ScrollBars.Vertical;
                    }
                    else
                    {
                        conversionDescriptionTxt.ScrollBars = ScrollBars.None;
                    }

                    return;
                }
            }
        }
Ejemplo n.º 3
0
        protected override void SetVideoCropping()
        {
            if (!_skipCropping)
            {
                if (ParameterValue("-ovc") == "copy") // For copy video stream don't set video prcoessing parameters, it can break the conversion
                {
                    _jobLog.WriteEntry(this, "Video Copy codec detected, skipping cropping", Log.LogEntryType.Warning);
                    return;
                }

                // Check if we need to run cropping
                if (String.IsNullOrEmpty(_videoFile.CropString))
                {
                    _jobStatus.CurrentAction = Localise.GetPhrase("Analyzing video information");
                    _videoFile.UpdateCropInfo(_jobLog);
                }

                // Check if we have a valid crop string
                if (!String.IsNullOrWhiteSpace(_videoFile.CropString))
                {
                    ParameterReplaceOrInsertVideoFilter("crop", "=" + _videoFile.CropString);
                    _jobLog.WriteEntry(this, Localise.GetPhrase("MEncoder setting up video cropping"), Log.LogEntryType.Information);
                }
                else
                {
                    _jobLog.WriteEntry(this, Localise.GetPhrase("MEncoder found no video cropping"), Log.LogEntryType.Information);
                }
            }
            else
            {
                _jobLog.WriteEntry(this, Localise.GetPhrase("MEncoder Skipping video cropping"), Log.LogEntryType.Information);
            }
        }
Ejemplo n.º 4
0
        void eMail_SendTest(GeneralOptions go)
        {
            bool success = false;

            try
            {
                success = _pipeProxy.TestEmailSettings(go.eMailSettings.eMailBasicSettings);

                if (!success)
                {
                    MessageBox.Show(Localise.GetPhrase("Send eMail test failed! Please check your settings and internet connectivity"), Localise.GetPhrase("Test eMail Failed"));
                }
                else
                {
                    MessageBox.Show(Localise.GetPhrase("Send eMail test successful"), Localise.GetPhrase("Test eMail Success"));
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(Localise.GetPhrase("Unable to communicate with engine."), Localise.GetPhrase("Communication Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log.WriteSystemEventLog(Localise.GetPhrase("MCEBuddy GUI: Unable to get pipe active status"), EventLogEntryType.Warning);
                Log.WriteSystemEventLog(e.ToString(), EventLogEntryType.Warning);
            }

            // Enable the controls
            foreach (Control ctl in this.Controls)
            {
                ctl.Enabled = true;
            }

            testSettings.Text = Localise.GetPhrase("Test");

            _testThread = null; // This is done
        }
        /// <summary>
        /// Called after the form has been loaded but before it is shown to the user.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                Localise.Form(this);

                pictureBoxLogo.Image = Images.Radio48x48;

                Answers = new ReceiverConfigurationWizardAnswers()
                {
                    ConnectionType     = ConnectionType.TCP,
                    DedicatedReceiver  = DedicatedReceiver.KineticAvionicsAll,
                    KineticConnection  = KineticConnection.BaseStation,
                    ReceiverClass      = ReceiverClass.SoftwareDefinedRadio,
                    SdrDecoder         = SdrDecoder.Rtl1090,
                    UseLoopbackAddress = YesNo.Yes,
                };

                foreach (WizardPage page in wizard.Pages)
                {
                    page.CloseFromNext += Page_CloseFromNext;
                    page.CloseFromBack += Page_CloseFromBack;
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Write the EDL Box data to the EDL File
        /// </summary>
        /// <param name="edlFile">EdlFile to write to</param>
        /// <returns>True if successful</returns>
        private bool WriteEDL(string edlFile)
        {
            try
            {
                // Create an EDL File
                string edlEntries = "";
                foreach (CutStartEnd cut in edlCuts.Items)
                {
                    edlEntries += TimeSpan.ParseExact(cut.CutStart, @"hh\:mm\:ss\.fff", CultureInfo.InvariantCulture).TotalSeconds.ToString("0.000", CultureInfo.InvariantCulture) + "\t" + TimeSpan.ParseExact(cut.CutEnd, @"hh\:mm\:ss\.fff", CultureInfo.InvariantCulture).TotalSeconds.ToString("0.000", CultureInfo.InvariantCulture) + "\t" + "0" + "\r\n";
                }

                // Write to EDL file
                if (!String.IsNullOrWhiteSpace(edlEntries))                                      // Check if these is something to write
                {
                    System.IO.File.WriteAllText(edlFile, edlEntries, System.Text.Encoding.UTF8); // UTF format
                    MessageBox.Show(Localise.GetPhrase("Commercial cuts saved to EDL file") + "\r\n" + edlFile, Localise.GetPhrase("Save Complete"), MessageBoxButton.OK, MessageBoxImage.Information);
                    _savedEDLCuts = true;                                                        // We saved it
                }

                return(true);
            }
            catch (Exception e)
            {
                MessageBox.Show(Localise.GetPhrase("Error saving commercial cuts to EDL file") + "\r\n" + edlFile + "\r\n" + "Error : " + e.ToString(), Localise.GetPhrase("Save Error"), MessageBoxButton.OK, MessageBoxImage.Error);
                return(false);
            }
        }
Ejemplo n.º 7
0
        private void testSettings_Click(object sender, EventArgs e)
        {
            // Validate settings
            if (CheckSettings() == false)
            {
                return;
            }

            GeneralOptions go = _go.Clone(); // Create a temporary object to test with

            WriteSettings(go);               // Update the temp GO object with the test settings, only testing it so we don't need to write main object

            if (MessageBox.Show(Localise.GetPhrase("MCEBuddy will send an eMail to test the server settings.\r\nThis can take upto 60 seconds.\r\nMCEBuddy may be unresponsive during this period."),
                                Localise.GetPhrase("Test eMail"),
                                MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Cancel)
            {
                return;
            }


            // Disable the control except for Ok and Cancel
            foreach (Control ctl in this.Controls)
            {
                ctl.Enabled = false;
            }
            oKcmd.Enabled = cmdCancel.Enabled = true;

            testSettings.Text        = Localise.GetPhrase("Testing");
            _testThread              = new Thread(() => eMail_SendTest(go)); // Send the eMail through a thead
            _testThread.IsBackground = true;                                 // Kill thread when object terminates
            _testThread.Start();
        }
Ejemplo n.º 8
0
        private void deleteConvertedChk_CheckedChanged(object sender, EventArgs e)
        {
            if (loading) // nothing to do if the form is loading
            {
                return;
            }

            if (deleteConvertedChk.Checked)
            {
                DialogResult result =
                    MessageBox.Show(
                        Localise.GetPhrase("Do you wish MCEBuddy to delete each converted file when the original file has been deleted?"),
                        Localise.GetPhrase("Confirm sync conversions?"),
                        MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    deleteConvertedChk.Checked = true;
                    deleteOriginalChk.Checked  = archiveOriginalChk.Checked = false; //only delete or archive can be checked at a time
                }
                else
                {
                    deleteConvertedChk.Checked = false;
                }
            }
        }
Ejemplo n.º 9
0
        private void disableToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int enabledCount = 0;

            foreach (ListViewItem item in taskListLv.Items)
            {
                if (_mceOptions.GetConversionTaskByName(item.SubItems[0].Text).enabled)
                {
                    enabledCount++;
                }
            }

            // Cannot disable all conversion tasks
            if (enabledCount <= 1)
            {
                MessageBox.Show(Localise.GetPhrase("Atleast one Conversion Task must be enabled"), Localise.GetPhrase("Conversion Task"));
                return;
            }

            string selectedTaskName  = taskListLv.SelectedItems[0].SubItems[0].Text;
            ConversionJobOptions cjo = _mceOptions.GetConversionTaskByName(selectedTaskName);

            // Set it to disable in the config file
            cjo.enabled = false;
            _mceOptions.AddOrUpdateConversionTask(cjo, false);

            // Change the color
            taskListLv.SelectedItems[0].ForeColor = Color.LightGray;
        }
Ejemplo n.º 10
0
        private bool CheckValidTimes()
        {
            // Check if atleast one day of the week is enabled
            if (!(sunChk.Checked || monChk.Checked || tueChk.Checked || wedChk.Checked || thuChk.Checked || friChk.Checked || satChk.Checked))
            {
                MessageBox.Show(Localise.GetPhrase("Atleast one day of the week must be enabled"), Localise.GetPhrase("Invalid Days of Week"));
                return(false);
            }

            // check if any of the times aren't entered
            if (((wakeCheck.Checked || startCheck.Checked) && ("" == wakeHourCbo.Text || "" == wakeMinuteCbo.Text || "" == wakeAMPMCbo.Text)) || ((stopChk.Checked) && ("" == stopHourCbo.Text || "" == stopMinuteCbo.Text || "" == stopAMPMCbo.Text)))
            {
                MessageBox.Show(Localise.GetPhrase("Please enter a valid time"), Localise.GetPhrase("Invalid Time"));
                return(false);
            }

            if (stopChk.Enabled) // check if end time > start time
            {
                DateTime rn        = DateTime.Now;
                DateTime startTime = new DateTime(rn.Year, rn.Month, rn.Day, GetHour(wakeHourCbo, wakeAMPMCbo), int.Parse(wakeMinuteCbo.Text), 0);
                DateTime endTime   = new DateTime(rn.Year, rn.Month, rn.Day, GetHour(stopHourCbo, stopAMPMCbo), int.Parse(stopMinuteCbo.Text), 0);

                if (startTime >= endTime)
                {
                    if (MessageBox.Show(Localise.GetPhrase("Stop time is after Start time. Assuming the Stop time is during the next day, is that correct?"),
                                        Localise.GetPhrase("Time Check"),
                                        MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.No)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 11
0
        private void deleteConversionTaskCmd_Click(object sender, EventArgs e)
        {
            if (taskListLv.SelectedItems.Count > 0)
            {
                int enabledCount = 0;

                foreach (ListViewItem item in taskListLv.Items)
                {
                    if (_mceOptions.GetConversionTaskByName(item.SubItems[0].Text).enabled)
                    {
                        enabledCount++;
                    }
                }

                // Cannot disable/delete all conversion tasks, if we are deleting a disabled task no issues (disable click handler will handle not allowing all tasks to be disabled)
                if (enabledCount <= 1 && _mceOptions.GetConversionTaskByName(taskListLv.SelectedItems[0].SubItems[0].Text).enabled)
                {
                    MessageBox.Show(Localise.GetPhrase("Atleast one Conversion Task must be enabled"), Localise.GetPhrase("Delete Task"));
                    return;
                }

                if (MessageBox.Show(
                        Localise.GetPhrase("Are you sure you want to delete this task?"),
                        Localise.GetPhrase("Delete Task"),
                        MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    string selectedTaskName = taskListLv.SelectedItems[0].SubItems[0].Text;
                    _mceOptions.DeleteConversionTask(selectedTaskName, false);
                    ReadConversionTaskSettings();
                }
            }
        }
        private void DisplayeEventLog()
        {
            eventList.ListViewItemSorter = null; // Clear the sorter function to speed it up, else it sorts while adding
            eventList.Items.Clear();             // Clear the history

            foreach (EventLogEntry eventLogEntry in _eventLogEntries)
            {
                string message = "";

                foreach (string msg in eventLogEntry.ReplacementStrings)
                {
                    message += msg + "\n";
                }

                string[] evItem = new string[eventList.Columns.Count];                            // create list of Event Log entries
                evItem[eventList.Columns["type"].Index]     = eventLogEntry.EntryType.ToString(); // Type
                evItem[eventList.Columns["dateTime"].Index] = eventLogEntry.TimeGenerated.ToString("d-MMM-yyyy   h:mm tt", System.Globalization.CultureInfo.InvariantCulture);
                evItem[eventList.Columns["summary"].Index]  = message;
                eventList.Items.Add(new ListViewItem(evItem));
            }

            this.Text = Localise.GetPhrase("MCEBuddy Windows Event Log Viewer") + " - " + eventList.Items.Count + " " + Localise.GetPhrase("Entries");
            eventList.ListViewItemSorter = Sorter; // Set the sorter function
            Sorter.SortColumn            = 1;      // We need to sort by Date/Time
            Sorter.Order = SortOrder.Descending;   // We want to sort by latest logs first
            eventList.Sort();                      // Sort the logs
        }
        protected override void SetAudioLanguage()
        {
            // First clear any audio track selection if asked
            if (_encoderChooseBestAudioTrack) // We let the encoder choose the best audio track
            {
                _jobLog.WriteEntry(this, "Letting handbrake choose best audio track", Log.LogEntryType.Information);
                ParameterValueDelete("-a"); // Delete this parameter, let handbrake choose the best audio track
            }

            if (_videoFile.AudioTrack == -1)
            {
                _jobLog.WriteEntry(this, Localise.GetPhrase("Cannot get Audio and Video stream details, continuing with default Audio Language selection"), Log.LogEntryType.Warning);
            }
            else
            {
                // We need to compensate for zero channel audio tracks, which are ignored by handbrake
                // Cycle through and skip over zero channel tracks until we get the track we need
                int audioTrack = 1; // Baseline audio track for Handbrake is 1
                for (int i = 0; i < _videoFile.FFMPEGStreamInfo.AudioTracks; i++)
                {
                    if (_videoFile.AudioTrack == i) // We have reached the selected audio track limit
                    {
                        break;
                    }

                    if (_videoFile.FFMPEGStreamInfo.MediaInfo.AudioInfo[i].Channels != 0) // skip over 0 channel tracks until we reach the selected audio track
                    {
                        audioTrack++;
                    }
                }

                _jobLog.WriteEntry(this, "Selecting audio (normalized) track " + audioTrack.ToString(), Log.LogEntryType.Information);
                ParameterValueReplaceOrInsert("-a", audioTrack.ToString(System.Globalization.CultureInfo.InvariantCulture)); // Select the Audiotrack we had isolated earlier (1st Audio track is 1, FFMPEGStreamInfo is 0 based)
            }
        }
Ejemplo n.º 14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Localise.SetLayoutDirectionByPreference(this);
            SetContentView(Resource.Layout.FirstDebriefActivity);
            SupportActionBar.Title = StringResources.debriefing_activity_title;

            var emojiTextView = (EmojiAppCompatTextView)FindViewById(Resource.Id.emoji_text_view);

            emojiTextView.Text = EmojiCompat.Get().Process("\uD83C\uDF89");

            FindViewById <TextView>(Resource.Id.CongratsTitle).Text = StringResources.debriefing_congrats_title;
            FindViewById <TextView>(Resource.Id.CongratsBody).Text  = string.Format(
                StringResources.debriefing_congrats_body, GabberPCL.Config.PRINT_URL);

            FindViewById <TextView>(Resource.Id.ConsentTitle).Text = StringResources.debriefing_consent_title;
            FindViewById <TextView>(Resource.Id.ConsentBody1).Text = StringResources.debriefing_consent_body1;
            FindViewById <TextView>(Resource.Id.ConsentBody2).Text = StringResources.debriefing_consent_body2;
            FindViewById <TextView>(Resource.Id.ConsentBody3).Text = StringResources.debriefing_consent_body3;

            AppCompatButton finishButton = FindViewById <AppCompatButton>(Resource.Id.finishButton);

            finishButton.Text   = StringResources.debriefing_finish_button;
            finishButton.Click += FinishButton_Click;
        }
        private bool CheckValidEntries()
        {
            for (int i = 0; i < rowCount; i++)
            {
                string originalTitle  = ((TextBox)this.Controls.Find("originalTitleTxt" + i.ToString(), true)[0]).Text;
                string correctedTitle = ((TextBox)this.Controls.Find("correctedTitleTxt" + i.ToString(), true)[0]).Text;
                string tvdbSeriesId   = ((TextBox)this.Controls.Find("tvdbSeriesId" + i.ToString(), true)[0]).Text;
                string imdbSeriesId   = ((TextBox)this.Controls.Find("imdbSeriesId" + i.ToString(), true)[0]).Text;

                if (rowCount > 1) // If we have more than one entry, either enter a Corrected Title or enter a Series Id and MUST enter an original title
                {
                    if (String.IsNullOrWhiteSpace(originalTitle) ||
                        (String.IsNullOrWhiteSpace(correctedTitle) && String.IsNullOrWhiteSpace(tvdbSeriesId) && String.IsNullOrWhiteSpace(imdbSeriesId)) ||
                        (!String.IsNullOrWhiteSpace(correctedTitle) && (!String.IsNullOrWhiteSpace(tvdbSeriesId) || !String.IsNullOrWhiteSpace(imdbSeriesId))))
                    {
                        MessageBox.Show(Localise.GetPhrase("For each row, please enter the Original title to match the show name AND either a Corrected title or a TVDB/IMDB Series ID"), Localise.GetPhrase("Error"));
                        return(false);
                    }
                }
                else // We have only one entry, either enter a corrected title or a series id (original title is optional)
                {
                    if ((String.IsNullOrWhiteSpace(correctedTitle) && String.IsNullOrWhiteSpace(tvdbSeriesId) && String.IsNullOrWhiteSpace(imdbSeriesId)) ||
                        (!String.IsNullOrWhiteSpace(correctedTitle) && (!String.IsNullOrWhiteSpace(tvdbSeriesId) || !String.IsNullOrWhiteSpace(imdbSeriesId))))
                    {
                        MessageBox.Show(Localise.GetPhrase("Please enter either a Corrected title or a TVDB/IMDB Series ID"), Localise.GetPhrase("Error"));
                        return(false);
                    }
                }
            }

            return(true); // All good
        }
Ejemplo n.º 16
0
        private async Task GetLangData()
        {
            SupportedLanguages = (await LanguageChoiceManager.GetLanguageChoices()).OrderBy((lang) => lang.Code).ToList();

            // First time users logs in, set the language to their culture if we support it, or English.
            if (Session.ActiveUser.AppLang == 0)
            {
                var currentMobileLang = Localise.GetCurrentCultureInfo().TwoLetterISOLanguageName;
                var isSupportedLang   = SupportedLanguages.FirstOrDefault((lang) => lang.Code == currentMobileLang);
                Session.ActiveUser.AppLang = isSupportedLang != null ? isSupportedLang.Id : 1;
                // This will save the choice for future: reopening app, other activities, etc.
                Queries.SaveActiveUser();
            }

            var found = SupportedLanguages.Find((lang) => lang.Id == Session.ActiveUser.AppLang);

            StringResources.Culture = new CultureInfo(found.Code);
            Localise.SetLocale(StringResources.Culture);

            SetLayoutDirection();

            nav = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation);
            LoadNavigationTitles();
            nav.NavigationItemSelected += NavigationItemSelected;

            LanguageChoiceManager.RefreshIfNeeded();
        }
Ejemplo n.º 17
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            DomainCheck();

            if (passwordTxt.Text != confirmPasswordTxt.Text)
            {
                MessageBox.Show(Localise.GetPhrase("Passwords do not match, please reenter the passwords"), Localise.GetPhrase("Password Mismatch"));
                return;
            }

            if (object.ReferenceEquals(options.GetType(), (new MonitorJobOptions()).GetType())) // Check type of object
            {
                MonitorJobOptions mjo = (MonitorJobOptions)options;
                mjo.domainName = domainNameTxt.Text.Trim();
                mjo.userName   = userNameTxt.Text.Trim();
                mjo.password   = passwordTxt.Text;
            }
            else if (object.ReferenceEquals(options.GetType(), (new ConversionJobOptions()).GetType())) // Check type of object
            {
                ConversionJobOptions cjo = (ConversionJobOptions)options;
                cjo.domainName           = domainNameTxt.Text.Trim();
                cjo.userName             = userNameTxt.Text.Trim();
                cjo.password             = passwordTxt.Text;
                cjo.fallbackToSourcePath = fallbackToSourceChk.Checked;
            }
            else if (object.ReferenceEquals(options.GetType(), (new GeneralOptions()).GetType())) // Check type of object
            {
                GeneralOptions go = (GeneralOptions)options;
                go.domainName = domainNameTxt.Text.Trim();
                go.userName   = userNameTxt.Text.Trim();
                go.password   = passwordTxt.Text;
            }

            this.Close();
        }
Ejemplo n.º 18
0
        protected override void SetAudioLanguage()
        {
            // First clear any audio track selection if asked
            if (_encoderChooseBestAudioTrack) // Nothing to do here, Mencoder does not support multiple audio tracks
            {
                _jobLog.WriteEntry(this, "Letting mencoder choose best audio track: Nothing to do, mencoder does not support multiple audio tracks", Log.LogEntryType.Debug);
            }

            if (_videoFile.AudioPID == -1)
            {
                _jobLog.WriteEntry(this, Localise.GetPhrase("Cannot get Audio and Video stream details, continuing with default Audio Language selection"), Log.LogEntryType.Warning);
            }
            else
            {
                if (String.IsNullOrWhiteSpace(ParameterValue("-aid")))
                {
                    _jobLog.WriteEntry(this, "Selecting audio PID " + _videoFile.AudioPID.ToString(), Log.LogEntryType.Information);
                    ParameterValueReplaceOrInsert("-aid", (_videoFile.AudioPID).ToString(System.Globalization.CultureInfo.InvariantCulture)); // Select the Audio track PID we had isolated earlier
                }
                else
                {
                    _jobLog.WriteEntry(this, Localise.GetPhrase("User has specified Audio language selection in profile, continuing without Audio Language selection"), Log.LogEntryType.Warning);
                }
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Called when the form is ready for use but not yet on screen.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                toolStripDropDownButtonInvalidPluginCount.Visible    = false;
                toolStripDropDownButtonLaterVersionAvailable.Visible = false;

                Localise.Form(this);
                Localise.ToolStrip(contextMenuStripNotifyIcon);
                notifyIcon.Text = Strings.VirtualRadarServer;

                _OnlineHelp = new OnlineHelpHelper(this, OnlineHelpAddress.WinFormsMainDialog);

                _Presenter = Factory.Singleton.Resolve <IMainPresenter>();
                _Presenter.Initialise(this);
                _Presenter.UPnpManager = _UPnpManager;

                var runtimeEnvironment = Factory.Singleton.ResolveSingleton <IRuntimeEnvironment>();
                if (runtimeEnvironment.Is64BitProcess)
                {
                    Text = String.Format("{0} ({1})", Text, Strings.Title64Bit);
                }
            }
        }
Ejemplo n.º 20
0
        private void reconvertFileBtn_Click(object sender, EventArgs e)
        {
            if (showHistoryList.SelectedItems.Count == 0)
            {
                return;
            }

            if (MessageBox.Show(Localise.GetPhrase("Are you sure you want to reconvert the selected files?"),
                                Localise.GetPhrase("Reconvert files"),
                                MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes)
            {
                foreach (ListViewItem item in showHistoryList.SelectedItems)
                {
                    try
                    {
                        _pipeProxy.DeleteHistoryItem(item.Text);
                    }
                    catch (Exception e1)
                    {
                        MessageBox.Show(Localise.GetPhrase("Unable to communicate with engine."), Localise.GetPhrase("Communication Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Log.WriteSystemEventLog(Localise.GetPhrase("MCEBuddy GUI: Unable to clear History File"), EventLogEntryType.Warning);
                        Log.WriteSystemEventLog(e1.ToString(), EventLogEntryType.Warning);
                    }
                }

                // Reload form
                GetAndDisplayHistoryLog();
            }
        }
        private bool ValidateSettings()
        {
            if (GetProcessorAffinityMask() == (IntPtr)(-1))
            {
                MessageBox.Show(Localise.GetPhrase("Select atleast one processor to use"), Localise.GetPhrase("Invalid Configuration"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            if (String.IsNullOrWhiteSpace(pollPeriodTxt.Text) || (pollPeriodTxt.Text == "0"))
            {
                MessageBox.Show(Localise.GetPhrase("Invalid poll period"), Localise.GetPhrase("Invalid Configuration"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            if (String.IsNullOrWhiteSpace(serverPortTxt.Text) || (serverPortTxt.Text == "0"))
            {
                MessageBox.Show(Localise.GetPhrase("Invalid server port"), Localise.GetPhrase("Invalid Configuration"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            if (!String.IsNullOrWhiteSpace(customProfileTxt.Text) && !File.Exists(customProfileTxt.Text))
            {
                MessageBox.Show(Localise.GetPhrase("Invalid custom profiles.conf"), Localise.GetPhrase("Invalid Configuration"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            return(true);
        }
        private void deleteOriginalChk_CheckedChanged(object sender, EventArgs e)
        {
            if (_loading) // nothing to do if the form is loading
            {
                return;
            }

            if (deleteOriginalChk.Checked)
            {
                DialogResult result =
                    MessageBox.Show(
                        Localise.GetPhrase("Only select this option if MCEBuddy has been converting your files reliably for an acceptable period of time. Do you wish MCEBuddy to delete each original file once it has been converted?"),
                        Localise.GetPhrase("Confirm delete originals?"),
                        MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    deleteOriginalChk.Checked  = true;
                    archiveOriginalChk.Checked = false; //only delete or archive can be checked at a time
                }
                else
                {
                    deleteOriginalChk.Checked = false;
                }
            }
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Called when the user clicks the browse button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonBrowse_Click(object sender, EventArgs e)
        {
            string folder = null;

            if (!String.IsNullOrEmpty(FileName))
            {
                folder = Path.GetDirectoryName(FileName);
            }
            if (!Directory.Exists(folder))
            {
                folder = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
            }

            using (var dialog = new OpenFileDialog()
            {
                AddExtension = BrowserAddExtension,
                AutoUpgradeEnabled = true,
                CheckFileExists = BrowserCheckFileExists,
                DefaultExt = BrowserDefaultExt,
                FileName = FileName,
                Filter = BrowserFilter,
                InitialDirectory = folder,
                Multiselect = false,
                Title = Localise.GetLocalisedText(BrowserTitle),
            }) {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    FileName = dialog.FileName;
                }
            }
        }
        private void monitorConvertedChk_CheckedChanged(object sender, EventArgs e)
        {
            if (_loading) // nothing to do if the form is loading
            {
                return;
            }

            if (monitorConvertedChk.Checked)
            {
                DialogResult result =
                    MessageBox.Show(
                        Localise.GetPhrase("CHECK THIS BOX AT YOUR OWN RISK.\r\nDO NOT CHECK THIS BOX UNLESS YOU KNOW WHAT YOU ARE DOING.\r\nBy default Monitor Locations will ignore files that have already been converted.\r\nCheck this box if you also want to monitor converted files in the Monitor Path."),
                        Localise.GetPhrase("Are you sure you want to do this?"),
                        MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    MessageBox.Show(
                        Localise.GetPhrase("To avoid an infinite conversion loop, it is recommended to setup your Monitor search pattern in a way such as to ensure that the converted files are not being monitored by this Monitor task."),
                        Localise.GetPhrase("Recommendation"),
                        MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    monitorConvertedChk.Checked = true;
                }
                else
                {
                    monitorConvertedChk.Checked = false;
                }
            }
        }
        private void reMonitorChk_CheckedChanged(object sender, EventArgs e)
        {
            if (_loading) // nothing to do if the form is loading
            {
                return;
            }

            if (reMonitorRecordedChk.Checked)
            {
                DialogResult result =
                    MessageBox.Show(
                        Localise.GetPhrase("CHECK THIS BOX AT YOUR OWN RISK.\r\nDO NOT CHECK THIS BOX UNLESS YOU KNOW WHAT YOU ARE DOING.\r\nBy default Monitor Locations will not remonitor recorded videos that have been processed.\r\nCheck this box if you want to remonitor and reconvert the recorded videos."),
                        Localise.GetPhrase("Are you sure you want to do this?"),
                        MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    MessageBox.Show(
                        Localise.GetPhrase("To avoid an infinite conversion loop, it is recommended that you enable Delete original file option in the Settings page."),
                        Localise.GetPhrase("Recommendation"),
                        MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    reMonitorRecordedChk.Checked = true;
                }
                else
                {
                    reMonitorRecordedChk.Checked = false;
                }
            }
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Called when the control has been loaded but before it is shown to the user.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                Localise.Control(this);

                comboBoxShowAddressType.Items.Add(Strings.ShowLocalAddress);
                comboBoxShowAddressType.Items.Add(Strings.ShowNetworkAddress);
                comboBoxShowAddressType.Items.Add(Strings.ShowInternetAddress);
                comboBoxShowAddressType.SelectedIndex = 0;

                comboBoxSite.Items.Add(Strings.DefaultVersion);
                comboBoxSite.Items.Add(Strings.DesktopVersion);
                comboBoxSite.Items.Add(Strings.MobileVersion);
                comboBoxSite.Items.Add(Strings.FlightSimVersion);
                comboBoxSite.SelectedIndex = 0;

                if (Factory.Singleton.Resolve <IRuntimeEnvironment>().Singleton.IsMono)
                {
                    linkLabelAddress.TextAlign = ContentAlignment.TopLeft;
                }
            }
        }
Ejemplo n.º 27
0
 private void playStopCmd_Click(object sender, RoutedEventArgs e)
 {
     // Cut button is disabled while playing and enabled while paused
     if (!_playing) // Play
     {
         if (mediaPlayer.Position >= _totalVideoTime)
         {
             return; // We are at the end
         }
         playStopCmd.Content        = Localise.GetPhrase("Pause");
         cutStartCmd.IsEnabled      = cutEndCmd.IsEnabled = false;
         mediaPlayer.LoadedBehavior = MediaState.Manual;
         mediaPlayer.Play();
         _sliderUpdateTimer.Start();
         _playing = true;
     }
     else // Pause
     {
         mediaPlayer.LoadedBehavior = MediaState.Manual;
         mediaPlayer.Pause();
         _sliderUpdateTimer.Stop();
         playStopCmd.Content   = Localise.GetPhrase("Play");
         cutStartCmd.IsEnabled = (StartCut < 0);
         cutEndCmd.IsEnabled   = !(StartCut < 0);
         _playing = false;
     }
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Called when the control has been loaded and initialised but is not yet on display.
 /// </summary>
 /// <param name="e"></param>
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (!DesignMode)
     {
         Localise.Control(this);
     }
 }
Ejemplo n.º 29
0
        private void mediaPlayer_MediaFailed(object sender, ExceptionRoutedEventArgs e)
        {
            ResetMediaOpenButton();

            CheckAndStopPlay(); // If we are playing something first stop it

            MessageBox.Show(Localise.GetPhrase("Failed to load media file") + ", error:\r\n" + e.ErrorException, Localise.GetPhrase("Media Load Error"), MessageBoxButton.OK, MessageBoxImage.Error);
        }
Ejemplo n.º 30
0
 /// <summary>
 /// Called after the control has been fully constructed but is not yet on display.
 /// </summary>
 /// <param name="e"></param>
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (!DesignMode)
     {
         Localise.Control(this);
         _Sorter.RefreshSortIndicators();
     }
 }