forked from libretro/RetroArch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks_internal.h
272 lines (212 loc) · 7.01 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 - Higor Euripedes
* Copyright (C) 2011-2017 - 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 <retro_miscellaneous.h>
#include <queues/message_queue.h>
#include <queues/task_queue.h>
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#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_CONTENT_WITH_CURRENT_CORE_FROM_MENU,
CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU,
CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU
};
enum nbio_status_enum
{
NBIO_STATUS_INIT = 0,
NBIO_STATUS_TRANSFER,
NBIO_STATUS_TRANSFER_PARSE,
NBIO_STATUS_TRANSFER_FINISHED
};
enum nbio_status_flags
{
NBIO_FLAG_NONE = 0,
NBIO_FLAG_IMAGE_SUPPORTS_RGBA
};
enum nbio_type
{
NBIO_TYPE_NONE = 0,
NBIO_TYPE_JPEG,
NBIO_TYPE_PNG,
NBIO_TYPE_TGA,
NBIO_TYPE_BMP,
NBIO_TYPE_OGG,
NBIO_TYPE_FLAC,
NBIO_TYPE_MP3,
NBIO_TYPE_MOD,
NBIO_TYPE_WAV
};
typedef struct nbio_handle
{
enum nbio_type type;
bool is_finished;
unsigned status;
unsigned pos_increment;
uint32_t status_flags;
void *data;
char *path;
struct nbio_t *handle;
msg_queue_t *msg_queue;
transfer_cb_t cb;
} nbio_handle_t;
typedef struct
{
enum msg_hash_enums enum_idx;
char path[PATH_MAX_LENGTH];
} file_transfer_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);
void *task_push_http_post_transfer(const char *url, const char *post_data, 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(retro_task_callback_t cb);
bool task_push_netplay_lan_scan(retro_task_callback_t cb);
bool task_push_netplay_crc_scan(uint32_t crc, char* name,
const char *hostname, const char *corename);
bool task_push_netplay_lan_scan_rooms(retro_task_callback_t cb);
bool task_push_netplay_nat_traversal(void *nat_traversal_state, uint16_t port);
#endif
bool task_push_image_load(const char *fullpath,
retro_task_callback_t cb, void *userdata);
#ifdef HAVE_LIBRETRODB
bool task_push_dbscan(
const char *playlist_directory,
const char *content_database,
const char *fullpath,
bool directory, bool show_hidden_files,
retro_task_callback_t cb);
#endif
#ifdef HAVE_OVERLAY
bool task_push_overlay_load_default(
retro_task_callback_t cb, void *user_data);
#endif
bool task_check_decompress(const char *source_file);
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_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);
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);
bool task_push_load_new_core(
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);
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);
bool task_push_start_current_core(content_ctx_info_t *content_info);
bool task_push_start_dummy_core(content_ctx_info_t *content_info);
bool task_push_load_content_with_new_core_from_companion_ui(
const char *core_path,
const char *fullpath,
content_ctx_info_t *content_info,
retro_task_callback_t cb,
void *user_data);
#ifdef HAVE_MENU
bool task_push_load_content_with_new_core_from_menu(
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);
bool task_push_load_content_from_playlist_from_menu(
const char *core_path,
const char *fullpath,
const char *label,
content_ctx_info_t *content_info,
retro_task_callback_t cb,
void *user_data);
bool task_push_load_content_with_core_from_menu(
const char *fullpath,
content_ctx_info_t *content_info,
enum rarch_core_type type,
retro_task_callback_t cb,
void *user_data);
bool task_push_load_subsystem_with_core_from_menu(
const char *fullpath,
content_ctx_info_t *content_info,
enum rarch_core_type type,
retro_task_callback_t cb,
void *user_data);
#endif
void task_file_load_handler(retro_task_t *task);
bool task_audio_mixer_load_handler(retro_task_t *task);
bool take_screenshot(const char *path, bool silence, bool has_valid_framebuffer);
bool event_load_save_files(void);
bool event_save_files(void);
void path_init_savefile_rtc(const char *savefile_path);
void *savefile_ptr_get(void);
void path_init_savefile_new(void);
bool input_is_autoconfigured(unsigned i);
unsigned input_autoconfigure_get_device_name_index(unsigned i);
void input_autoconfigure_reset(void);
bool input_autoconfigure_connect(
const char *name,
const char *display_name,
const char *driver,
unsigned idx,
unsigned vid,
unsigned pid);
bool input_autoconfigure_disconnect(unsigned i, const char *ident);
bool input_autoconfigure_get_swap_override(void);
void input_autoconfigure_joypad_reindex_devices(void);
void task_push_get_powerstate(void);
enum frontend_powerstate get_last_powerstate(int *percent);
bool task_push_audio_mixer_load_and_play(
const char *fullpath, retro_task_callback_t cb, void *user_data);
bool task_push_audio_mixer_load(
const char *fullpath, retro_task_callback_t cb, void *user_data);
extern const char* const input_builtin_autoconfs[];
RETRO_END_DECLS
#endif