public frm2VariationEditor(string Filename) { InitializeComponent(); this.Data = RolandStyleData.CreateFromReader( new Reader_STL_2var(Filename) ); this.Text = this.Data.Name; this.Initialize(); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "Roland style (*.stl, *.sth)|*.stl;*.sth"; if (dlg.ShowDialog() == DialogResult.OK) { #region Do some WinForms shit this.btnPlay.Enabled = true; this.comboBox1.Enabled = true; this.comboBox2.Enabled = true; this.comboBox3.Enabled = true; this.comboBox4.Enabled = true; #endregion IStyleReader_2variation Reader; string Ext = Path.GetExtension(dlg.FileName); if (Ext.ToLower().Contains("stl")) { Reader = new Reader_STL_2var(dlg.FileName); } else { Reader = new Reader_STH(dlg.FileName); } this.data = RolandStyleData.CreateFromReader(Reader); this.lStyleName.Text = this.data.Name; this.lSignature.Text = Reader.Signature.ToString() + " format style"; this.lMetronomeMark.Text = this.data.Measure.ToString(); this.lTempo.Text = this.data.Tempo + " BPM"; this.pbBeat.Maximum = this.data.Measure.Numerator; this.RenderMessages(); } }