public Track(string a_sSoundFile, int nNumNotes, EPoint pntGridCellSize) { m_snd = new Sound(); m_snd.Filename = a_sSoundFile; for (int nNote = 0; nNote < nNumNotes; nNote++) { CheckBox cb = new CheckBox(); cb.Parent = this; cb.Rect = new ERectangleF(nNote*pntGridCellSize.X,0,30,30); cb.Name = nNote.ToString(); } }
public PlayKeyboard() { string[] keys = new string[]{"z","s","x","d","c","v","g","b","h","n","j","m", "q","d2","w","d3","e","r","d5","t","d6","y","d7","u","i","d9","o","d0","p"}; this._keys = new Hashtable(); int i=0; foreach (string s in keys) this._keys.Add(s.ToUpper(),i++); this._keys.Add("Oemcomma", this._keys["Q"]); this._sounds = new ArrayList(); for (int j=0; j<4; j++) { Sound snd = new Sound(); snd.Filename = "Tone.wav"; this._sounds.Add(snd); } //EH.Instance.Stage.RenderControl.KeyDown+=new System.Windows.Forms.KeyEventHandler(RenderControl_KeyDown); EH.Instance.KeyEvent+=new KeyEventHandler(Instance_KeyEvent); }
public void SoundDisposed(Sound snd) { this._sounds.Remove(snd); }
public void SoundCreated(Sound snd) { this._sounds.Add(snd); }
public static Sound Create(string filename, bool autoDisposeWhenDone) { Sound snd = new Sound(); //Sound.Create(); snd.AutoDispose = autoDisposeWhenDone; snd.Filename = filename; if (snd.CanPlay) snd.Play(); return snd; }