예제 #1
0
 /// <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);
 }
예제 #2
0
        /// <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;
            }
        }
예제 #3
0
 void dlgPlayfinished(WaveGenIF WaveGen)
 {
     BeginInvoke((MethodInvoker) delegate
     {
         if (cmdPlay.Checked)
         {
             cmdPlay.Checked = false;
         }
     });
 }
예제 #4
0
        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);
        }
예제 #5
0
 public CallbackParams(WaveGenIF _this, object parent, delegatePlayFinished dlg)
 {
     m_this   = _this;
     m_parent = parent;
     m_dlg    = dlg;
 }
예제 #6
0
        static void dlgPlayFinished_(WaveGenIF WaveGen, object parent)
        {
            frmMain pThis = (frmMain)parent;

            pThis.dlgPlayfinished(WaveGen);
        }
예제 #7
0
        /// <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)";
            }
        }