예제 #1
0
        private void LoadControls(Form1StringData svgds, int numberOfMeasures)
        {
            var page = svgds.Page;

            this.PageWidthTextBox.Text           = page.Width;
            this.PageHeightTextBox.Text          = page.Height;
            this.MarginTopPage1TextBox.Text      = page.MarginTopPage1;
            this.MarginTopOtherPagesTextBox.Text = page.MarginTopOther;
            this.MarginRightTextBox.Text         = page.MarginRight;
            this.MarginBottomTextBox.Text        = page.MarginBottom;
            this.MarginLeftTextBox.Text          = page.MarginLeft;

            var notes = svgds.Notation;

            this.StafflineStemStrokeWidthComboBox.SelectedIndex = GetIndex(StafflineStemStrokeWidthComboBox, notes.stafflineStemStrokeWidth);
            this.GapSizeComboBox.SelectedIndex         = GetIndex(GapSizeComboBox, notes.gapSize);
            this.MinimumGapsBetweenStavesTextBox.Text  = notes.minGapsBetweenStaves;
            this.MinimumGapsBetweenSystemsTextBox.Text = notes.minGapsBetweenSystems;
            this.SystemStartBarsLabel.Text             = "system start bars [1.." + _numberOfMeasures.ToString() + "] ( must start at 1 )";
            this.SystemStartBarsTextBox.Text           = notes.systemStartBars;
            this.CrotchetsPerMinuteTextBox.Text        = notes.crotchetsPerMinute;

            var metadata = svgds.Metadata;

            this.MetadataTitleTextBox.Text    = metadata.Title;
            this.MetadataAuthorTextBox.Text   = metadata.Author;
            this.MetadataKeywordsTextBox.Text = metadata.Keywords;
            this.MetadataCommentTextBox.Text  = metadata.Comment;

            var options = svgds.Options;

            this.OptionWritePage1TitlesCheckBox.CheckState   = (options.WritePage1Titles == "true") ? CheckState.Checked : CheckState.Unchecked;
            this.OptionIncludeMIDIDataCheckBox.CheckState    = (options.IncludeMIDIData == "true") ? CheckState.Checked : CheckState.Unchecked;
            this.OptionWriteScoreAsScrollCheckBox.CheckState = (options.WriteScrollScore == "true") ? CheckState.Checked : CheckState.Unchecked;
        }
예제 #2
0
        private void WriteButton_Click(object sender, EventArgs e)
        {
            string form1DataPath = _MNX_Form1Data_Paths[MNXSelect.SelectedIndex].Item2;

            var form1StringData = new Form1StringData(form1DataPath);
            var form1Data       = new Form1Data(form1StringData);

            SVGMIDIScore svgMIDIScore = new SVGMIDIScore(M.SVG_out_Folder, mnx, form1Data);
        }
예제 #3
0
        private void LoadSettings(int mnxSelectedIndex)
        {
            string mnxFilePath = _MNX_Form1Data_Paths[mnxSelectedIndex].Item1;

            ValidateXML(mnxFilePath); // If there is an error, a MessageBox is displayed, and the program stops.

            mnx = new MNX.Common.MNX(mnxFilePath);

            _numberOfMeasures = mnx.NumberOfMeasures;

            var form1DataPath = _MNX_Form1Data_Paths[mnxSelectedIndex].Item2;
            var svgds         = new Form1StringData(form1DataPath);

            LoadControls(svgds, _numberOfMeasures);
        }
예제 #4
0
        public void SaveSettings()
        {
            Form1StringData svgds = new Form1StringData(_MNX_Form1Data_Paths[MNXSelect.SelectedIndex].Item2);

            var page = svgds.Page;

            page.Width          = PageWidthTextBox.Text;
            page.Height         = PageHeightTextBox.Text;
            page.MarginTopPage1 = MarginTopPage1TextBox.Text;
            page.MarginTopOther = MarginTopOtherPagesTextBox.Text;
            page.MarginRight    = MarginRightTextBox.Text;
            page.MarginLeft     = MarginLeftTextBox.Text;
            page.MarginBottom   = MarginBottomTextBox.Text;

            var notes = svgds.Notation;

            notes.stafflineStemStrokeWidth = (string)StafflineStemStrokeWidthComboBox.Items[StafflineStemStrokeWidthComboBox.SelectedIndex];
            notes.gapSize = (string)GapSizeComboBox.Items[GapSizeComboBox.SelectedIndex];
            notes.minGapsBetweenStaves  = MinimumGapsBetweenStavesTextBox.Text;
            notes.minGapsBetweenSystems = MinimumGapsBetweenSystemsTextBox.Text;
            notes.systemStartBars       = SystemStartBarsTextBox.Text;
            notes.crotchetsPerMinute    = CrotchetsPerMinuteTextBox.Text;

            var metadata = svgds.Metadata;

            metadata.Title    = this.MetadataTitleTextBox.Text;
            metadata.Author   = this.MetadataAuthorTextBox.Text;
            metadata.Keywords = this.MetadataKeywordsTextBox.Text;
            metadata.Comment  = this.MetadataCommentTextBox.Text;

            var options = svgds.Options;

            options.WritePage1Titles = (this.OptionWritePage1TitlesCheckBox.CheckState == CheckState.Checked) ? "true" : "false";
            options.IncludeMIDIData  = (this.OptionIncludeMIDIDataCheckBox.CheckState == CheckState.Checked) ? "true" : "false";
            options.WriteScrollScore = (this.OptionWriteScoreAsScrollCheckBox.CheckState == CheckState.Checked) ? "true" : "false";

            svgds.SaveSettings();
        }