Changeset 23962
- Timestamp:
- 09/28/13 10:10:16 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/epgsearch.h
r19490 r23962 2 2 #define EPGSEARCH_H 3 3 4 int searchepg(char* search, int searchtype, struct skin* epgsearch, struct skin* listbox)4 int searchepg(char* search, char* search1, char* search2, int searchtype, struct skin* epgsearch, struct skin* listbox) 5 5 { 6 int allepg = 1, count = 0; 6 7 char* result = NULL, *epgdesc = NULL, *tmpstr = NULL; 7 8 char* buf = NULL; … … 10 11 struct skin* tmp = NULL; 11 12 struct tm *loctime = NULL; 13 time_t akttime = time(NULL) + 10800; 12 14 13 15 if(search == NULL || strlen(search) < 2) return 1; … … 22 24 return 1; 23 25 } 26 27 if(textbox(_("Message"), _("Search only aktual epg ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1) 28 allepg = 0; 24 29 25 30 while(chnode != NULL) … … 28 33 while(epgnode != NULL) 29 34 { 35 if(allepg == 0 && epgnode->starttime > akttime) break; 36 30 37 result = NULL; 31 if(searchtype == 0 || searchtype == 2) 38 count = 0; 39 40 start: 41 if(searchtype == 0 || searchtype == 2 || searchtype == 3) 32 42 { 33 43 if(epgnode->title != NULL) 34 44 result = ostrstrcase(epgnode->title, search); 35 45 } 36 if((searchtype == 1 || searchtype == 2) && result == NULL) 46 if(searchtype == 3 && result == NULL) 47 { 48 if(epgnode->subtitle != NULL) 49 result = ostrstrcase(epgnode->subtitle, search); 50 } 51 if((searchtype == 1 || searchtype == 2 || searchtype == 3) && result == NULL) 37 52 { 38 53 epgdesc = epgdescunzip(epgnode); … … 43 58 } 44 59 } 60 61 if(result == NULL && count == 0 && search1 != NULL && ostrcmp(search, search1) != 0) 62 { 63 count = 1; 64 search = search1; 65 goto start; 66 } 67 68 if(result == NULL && count == 1 && search2 != NULL) 69 { 70 count = 2; 71 search = search2; 72 goto start; 73 } 74 45 75 if(result != NULL) 46 76 { … … 85 115 void screenepgsearch(char* text) 86 116 { 87 int rcret = -1, ret = 0 ;117 int rcret = -1, ret = 0, genre = 0; 88 118 struct skin* epgsearch = getscreen("epgsearch"); 89 119 struct skin* listbox = getscreennode(epgsearch, "listbox"); 90 120 char* search = NULL; 121 struct skin* tmp = NULL; 91 122 92 123 if(text != NULL) 93 124 { 94 125 delmarkedscreennodes(epgsearch, 1); 95 searchepg(text, 0, epgsearch, listbox);126 searchepg(text, NULL, NULL, 0, epgsearch, listbox); 96 127 } 97 128 … … 111 142 if(listbox->select != NULL) 112 143 { 113 servicecheckret(servicestart((struct channel*)listbox->select->handle, NULL, NULL, 0), 0); 144 if(genre == 0) 145 servicecheckret(servicestart((struct channel*)listbox->select->handle, NULL, NULL, 0), 0); 146 else 147 { 148 genre = 0; 149 delmarkedscreennodes(epgsearch, 1); 150 searchepg(listbox->select->text, listbox->select->handle, listbox->select->handle1, 3, epgsearch, listbox); 151 } 114 152 } 115 153 break; … … 118 156 if(rcret == getrcconfigint("rcred", NULL)) 119 157 { 120 if(listbox->select != NULL )158 if(listbox->select != NULL && genre == 0) 121 159 { 122 160 ret = addrecepg((struct channel*)listbox->select->handle, (struct epg*)listbox->select->handle1, NULL); … … 131 169 if(search != NULL) 132 170 { 171 genre = 0; 133 172 delmarkedscreennodes(epgsearch, 1); 134 searchepg(search, 0, epgsearch, listbox);173 searchepg(search, NULL, NULL, 0, epgsearch, listbox); 135 174 free(search); search = NULL; 136 175 } … … 144 183 if(search != NULL) 145 184 { 185 genre = 0; 146 186 delmarkedscreennodes(epgsearch, 1); 147 searchepg(search, 1, epgsearch, listbox);187 searchepg(search, NULL, NULL, 1, epgsearch, listbox); 148 188 free(search); search = NULL; 149 189 } … … 157 197 if(search != NULL) 158 198 { 199 genre = 0; 159 200 delmarkedscreennodes(epgsearch, 1); 160 searchepg(search, 2, epgsearch, listbox);201 searchepg(search, NULL, NULL, 2, epgsearch, listbox); 161 202 free(search); search = NULL; 162 203 } 204 drawscreen(epgsearch, 0, 0); 205 continue; 206 } 207 208 if(rcret == getrcconfigint("rcmenu", NULL)) 209 { 210 genre = 1; 211 delmarkedscreennodes(epgsearch, 1); 212 213 tmp = addlistbox(epgsearch, listbox, tmp, 1); 214 if(tmp != NULL) 215 { 216 changetext(tmp, _("Action")); 217 tmp->handle = "Action"; 218 tmp->handle1 = NULL; 219 } 220 221 tmp = addlistbox(epgsearch, listbox, tmp, 1); 222 if(tmp != NULL) 223 { 224 changetext(tmp, _("Animation")); 225 tmp->handle = "Animation"; 226 tmp->handle1 = NULL; 227 } 228 229 tmp = addlistbox(epgsearch, listbox, tmp, 1); 230 if(tmp != NULL) 231 { 232 changetext(tmp, _("History")); 233 tmp->handle = "History"; 234 tmp->handle1 = NULL; 235 } 236 237 tmp = addlistbox(epgsearch, listbox, tmp, 1); 238 if(tmp != NULL) 239 { 240 changetext(tmp, _("Doku")); 241 tmp->handle = "Doku"; 242 tmp->handle1 = NULL; 243 } 244 245 tmp = addlistbox(epgsearch, listbox, tmp, 1); 246 if(tmp != NULL) 247 { 248 changetext(tmp, _("Thriller")); 249 tmp->handle = "Thriller"; 250 tmp->handle1 = NULL; 251 } 252 253 tmp = addlistbox(epgsearch, listbox, tmp, 1); 254 if(tmp != NULL) 255 { 256 changetext(tmp, _("Child")); 257 tmp->handle = "Child"; 258 tmp->handle1 = NULL; 259 } 260 261 tmp = addlistbox(epgsearch, listbox, tmp, 1); 262 if(tmp != NULL) 263 { 264 changetext(tmp, _("Fantasy")); 265 tmp->handle = "Fantasy"; 266 tmp->handle1 = NULL; 267 } 268 269 tmp = addlistbox(epgsearch, listbox, tmp, 1); 270 if(tmp != NULL) 271 { 272 changetext(tmp, _("Horror")); 273 tmp->handle = "Horror"; 274 tmp->handle1 = NULL; 275 } 276 277 tmp = addlistbox(epgsearch, listbox, tmp, 1); 278 if(tmp != NULL) 279 { 280 changetext(tmp, _("Comedy")); 281 tmp->handle = "Comedy"; 282 tmp->handle1 = NULL; 283 } 284 285 tmp = addlistbox(epgsearch, listbox, tmp, 1); 286 if(tmp != NULL) 287 { 288 changetext(tmp, _("War")); 289 tmp->handle = "War"; 290 tmp->handle1 = NULL; 291 } 292 293 tmp = addlistbox(epgsearch, listbox, tmp, 1); 294 if(tmp != NULL) 295 { 296 changetext(tmp, _("Scifi")); 297 tmp->handle = "Scifi"; 298 tmp->handle1 = "Fiction"; 299 } 300 301 tmp = addlistbox(epgsearch, listbox, tmp, 1); 302 if(tmp != NULL) 303 { 304 changetext(tmp, _("Sport")); 305 tmp->handle = "Sport"; 306 tmp->handle1 = NULL; 307 } 308 309 tmp = addlistbox(epgsearch, listbox, tmp, 1); 310 if(tmp != NULL) 311 { 312 changetext(tmp, _("Western")); 313 tmp->handle = "Western"; 314 tmp->handle1 = NULL; 315 } 316 317 tmp = addlistbox(epgsearch, listbox, tmp, 1); 318 if(tmp != NULL) 319 { 320 changetext(tmp, _("Eastern")); 321 tmp->handle = "Eastern"; 322 tmp->handle1 = NULL; 323 } 324 325 tmp = addlistbox(epgsearch, listbox, tmp, 1); 326 if(tmp != NULL) 327 { 328 changetext(tmp, _("Music")); 329 tmp->handle = "Music"; 330 tmp->handle1 = NULL; 331 } 332 163 333 drawscreen(epgsearch, 0, 0); 164 334 continue;
Note: See TracChangeset
for help on using the changeset viewer.