Exemplo n.º 1
0
 public void GetStreamInfo(ref TStreamInfo info)
 {
     ZPlay.TStreamInfo_Internal pInfo = new ZPlay.TStreamInfo_Internal();
     ZPlay.zplay_GetStreamInfoW(this.objptr, ref pInfo);
     info.Bitrate       = pInfo.Bitrate;
     info.ChannelNumber = pInfo.ChannelNumber;
     info.SamplingRate  = pInfo.SamplingRate;
     info.VBR           = pInfo.VBR;
     info.Length        = pInfo.Length;
     info.Description   = Marshal.PtrToStringUni(pInfo.Description);
 }
Exemplo n.º 2
0
        public AudioControl(bool usesTimer)
        {
            this.player = new ZPlay();

            this.info = new TStreamInfo();
            this.status = new TStreamStatus();
            this.time = new TStreamTime();

            this.timer = usesTimer ? new System.Windows.Forms.Timer() : null;
            if (this.timer != null)
            {
                this.timer.Interval = 100;
                this.timer.Tick += new EventHandler(timer_Tick);
            }
        }
Exemplo n.º 3
0
 public void GetStreamInfo(ref TStreamInfo info)
 {
     TStreamInfo_Internal tmp = new TStreamInfo_Internal();
     zplay_GetStreamInfoW(objptr, ref tmp);
     info.Bitrate = tmp.Bitrate;
     info.ChannelNumber = tmp.ChannelNumber;
     info.SamplingRate = tmp.SamplingRate;
     info.VBR = tmp.VBR;
     info.Length = tmp.Length;
     info.Description = Marshal.PtrToStringUni(tmp.Description);
 }
Exemplo n.º 4
0
        private void ProgressBar1_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            TStreamTime newpos = new TStreamTime();

            TStreamInfo Info = new TStreamInfo();
            player.GetStreamInfo(ref Info);

            newpos.sec = System.Convert.ToUInt32(e.X * Info.Length.sec / System.Convert.ToDouble(((ProgressBar)sender).Size.Width));
            player.Seek(TTimeFormat.tfSecond, ref newpos, TSeekMethod.smFromBeginning);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Show info
        /// </summary>
        /// <remarks></remarks>
        public void showinfo()
        {
            Label3.Text = "";
            Label4.Text = "";
            Label5.Text = "";
            Label6.Text = "";
            Label7.Text = "";
            Label8.Text = "";
            Label9.Text = "";

            TID3InfoEx info = new TID3InfoEx();
            if (player.LoadID3Ex(ref info, true))
            {
                 Label3.Text = info.Title;
                Label4.Text = info.Artist;
                Label5.Text = info.Album;
                Label6.Text = info.Year;
                Label7.Text = info.Track;
                Label8.Text = info.Encoder;
                Label9.Text = info.Comment;

            }

            descr.Text = "Format:" + System.Environment.NewLine + "Length:" + System.Environment.NewLine + "Samplerate:" + System.Environment.NewLine + "Bitrate:" + System.Environment.NewLine + "Channel:" + System.Environment.NewLine + "VBR:";

            TStreamInfo StreamInfo = new TStreamInfo();
            player.GetStreamInfo(ref StreamInfo);
            descr1.Text = StreamInfo.Description + System.Environment.NewLine + System.Convert.ToString(StreamInfo.Length.hms.hour) + " : " + System.Convert.ToString(StreamInfo.Length.hms.minute) + " : " + System.Convert.ToString(StreamInfo.Length.hms.second) + System.Environment.NewLine + System.Convert.ToString(StreamInfo.SamplingRate) + " Hz" + System.Environment.NewLine + System.Convert.ToString(StreamInfo.Bitrate) + " kbps" + System.Environment.NewLine + System.Convert.ToString(StreamInfo.ChannelNumber) + System.Environment.NewLine + System.Convert.ToString(StreamInfo.VBR);

            if (info.Picture.PicturePresent)
                pictureBox2.Image = info.Picture.Bitmap;

            ProgressBar1.Minimum = 0;
            ProgressBar1.Maximum = System.Convert.ToInt32((int)(StreamInfo.Length.sec));
            ProgressBar1.Value = 0;

            Timer1.Enabled = true;
            Timer2.Enabled = true;
        }