2016-01-23 23:40:34 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2016-02-12 03:55:18 +00:00
|
|
|
#ifdef HAVE_MENU
|
|
|
|
#include "../menu/menu_driver.h"
|
|
|
|
#endif
|
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
#include "tasks_internal.h"
|
|
|
|
|
2016-01-23 23:40:34 +00:00
|
|
|
#include "../command_event.h"
|
|
|
|
|
2016-01-24 00:31:40 +00:00
|
|
|
/* TODO/FIXME - turn this into actual task */
|
|
|
|
|
2016-01-23 23:51:17 +00:00
|
|
|
bool rarch_task_push_content_load_default(
|
2016-01-23 23:40:34 +00:00
|
|
|
const char *core_path, const char *fullpath,
|
2016-01-23 23:51:17 +00:00
|
|
|
bool persist, enum rarch_core_type type,
|
2016-02-09 16:47:04 +00:00
|
|
|
retro_task_callback_t cb, void *user_data)
|
2016-01-23 23:40:34 +00:00
|
|
|
{
|
|
|
|
enum event_command cmd = EVENT_CMD_NONE;
|
|
|
|
|
|
|
|
if (core_path)
|
|
|
|
{
|
|
|
|
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path);
|
|
|
|
event_cmd_ctl(EVENT_CMD_LOAD_CORE, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fullpath)
|
|
|
|
runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)fullpath);
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case CORE_TYPE_PLAIN:
|
|
|
|
case CORE_TYPE_DUMMY:
|
|
|
|
cmd = persist ? EVENT_CMD_LOAD_CONTENT_PERSIST : EVENT_CMD_LOAD_CONTENT;
|
|
|
|
break;
|
|
|
|
case CORE_TYPE_FFMPEG:
|
2016-01-25 06:04:54 +00:00
|
|
|
#ifdef HAVE_FFMPEG
|
2016-01-23 23:40:34 +00:00
|
|
|
cmd = EVENT_CMD_LOAD_CONTENT_FFMPEG;
|
|
|
|
#endif
|
2016-01-25 06:04:54 +00:00
|
|
|
break;
|
2016-01-23 23:40:34 +00:00
|
|
|
case CORE_TYPE_IMAGEVIEWER:
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
cmd = EVENT_CMD_LOAD_CONTENT_IMAGEVIEWER;
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cmd != EVENT_CMD_NONE)
|
|
|
|
event_cmd_ctl(cmd, NULL);
|
|
|
|
|
2016-02-12 03:55:18 +00:00
|
|
|
#ifdef HAVE_MENU
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_QUIT, NULL);
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_QUICK_MENU, NULL);
|
|
|
|
#endif
|
|
|
|
|
2016-01-23 23:40:34 +00:00
|
|
|
return true;
|
|
|
|
}
|