public SongPlayer(WindowStudentController wlc, Song song) { windowLeerlingController = wlc; // Create standard Song if none provided if (song == null) { // Standard song song = new Song(4, 4); //song.AutoGenerate(); volume = 0.25f; } CurrentSong = song; Bpm = CurrentSong.BeatsPerMinute; // Timing stopwatch = new Stopwatch(); lastUpdate = 0; // State currentNotes = new List <Note>(); currentX = 0; SoundHelper.InitializeOutput(); // Settings SoundEnabled = true; }
// public PanelSong PanelSong { get { return panelSong; } } //public PanelPiano PanelPiano { get { return panelPiano1; } } public WindowStudent(WindowStudentController wlc) { // windowLeerlingController = wlc; //WindowStudent.windowLeerlingController = new WindowStudentController(this); InitializeComponent(); //this.panelSong.wlc = wlc; // Event handlers voor afhandelen toetsenbord. KeyPress += new KeyPressEventHandler(WindowLeerling_KeyPress); KeyDown += new KeyEventHandler(WindowLeerling_KeyDown); KeyUp += new KeyEventHandler(WindowLeerling_KeyUp); windowLeerlingController = wlc; // Event handler voor form sluiten. FormClosed += new FormClosedEventHandler(WindowLeerling_FormClosed); // Disable afspeelknopjes want er is aan het begin nog geen lied geselecteerd. buttonStart.Enabled = false; buttonStop.Enabled = false; buttonPause.Enabled = false; tempoToolStripMenuItem.Enabled = true; }