Atmel Software Framework

buff_player.c File Reference

Bufferization player.

Copyright (c) 2009-2011 Atmel Corporation. All rights reserved.

#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "board.h"
#include "compiler.h"
#include "audio_mixer.h"
#include "buff_player.h"
#include "conf_buff_player.h"

Data Structures

struct  buff_player_pcm_buf_fifo_t
 
struct  buff_player_pcm_buf_t
 

Macros

#define BUFF_PLAYER_MAX_BUF_CNT   64
 

Functions

void buff_player_close (void)
 
bool buff_player_create (uint8_t nb_buffers, size_t buffer_size)
 
void buff_player_dacs_end_of_pcm_buf (void)
 
void buff_player_dacs_flush (bool force)
 
bool buff_player_dacs_output (void *sample_buffer, size_t sample_length)
 
void buff_player_dacs_setup (uint32_t sample_rate_hz, uint8_t num_channels, uint8_t bits_per_sample, bool swap_channels)
 
static buff_player_pcm_buf_tbuff_player_get_first_pcm_buf (void)
 
static unsigned int buff_player_get_first_pcm_buf_idx (void)
 
static buff_player_pcm_buf_tbuff_player_get_last_pcm_buf (void)
 
static unsigned int buff_player_get_last_pcm_buf_idx (void)
 
static size_t buff_player_get_pcm_buf_fifo_size (void)
 
static buff_player_pcm_buf_tbuff_player_get_reload_pcm_buf (void)
 
static unsigned int buff_player_get_reload_pcm_buf_idx (void)
 
static buff_player_pcm_buf_tbuff_player_get_wr_pcm_buf (void)
 
static unsigned int buff_player_get_wr_pcm_buf_idx (void)
 
static bool buff_player_is_pcm_buf_fifo_empty (void)
 
static bool buff_player_is_pcm_buf_fifo_full (void)
 
static bool buff_player_is_pcm_buf_fifo_reloadable (void)
 
void * buff_player_malloc (size_t buffer_size)
 
void buff_player_mute_audio (bool mute)
 
static bool buff_player_peek_reload_pcm_buf (buff_player_pcm_buf_t *pcm_buf)
 
static bool buff_player_put_pcm_buf (void *sample_buffer, size_t sample_length)
 
static bool buff_player_remove_used_pcm_buf (void)
 

Variables

static buff_player_pcm_buf_fifo_tbuff_player_pcm_buf_fifo = NULL
 

void buff_player_close ( void  )

References NULL.

bool buff_player_create ( uint8_t  nb_buffers,
size_t  buffer_size 
)
void buff_player_dacs_flush ( bool  force)
bool buff_player_dacs_output ( void *  sample_buffer,
size_t  sample_length 
)
void buff_player_dacs_setup ( uint32_t  sample_rate_hz,
uint8_t  num_channels,
uint8_t  bits_per_sample,
bool  swap_channels 
)
static buff_player_pcm_buf_t* buff_player_get_first_pcm_buf ( void  )
static
static unsigned int buff_player_get_first_pcm_buf_idx ( void  )
static
static buff_player_pcm_buf_t* buff_player_get_last_pcm_buf ( void  )
static
static unsigned int buff_player_get_last_pcm_buf_idx ( void  )
static
static buff_player_pcm_buf_t* buff_player_get_reload_pcm_buf ( void  )
static
static unsigned int buff_player_get_reload_pcm_buf_idx ( void  )
static
static buff_player_pcm_buf_t* buff_player_get_wr_pcm_buf ( void  )
static
static unsigned int buff_player_get_wr_pcm_buf_idx ( void  )
static
static bool buff_player_is_pcm_buf_fifo_empty ( void  )
static
static bool buff_player_is_pcm_buf_fifo_full ( void  )
static
static bool buff_player_is_pcm_buf_fifo_reloadable ( void  )
static
void buff_player_mute_audio ( bool  mute)