foreach (string tunerDevice in VideoCapture1.TVTuner_Devices) { cbTVTuner.Items.Add(tunerDevice); }
foreach (string tunerTVFormat in VideoCapture1.TVTuner_TVFormats()) { cbTVSystem.Items.Add(tunerTVFormat); }
foreach (string tunerCountry in VideoCapture1.TVTuner_Countries) { cbTVCountry.Items.Add(tunerCountry); }
VideoCapture1.TVTuner_Name = cbTVTuner.Text;
VideoCapture1.TVTuner_Read();
foreach (string tunerMode in VideoCapture1.TVTuner_Modes()) { cbTVMode.Items.Add(tunerMode); }
edVideoFreq.Text = Convert.ToString(VideoCapture1.TVTuner_VideoFrequency); edAudioFreq.Text = Convert.ToString(VideoCapture1.TVTuner_AudioFrequency);
cbTVInput.SelectedIndex = cbTVInput.Items.IndexOf(VideoCapture1.TVTuner_InputType);
cbTVMode.SelectedIndex = cbTVMode.Items.IndexOf(VideoCapture1.TVTuner_Mode);
cbTVSystem.SelectedIndex = cbTVSystem.Items.IndexOf(VideoCapture1.TVTuner_TVFormat);
cbTVCountry.SelectedIndex = cbTVCountry.Items.IndexOf(VideoCapture1.TVTuner_Country);
private void VideoCapture1_OnTVTunerTuneChannels(object sender, TVTunerTuneChannelsEventArgs e) { pbChannels.Value = e.Progress; if (e.SignalPresent) { cbTVChannel.Items.Add(e.Channel.ToString()); } if (e.Channel == -1) { pbChannels.Value = 0; MessageBox.Show("AutoTune complete"); } Application.DoEvents(); }
const int KHz = 1000; const int MHz = 1000000; VideoCapture1.TVTuner_Read(); cbTVChannel.Items.Clear(); // For FM Tuning, you can specify the initial frequencies and the scanning pitch if ((cbTVMode.SelectedIndex != -1) && (cbTVMode.Text == "FM Radio")) { VideoCapture1.TVTuner_FM_Tuning_StartFrequency = 100 * MHz; VideoCapture1.TVTuner_FM_Tuning_StopFrequency = 110 * MHz; VideoCapture1.TVTuner_FM_Tuning_Step = 100 * KHz; }; VideoCapture1.TVTuner_TuneChannels_Start();
Once each channel is found, the event will be called and the channel will be added to the combobox.
Also, you can specify the frequency and number of each channel manually.
VideoCapture1.TVTuner_Channel = Convert.ToInt32(edChannel.Text); VideoCapture1.TVTuner_Apply();
VideoCapture1.TVTuner_Channel = -1; // must be -1 to use frequency VideoCapture1.TVTuner_Frequency = Convert.ToInt32(edChannel.Text); VideoCapture1.TVTuner_Apply();