private void FMain_Closed(object sender, EventArgs e)
        {
            this.UnmonitorLocalizationChange();
            //CmdPreviewStop.Execute(this, null);
            _liveControl.Dispose();
            DirectorSettingsManager.SaveSettings();

            _communication?.Client.SendEdExitedNotification().Wait(TimeSpan.FromSeconds(2));

            _communication?.Dispose();
        }
Exemplo n.º 2
0
        private void ApplySettings(DirectorSettings settings)
        {
            DirectorSettingsManager.ApplyLanguageSettings();

            var editor = visualizer.Editor;

            editor.Look.IndicatorsVisible = settings.ShowNoteIndicators;
            visualizer.InvertedScrolling  = settings.InvertedScrolling;
            visualizer.ScrollingSpeed     = settings.ScrollingSpeed;
            editor.Invalidate();
        }
        private void FMain_Load(object sender, EventArgs eventArgs)
        {
            MaximumSize = Screen.PrimaryScreen.WorkingArea.Size;
            using (var smallIcon = new Icon(Icon, new Size(16, 16))) {
                picIcon.InitialImage = picIcon.Image = smallIcon.ToBitmap();
                picIcon.ErrorImage   = ToolStripRenderer.CreateDisabledImage(picIcon.InitialImage);
            }

            ApplyColorScheme(ColorScheme.Default);
            CursorFixup(this);

            mnuEditSelectClearAll.ShortcutKeyDisplayString        = "Esc";
            mnuScoreNoteStartPositionAt0.ShortcutKeyDisplayString = "0";
            mnuScoreNoteStartPositionAt1.ShortcutKeyDisplayString = "1";
            mnuScoreNoteStartPositionAt2.ShortcutKeyDisplayString = "2";
            mnuScoreNoteStartPositionAt3.ShortcutKeyDisplayString = "3";
            mnuScoreNoteStartPositionAt4.ShortcutKeyDisplayString = "4";
            mnuScoreNoteStartPositionAt5.ShortcutKeyDisplayString = "5";
            mnuScoreNoteStartPositionTo0.ShortcutKeyDisplayString = "P";
            mnuScoreNoteStartPositionTo1.ShortcutKeyDisplayString = "Q";
            mnuScoreNoteStartPositionTo2.ShortcutKeyDisplayString = "W";
            mnuScoreNoteStartPositionTo3.ShortcutKeyDisplayString = "E";
            mnuScoreNoteStartPositionTo4.ShortcutKeyDisplayString = "R";
            mnuScoreNoteStartPositionTo5.ShortcutKeyDisplayString = "T";

            mnuEditModeSelect.ShortcutKeyDisplayString    = "F";
            mnuEditModeTap.ShortcutKeyDisplayString       = "A";
            mnuEditModeHoldFlick.ShortcutKeyDisplayString = "S";
            mnuEditModeSlide.ShortcutKeyDisplayString     = "D";

            DirectorSettingsManager.LoadSettings();
            ApplySettings(DirectorSettingsManager.CurrentSettings);

            _liveControl = new LiveControl();
            _liveControl.PreloadWave(TapAudioFilePath);
            _liveControl.PreloadWave(FlickAudioFilePath);
            _liveControl.PreloadWave(SlideAudioFilePath);

            // Localize before setting command shortcut display strings.
            Localize(LanguageManager.Current);
            this.MonitorLocalizationChange();

            RegisterCommands();

            CmdProjectNew.Command.Execute(null);
            CmdScoreNoteStartPositionSetAt.Command.Execute(NotePosition.Default);

            if (Program.StartupOptions.BvspCommunicationEnabled)
            {
                _communication = new SDCommunication(this);
                _communication.Server.Start(0);
            }
        }
Exemplo n.º 4
0
        private void BtnOK_Click(object sender, EventArgs e)
        {
            var s = _editorSettings;

            s.InvertedScrolling     = radInvertedScrollingOn.Checked;
            s.ShowNoteIndicators    = chkShowNoteIndicators.Checked;
            s.ScrollingSpeed        = (int)txtScrollingSpeed.Value;
            s.PreviewRenderMode     = (PreviewerRenderMode)cboPreviewRenderMode.SelectedIndex;
            s.PreviewSpeed          = Convert.ToSingle(txtPreviewSpeed.Text);
            s.ExternalPreviewerFile = txtExternalPreviewerFile.Text;
            s.ExternalPreviwerArgs  = txtExternalPreviewerArgs.Text;

            if (cboLanguage.SelectedIndex == 0)
            {
                s.Language = null;
            }
            else
            {
                s.Language = _languages[cboLanguage.SelectedIndex - 1].CodeName;
            }

            if (s.Language != _originalLanguage)
            {
                DirectorSettingsManager.ApplyLanguageSettings();

                var languageManager = LanguageManager.Current;

                if (languageManager == null)
                {
                    throw new InvalidOperationException();
                }

                LocalizationHelper.Relocalize(languageManager);
            }

            DialogResult = DialogResult.OK;
        }