RetroArch/driver.h

130 lines
3.3 KiB
C
Raw Normal View History

2012-04-21 21:13:50 +00:00
/* RetroArch - A frontend for libretro.
2014-01-01 00:50:59 +00:00
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
2017-03-22 02:09:18 +00:00
* Copyright (C) 2011-2017 - Daniel De Matteis
*
2012-04-21 21:13:50 +00:00
* RetroArch is free software: you can redistribute it and/or modify it under the terms
2010-05-28 16:22:57 +00: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 21:13:50 +00:00
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
2010-05-28 16:22:57 +00: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 21:31:57 +00:00
* You should have received a copy of the GNU General Public License along with RetroArch.
2010-05-28 16:22:57 +00:00
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __RARCH_DRIVER__H
#define __RARCH_DRIVER__H
2010-05-28 16:22:57 +00:00
2015-11-29 00:17:20 +00:00
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
2015-11-29 00:17:20 +00:00
#include <boolean.h>
#include <retro_common_api.h>
2014-05-31 14:48:07 +00:00
RETRO_BEGIN_DECLS
2013-04-21 08:05:12 +00:00
2015-12-05 17:49:41 +00:00
#define DRIVERS_CMD_ALL \
2016-12-05 00:47:56 +00:00
( DRIVER_AUDIO_MASK \
| DRIVER_VIDEO_MASK \
| DRIVER_INPUT_MASK \
| DRIVER_CAMERA_MASK \
| DRIVER_LOCATION_MASK \
| DRIVER_MENU_MASK \
| DRIVERS_VIDEO_INPUT_MASK \
| DRIVER_WIFI_MASK \
2018-06-04 05:48:08 +00:00
| DRIVER_LED_MASK \
| DRIVER_MIDI_MASK )
2015-12-05 17:49:41 +00:00
2017-05-28 13:26:47 +00:00
#define DRIVERS_CMD_ALL_BUT_MENU \
( DRIVER_AUDIO_MASK \
| DRIVER_VIDEO_MASK \
| DRIVER_INPUT_MASK \
| DRIVER_CAMERA_MASK \
| DRIVER_LOCATION_MASK \
| DRIVERS_VIDEO_INPUT_MASK \
| DRIVER_WIFI_MASK \
2018-06-04 05:48:08 +00:00
| DRIVER_LED_MASK \
| DRIVER_MIDI_MASK )
2017-05-28 13:26:47 +00:00
enum
{
2016-12-05 00:47:56 +00:00
DRIVER_AUDIO = 0,
DRIVER_VIDEO,
DRIVER_INPUT,
DRIVER_CAMERA,
DRIVER_LOCATION,
DRIVER_MENU,
DRIVERS_VIDEO_INPUT,
DRIVER_WIFI,
2018-06-04 05:48:08 +00:00
DRIVER_LED,
DRIVER_MIDI
2016-12-05 00:47:56 +00: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,
DRIVER_WIFI_MASK = 1 << DRIVER_WIFI,
2018-06-04 05:48:08 +00:00
DRIVER_LED_MASK = 1 << DRIVER_LED,
DRIVER_MIDI_MASK = 1 << DRIVER_MIDI
};
2015-12-11 09:43:53 +00:00
enum driver_ctl_state
{
RARCH_DRIVER_CTL_NONE = 0,
2015-12-11 09:52:15 +00:00
RARCH_DRIVER_CTL_DEINIT,
2016-09-05 16:13:50 +00:00
/* Sets monitor refresh rate to new value by calling
* video_monitor_set_refresh_rate(). Subsequently
* calls audio_monitor_set_refresh_rate(). */
RARCH_DRIVER_CTL_SET_REFRESH_RATE,
2016-09-05 16:13:50 +00:00
/* Update the system Audio/Video information.
* Will reinitialize audio/video drivers.
* Used by RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO. */
2016-02-01 11:56:17 +00:00
RARCH_DRIVER_CTL_UPDATE_SYSTEM_AV_INFO,
RARCH_DRIVER_CTL_FIND_FIRST,
RARCH_DRIVER_CTL_FIND_LAST,
2016-02-01 11:56:17 +00:00
RARCH_DRIVER_CTL_FIND_PREV,
2016-02-01 12:15:53 +00:00
RARCH_DRIVER_CTL_FIND_NEXT,
/* Find index of the driver, based on @label. */
RARCH_DRIVER_CTL_FIND_INDEX
2015-12-11 09:43:53 +00:00
};
2016-02-01 11:56:17 +00:00
typedef struct driver_ctx_info
{
const char *label;
char *s;
2016-02-01 12:15:53 +00:00
ssize_t len;
2016-02-01 11:56:17 +00:00
} driver_ctx_info_t;
2015-12-11 09:43:53 +00:00
bool driver_ctl(enum driver_ctl_state state, void *data);
/* 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);
2017-05-28 13:03:03 +00:00
void driver_uninit(int flags);
2017-01-16 21:04:57 +00:00
void drivers_init(int flags);
RETRO_END_DECLS
2013-04-21 08:05:12 +00:00
#endif