コード例 #1
0
ファイル: Track.cs プロジェクト: timdetering/Endogine
        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();
            }
        }
コード例 #2
0
ファイル: PlayKeyboard.cs プロジェクト: timdetering/Endogine
        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);
        }
コード例 #3
0
ファイル: SoundManager.cs プロジェクト: timdetering/Endogine
 public void SoundDisposed(Sound snd)
 {
     this._sounds.Remove(snd);
 }
コード例 #4
0
ファイル: SoundManager.cs プロジェクト: timdetering/Endogine
 public void SoundCreated(Sound snd)
 {
     this._sounds.Add(snd);
 }
コード例 #5
0
ファイル: Sound.cs プロジェクト: timdetering/Endogine
 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;
 }