dvb: add ability to scann modulation from dvb-c
[vlc.git] / modules / access / dvb / scan.h
1 /*****************************************************************************
2  * scan.h : functions to ease DVB scanning
3  *****************************************************************************
4  * Copyright (C) 2008,2010 the VideoLAN team
5  *
6  * Authors: Laurent Aimar <fenrir@videolan.org>
7  *          David Kaplan <david@2of1.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA    02111, USA.
22  *****************************************************************************/
23
24 typedef enum
25 {
26     SCAN_NONE,
27     SCAN_DVB_T,
28     SCAN_DVB_S,
29     SCAN_DVB_C,
30 } scan_type_t;
31
32 typedef struct
33 {
34     int i_frequency;
35     int i_symbol_rate;
36     int i_fec;
37     char c_polarization;
38 } scan_dvbs_transponder_t;
39
40 typedef struct scan_parameter_t
41 {
42     scan_type_t type;
43     bool b_exhaustive;
44     bool b_use_nit;
45     bool b_free_only;
46     bool b_modulation_set;
47
48     int i_modulation;
49     struct
50     {
51         int i_min;
52         int i_max;
53         int i_step;
54
55         int i_count;    /* Number of frequency test to do */
56     } frequency;
57
58     struct
59     {
60         /* Bandwidth should be 6, 7 or 8 */
61         int i_min;
62         int i_max;
63         int i_step;
64
65         int i_count;
66     } bandwidth;
67
68     struct
69     {
70         char *psz_name;         /* satellite name */
71         char *psz_path;         /* config file path */
72
73         scan_dvbs_transponder_t *p_transponders;
74         int i_count;
75     } sat_info;
76 } scan_parameter_t;
77
78 typedef struct
79 {
80     int i_frequency;
81     union
82     {
83         int i_bandwidth;
84         int i_symbol_rate;
85     };
86     int i_fec;
87     int i_modulation;
88     char c_polarization;
89 } scan_configuration_t;
90
91 typedef struct scan_t scan_t;
92
93 scan_t *scan_New( vlc_object_t *p_obj, const scan_parameter_t *p_parameter );
94 void scan_Destroy( scan_t *p_scan );
95
96 int scan_Next( scan_t *p_scan, scan_configuration_t *p_cfg );
97
98 block_t *scan_GetM3U( scan_t *p_scan );
99 bool scan_IsCancelled( scan_t *p_scan );
100
101 typedef struct scan_session_t scan_session_t;
102
103 scan_session_t *scan_session_New( vlc_object_t *,
104                                   const scan_configuration_t * );
105 void scan_session_Destroy( scan_t *, scan_session_t * );
106 bool scan_session_Push( scan_session_t *p_scan, block_t *p_block );
107 void scan_service_SetSNR( scan_session_t *p_scan, int i_snr );
108