コード例 #1
0
        private void btnStartStop_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (btnStartStop.Text == Start)
                {
                    if (fgm == null)
                    {
                        BuildFilterGraph();

                        // Changing the bit rate on the fly hasn't been tested yet
                        hsbBitRate.Enabled = false;
                    }

                    fgm.Run();
                    btnStartStop.Text = Stop;
                }
                else
                {
                    // Pause, don't Stop, otherwise the media clock needs to be reset on the source
                    // filter, and that isn't implemented yet.  jasonv 3/29/2005
                    fgm.Pause();
                    btnStartStop.Text = Start;
                }
            }
            catch (Exception ex)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture, Strings.DataStreamError,
                                                            ex.ToString()), string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None,
                                        MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
            }
        }
コード例 #2
0
        private void btnStartStop_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (btnStartStop.Text == Start)
                {
                    if (fgm == null)
                    {
                        BuildFilterGraph();

                        // Changing the bit rate on the fly hasn't been tested yet
                        hsbBitRate.Enabled = false;
                    }

                    fgm.Run();
                    btnStartStop.Text = Stop;
                }
                else
                {
                    // Pause, don't Stop, otherwise the media clock needs to be reset on the source
                    // filter, and that isn't implemented yet.  jasonv 3/29/2005
                    fgm.Pause();
                    btnStartStop.Text = Start;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Error starting or stopping the data stream. \r\n" + ex.ToString());
            }
        }
コード例 #3
0
        private void btnPause_Click(object sender, System.EventArgs e)
        {
            fgm.Pause();

            btnPlay.Enabled  = true;
            btnPause.Enabled = false;
            // stop remains enabled
        }