aboutsummaryrefslogtreecommitdiffstats
path: root/src/tv/channels.c
blob: ff155a748a1f92c011a83647d3332e137c6316b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include <stdio.h>

static struct tv_channels {
	int	channel;
	double	video_mhz;
	double	audio_mhz;
} tv_channels[] = {
	{ 1,	41.25,	46.75	},
	{ 2,	48.25,	53.75	},
	{ 3,	55.25,	60.75	},
	{ 4,	62.25,	67.75	},
	{ 5,	175.25,	180.75	},
	{ 6,	182.25,	187.75	},
	{ 7,	189.25,	194.75	},
	{ 8,	196.25,	201.75	},
	{ 9,	203.25,	208.75	},
	{ 10,	210.25,	215.75	},
	{ 11,	217.25,	222.75	},
	{ 12,	224.25,	229.75	},
	{ 21,	471.25,	476.75	},
	{ 22,	479.25,	484.75	},
	{ 23,	487.25,	492.75	},
	{ 24,	495.25,	500.75	},
	{ 25,	503.25,	508.75	},
	{ 26,	511.25,	516.75	},
	{ 27,	519.25,	524.75	},
	{ 28,	527.25,	532.75	},
	{ 29,	535.25,	540.75	},
	{ 30,	543.25,	548.75	},
	{ 31,	551.25,	556.75	},
	{ 32,	559.25,	564.75	},
	{ 33,	567.25,	572.75	},
	{ 34,	575.25,	580.75	},
	{ 35,	583.25,	588.75	},
	{ 36,	591.25,	596.75	},
	{ 37,	599.25,	604.75	},
	{ 38,	607.25,	612.75	},
	{ 39,	615.25,	620.75	},
	{ 40,	623.25,	628.75	},
	{ 41,	631.25,	636.75	},
	{ 42,	639.25,	644.75	},
	{ 43,	647.25,	652.75	},
	{ 44,	655.25,	660.75	},
	{ 45,	663.25,	668.75	},
	{ 46,	671.25,	676.75	},
	{ 47,	679.25,	684.75	},
	{ 48,	687.25,	692.75	},
	{ 49,	695.25,	700.75	},
	{ 50,	703.25,	708.75	},
	{ 51,	711.25,	716.75	},
	{ 52,	719.25,	724.75	},
	{ 53,	727.25,	732.75	},
	{ 54,	735.25,	740.75	},
	{ 55,	743.25,	748.75	},
	{ 56,	751.25,	756.75	},
	{ 57,	759.25,	764.75	},
	{ 58,	767.25,	772.75	},
	{ 59,	775.25,	780.75	},
	{ 60,	783.25,	788.75	},
	{ 61,	791.25,	796.75	},
	{ 62,	799.25,	804.75	},
	{ 63,	807.25,	812.75	},
	{ 64,	815.25,	820.75	},
	{ 65,	823.25,	828.75	},
	{ 66,	831.25,	836.75	},
	{ 67,	839.25,	844.75	},
	{ 68,	847.25,	852.75	},
	{ 69,	855.25,	860.75	},
	{ 0,	0,	0,	}
};

double get_tv_video_frequency(int channel)
{
	int i;

	for (i = 0; tv_channels[i].channel; i++) {
		if (tv_channels[i].channel == channel)
			return tv_channels[i].video_mhz * 1e6;
	}

	return 0.0;
}

void list_tv_channels(void)
{
	int i;

	printf("List of TV channels in MHz:\n\n");
	printf("Channel Video   Audio\n");
	printf("------------------------\n");
	for (i = 0; tv_channels[i].channel; i++) {
		printf("%d\t%.2f\t%.2f\n", tv_channels[i].channel, tv_channels[i].video_mhz, tv_channels[i].audio_mhz);
	}
}