public MainWindow() { audioEngine = new AudioEngine(); audioEngine.ImageLoad += AudioEngine_ImageLoad; audioEngine.TagLoad += AudioEngine_TagLoad; InitializeComponent(); wndErrorConsole = new ErrorConsole(); this.ConsoleWriter = new StringWriter(); Console.SetOut(this.ConsoleWriter); Console.SetError(this.ConsoleWriter); this.btn_close.Visibility = Visibility.Visible; // sets up a timer which is needed for updating the trackbar. this.timer1 = new System.Windows.Forms.Timer(); this.timer1.Enabled = true; this.timer1.Interval = 500; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); //wireup clock spectrumAnalyzer.Visibility = System.Windows.Visibility.Visible; clockDisplay.Visibility = System.Windows.Visibility.Visible; this.AudioEngine.Engine.PropertyChanged += AudioEngine_PropertyChanged; this.AudioEngine.TrackChange += AudioEngine_TrackChange; spectrumAnalyzer.RegisterSoundPlayer(AudioEngine.Engine); init = false; }
private void AudioEngine_TagLoad(AudioEngine sender, AudioEngine.TagData e) { tb_Artist.Text = e.artist; tb_Title.Text = e.title; tb_TrackAlbum.Text = e.trackalbum; tb_Year.Text = e.year; }
private void AudioEngine_ImageLoad(AudioEngine sender, AudioEngine.ImageData e) { imgAlbumArt.Source = e.Image; }
private void AudioEngine_TrackChange(AudioEngine sender, AudioEngine.TrackChangeData e) { Playlist.SelectedIndex = e.index; }