Exemplo n.º 1
0
        public Tag(string path, bool isRadio)
        {
            TAG_INFO tagInfo = null;

            if (isRadio)
            {
                if (CommonInterface.IsValid(path, CommonInterface.URLPattern) && !CommonInterface.IsValid(path, CommonInterface.PathPattern2))
                {
                    tagInfo = new TAG_INFO(path);
                }
            }
            else
            {
                tagInfo = BassTags.BASS_TAG_GetFromFile(path);
            }
            if (tagInfo != null)
            {
                bitRate   = tagInfo.bitrate;
                freq      = tagInfo.channelinfo.freq;
                channels  = ChannelsDict[tagInfo.channelinfo.chans];
                artist    = tagInfo.artist;
                album     = tagInfo.album;
                genre     = tagInfo.genre;
                title     = tagInfo.title;
                year      = tagInfo.year;
                this.path = path;
                fileName  = System.IO.Path.GetFileName(path);
                image     = tagInfo.PictureGetImage(0);
                error     = false;
            }
            else
            {
                error = true;
            }
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (CommonInterface.IsValid(textBox1.Text, CommonInterface.URLPattern) && !CommonInterface.IsValid(textBox1.Text, CommonInterface.PathPattern2))
     {
         Audio.PlayRadio(textBox1.Text, Audio.Volume);
         CommonInterface.Iterator = 0;
         if (Audio.Stream == 0)
         {
             MessageBox.Show("Радиостанция не найдена!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             timer1.Enabled = true;
         }
     }
 }