forked from libretro/RetroArch
-
Notifications
You must be signed in to change notification settings - Fork 2
/
tasks_internal.h
178 lines (137 loc) · 4.74 KB
/
tasks_internal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2016 - Higor Euripedes
* 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/>.
*/
#ifndef TASKS_HANDLER_INTERNAL_H
#define TASKS_HANDLER_INTERNAL_H
#include <stdint.h>
#include <boolean.h>
#include <retro_common_api.h>
#include <queues/message_queue.h>
#include <queues/task_queue.h>
#include <formats/image.h>
#include "../content.h"
#include "../core_type.h"
#include "../msg_hash.h"
RETRO_BEGIN_DECLS
typedef int (*transfer_cb_t)(void *data, size_t len);
enum content_mode_load
{
CONTENT_MODE_LOAD_NONE = 0,
CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE,
CONTENT_MODE_LOAD_FROM_CLI,
CONTENT_MODE_LOAD_NOTHING_WITH_CURRENT_CORE_FROM_MENU,
CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU,
CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU,
CONTENT_MODE_LOAD_NOTHING_WITH_VIDEO_PROCESSOR_CORE_FROM_MENU,
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU,
CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU,
CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU,
CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU,
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI,
CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI,
CONTENT_MODE_LOAD_CONTENT_FROM_PLAYLIST_FROM_MENU
};
enum nbio_status_enum
{
NBIO_STATUS_POLL = 0,
NBIO_STATUS_TRANSFER,
NBIO_STATUS_TRANSFER_PARSE,
NBIO_STATUS_TRANSFER_PARSE_FREE
};
typedef struct nbio_handle
{
enum image_type_enum image_type;
void *data;
bool is_finished;
transfer_cb_t cb;
struct nbio_t *handle;
unsigned pos_increment;
msg_queue_t *msg_queue;
unsigned status;
} nbio_handle_t;
typedef struct autoconfig_params
{
char name[255];
char driver[255];
char display_name[255];
unsigned idx;
int32_t vid;
int32_t pid;
} autoconfig_params_t;
#ifdef HAVE_NETWORKING
typedef struct
{
char *data;
size_t len;
} http_transfer_data_t;
void *task_push_http_transfer(const char *url, bool mute, const char *type,
retro_task_callback_t cb, void *userdata);
task_retriever_info_t *http_task_get_transfer_list(void);
bool task_push_wifi_scan(void);
bool task_push_netplay_lan_scan(void);
#endif
bool task_push_image_load(const char *fullpath,
enum msg_hash_enums enum_idx,
retro_task_callback_t cb, void *userdata);
#ifdef HAVE_LIBRETRODB
bool task_push_dbscan(const char *fullpath,
bool directory, retro_task_callback_t cb);
#endif
#ifdef HAVE_OVERLAY
bool task_push_overlay_load_default(
retro_task_callback_t cb, void *user_data);
#endif
int find_first_data_track(const char* cue_path,
int32_t* offset, char* track_path, size_t max_len);
int detect_system(const char* track_path, int32_t offset,
const char** system_name);
int detect_ps1_game(const char *track_path, char *game_id);
int detect_psp_game(const char *track_path, char *game_id);
bool task_check_decompress(const char *source_file);
bool task_image_load_handler(retro_task_t *task);
bool task_push_decompress(
const char *source_file,
const char *target_dir,
const char *target_file,
const char *subdir,
const char *valid_ext,
retro_task_callback_t cb,
void *user_data);
bool task_push_content_load_default(
const char *core_path,
const char *fullpath,
content_ctx_info_t *content_info,
enum rarch_core_type type,
enum content_mode_load mode,
retro_task_callback_t cb,
void *user_data);
void task_image_load_free(retro_task_t *task);
void task_file_load_handler(retro_task_t *task);
bool content_push_to_history_playlist(
void *data,
const char *path,
const char *core_name,
const char *core_path);
bool take_screenshot(const char *path, bool silence);
bool event_load_save_files(void);
bool event_save_files(void);
void path_init_savefile_rtc(void);
void *savefile_ptr_get(void);
void path_init_savefile_new(void);
bool input_autoconfigure_connect(autoconfig_params_t *params);
bool input_autoconfigure_disconnect(unsigned i, const char *ident);
extern const char* const input_builtin_autoconfs[];
RETRO_END_DECLS
#endif