2016-02-09 16:12:39 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2017-01-22 12:40:32 +00:00
|
|
|
* Copyright (C) 2011-2017 - Higor Euripedes
|
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2016-02-09 16:12:39 +00:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
#ifndef TASKS_HANDLER_INTERNAL_H
|
|
|
|
#define TASKS_HANDLER_INTERNAL_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2016-06-03 00:43:30 +00:00
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
#include <boolean.h>
|
2016-06-03 00:43:30 +00:00
|
|
|
#include <retro_common_api.h>
|
2016-12-29 22:14:48 +00:00
|
|
|
#include <retro_miscellaneous.h>
|
2016-02-09 16:12:39 +00:00
|
|
|
|
2016-05-10 05:54:47 +00:00
|
|
|
#include <queues/message_queue.h>
|
2016-02-09 17:13:47 +00:00
|
|
|
#include <queues/task_queue.h>
|
2016-06-20 04:34:30 +00:00
|
|
|
#include <formats/image.h>
|
2016-02-09 16:12:39 +00:00
|
|
|
|
2017-02-21 17:55:11 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../config.h"
|
|
|
|
#endif
|
|
|
|
|
2016-05-16 14:25:16 +00:00
|
|
|
#include "../content.h"
|
2016-03-22 01:56:06 +00:00
|
|
|
#include "../core_type.h"
|
2016-06-20 14:14:59 +00:00
|
|
|
#include "../msg_hash.h"
|
2016-12-20 14:18:07 +00:00
|
|
|
#include "../frontend/frontend_driver.h"
|
2016-02-09 16:12:39 +00:00
|
|
|
|
2016-06-03 00:43:30 +00:00
|
|
|
RETRO_BEGIN_DECLS
|
2016-06-02 23:14:53 +00:00
|
|
|
|
2016-06-20 04:34:30 +00:00
|
|
|
typedef int (*transfer_cb_t)(void *data, size_t len);
|
|
|
|
|
2016-05-16 12:10:56 +00:00
|
|
|
enum content_mode_load
|
|
|
|
{
|
|
|
|
CONTENT_MODE_LOAD_NONE = 0,
|
|
|
|
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU,
|
|
|
|
CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU,
|
2017-02-21 16:29:30 +00:00
|
|
|
CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU
|
2016-05-16 12:10:56 +00:00
|
|
|
};
|
|
|
|
|
2016-05-10 05:54:47 +00:00
|
|
|
enum nbio_status_enum
|
|
|
|
{
|
2016-12-30 03:58:58 +00:00
|
|
|
NBIO_STATUS_INIT = 0,
|
|
|
|
NBIO_STATUS_POLL,
|
2016-05-10 05:54:47 +00:00
|
|
|
NBIO_STATUS_TRANSFER,
|
|
|
|
NBIO_STATUS_TRANSFER_PARSE,
|
|
|
|
NBIO_STATUS_TRANSFER_PARSE_FREE
|
|
|
|
};
|
|
|
|
|
2016-12-29 22:14:48 +00:00
|
|
|
enum nbio_status_flags
|
|
|
|
{
|
|
|
|
NBIO_FLAG_NONE = 0,
|
|
|
|
NBIO_FLAG_IMAGE_SUPPORTS_RGBA
|
|
|
|
};
|
|
|
|
|
2016-05-10 05:54:47 +00:00
|
|
|
typedef struct nbio_handle
|
|
|
|
{
|
2016-05-11 02:10:42 +00:00
|
|
|
enum image_type_enum image_type;
|
2016-05-18 21:28:03 +00:00
|
|
|
void *data;
|
2016-05-10 05:54:47 +00:00
|
|
|
bool is_finished;
|
|
|
|
transfer_cb_t cb;
|
|
|
|
struct nbio_t *handle;
|
|
|
|
unsigned pos_increment;
|
|
|
|
msg_queue_t *msg_queue;
|
|
|
|
unsigned status;
|
2016-12-29 22:14:48 +00:00
|
|
|
uint32_t status_flags;
|
2016-12-30 03:58:58 +00:00
|
|
|
char path[4096];
|
2016-05-10 05:54:47 +00:00
|
|
|
} nbio_handle_t;
|
|
|
|
|
2016-05-10 17:43:15 +00:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-09-16 22:22:55 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char *data;
|
|
|
|
size_t len;
|
|
|
|
} http_transfer_data_t;
|
|
|
|
|
2016-05-27 16:14:47 +00:00
|
|
|
void *task_push_http_transfer(const char *url, bool mute, const char *type,
|
2017-03-02 22:36:25 +00:00
|
|
|
retro_task_callback_t cb, void *userdata);
|
|
|
|
|
|
|
|
void *task_push_http_post_transfer(const char *url, const char *post_data, bool mute, const char *type,
|
2016-02-09 16:47:04 +00:00
|
|
|
retro_task_callback_t cb, void *userdata);
|
2016-05-05 04:11:28 +00:00
|
|
|
|
2016-05-06 04:31:25 +00:00
|
|
|
task_retriever_info_t *http_task_get_transfer_list(void);
|
2016-11-29 23:18:27 +00:00
|
|
|
|
2016-11-30 16:37:32 +00:00
|
|
|
bool task_push_wifi_scan(void);
|
2016-11-29 23:18:27 +00:00
|
|
|
|
2016-12-02 23:56:29 +00:00
|
|
|
bool task_push_netplay_lan_scan(void);
|
|
|
|
|
2017-01-22 23:57:50 +00:00
|
|
|
bool task_push_netplay_crc_scan(uint32_t crc, char* name,
|
2017-01-22 17:39:19 +00:00
|
|
|
const char *hostname, const char *corename);
|
2017-01-22 02:17:50 +00:00
|
|
|
|
2017-02-21 04:27:50 +00:00
|
|
|
bool task_push_netplay_nat_traversal(void *nat_traversal_state, uint16_t port);
|
2017-02-21 00:08:31 +00:00
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|
|
|
|
|
2016-12-29 21:53:10 +00:00
|
|
|
bool task_push_image_load(const char *fullpath,
|
|
|
|
retro_task_callback_t cb, void *userdata);
|
2016-02-09 16:12:39 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_LIBRETRODB
|
2017-01-18 00:23:09 +00:00
|
|
|
bool task_push_dbscan(
|
|
|
|
const char *playlist_directory,
|
|
|
|
const char *content_database,
|
|
|
|
const char *fullpath,
|
2016-02-09 16:47:04 +00:00
|
|
|
bool directory, retro_task_callback_t cb);
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_OVERLAY
|
2016-05-27 16:14:47 +00:00
|
|
|
bool task_push_overlay_load_default(
|
2016-02-09 16:47:04 +00:00
|
|
|
retro_task_callback_t cb, void *user_data);
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
int find_first_data_track(const char* cue_path,
|
|
|
|
int32_t* offset, char* track_path, size_t max_len);
|
|
|
|
|
2017-03-07 00:16:26 +00:00
|
|
|
int detect_system(const char* track_path, const char** system_name);
|
2016-02-09 16:12:39 +00:00
|
|
|
|
|
|
|
int detect_ps1_game(const char *track_path, char *game_id);
|
|
|
|
|
|
|
|
int detect_psp_game(const char *track_path, char *game_id);
|
|
|
|
|
2016-05-27 16:14:47 +00:00
|
|
|
bool task_check_decompress(const char *source_file);
|
2016-05-04 23:42:56 +00:00
|
|
|
|
2016-05-27 16:14:47 +00:00
|
|
|
bool task_image_load_handler(retro_task_t *task);
|
2016-05-10 05:54:47 +00:00
|
|
|
|
2016-05-27 16:14:47 +00:00
|
|
|
bool task_push_decompress(
|
2016-02-09 16:12:39 +00:00
|
|
|
const char *source_file,
|
|
|
|
const char *target_dir,
|
|
|
|
const char *target_file,
|
|
|
|
const char *subdir,
|
|
|
|
const char *valid_ext,
|
2016-02-09 16:47:04 +00:00
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
2016-02-09 16:12:39 +00:00
|
|
|
|
2017-02-21 16:29:30 +00:00
|
|
|
bool task_push_load_content_with_current_core_from_companion_ui(
|
|
|
|
const char *fullpath,
|
|
|
|
content_ctx_info_t *content_info,
|
|
|
|
enum rarch_core_type type,
|
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
|
|
|
|
2017-02-21 15:59:48 +00:00
|
|
|
bool task_push_load_content_from_cli(
|
|
|
|
const char *core_path,
|
|
|
|
const char *fullpath,
|
|
|
|
content_ctx_info_t *content_info,
|
|
|
|
enum rarch_core_type type,
|
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
|
|
|
|
2017-02-21 15:53:02 +00:00
|
|
|
bool task_push_load_new_core(
|
2017-02-21 03:07:40 +00:00
|
|
|
const char *core_path,
|
|
|
|
const char *fullpath,
|
|
|
|
content_ctx_info_t *content_info,
|
|
|
|
enum rarch_core_type type,
|
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
|
|
|
|
2017-02-21 16:22:04 +00:00
|
|
|
bool task_push_start_builtin_core(content_ctx_info_t *content_info,
|
|
|
|
enum rarch_core_type type,
|
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
|
|
|
|
2017-02-21 15:50:39 +00:00
|
|
|
bool task_push_start_current_core(content_ctx_info_t *content_info);
|
2017-02-21 02:54:34 +00:00
|
|
|
|
2017-02-21 15:50:39 +00:00
|
|
|
bool task_push_start_dummy_core(content_ctx_info_t *content_info);
|
2017-02-21 02:32:52 +00:00
|
|
|
|
2017-02-21 17:36:38 +00:00
|
|
|
bool task_push_load_content_with_new_core_from_companion_ui(
|
2017-02-21 15:30:47 +00:00
|
|
|
const char *core_path,
|
|
|
|
const char *fullpath,
|
|
|
|
content_ctx_info_t *content_info,
|
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
|
|
|
|
2017-02-21 17:55:11 +00:00
|
|
|
#ifdef HAVE_MENU
|
2017-02-21 17:36:38 +00:00
|
|
|
bool task_push_load_content_with_new_core_from_menu(
|
2017-02-21 03:31:03 +00:00
|
|
|
const char *core_path,
|
|
|
|
const char *fullpath,
|
|
|
|
content_ctx_info_t *content_info,
|
|
|
|
enum rarch_core_type type,
|
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
|
|
|
|
2017-02-21 17:36:38 +00:00
|
|
|
bool task_push_load_content_from_playlist_from_menu(
|
2017-02-21 02:44:36 +00:00
|
|
|
const char *core_path,
|
|
|
|
const char *fullpath,
|
|
|
|
content_ctx_info_t *content_info,
|
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
|
|
|
|
2017-02-21 17:36:38 +00:00
|
|
|
bool task_push_load_content_with_core_from_menu(
|
2016-02-09 16:47:04 +00:00
|
|
|
const char *fullpath,
|
2016-05-16 14:25:16 +00:00
|
|
|
content_ctx_info_t *content_info,
|
2016-02-09 16:47:04 +00:00
|
|
|
enum rarch_core_type type,
|
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
2017-02-21 17:55:11 +00:00
|
|
|
#endif
|
2016-02-09 16:12:39 +00:00
|
|
|
|
2016-05-27 16:14:47 +00:00
|
|
|
void task_image_load_free(retro_task_t *task);
|
2016-05-10 05:54:47 +00:00
|
|
|
|
2016-05-27 16:14:47 +00:00
|
|
|
void task_file_load_handler(retro_task_t *task);
|
2016-05-10 05:54:47 +00:00
|
|
|
|
2016-12-06 05:52:57 +00:00
|
|
|
bool take_screenshot(const char *path, bool silence);
|
2016-05-17 12:31:33 +00:00
|
|
|
|
2016-09-19 02:05:44 +00:00
|
|
|
bool event_load_save_files(void);
|
|
|
|
|
2016-09-19 02:09:27 +00:00
|
|
|
bool event_save_files(void);
|
|
|
|
|
2016-09-19 02:18:40 +00:00
|
|
|
void path_init_savefile_rtc(void);
|
|
|
|
|
|
|
|
void *savefile_ptr_get(void);
|
|
|
|
|
|
|
|
void path_init_savefile_new(void);
|
|
|
|
|
2016-12-31 06:43:34 +00:00
|
|
|
bool input_autoconfigure_connect(
|
|
|
|
const char *name,
|
|
|
|
const char *display_name,
|
|
|
|
const char *driver,
|
|
|
|
unsigned idx,
|
|
|
|
unsigned vid,
|
|
|
|
unsigned pid);
|
2016-12-01 19:38:20 +00:00
|
|
|
|
2016-12-01 21:36:38 +00:00
|
|
|
bool input_autoconfigure_disconnect(unsigned i, const char *ident);
|
2016-12-01 19:38:20 +00:00
|
|
|
|
2016-12-20 20:46:12 +00:00
|
|
|
void task_push_get_powerstate(void);
|
2016-12-20 14:18:07 +00:00
|
|
|
|
|
|
|
enum frontend_powerstate get_last_powerstate(int *percent);
|
|
|
|
|
2016-12-01 21:57:43 +00:00
|
|
|
extern const char* const input_builtin_autoconfs[];
|
|
|
|
|
2016-06-03 00:43:30 +00:00
|
|
|
RETRO_END_DECLS
|
2016-06-02 23:14:53 +00:00
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|