channel tuning: auto scan
The auto scan auto-tune the available channels for a given country code and tuner input type (cable or antenna), and save their frequencies into the registry.
It is highly recommend to run it at least one time before setting TV channels.
This is a one-time operation for a given country code and tuner input type (antenna or cable). It is not useful to run it more than one time on a given platform.
To begin an auto scan, proceed as follows:
-
stop preview, if running,
-
select the TunerMode (tm_TVTuner is selected by default)
-
assign to TVCountryCode the country code being living,
-
assign to TVTunerInputType the proper input being using (antenna or cable),
-
invoke TVStartAutoScan. This will start preview and begin the auto-tuning process.
Remark: altough they are prefixed by "TV", TVCountryCode, TVTunerInputType and TVChannel are also used to select radio channels when TunerMode = tm_FMRadioTuner or tm_AMRadioTuner.
After invoking TVStartAutoScan, preview starts and the OnTVChannelScanStarted event occurs when the first channel is found. This event returns also the minimal and maximal channels.
During the auto scan process, the OnTVChannelSelected event occurs for each TV channel scanned, returning all channel information, like tuning success, channel frequency, frequency override (if any). For each channel tuned, the channel frequency is saved in the registry.
The auto scan process ends:
-
when the last channel is reached,
-
when TVStopAutoScan is invoked.
When the process ends, the OnTVChannelScanCompleted event occurs.