esp32-audio-player 0.1.0
Audio player engine for ESP32
Loading...
Searching...
No Matches
events.h File Reference

Events from the player to the application. More...

Include dependency graph for events.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  core_event_t
 

Typedefs

typedef void(* core_event_sink_t) (const core_event_t *ev, void *user)
 

Enumerations

enum  core_event_type_t {
  EV_NONE = 0 , EV_PLAYER_STATE , EV_TRACK_CHANGED , EV_POSITION ,
  EV_VOLUME , EV_QUEUE_CHANGED , EV_PLAYBACK_ERROR , EV_SLEEP_TIMER
}
 

Functions

void core_events_set_sink (core_event_sink_t sink, void *user)
 
void core_event_post (const core_event_t *ev)
 
void core_event_post_simple (core_event_type_t type, int32_t a, int32_t b)
 
void core_event_post_text (core_event_type_t type, int32_t a, const char *text)
 

Detailed Description

Events from the player to the application.

The player calls the sink installed with core_events_set_sink() from the thread that runs player_run_once() (or from the thread that issued a command). Keep the sink short: copy the event into a queue, set a flag, or log it.

Typedef Documentation

◆ core_event_sink_t

typedef void(* core_event_sink_t) (const core_event_t *ev, void *user)

Enumeration Type Documentation

◆ core_event_type_t

Enumerator
EV_NONE 
EV_PLAYER_STATE 

player

a = player_state_t

EV_TRACK_CHANGED 

a = queue index

EV_POSITION 

a = position ms (about 4 times per second)

EV_VOLUME 

f = volume dB

EV_QUEUE_CHANGED 
EV_PLAYBACK_ERROR 

a = core_err_t, text = file name

EV_SLEEP_TIMER 

a = seconds left (0 = fired and paused, -1 = cancelled)

Function Documentation

◆ core_event_post()

void core_event_post ( const core_event_t *  ev)

◆ core_event_post_simple()

void core_event_post_simple ( core_event_type_t  type,
int32_t  a,
int32_t  b 
)

◆ core_event_post_text()

void core_event_post_text ( core_event_type_t  type,
int32_t  a,
const char *  text 
)

◆ core_events_set_sink()

void core_events_set_sink ( core_event_sink_t  sink,
void *  user 
)