Example #1
0
        public AssistantComposerForm(string settingsPath, IMoritzForm1 moritzForm1)
        {
            InitializeComponent();

            _allTextBoxes = GetAllTextBoxes();

            _moritzForm1 = moritzForm1;
            _fsf = new FormStateFunctions();

            SetDefaultValues();
            DeselectAll();

            Debug.Assert(File.Exists(settingsPath));

            _settingsPath = settingsPath;
            _settingsFolderPath = Path.GetDirectoryName(settingsPath);
            _scoreTitle = Path.GetFileNameWithoutExtension(settingsPath);

            this.Text = _settingsFolderPath.Substring(_settingsFolderPath.LastIndexOf('\\') + 1);
            this.QuitAssistantComposerButton.Text = "Quit algorithm:  " + _scoreTitle;

            _dimensionsAndMetadataForm = new DimensionsAndMetadataForm(this, _settingsPath, _fsf);

            _algorithm = ComposableSvgScore.Algorithm(_scoreTitle);

            Debug.Assert(_algorithm != null);

            _outputVoiceIndices = GetOutputVoiceIndices(_algorithm.MidiChannelIndexPerOutputVoice.Count);

            GetSelectedSettings();

            if(VoiceIndicesPerStaffTextBox.Text == "")
            {
                SetDefaultVoiceIndicesPerStaff(_algorithm.MidiChannelIndexPerOutputVoice.Count);
            }
        }
Example #2
0
        private void RevertEverythingButton_Click(object sender, EventArgs e)
        {
            DialogResult result =
            MessageBox.Show("Are you sure you want to revert all the settings to the saved version?",
                    "Revert?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);

            if(result == System.Windows.Forms.DialogResult.Yes)
            {
                Point dimensionsAndMetadataFormLocation = GetDimensionsAndMetadataFormLocation();
                Dictionary<int, Point> visiblePaletteFormLocations = GetVisiblePaletteFormLocations();
                Dictionary<int, Point> visibleOrnamentFormLocations = GetVisibleOrnamentFormLocations();

                _dimensionsAndMetadataForm.Close();
                _dimensionsAndMetadataForm = new DimensionsAndMetadataForm(this, _settingsPath, _fsf);

                foreach(PaletteForm paletteForm in PalettesListBox.Items)
                {
                    paletteForm.Delete(); // closes any OrnamentsForm and/or PaletteChordform
                }

                LoadSettings(); // clears existing settings

                ReshowForms(dimensionsAndMetadataFormLocation, visiblePaletteFormLocations, visibleOrnamentFormLocations);
            }
        }