2012-04-21 23:13:50 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 01:50:59 +01:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2017-03-22 03:09:18 +01:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2017-12-11 23:55:31 -08:00
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2010-05-28 18:22:57 +02:00
|
|
|
* 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.
|
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2010-05-28 18:22:57 +02:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 23:31:57 +02:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2010-05-28 18:22:57 +02:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2015-11-02 20:41:42 +01:00
|
|
|
#ifndef __RARCH_DRIVER__H
|
|
|
|
#define __RARCH_DRIVER__H
|
2010-05-28 18:22:57 +02:00
|
|
|
|
2015-11-29 01:17:20 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
2016-02-04 20:36:00 +01:00
|
|
|
#include <sys/types.h>
|
2015-11-29 01:17:20 +01:00
|
|
|
|
2014-10-21 05:05:52 +02:00
|
|
|
#include <boolean.h>
|
2016-06-03 03:22:35 +02:00
|
|
|
#include <retro_common_api.h>
|
2014-05-31 16:48:07 +02:00
|
|
|
|
2021-11-07 01:44:45 +01:00
|
|
|
#include "configuration.h"
|
2021-11-12 04:45:09 +01:00
|
|
|
#include "retroarch_types.h"
|
2021-11-07 01:44:45 +01:00
|
|
|
|
2016-06-03 03:22:35 +02:00
|
|
|
RETRO_BEGIN_DECLS
|
2013-04-21 10:05:12 +02:00
|
|
|
|
2014-10-08 05:49:04 +01:00
|
|
|
enum
|
|
|
|
{
|
2016-12-05 01:47:56 +01:00
|
|
|
DRIVER_AUDIO = 0,
|
|
|
|
DRIVER_VIDEO,
|
|
|
|
DRIVER_INPUT,
|
|
|
|
DRIVER_CAMERA,
|
|
|
|
DRIVER_LOCATION,
|
|
|
|
DRIVER_MENU,
|
|
|
|
DRIVERS_VIDEO_INPUT,
|
2020-06-17 14:56:44 +03:00
|
|
|
DRIVER_BLUETOOTH,
|
2017-12-27 11:05:12 -05:00
|
|
|
DRIVER_WIFI,
|
2018-06-04 07:48:08 +02:00
|
|
|
DRIVER_LED,
|
|
|
|
DRIVER_MIDI
|
2016-12-05 01:47:56 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
DRIVER_AUDIO_MASK = 1 << DRIVER_AUDIO,
|
|
|
|
DRIVER_VIDEO_MASK = 1 << DRIVER_VIDEO,
|
|
|
|
DRIVER_INPUT_MASK = 1 << DRIVER_INPUT,
|
|
|
|
DRIVER_CAMERA_MASK = 1 << DRIVER_CAMERA,
|
|
|
|
DRIVER_LOCATION_MASK = 1 << DRIVER_LOCATION,
|
|
|
|
DRIVER_MENU_MASK = 1 << DRIVER_MENU,
|
|
|
|
DRIVERS_VIDEO_INPUT_MASK = 1 << DRIVERS_VIDEO_INPUT,
|
2020-06-17 14:56:44 +03:00
|
|
|
DRIVER_BLUETOOTH_MASK = 1 << DRIVER_BLUETOOTH,
|
2017-12-27 11:05:12 -05:00
|
|
|
DRIVER_WIFI_MASK = 1 << DRIVER_WIFI,
|
2018-06-04 07:48:08 +02:00
|
|
|
DRIVER_LED_MASK = 1 << DRIVER_LED,
|
|
|
|
DRIVER_MIDI_MASK = 1 << DRIVER_MIDI
|
2014-10-08 05:49:04 +01:00
|
|
|
};
|
|
|
|
|
2015-12-11 10:43:53 +01:00
|
|
|
enum driver_ctl_state
|
|
|
|
{
|
|
|
|
RARCH_DRIVER_CTL_NONE = 0,
|
2016-09-05 18:13:50 +02:00
|
|
|
|
2015-12-11 11:00:12 +01:00
|
|
|
/* Sets monitor refresh rate to new value by calling
|
|
|
|
* video_monitor_set_refresh_rate(). Subsequently
|
|
|
|
* calls audio_monitor_set_refresh_rate(). */
|
2015-12-11 11:04:16 +01:00
|
|
|
RARCH_DRIVER_CTL_SET_REFRESH_RATE,
|
2016-09-05 18:13:50 +02:00
|
|
|
|
2016-02-01 12:56:17 +01:00
|
|
|
RARCH_DRIVER_CTL_FIND_FIRST,
|
|
|
|
|
2017-07-11 21:00:44 -04:00
|
|
|
RARCH_DRIVER_CTL_FIND_LAST,
|
|
|
|
|
2016-02-01 12:56:17 +01:00
|
|
|
RARCH_DRIVER_CTL_FIND_PREV,
|
|
|
|
|
2020-09-16 18:41:45 +02:00
|
|
|
RARCH_DRIVER_CTL_FIND_NEXT
|
2015-12-11 10:43:53 +01:00
|
|
|
};
|
|
|
|
|
2016-02-01 12:56:17 +01:00
|
|
|
typedef struct driver_ctx_info
|
|
|
|
{
|
|
|
|
const char *label;
|
|
|
|
char *s;
|
2016-02-01 13:15:53 +01:00
|
|
|
ssize_t len;
|
2016-02-01 12:56:17 +01:00
|
|
|
} driver_ctx_info_t;
|
|
|
|
|
2015-12-11 10:43:53 +01:00
|
|
|
bool driver_ctl(enum driver_ctl_state state, void *data);
|
2015-03-22 01:16:57 +01:00
|
|
|
|
2021-09-13 18:33:53 +02:00
|
|
|
/**
|
|
|
|
* driver_find_index:
|
|
|
|
* @label : string of driver type to be found.
|
|
|
|
* @drv : identifier of driver to be found.
|
|
|
|
*
|
|
|
|
* Find index of the driver, based on @label.
|
|
|
|
*
|
|
|
|
* Returns: -1 if no driver based on @label and @drv found, otherwise
|
|
|
|
* index number of the driver found in the array.
|
|
|
|
**/
|
|
|
|
int driver_find_index(const char *label, const char *drv);
|
|
|
|
|
2017-01-22 12:47:17 +01:00
|
|
|
/* Sets audio and video drivers to nonblock state.
|
|
|
|
*
|
|
|
|
* If nonblock state is false, sets blocking state for both
|
|
|
|
* audio and video drivers instead. */
|
|
|
|
void driver_set_nonblock_state(void);
|
|
|
|
|
2021-11-07 01:44:45 +01:00
|
|
|
/**
|
|
|
|
* drivers_init:
|
|
|
|
* @flags : Bitmask of drivers to initialize.
|
|
|
|
*
|
|
|
|
* Initializes drivers.
|
|
|
|
* @flags determines which drivers get initialized.
|
|
|
|
**/
|
|
|
|
void drivers_init(settings_t *settings, int flags,
|
|
|
|
bool verbosity_enabled);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Driver ownership - set this to true if the platform in
|
|
|
|
* question needs to 'own'
|
|
|
|
* the respective handle and therefore skip regular RetroArch
|
|
|
|
* driver teardown/reiniting procedure.
|
|
|
|
*
|
|
|
|
* If to true, the 'free' function will get skipped. It is
|
|
|
|
* then up to the driver implementation to properly handle
|
|
|
|
* 'reiniting' inside the 'init' function and make sure it
|
|
|
|
* returns the existing handle instead of allocating and
|
|
|
|
* returning a pointer to a new handle.
|
|
|
|
*
|
|
|
|
* Typically, if a driver intends to make use of this, it should
|
|
|
|
* set this to true at the end of its 'init' function.
|
|
|
|
**/
|
|
|
|
void driver_uninit(int flags);
|
|
|
|
|
2021-11-12 04:45:09 +01:00
|
|
|
void retro_input_poll_null(void);
|
|
|
|
|
|
|
|
void retroarch_deinit_drivers(struct retro_callbacks *cbs);
|
|
|
|
|
2016-06-03 03:22:35 +02:00
|
|
|
RETRO_END_DECLS
|
2013-04-21 10:05:12 +02:00
|
|
|
|
2012-03-29 00:30:50 +02:00
|
|
|
#endif
|