private void StartPlaying() { DoConnectControls(); StatusLabel.Text = "Connecting..."; notifyIcon.Icon = Resources.active; pl = new Player(IPTextBox.Text, Convert.ToDouble(VolumeBar.Value)); pl.OnConnect += new Player.OnConnectEventHandler(this.OnConnect); pl.OnDisconnect += new Player.OnDisconnectEventHandler(this.OnDisconnect); pl.OnError += new Player.OnErrorEventHandler(this.OnError); //Thread starter = new Thread(new ThreadStart(pl.Start)); //starter.Start(); pl.Start(); /*if (pl.Connected) { StatusLabel.Text = "Connected"; notifyIcon.Icon = GetIcon("active.ico"); notifyIcon.Icon = GetIcon("streaming.ico"); contextMenu.Items[0].Visible = false; contextMenu.Items[1].Visible = true; VolumeGB.Enabled = true; ConnectionGB.Enabled = false; StartButton.Enabled = false; StopButton.Enabled = true; } else { notifyIcon.Icon = GetIcon("error.ico"); }*/ }
private void StopPlaying() { if (pl != null) pl.Stop(); pl = null; StatusLabel.Text = "Not connected"; notifyIcon.Icon = Resources.inactive; notifyIcon.Text = ""; DoDisconnectControl(); }
private void StartPlaying() { DoConnectControls(); StatusLabel.Text = "Connecting..."; notifyIcon.Icon = Resources.active; int deviceID = Convert.ToInt32(inputDeviceList.SelectedItem.ToString().Substring("Device ID ".Length, inputDeviceList.SelectedItem.ToString().IndexOf(':') - "Device ID ".Length)); pl = new Player(IPTextBox.Text, Convert.ToDouble(VolumeBar.Value),deviceID); pl.OnConnect += new Player.OnConnectEventHandler(this.OnConnect); pl.OnDisconnect += new Player.OnDisconnectEventHandler(this.OnDisconnect); pl.OnError += new Player.OnErrorEventHandler(this.OnError); //Thread starter = new Thread(new ThreadStart(pl.Start)); //starter.Start(); pl.Start(); /*if (pl.Connected) { StatusLabel.Text = "Connected"; notifyIcon.Icon = GetIcon("active.ico"); notifyIcon.Icon = GetIcon("streaming.ico"); contextMenu.Items[0].Visible = false; contextMenu.Items[1].Visible = true; VolumeGB.Enabled = true; ConnectionGB.Enabled = false; StartButton.Enabled = false; StopButton.Enabled = true; } else { notifyIcon.Icon = GetIcon("error.ico"); }*/ }