RetroArch
Classes | Macros | Typedefs | Enumerations | Functions
rsound.h File Reference
#include <sys/types.h>
#include <unistd.h>
#include <rthreads/rthreads.h>
#include <sys/time.h>
#include <time.h>
#include <stdint.h>
#include <stddef.h>
#include <retro_common_api.h>
#include <queues/fifo_queue.h>
Include dependency graph for rsound.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rsound
 

Macros

#define RSD_DEFAULT_HOST   "localhost"
 
#define RSD_DEFAULT_PORT   "12345"
 
#define RSD_DEFAULT_UNIX_SOCK   "/tmp/rsound"
 
#define RSD_DEFAULT_OBJECT   "rsound"
 
#define RSD_VERSION   "1.1"
 
#define RSD_SAMPLERATE   RSD_SAMPLERATE
 
#define RSD_CHANNELS   RSD_CHANNELS
 
#define RSD_HOST   RSD_HOST
 
#define RSD_PORT   RSD_PORT
 
#define RSD_BUFSIZE   RSD_BUFSIZE
 
#define RSD_LATENCY   RSD_LATENCY
 
#define RSD_FORMAT   RSD_FORMAT
 
#define RSD_IDENTITY   RSD_IDENTITY
 
#define RSD_S16_LE   RSD_S16_LE
 
#define RSD_S16_BE   RSD_S16_BE
 
#define RSD_U16_LE   RSD_U16_LE
 
#define RSD_U16_BE   RSD_U16_BE
 
#define RSD_U8   RSD_U8
 
#define RSD_S8   RSD_S8
 
#define RSD_S16_NE   RSD_S16_NE
 
#define RSD_U16_NE   RSD_U16_NE
 
#define RSD_ALAW   RSD_ALAW
 
#define RSD_MULAW   RSD_MULAW
 
#define RSD_S32_LE   RSD_S32_LE
 
#define RSD_S32_BE   RSD_S32_BE
 
#define RSD_S32_NE   RSD_S32_NE
 
#define RSD_U32_LE   RSD_U32_LE
 
#define RSD_U32_BE   RSD_U32_BE
 
#define RSD_U32_NE   RSD_U32_NE
 
#define RSD_DELAY_MS   RSD_DELAY_MS
 
#define RSD_SAMPLESIZE   RSD_SAMPLESIZE
 
#define RSD_EXEC   RSD_EXEC
 
#define RSD_SIMPLE_START   RSD_SIMPLE_START
 
#define RSD_NO_FMT   RSD_NO_FMT
 
#define RSD_USES_OPAQUE_TYPE   RSD_USES_OPAQUE_TYPE
 
#define RSD_USES_SAMPLESIZE_MEMBER   RSD_USES_SAMPLESIZE_MEMBER
 
#define RSD_AUDIO_CALLBACK_T   RSD_AUDIO_CALLBACK_T
 
#define RSD_ERROR_CALLBACK_T   RSD_ERROR_CALLBACK_T
 
#define RSD_SET_CALLBACK   RSD_SET_CALLBACK
 
#define RSD_CALLBACK_LOCK   RSD_CALLBACK_LOCK
 
#define RSD_CALLBACK_UNLOCK   RSD_CALLBACK_UNLOCK
 

Typedefs

typedef ssize_t(* rsd_audio_callback_t) (void *data, size_t bytes, void *userdata)
 
typedef void(* rsd_error_callback_t) (void *userdata)
 
typedef struct rsound rsound_t
 

Enumerations

enum  rsd_format {
  RSD_NO_FMT = 0x0000, RSD_S16_LE = 0x0001, RSD_S16_BE = 0x0002, RSD_U16_LE = 0x0004,
  RSD_U16_BE = 0x0008, RSD_U8 = 0x0010, RSD_S8 = 0x0020, RSD_S16_NE = 0x0040,
  RSD_U16_NE = 0x0080, RSD_ALAW = 0x0100, RSD_MULAW = 0x0200, RSD_S32_LE = 0x0400,
  RSD_S32_BE = 0x0800, RSD_S32_NE = 0x1000, RSD_U32_LE = 0x2000, RSD_U32_BE = 0x4000,
  RSD_U32_NE = 0x8000
}
 
enum  rsd_settings {
  RSD_SAMPLERATE = 0, RSD_CHANNELS, RSD_HOST, RSD_PORT,
  RSD_BUFSIZE, RSD_LATENCY, RSD_FORMAT, RSD_IDENTITY
}
 

Functions

int rsd_init (rsound_t **rd)
 
int rsd_simple_start (rsound_t **rd, const char *host, const char *port, const char *ident, int rate, int channels, enum rsd_format format)
 
int rsd_set_param (rsound_t *rd, enum rsd_settings option, void *param)
 
void rsd_set_callback (rsound_t *rd, rsd_audio_callback_t callback, rsd_error_callback_t err_callback, size_t max_size, void *userdata)
 
void rsd_callback_lock (rsound_t *rd)
 
void rsd_callback_unlock (rsound_t *rd)
 
int rsd_start (rsound_t *rd)
 
int rsd_exec (rsound_t *rd)
 
int rsd_stop (rsound_t *rd)
 
size_t rsd_write (rsound_t *rd, const void *buf, size_t size)
 
size_t rsd_pointer (rsound_t *rd)
 
size_t rsd_get_avail (rsound_t *rd)
 
size_t rsd_delay (rsound_t *rd)
 
size_t rsd_delay_ms (rsound_t *rd)
 
int rsd_samplesize (rsound_t *rd)
 
void rsd_delay_wait (rsound_t *rd)
 
int rsd_pause (rsound_t *rd, int enable)
 
int rsd_free (rsound_t *rd)
 

Macro Definition Documentation

◆ RSD_ALAW

#define RSD_ALAW   RSD_ALAW

◆ RSD_AUDIO_CALLBACK_T

#define RSD_AUDIO_CALLBACK_T   RSD_AUDIO_CALLBACK_T

◆ RSD_BUFSIZE

#define RSD_BUFSIZE   RSD_BUFSIZE

◆ RSD_CALLBACK_LOCK

#define RSD_CALLBACK_LOCK   RSD_CALLBACK_LOCK

◆ RSD_CALLBACK_UNLOCK

#define RSD_CALLBACK_UNLOCK   RSD_CALLBACK_UNLOCK

◆ RSD_CHANNELS

#define RSD_CHANNELS   RSD_CHANNELS

◆ RSD_DEFAULT_HOST

#define RSD_DEFAULT_HOST   "localhost"

◆ RSD_DEFAULT_OBJECT

#define RSD_DEFAULT_OBJECT   "rsound"

◆ RSD_DEFAULT_PORT

#define RSD_DEFAULT_PORT   "12345"

◆ RSD_DEFAULT_UNIX_SOCK

#define RSD_DEFAULT_UNIX_SOCK   "/tmp/rsound"

◆ RSD_DELAY_MS

#define RSD_DELAY_MS   RSD_DELAY_MS

◆ RSD_ERROR_CALLBACK_T

#define RSD_ERROR_CALLBACK_T   RSD_ERROR_CALLBACK_T

◆ RSD_EXEC

#define RSD_EXEC   RSD_EXEC

◆ RSD_FORMAT

#define RSD_FORMAT   RSD_FORMAT

◆ RSD_HOST

#define RSD_HOST   RSD_HOST

◆ RSD_IDENTITY

#define RSD_IDENTITY   RSD_IDENTITY

◆ RSD_LATENCY

#define RSD_LATENCY   RSD_LATENCY

◆ RSD_MULAW

#define RSD_MULAW   RSD_MULAW

◆ RSD_NO_FMT

#define RSD_NO_FMT   RSD_NO_FMT

◆ RSD_PORT

#define RSD_PORT   RSD_PORT

◆ RSD_S16_BE

#define RSD_S16_BE   RSD_S16_BE

◆ RSD_S16_LE

#define RSD_S16_LE   RSD_S16_LE

◆ RSD_S16_NE

#define RSD_S16_NE   RSD_S16_NE

◆ RSD_S32_BE

#define RSD_S32_BE   RSD_S32_BE

◆ RSD_S32_LE

#define RSD_S32_LE   RSD_S32_LE

◆ RSD_S32_NE

#define RSD_S32_NE   RSD_S32_NE

◆ RSD_S8

#define RSD_S8   RSD_S8

◆ RSD_SAMPLERATE

#define RSD_SAMPLERATE   RSD_SAMPLERATE

◆ RSD_SAMPLESIZE

#define RSD_SAMPLESIZE   RSD_SAMPLESIZE

◆ RSD_SET_CALLBACK

#define RSD_SET_CALLBACK   RSD_SET_CALLBACK

◆ RSD_SIMPLE_START

#define RSD_SIMPLE_START   RSD_SIMPLE_START

◆ RSD_U16_BE

#define RSD_U16_BE   RSD_U16_BE

◆ RSD_U16_LE

#define RSD_U16_LE   RSD_U16_LE

◆ RSD_U16_NE

#define RSD_U16_NE   RSD_U16_NE

◆ RSD_U32_BE

#define RSD_U32_BE   RSD_U32_BE

◆ RSD_U32_LE

#define RSD_U32_LE   RSD_U32_LE

◆ RSD_U32_NE

#define RSD_U32_NE   RSD_U32_NE

◆ RSD_U8

#define RSD_U8   RSD_U8

◆ RSD_USES_OPAQUE_TYPE

#define RSD_USES_OPAQUE_TYPE   RSD_USES_OPAQUE_TYPE

◆ RSD_USES_SAMPLESIZE_MEMBER

#define RSD_USES_SAMPLESIZE_MEMBER   RSD_USES_SAMPLESIZE_MEMBER

◆ RSD_VERSION

#define RSD_VERSION   "1.1"

Typedef Documentation

◆ rsd_audio_callback_t

typedef ssize_t(* rsd_audio_callback_t) (void *data, size_t bytes, void *userdata)

◆ rsd_error_callback_t

typedef void(* rsd_error_callback_t) (void *userdata)

◆ rsound_t

typedef struct rsound rsound_t

Enumeration Type Documentation

◆ rsd_format

enum rsd_format
Enumerator
RSD_NO_FMT 
RSD_S16_LE 
RSD_S16_BE 
RSD_U16_LE 
RSD_U16_BE 
RSD_U8 
RSD_S8 
RSD_S16_NE 
RSD_U16_NE 
RSD_ALAW 
RSD_MULAW 
RSD_S32_LE 
RSD_S32_BE 
RSD_S32_NE 
RSD_U32_LE 
RSD_U32_BE 
RSD_U32_NE 

◆ rsd_settings

Enumerator
RSD_SAMPLERATE 
RSD_CHANNELS 
RSD_HOST 
RSD_PORT 
RSD_BUFSIZE 
RSD_LATENCY 
RSD_FORMAT 
RSD_IDENTITY 

Function Documentation

◆ rsd_callback_lock()

void rsd_callback_lock ( rsound_t rd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_callback_unlock()

void rsd_callback_unlock ( rsound_t rd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_delay()

size_t rsd_delay ( rsound_t rd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_delay_ms()

size_t rsd_delay_ms ( rsound_t rd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_delay_wait()

void rsd_delay_wait ( rsound_t rd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_exec()

int rsd_exec ( rsound_t rd)
Here is the call graph for this function:

◆ rsd_free()

int rsd_free ( rsound_t rd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_get_avail()

size_t rsd_get_avail ( rsound_t rd)
Here is the call graph for this function:

◆ rsd_init()

int rsd_init ( rsound_t **  rd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_pause()

int rsd_pause ( rsound_t rd,
int  enable 
)
Here is the call graph for this function:

◆ rsd_pointer()

size_t rsd_pointer ( rsound_t rd)
Here is the call graph for this function:

◆ rsd_samplesize()

int rsd_samplesize ( rsound_t rd)

◆ rsd_set_callback()

void rsd_set_callback ( rsound_t rd,
rsd_audio_callback_t  callback,
rsd_error_callback_t  err_callback,
size_t  max_size,
void userdata 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_set_param()

int rsd_set_param ( rsound_t rd,
enum rsd_settings  option,
void param 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_simple_start()

int rsd_simple_start ( rsound_t **  rd,
const char *  host,
const char *  port,
const char *  ident,
int  rate,
int  channels,
enum rsd_format  format 
)
Here is the call graph for this function:

◆ rsd_start()

int rsd_start ( rsound_t rd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_stop()

int rsd_stop ( rsound_t rd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsd_write()

size_t rsd_write ( rsound_t rd,
const void buf,
size_t  size 
)
Here is the call graph for this function: