mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +00:00
(audio_driver.c) More documentation
This commit is contained in:
parent
a2b05d31b1
commit
d3bf87f4d6
@ -29,12 +29,25 @@ extern "C" {
|
|||||||
|
|
||||||
typedef struct audio_driver
|
typedef struct audio_driver
|
||||||
{
|
{
|
||||||
|
/* Creates and initializes handle to audio driver.
|
||||||
|
*
|
||||||
|
* Returns: audio driver handle on success, otherwise NULL.
|
||||||
|
**/
|
||||||
void *(*init)(const char *device, unsigned rate, unsigned latency);
|
void *(*init)(const char *device, unsigned rate, unsigned latency);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @data : Pointer to audio data handle.
|
||||||
|
* @buf : Audio buffer data.
|
||||||
|
* @size : Size of audio buffer.
|
||||||
|
*
|
||||||
|
* Write samples to audio driver.
|
||||||
|
**/
|
||||||
ssize_t (*write)(void *data, const void *buf, size_t size);
|
ssize_t (*write)(void *data, const void *buf, size_t size);
|
||||||
|
|
||||||
|
/* Stops driver. */
|
||||||
bool (*stop)(void *data);
|
bool (*stop)(void *data);
|
||||||
|
|
||||||
|
/* Starts driver. */
|
||||||
bool (*start)(void *data);
|
bool (*start)(void *data);
|
||||||
|
|
||||||
/* Is the audio driver currently running? */
|
/* Is the audio driver currently running? */
|
||||||
@ -43,6 +56,7 @@ typedef struct audio_driver
|
|||||||
/* Should we care about blocking in audio thread? Fast forwarding. */
|
/* Should we care about blocking in audio thread? Fast forwarding. */
|
||||||
void (*set_nonblock_state)(void *data, bool toggle);
|
void (*set_nonblock_state)(void *data, bool toggle);
|
||||||
|
|
||||||
|
/* Frees driver data. */
|
||||||
void (*free)(void *data);
|
void (*free)(void *data);
|
||||||
|
|
||||||
/* Defines if driver will take standard floating point samples,
|
/* Defines if driver will take standard floating point samples,
|
||||||
|
@ -542,16 +542,16 @@ static inline void input_poll_overlay(void)
|
|||||||
/* Map "analog" buttons to analog axes like regular input drivers do. */
|
/* Map "analog" buttons to analog axes like regular input drivers do. */
|
||||||
for (j = 0; j < 4; j++)
|
for (j = 0; j < 4; j++)
|
||||||
{
|
{
|
||||||
if (!driver.overlay_state.analog[j])
|
unsigned bind_plus = RARCH_ANALOG_LEFT_X_PLUS + 2 * j;
|
||||||
{
|
unsigned bind_minus = bind_plus + 1;
|
||||||
unsigned bind_plus = RARCH_ANALOG_LEFT_X_PLUS + 2 * j;
|
|
||||||
unsigned bind_minus = bind_plus + 1;
|
|
||||||
|
|
||||||
if (driver.overlay_state.buttons & (1ULL << bind_plus))
|
if (driver.overlay_state.analog[j])
|
||||||
driver.overlay_state.analog[j] += 0x7fff;
|
continue;
|
||||||
if (driver.overlay_state.buttons & (1ULL << bind_minus))
|
|
||||||
driver.overlay_state.analog[j] -= 0x7fff;
|
if (driver.overlay_state.buttons & (1ULL << bind_plus))
|
||||||
}
|
driver.overlay_state.analog[j] += 0x7fff;
|
||||||
|
if (driver.overlay_state.buttons & (1ULL << bind_minus))
|
||||||
|
driver.overlay_state.analog[j] -= 0x7fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for analog_dpad_mode.
|
/* Check for analog_dpad_mode.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user