/// <summary> /// Loading platform /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmMain_Load(object sender, EventArgs e) { rchMML.LanguageOption = RichTextBoxLanguageOptions.UIFonts; rchMML.Font = new Font(Resources.DefaultFontName, 9); waveGen = new WaveGenIF(); waveGen.CreateWaveGen(Handle); }
/// <summary> /// Destruction form /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmMain_FormClosing(object sender, FormClosingEventArgs e) { if (waveGen != null) { waveGen.Release(); waveGen = null; } }
void dlgPlayfinished(WaveGenIF WaveGen) { BeginInvoke((MethodInvoker) delegate { if (cmdPlay.Checked) { cmdPlay.Checked = false; } }); }
private void frmADSRParam_Load(object sender, EventArgs e) { waveGen = new WaveGenIF(); waveGen.CreateWaveGen(Handle); txtAPower.Text = "1.00"; txtATime.Text = "0.05"; txtDTime.Text = "0.03"; txtSPower.Text = "0.80"; txtRTime.Text = "0.10"; drawADSR(picGraphic); }
public CallbackParams(WaveGenIF _this, object parent, delegatePlayFinished dlg) { m_this = _this; m_parent = parent; m_dlg = dlg; }
static void dlgPlayFinished_(WaveGenIF WaveGen, object parent) { frmMain pThis = (frmMain)parent; pThis.dlgPlayfinished(WaveGen); }
/// <summary> /// Play /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdPlay_CheckedChanged(object sender, EventArgs e) { if (cmdPlay.Checked) { if (chkAutoSave.Checked && isWaveSave == false) { cmdSaveFile.PerformClick(); } cmdPlay.Text = Resources.StopButtonText + " (F5)"; Int32 errorCode = 0; UInt32 errorLine = 0; if (waveGen.CompileMML(rchMML.Text, ref errorCode, ref errorLine, isWaveSave, dlgPlayFinished_, this)) { stsNotify.Text = Resources.MMLerror.Replace("_LINE_", errorLine.ToString()).Replace("_MSG_", WaveGenIF.GetErrorString(errorCode)); MoveLine((int)errorLine); System.Media.SystemSounds.Exclamation.Play(); cmdPlay.Checked = false; return; } stsNotify.Text = ""; } else { if (waveGen != null) { waveGen.Stop(); } cmdPlay.Text = Resources.PlayButtonText + " (F5)"; } }