diff options
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 299 |
1 files changed, 279 insertions, 20 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index 7c4c83a991..092d23406b 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -192,6 +192,263 @@ static int bookmark_menu_callback(int action, | |||
192 | return action; | 192 | return action; |
193 | } | 193 | } |
194 | 194 | ||
195 | /* playing_time screen context */ | ||
196 | struct playing_time_info { | ||
197 | int curr_playing; /* index of currently playing track in playlist */ | ||
198 | int nb_tracks; /* how many tracks in playlist */ | ||
199 | /* seconds before and after current position, and total. Datatype | ||
200 | allows for values up to 68years. If I had kept it in ms | ||
201 | though, it would have overflowed at 24days, which takes | ||
202 | something like 8.5GB at 32kbps, and so we could conceivably | ||
203 | have playlists lasting longer than that. */ | ||
204 | long secs_bef, secs_aft, secs_ttl; | ||
205 | long trk_secs_bef, trk_secs_aft, trk_secs_ttl; | ||
206 | /* kilobytes played before and after current pos, and total. | ||
207 | Kilobytes because bytes would overflow. Data type range is up | ||
208 | to 2TB. */ | ||
209 | long kbs_bef, kbs_aft, kbs_ttl; | ||
210 | }; | ||
211 | |||
212 | /* list callback for playing_time screen */ | ||
213 | static const char * playing_time_get_or_speak_info(int selected_item, void * data, | ||
214 | char *buf, size_t buffer_len, | ||
215 | bool say_it) | ||
216 | { | ||
217 | struct playing_time_info *pti = (struct playing_time_info *)data; | ||
218 | switch(selected_item) { | ||
219 | case 0: { /* elapsed and total time */ | ||
220 | char timestr1[25], timestr2[25]; | ||
221 | format_time_auto(timestr1, sizeof(timestr1), pti->secs_bef, | ||
222 | UNIT_SEC, false); | ||
223 | format_time_auto(timestr2, sizeof(timestr2), pti->secs_ttl, | ||
224 | UNIT_SEC, false); | ||
225 | long elapsed_perc; /* percentage of duration elapsed */ | ||
226 | if (pti->secs_ttl == 0) | ||
227 | elapsed_perc = 0; | ||
228 | else if (pti->secs_ttl <= 0xFFFFFF) | ||
229 | elapsed_perc = pti->secs_bef *100 / pti->secs_ttl; | ||
230 | else /* sacrifice some precision to avoid overflow */ | ||
231 | elapsed_perc = (pti->secs_bef>>7) *100 /(pti->secs_ttl>>7); | ||
232 | snprintf(buf, buffer_len, str(LANG_PLAYTIME_ELAPSED), | ||
233 | timestr1, timestr2, elapsed_perc); | ||
234 | if (say_it) | ||
235 | talk_ids(false, LANG_PLAYTIME_ELAPSED, | ||
236 | TALK_ID(pti->secs_bef, UNIT_TIME), | ||
237 | VOICE_OF, | ||
238 | TALK_ID(pti->secs_ttl, UNIT_TIME), | ||
239 | VOICE_PAUSE, | ||
240 | TALK_ID(elapsed_perc, UNIT_PERCENT)); | ||
241 | break; | ||
242 | } | ||
243 | case 1: { /* playlist remaining time */ | ||
244 | char timestr[25]; | ||
245 | format_time_auto(timestr, sizeof(timestr), pti->secs_aft, | ||
246 | UNIT_SEC, false); | ||
247 | snprintf(buf, buffer_len, str(LANG_PLAYTIME_REMAINING), | ||
248 | timestr); | ||
249 | if (say_it) | ||
250 | talk_ids(false, LANG_PLAYTIME_REMAINING, | ||
251 | TALK_ID(pti->secs_aft, UNIT_TIME)); | ||
252 | break; | ||
253 | } | ||
254 | case 2: { /* track elapsed and duration */ | ||
255 | char timestr1[25], timestr2[25]; | ||
256 | format_time_auto(timestr1, sizeof(timestr1), pti->trk_secs_bef, | ||
257 | UNIT_SEC, false); | ||
258 | format_time_auto(timestr2, sizeof(timestr2), pti->trk_secs_ttl, | ||
259 | UNIT_SEC, false); | ||
260 | long elapsed_perc; /* percentage of duration elapsed */ | ||
261 | if (pti->trk_secs_ttl == 0) | ||
262 | elapsed_perc = 0; | ||
263 | else if (pti->trk_secs_ttl <= 0xFFFFFF) | ||
264 | elapsed_perc = pti->trk_secs_bef *100 / pti->trk_secs_ttl; | ||
265 | else /* sacrifice some precision to avoid overflow */ | ||
266 | elapsed_perc = (pti->trk_secs_bef>>7) *100 /(pti->trk_secs_ttl>>7); | ||
267 | snprintf(buf, buffer_len, str(LANG_PLAYTIME_TRK_ELAPSED), | ||
268 | timestr1, timestr2, elapsed_perc); | ||
269 | if (say_it) | ||
270 | talk_ids(false, LANG_PLAYTIME_TRK_ELAPSED, | ||
271 | TALK_ID(pti->trk_secs_bef, UNIT_TIME), | ||
272 | VOICE_OF, | ||
273 | TALK_ID(pti->trk_secs_ttl, UNIT_TIME), | ||
274 | VOICE_PAUSE, | ||
275 | TALK_ID(elapsed_perc, UNIT_PERCENT)); | ||
276 | break; | ||
277 | } | ||
278 | case 3: { /* track remaining time */ | ||
279 | char timestr[25]; | ||
280 | format_time_auto(timestr, sizeof(timestr), pti->trk_secs_aft, | ||
281 | UNIT_SEC, false); | ||
282 | snprintf(buf, buffer_len, str(LANG_PLAYTIME_TRK_REMAINING), | ||
283 | timestr); | ||
284 | if (say_it) | ||
285 | talk_ids(false, LANG_PLAYTIME_TRK_REMAINING, | ||
286 | TALK_ID(pti->trk_secs_aft, UNIT_TIME)); | ||
287 | break; | ||
288 | } | ||
289 | case 4: { /* track index */ | ||
290 | int track_perc = (pti->curr_playing+1) *100 / pti->nb_tracks; | ||
291 | snprintf(buf, buffer_len, str(LANG_PLAYTIME_TRACK), | ||
292 | pti->curr_playing, pti->nb_tracks, track_perc); | ||
293 | if (say_it) | ||
294 | talk_ids(false, LANG_PLAYTIME_TRACK, | ||
295 | TALK_ID(pti->curr_playing+1, UNIT_INT), | ||
296 | VOICE_OF, | ||
297 | TALK_ID(pti->nb_tracks, UNIT_INT), | ||
298 | VOICE_PAUSE, | ||
299 | TALK_ID(track_perc, UNIT_PERCENT)); | ||
300 | break; | ||
301 | } | ||
302 | case 5: { /* storage size */ | ||
303 | char str1[10], str2[10], str3[10]; | ||
304 | output_dyn_value(str1, sizeof(str1), pti->kbs_ttl, kibyte_units, 3, true); | ||
305 | output_dyn_value(str2, sizeof(str2), pti->kbs_bef, kibyte_units, 3, true); | ||
306 | output_dyn_value(str3, sizeof(str3), pti->kbs_aft, kibyte_units, 3, true); | ||
307 | snprintf(buf, buffer_len, str(LANG_PLAYTIME_STORAGE), | ||
308 | str1,str2,str3); | ||
309 | if (say_it) { | ||
310 | talk_id(LANG_PLAYTIME_STORAGE, false); | ||
311 | output_dyn_value(NULL, 0, pti->kbs_ttl, kibyte_units, 3, true); | ||
312 | talk_ids(true, VOICE_PAUSE, VOICE_PLAYTIME_DONE); | ||
313 | output_dyn_value(NULL, 0, pti->kbs_bef, kibyte_units, 3, true); | ||
314 | talk_id(LANG_PLAYTIME_REMAINING, true); | ||
315 | output_dyn_value(NULL, 0, pti->kbs_aft, kibyte_units, 3, true); | ||
316 | } | ||
317 | break; | ||
318 | } | ||
319 | case 6: { /* Average track file size */ | ||
320 | char str[10]; | ||
321 | long avg_track_size = pti->kbs_ttl /pti->nb_tracks; | ||
322 | output_dyn_value(str, sizeof(str), avg_track_size, kibyte_units, 3, true); | ||
323 | snprintf(buf, buffer_len, str(LANG_PLAYTIME_AVG_TRACK_SIZE), | ||
324 | str); | ||
325 | if (say_it) { | ||
326 | talk_id(LANG_PLAYTIME_AVG_TRACK_SIZE, false); | ||
327 | output_dyn_value(NULL, 0, avg_track_size, kibyte_units, 3, true); | ||
328 | } | ||
329 | break; | ||
330 | } | ||
331 | case 7: { /* Average bitrate */ | ||
332 | /* Convert power of 2 kilobytes to power of 10 kilobits */ | ||
333 | long avg_bitrate = pti->kbs_ttl / pti->secs_ttl *1024 *8 /1000; | ||
334 | snprintf(buf, buffer_len, str(LANG_PLAYTIME_AVG_BITRATE), | ||
335 | avg_bitrate); | ||
336 | if (say_it) | ||
337 | talk_ids(false, LANG_PLAYTIME_AVG_BITRATE, | ||
338 | TALK_ID(avg_bitrate, UNIT_KBIT)); | ||
339 | break; | ||
340 | } | ||
341 | } | ||
342 | return buf; | ||
343 | } | ||
344 | |||
345 | static const char * playing_time_get_info(int selected_item, void * data, | ||
346 | char *buffer, size_t buffer_len) | ||
347 | { | ||
348 | return playing_time_get_or_speak_info(selected_item, data, | ||
349 | buffer, buffer_len, false); | ||
350 | } | ||
351 | |||
352 | static int playing_time_speak_info(int selected_item, void * data) | ||
353 | { | ||
354 | static char buffer[MAX_PATH]; | ||
355 | playing_time_get_or_speak_info(selected_item, data, | ||
356 | buffer, MAX_PATH, true); | ||
357 | return 0; | ||
358 | } | ||
359 | |||
360 | /* playing time screen: shows total and elapsed playlist duration and | ||
361 | other stats */ | ||
362 | static bool playing_time(void) | ||
363 | { | ||
364 | unsigned long talked_tick = current_tick; | ||
365 | struct playing_time_info pti; | ||
366 | struct playlist_track_info pltrack; | ||
367 | struct mp3entry id3; | ||
368 | int i, fd, ret; | ||
369 | |||
370 | pti.nb_tracks = playlist_amount(); | ||
371 | playlist_get_resume_info(&pti.curr_playing); | ||
372 | struct mp3entry *curr_id3 = audio_current_track(); | ||
373 | if (pti.curr_playing == -1 || !curr_id3) | ||
374 | return false; | ||
375 | pti.secs_bef = pti.trk_secs_bef = curr_id3->elapsed/1000; | ||
376 | pti.secs_aft = pti.trk_secs_aft | ||
377 | = (curr_id3->length -curr_id3->elapsed)/1000; | ||
378 | pti.kbs_bef = curr_id3->offset/1024; | ||
379 | pti.kbs_aft = (curr_id3->filesize -curr_id3->offset)/1024; | ||
380 | |||
381 | splash(0, ID2P(LANG_WAIT)); | ||
382 | |||
383 | /* Go through each file in the playlist and get its stats. For | ||
384 | huge playlists this can take a while... The reference position | ||
385 | is the position at the moment this function was invoked, | ||
386 | although playback continues forward. */ | ||
387 | for (i = 0; i < pti.nb_tracks; i++) { | ||
388 | /* Show a splash while we are loading. */ | ||
389 | splashf(0, str(LANG_LOADING_PERCENT), | ||
390 | i*100/pti.nb_tracks, str(LANG_OFF_ABORT)); | ||
391 | /* Voice equivalent */ | ||
392 | if (TIME_AFTER(current_tick, talked_tick+5*HZ)) { | ||
393 | talked_tick = current_tick; | ||
394 | talk_ids(false, LANG_LOADING_PERCENT, | ||
395 | TALK_ID(i*100/pti.nb_tracks, UNIT_PERCENT)); | ||
396 | } | ||
397 | if (action_userabort(TIMEOUT_NOBLOCK)) | ||
398 | goto exit; | ||
399 | |||
400 | if (i == pti.curr_playing) | ||
401 | continue; | ||
402 | |||
403 | if (playlist_get_track_info(NULL, i, &pltrack) < 0) | ||
404 | goto error; | ||
405 | if ((fd = open(pltrack.filename, O_RDONLY)) < 0) | ||
406 | goto error; | ||
407 | ret = get_metadata(&id3, fd, pltrack.filename); | ||
408 | close(fd); | ||
409 | if (!ret) | ||
410 | goto error; | ||
411 | |||
412 | if (i < pti.curr_playing) { | ||
413 | pti.secs_bef += id3.length/1000; | ||
414 | pti.kbs_bef += id3.filesize/1024; | ||
415 | } else { | ||
416 | pti.secs_aft += id3.length/1000; | ||
417 | pti.kbs_aft += id3.filesize/1024; | ||
418 | } | ||
419 | } | ||
420 | |||
421 | pti.secs_ttl = pti.secs_bef +pti.secs_aft; | ||
422 | pti.trk_secs_ttl = pti.trk_secs_bef +pti.trk_secs_aft; | ||
423 | pti.kbs_ttl = pti.kbs_bef +pti.kbs_aft; | ||
424 | |||
425 | struct gui_synclist pt_lists; | ||
426 | int key; | ||
427 | |||
428 | gui_synclist_init(&pt_lists, &playing_time_get_info, &pti, true, 1, NULL); | ||
429 | if (global_settings.talk_menu) | ||
430 | gui_synclist_set_voice_callback(&pt_lists, playing_time_speak_info); | ||
431 | gui_synclist_set_nb_items(&pt_lists, 8); | ||
432 | gui_synclist_draw(&pt_lists); | ||
433 | gui_syncstatusbar_draw(&statusbars, true); | ||
434 | gui_synclist_speak_item(&pt_lists); | ||
435 | while (true) { | ||
436 | gui_syncstatusbar_draw(&statusbars, false); | ||
437 | if (list_do_action(CONTEXT_LIST, HZ/2, | ||
438 | &pt_lists, &key, LIST_WRAP_UNLESS_HELD) == 0 | ||
439 | && key!=ACTION_NONE && key!=ACTION_UNKNOWN) | ||
440 | { | ||
441 | talk_force_shutup(); | ||
442 | return(default_event_handler(key) == SYS_USB_CONNECTED); | ||
443 | } | ||
444 | } | ||
445 | error: | ||
446 | splash(HZ, ID2P(LANG_PLAYTIME_ERROR)); | ||
447 | exit: | ||
448 | return false; | ||
449 | } | ||
450 | |||
451 | |||
195 | /* CONTEXT_WPS playlist options */ | 452 | /* CONTEXT_WPS playlist options */ |
196 | static bool shuffle_playlist(void) | 453 | static bool shuffle_playlist(void) |
197 | { | 454 | { |
@@ -213,10 +470,12 @@ MENUITEM_FUNCTION(playlist_save_item, 0, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST), | |||
213 | save_playlist, NULL, NULL, Icon_Playlist); | 470 | save_playlist, NULL, NULL, Icon_Playlist); |
214 | MENUITEM_FUNCTION(reshuffle_item, 0, ID2P(LANG_SHUFFLE_PLAYLIST), | 471 | MENUITEM_FUNCTION(reshuffle_item, 0, ID2P(LANG_SHUFFLE_PLAYLIST), |
215 | shuffle_playlist, NULL, NULL, Icon_Playlist); | 472 | shuffle_playlist, NULL, NULL, Icon_Playlist); |
473 | MENUITEM_FUNCTION(playing_time_item, 0, ID2P(LANG_PLAYING_TIME), | ||
474 | playing_time, NULL, NULL, Icon_Playlist); | ||
216 | MAKE_ONPLAYMENU( wps_playlist_menu, ID2P(LANG_PLAYLIST), | 475 | MAKE_ONPLAYMENU( wps_playlist_menu, ID2P(LANG_PLAYLIST), |
217 | NULL, Icon_Playlist, | 476 | NULL, Icon_Playlist, |
218 | &view_cur_playlist, &search_playlist_item, | 477 | &view_cur_playlist, &search_playlist_item, |
219 | &playlist_save_item, &reshuffle_item | 478 | &playlist_save_item, &reshuffle_item, &playing_time_item |
220 | ); | 479 | ); |
221 | 480 | ||
222 | /* CONTEXT_[TREE|ID3DB] playlist options */ | 481 | /* CONTEXT_[TREE|ID3DB] playlist options */ |
@@ -381,18 +640,18 @@ MENUITEM_FUNCTION(view_playlist_item, 0, ID2P(LANG_VIEW), | |||
381 | 640 | ||
382 | MAKE_ONPLAYMENU( tree_playlist_menu, ID2P(LANG_CURRENT_PLAYLIST), | 641 | MAKE_ONPLAYMENU( tree_playlist_menu, ID2P(LANG_CURRENT_PLAYLIST), |
383 | treeplaylist_callback, Icon_Playlist, | 642 | treeplaylist_callback, Icon_Playlist, |
384 | 643 | ||
385 | /* view */ | 644 | /* view */ |
386 | &view_playlist_item, | 645 | &view_playlist_item, |
387 | 646 | ||
388 | /* insert */ | 647 | /* insert */ |
389 | &i_pl_item, &i_first_pl_item, &i_last_pl_item, | 648 | &i_pl_item, &i_first_pl_item, &i_last_pl_item, |
390 | &i_shuf_pl_item, &i_last_shuf_pl_item, | 649 | &i_shuf_pl_item, &i_last_shuf_pl_item, |
391 | /* queue */ | 650 | /* queue */ |
392 | 651 | ||
393 | &q_pl_item, &q_first_pl_item, &q_last_pl_item, | 652 | &q_pl_item, &q_first_pl_item, &q_last_pl_item, |
394 | &q_shuf_pl_item, &q_last_shuf_pl_item, | 653 | &q_shuf_pl_item, &q_last_shuf_pl_item, |
395 | 654 | ||
396 | /* replace */ | 655 | /* replace */ |
397 | &replace_pl_item | 656 | &replace_pl_item |
398 | ); | 657 | ); |
@@ -941,7 +1200,7 @@ static int clipboard_pastedirectory(struct dirrecurse_params *src, | |||
941 | a move instead */ | 1200 | a move instead */ |
942 | flags |= PASTE_EXDEV; | 1201 | flags |= PASTE_EXDEV; |
943 | break; | 1202 | break; |
944 | } | 1203 | } |
945 | #endif /* HAVE_MULTIVOLUME */ | 1204 | #endif /* HAVE_MULTIVOLUME */ |
946 | } | 1205 | } |
947 | } | 1206 | } |
@@ -999,7 +1258,7 @@ static int clipboard_pastedirectory(struct dirrecurse_params *src, | |||
999 | rc = OPRC_CANCELLED; | 1258 | rc = OPRC_CANCELLED; |
1000 | break; | 1259 | break; |
1001 | } | 1260 | } |
1002 | 1261 | ||
1003 | DEBUGF("Copy %s to %s\n", src->path, target->path); | 1262 | DEBUGF("Copy %s to %s\n", src->path, target->path); |
1004 | 1263 | ||
1005 | if (info.attribute & ATTR_DIRECTORY) { | 1264 | if (info.attribute & ATTR_DIRECTORY) { |
@@ -1151,16 +1410,16 @@ static int ratingitem_callback(int action,const struct menu_item_ex *this_item) | |||
1151 | MENUITEM_FUNCTION(rating_item, 0, ID2P(LANG_MENU_SET_RATING), | 1410 | MENUITEM_FUNCTION(rating_item, 0, ID2P(LANG_MENU_SET_RATING), |
1152 | set_rating_inline, NULL, | 1411 | set_rating_inline, NULL, |
1153 | ratingitem_callback, Icon_Questionmark); | 1412 | ratingitem_callback, Icon_Questionmark); |
1154 | #endif | 1413 | #endif |
1155 | #ifdef HAVE_PICTUREFLOW_INTEGRATION | 1414 | #ifdef HAVE_PICTUREFLOW_INTEGRATION |
1156 | MENUITEM_RETURNVALUE(pictureflow_item, ID2P(LANG_ONPLAY_PICTUREFLOW), | 1415 | MENUITEM_RETURNVALUE(pictureflow_item, ID2P(LANG_ONPLAY_PICTUREFLOW), |
1157 | GO_TO_PICTUREFLOW, NULL, Icon_NOICON); | 1416 | GO_TO_PICTUREFLOW, NULL, Icon_NOICON); |
1158 | #endif | 1417 | #endif |
1159 | 1418 | ||
1160 | static bool view_cue(void) | 1419 | static bool view_cue(void) |
1161 | { | 1420 | { |
1162 | struct mp3entry* id3 = audio_current_track(); | 1421 | struct mp3entry* id3 = audio_current_track(); |
1163 | if(id3 && id3->cuesheet) | 1422 | if (id3 && id3->cuesheet) |
1164 | { | 1423 | { |
1165 | browse_cuesheet(id3->cuesheet); | 1424 | browse_cuesheet(id3->cuesheet); |
1166 | } | 1425 | } |
@@ -1274,7 +1533,7 @@ MENUITEM_FUNCTION(set_recdir_item, 0, ID2P(LANG_SET_AS_REC_DIR), | |||
1274 | #endif | 1533 | #endif |
1275 | static bool set_startdir(void) | 1534 | static bool set_startdir(void) |
1276 | { | 1535 | { |
1277 | snprintf(global_settings.start_directory, | 1536 | snprintf(global_settings.start_directory, |
1278 | sizeof(global_settings.start_directory), | 1537 | sizeof(global_settings.start_directory), |
1279 | "%s/", selected_file); | 1538 | "%s/", selected_file); |
1280 | settings_save(); | 1539 | settings_save(); |
@@ -1375,10 +1634,10 @@ MAKE_ONPLAYMENU( wps_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE), | |||
1375 | #ifdef HAVE_TAGCACHE | 1634 | #ifdef HAVE_TAGCACHE |
1376 | &rating_item, | 1635 | &rating_item, |
1377 | #endif | 1636 | #endif |
1378 | &bookmark_menu, | 1637 | &bookmark_menu, |
1379 | #ifdef HAVE_PICTUREFLOW_INTEGRATION | 1638 | #ifdef HAVE_PICTUREFLOW_INTEGRATION |
1380 | &pictureflow_item, | 1639 | &pictureflow_item, |
1381 | #endif | 1640 | #endif |
1382 | &browse_id3_item, &list_viewers_item, | 1641 | &browse_id3_item, &list_viewers_item, |
1383 | &delete_file_item, &view_cue_item, | 1642 | &delete_file_item, &view_cue_item, |
1384 | #ifdef HAVE_PITCHCONTROL | 1643 | #ifdef HAVE_PITCHCONTROL |
@@ -1451,7 +1710,7 @@ static int playlist_insert_shuffled(void) | |||
1451 | playlist_insert_func((intptr_t*)PLAYLIST_INSERT_SHUFFLED); | 1710 | playlist_insert_func((intptr_t*)PLAYLIST_INSERT_SHUFFLED); |
1452 | return ONPLAY_START_PLAY; | 1711 | return ONPLAY_START_PLAY; |
1453 | } | 1712 | } |
1454 | 1713 | ||
1455 | return ONPLAY_RELOAD_DIR; | 1714 | return ONPLAY_RELOAD_DIR; |
1456 | } | 1715 | } |
1457 | 1716 | ||
@@ -1465,7 +1724,7 @@ struct hotkey_assignment { | |||
1465 | #define HOTKEY_FUNC(func, param) {{(void *)func}, param} | 1724 | #define HOTKEY_FUNC(func, param) {{(void *)func}, param} |
1466 | 1725 | ||
1467 | /* Any desired hotkey functions go here, in the enum in onplay.h, | 1726 | /* Any desired hotkey functions go here, in the enum in onplay.h, |
1468 | and in the settings menu in settings_list.c. The order here | 1727 | and in the settings menu in settings_list.c. The order here |
1469 | is not important. */ | 1728 | is not important. */ |
1470 | static struct hotkey_assignment hotkey_items[] = { | 1729 | static struct hotkey_assignment hotkey_items[] = { |
1471 | { HOTKEY_VIEW_PLAYLIST, LANG_VIEW_DYNAMIC_PLAYLIST, | 1730 | { HOTKEY_VIEW_PLAYLIST, LANG_VIEW_DYNAMIC_PLAYLIST, |
@@ -1510,7 +1769,7 @@ int get_hotkey_lang_id(int action) | |||
1510 | if (hotkey_items[i].action == action) | 1769 | if (hotkey_items[i].action == action) |
1511 | return hotkey_items[i].lang_id; | 1770 | return hotkey_items[i].lang_id; |
1512 | } | 1771 | } |
1513 | 1772 | ||
1514 | return LANG_OFF; | 1773 | return LANG_OFF; |
1515 | } | 1774 | } |
1516 | 1775 | ||
@@ -1521,7 +1780,7 @@ static int execute_hotkey(bool is_wps) | |||
1521 | struct hotkey_assignment *this_item; | 1780 | struct hotkey_assignment *this_item; |
1522 | const int action = (is_wps ? global_settings.hotkey_wps : | 1781 | const int action = (is_wps ? global_settings.hotkey_wps : |
1523 | global_settings.hotkey_tree); | 1782 | global_settings.hotkey_tree); |
1524 | 1783 | ||
1525 | /* search assignment struct for a match for the hotkey setting */ | 1784 | /* search assignment struct for a match for the hotkey setting */ |
1526 | while (i--) | 1785 | while (i--) |
1527 | { | 1786 | { |
@@ -1546,7 +1805,7 @@ static int execute_hotkey(bool is_wps) | |||
1546 | return return_code; | 1805 | return return_code; |
1547 | } | 1806 | } |
1548 | } | 1807 | } |
1549 | 1808 | ||
1550 | /* no valid hotkey set, ignore hotkey */ | 1809 | /* no valid hotkey set, ignore hotkey */ |
1551 | return ONPLAY_RELOAD_DIR; | 1810 | return ONPLAY_RELOAD_DIR; |
1552 | } | 1811 | } |