Commit 7c615b77 authored by hpi1's avatar hpi1

Splitted _process_psr_event()

parent f00ecbc3
......@@ -1692,53 +1692,63 @@ void bd_stop_bdj(BLURAY *bd)
* Navigation mode interface
*/
static void _process_psr_restore_event(BLURAY *bd, BD_PSR_EVENT *ev)
{
/* PSR restore events are handled internally.
* Restore stored playback position.
*/
BD_DEBUG(DBG_BLURAY, "PSR restore: psr%u = %u (%p)\n", ev->psr_idx, ev->new_val, bd);
switch (ev->psr_idx) {
case PSR_ANGLE_NUMBER:
/* can't set angle before playlist is opened */
return;
case PSR_TITLE_NUMBER:
/* pass to the application */
_queue_event(bd, (BD_EVENT){BD_EVENT_TITLE, ev->new_val});
return;
case PSR_CHAPTER:
/* will be selected automatically */
return;
case PSR_PLAYLIST:
bd_select_playlist(bd, ev->new_val);
nav_set_angle(bd->title, bd->st0.clip, bd_psr_read(bd->regs, PSR_ANGLE_NUMBER) - 1);
return;
case PSR_PLAYITEM:
bd_seek_playitem(bd, ev->new_val);
return;
case PSR_TIME:
bd_seek_time(bd, ((int64_t)ev->new_val) << 1);
return;
case PSR_SELECTED_BUTTON_ID:
case PSR_MENU_PAGE_ID:
/* handled by graphics controller */
return;
default:
/* others: ignore */
return;
}
}
/*
* notification events to APP
*/
static void _process_psr_event(void *handle, BD_PSR_EVENT *ev)
{
BLURAY *bd = (BLURAY*)handle;
if (ev->ev_type == BD_PSR_SAVE) {
BD_DEBUG(DBG_BLURAY, "PSR SAVE event (%p)\n", bd);
return;
}
/* PSR restore events are handled internally */
if (ev->ev_type == BD_PSR_RESTORE) {
switch (ev->ev_type) {
case BD_PSR_RESTORE:
_process_psr_restore_event(bd, ev);
return;
BD_DEBUG(DBG_BLURAY, "PSR RESTORE event %d %d (%p)\n", ev->psr_idx, ev->new_val, bd);
/* Restore stored playback position */
switch (ev->psr_idx) {
case PSR_ANGLE_NUMBER:
/* can't set angle before playlist is opened */
return;
case PSR_TITLE_NUMBER:
/* pass to the application */
break;
case PSR_CHAPTER:
/* will be selected automatically */
return;
case PSR_PLAYLIST:
bd_select_playlist(bd, ev->new_val);
nav_set_angle(bd->title, bd->st0.clip, bd_psr_read(bd->regs, PSR_ANGLE_NUMBER) - 1);
return;
case PSR_PLAYITEM:
bd_seek_playitem(bd, ev->new_val);
return;
case PSR_TIME:
bd_seek_time(bd, ((int64_t)ev->new_val) << 1);
return;
case PSR_SELECTED_BUTTON_ID:
case PSR_MENU_PAGE_ID:
/* TODO: need to inform graphics controller ? */
default:
/* others: ignore */
return;
}
case BD_PSR_SAVE:
default:
return;
}
BD_DEBUG(DBG_BLURAY, "PSR event %d %d (%p)\n", ev->psr_idx, ev->new_val, bd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment