Mercurial > mplayer.hg
annotate libmenu/menu_dvbin.c @ 15597:aa7224b06f8c
geometry support for gl2 under win, default window pos centered for gl, gl2
author | gpoirier |
---|---|
date | Mon, 30 May 2005 11:49:41 +0000 |
parents | e76abd2a803c |
children | 931bdbc37ee0 |
rev | line source |
---|---|
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
1 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
2 #include <stdlib.h> |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
3 #include <stdio.h> |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
4 #include <dirent.h> |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
5 #include <errno.h> |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
6 #include <string.h> |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
7 #include <sys/types.h> |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
8 #include <sys/stat.h> |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
9 #include <ctype.h> |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
10 #include <unistd.h> |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
11 #include <limits.h> |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
12 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
13 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
14 #include "../config.h" |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
15 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
16 #include "../m_struct.h" |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
17 #include "../m_option.h" |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
18 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
19 #include "img_format.h" |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
20 #include "mp_image.h" |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
21 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
22 #include "menu.h" |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
23 #include "menu_list.h" |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
24 #include "../input/input.h" |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
25 #include "../osdep/keycodes.h" |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
26 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
27 #include "../libmpdemux/dvbin.h" |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
28 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
29 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
30 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
31 struct list_entry_s { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
32 struct list_entry p; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
33 int num; //the position of the chosen channel in the list |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
34 }; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
35 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
36 struct menu_priv_s { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
37 menu_list_priv_t p; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
38 char* title; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
39 char* file; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
40 int card; |
12308 | 41 int level; |
42 dvb_config_t *config; | |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
43 }; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
44 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
45 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
46 #define ST_OFF(m) M_ST_OFF(struct menu_priv_s, m) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
47 #define mpriv (menu->priv) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
48 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
49 static m_option_t cfg_fields[] = { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
50 MENU_LIST_PRIV_FIELDS, |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
51 { "title", ST_OFF(title), CONF_TYPE_STRING, 0, 0, 0, NULL }, |
12308 | 52 { NULL, NULL, NULL, 0,0,0,NULL }, |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
53 }; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
54 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
55 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
56 static struct menu_priv_s cfg_dflt = { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
57 MENU_LIST_PRIV_DFLT, |
12308 | 58 "Select a channel: ", |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
59 "channels.conf", |
12308 | 60 0, |
61 0, | |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
62 NULL, |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
63 }; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
64 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
65 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
66 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
67 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
68 static void free_entry(list_entry_t* entry) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
69 { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
70 free(entry->p.txt); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
71 free(entry); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
72 } |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
73 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
74 |
12308 | 75 static int fill_channels_menu(menu_t *menu, dvb_channels_list *dvb_list_ptr) |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
76 { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
77 int n; |
12308 | 78 dvb_channel_t *channel; |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
79 list_entry_t* elem; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
80 |
12308 | 81 mpriv->level = 2; |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
82 if(dvb_list_ptr == NULL) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
83 { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
84 mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_set_channel: LIST NULL PTR, quit\n"); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
85 n = 1; |
12308 | 86 if((elem = calloc(1, sizeof(list_entry_t))) != NULL) |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
87 { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
88 elem->p.next = NULL; |
12308 | 89 elem->p.txt = strdup("There are no channels for this DVB card!"); |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
90 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
91 menu_list_add_entry(menu, elem); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
92 } |
12308 | 93 return 1; |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
94 } |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
95 for(n = 0; n < dvb_list_ptr->NUM_CHANNELS; n++) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
96 { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
97 channel = &(dvb_list_ptr->channels[n]); |
12308 | 98 if((elem = calloc(1, sizeof(list_entry_t))) != NULL) |
99 { | |
100 elem->p.next = NULL; | |
101 elem->p.txt = strdup(channel->name); | |
102 elem->num = n; | |
103 | |
104 menu_list_add_entry(menu, elem); | |
105 } | |
106 else | |
107 { | |
108 mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n", | |
109 sizeof(list_entry_t), strerror(errno)); | |
110 | |
111 break; | |
112 } | |
113 } | |
114 | |
115 return n; | |
116 } | |
117 | |
118 | |
119 static int fill_cards_menu(menu_t *menu, dvb_config_t *conf) | |
120 { | |
121 int n; | |
122 list_entry_t* elem; | |
123 | |
124 for(n = 0; n < conf->count; n++) | |
125 { | |
126 if((elem = calloc(1, sizeof(list_entry_t))) != NULL) | |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
127 { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
128 elem->p.next = NULL; |
12308 | 129 elem->p.txt = strdup(conf->cards[n].name); |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
130 elem->num = n; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
131 |
11352 | 132 if(n == 0) |
133 elem->p.prev = NULL; | |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
134 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
135 menu_list_add_entry(menu, elem); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
136 } |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
137 else |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
138 { |
12308 | 139 fprintf(stderr, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n", |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
140 sizeof(list_entry_t), strerror(errno)); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
141 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
142 if(n) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
143 return 1; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
144 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
145 return 0; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
146 } |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
147 } |
12308 | 148 |
149 return n; | |
150 } | |
151 | |
152 | |
153 static int fill_menu(menu_t* menu) | |
154 { | |
155 list_entry_t* elem; | |
156 dvb_channels_list *dvb_list_ptr; | |
157 | |
158 menu_list_init(menu); | |
159 | |
160 if(mpriv->config == NULL) | |
161 { | |
162 if((elem = calloc(1, sizeof(list_entry_t))) != NULL) | |
163 { | |
164 elem->p.prev = elem->p.next = NULL; | |
165 elem->p.txt = strdup("NO DVB configuration present!"); | |
166 | |
167 menu_list_add_entry(menu, elem); | |
168 return 1; | |
169 } | |
170 return 0; | |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
171 } |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
172 |
12308 | 173 mpriv->p.title = mpriv->title; |
174 if(mpriv->level == 1 && mpriv->config->count > 1) | |
175 return fill_cards_menu(menu, mpriv->config); | |
176 else | |
177 { | |
178 dvb_list_ptr = mpriv->config->cards[mpriv->card].list; | |
179 return fill_channels_menu(menu, dvb_list_ptr); | |
180 } | |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
181 } |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
182 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
183 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
184 static void read_cmd(menu_t* menu, int cmd) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
185 { |
12308 | 186 list_entry_t *elem; |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
187 mp_cmd_t* c; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
188 char *cmd_name; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
189 switch(cmd) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
190 { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
191 case MENU_CMD_OK: |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
192 { |
12308 | 193 elem = mpriv->p.current; |
194 | |
195 if(mpriv->level == 1) | |
196 { | |
197 mpriv->card = mpriv->p.current->num; | |
198 mpriv->level = 2; | |
199 menu_list_uninit(menu, free_entry); | |
200 fill_menu(menu); | |
201 } | |
202 else | |
203 { | |
204 dvb_priv_t *dvbp = (dvb_priv_t*) mpriv->config->priv; | |
205 cmd_name = malloc(25 + strlen(elem->p.txt)); | |
206 if(dvbp != NULL) | |
207 sprintf(cmd_name, "dvb_set_channel %d %d", elem->num, mpriv->card); | |
208 else | |
209 sprintf(cmd_name, "loadfile 'dvb://%d@%s'", mpriv->card+1, elem->p.txt); | |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
210 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
211 c = mp_input_parse_cmd(cmd_name); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
212 if(c) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
213 mp_input_queue_cmd(c); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
214 } |
12308 | 215 } |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
216 break; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
217 |
12308 | 218 case MENU_CMD_CANCEL: |
219 { | |
220 elem = mpriv->p.current; | |
221 | |
222 menu_list_uninit(menu, free_entry); | |
223 if(mpriv->config->count > 1) | |
224 mpriv->level--; | |
225 else | |
226 mpriv->level = 0; | |
227 | |
228 if(mpriv->level > 0) | |
229 { | |
230 fill_menu(menu); | |
231 break; | |
232 } | |
233 } | |
234 | |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
235 default: |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
236 menu_list_read_cmd(menu, cmd); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
237 } |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
238 } |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
239 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
240 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
241 static void close_menu(menu_t* menu) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
242 { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
243 menu_list_uninit(menu, free_entry); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
244 } |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
245 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
246 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
247 static int open_dvb_sel(menu_t* menu, char* args) |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
248 { |
12308 | 249 mpriv->config = dvb_get_config(); |
250 if(mpriv->config == NULL) | |
251 return 0; | |
252 | |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
253 menu->draw = menu_list_draw; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
254 menu->read_cmd = read_cmd; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
255 menu->close = close_menu; |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
256 |
12308 | 257 mpriv->card = 0; |
258 mpriv->level = 1; | |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
259 return fill_menu(menu); |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
260 } |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
261 |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
262 const menu_info_t menu_info_dvbsel = |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
263 { |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
264 "DVB channels menu", //descr |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
265 "dvbsel", //name |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
266 "Nico", //author |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
267 "dvb_sel", |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
268 { //m_struct_t priv_st= |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
269 "dvb_cfg", //name |
12308 | 270 sizeof(struct menu_priv_s), //size |
10626
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
271 &cfg_dflt, //defaults |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
272 cfg_fields //settable fields |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
273 }, |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
274 open_dvb_sel //open function |
fd97f3727f15
Finnaly commit Nico's dvb menu. Sorry for committing this
albeu
parents:
diff
changeset
|
275 }; |