Create video_driver_get_video_output_next/video_driver_get_video_output_prev

This commit is contained in:
twinaphex 2015-03-23 00:50:33 +01:00
parent efdbd03433
commit 2392a433d8
3 changed files with 40 additions and 10 deletions

View File

@ -846,3 +846,37 @@ void video_driver_apply_state_changes(void)
return;
driver->video_poke->apply_state_changes(driver->video_data);
}
void video_driver_get_video_output_next(void)
{
driver_t *driver = driver_get_ptr();
if (!driver)
return;
if (!driver->video)
return;
if (!driver->video_data)
return;
if (!driver->video_poke)
return;
if (!driver->video_poke->get_video_output_next)
return;
driver->video_poke->get_video_output_next(driver->video_data);
}
void video_driver_get_video_output_prev(void)
{
driver_t *driver = driver_get_ptr();
if (!driver)
return;
if (!driver->video)
return;
if (!driver->video_data)
return;
if (!driver->video_poke)
return;
if (!driver->video_poke->get_video_output_prev)
return;
driver->video_poke->get_video_output_prev(driver->video_data);
}

View File

@ -314,6 +314,10 @@ void video_driver_set_filtering(unsigned index, bool smooth);
void video_driver_apply_state_changes(void);
void video_driver_get_video_output_next(void);
void video_driver_get_video_output_prev(void);
#ifdef __cplusplus
}
#endif

View File

@ -442,18 +442,10 @@ static int action_toggle_video_resolution(unsigned type, const char *label,
switch (action)
{
case MENU_ACTION_LEFT:
if (driver->video_data && driver->video_poke &&
driver->video_poke->get_video_output_prev)
{
driver->video_poke->get_video_output_prev(driver->video_data);
}
video_driver_get_video_output_prev();
break;
case MENU_ACTION_RIGHT:
if (driver->video_data && driver->video_poke &&
driver->video_poke->get_video_output_next)
{
driver->video_poke->get_video_output_next(driver->video_data);
}
video_driver_get_video_output_next();
break;
}
#endif