예제 #1
0
        private void Play_Click(object sender, RoutedEventArgs e)
        {
            if (textBox.Text != string.Empty)
            {
                if ((textBox.Text.StartsWith("http://")) || (textBox.Text.StartsWith("https://")))
                {
                    string url = textBox.Text;
                    ButtonPlay.Background = new ImageBrush(new BitmapImage(new Uri("icons/Play.png", UriKind.Relative)));

                    if (play)
                    {
                        ClassBass.Play(url, ClassBass.Volume);
                        play = false;
                        ButtonPlay.Background = new ImageBrush(new BitmapImage(new Uri("icons/Pause.png", UriKind.Relative)));
                    }
                    else
                    {
                        ClassBass.Pause();
                        play = true;
                        ButtonPlay.Background = new ImageBrush(new BitmapImage(new Uri("icons/Play.png", UriKind.Relative)));
                    }
                }
                else
                {
                    MessageBox.Show("Error! URL is incorrect.");
                }
            }
            else
            {
                MessageBox.Show("Error! Input the radiostation's URL.");
            }
        }
예제 #2
0
 /// <summary>
 /// Button Stop stream playing
 /// </summary>
 private void Stop_Click(object sender, RoutedEventArgs e)
 {
     ClassBass.Stop();
     ButtonPlay.Background = new ImageBrush(new BitmapImage(new Uri("icons/Play.png", UriKind.Relative)));
 }
예제 #3
0
 /// <summary>
 /// Volume
 /// </summary>
 private void Slider_Value(object sender, RoutedPropertyChangedEventArgs <double> e)
 {
     ClassBass.SetVolumeToStream(ClassBass.Stream, (int)Slider.Value);
 }