Audacious  $Id:Doxyfile42802007-03-2104:39:00Znenolod$
Functions | Variables
playback.c File Reference
#include <glib.h>
#include <pthread.h>
#include <string.h>
#include <libaudcore/audstrings.h>
#include <libaudcore/hook.h>
#include "drct.h"
#include "i18n.h"
#include "interface.h"
#include "misc.h"
#include "output.h"
#include "playback.h"
#include "playlist.h"
#include "plugin.h"

Go to the source code of this file.

Functions

static void read_gain_from_tuple (const Tuple *tuple)
 
static bool_t update_from_playlist (void)
 
bool_t drct_get_ready (void)
 
static void set_pb_ready (InputPlayback *p)
 
static void wait_until_ready (void)
 
static void update_cb (void *hook_data, void *user_data)
 
int drct_get_time (void)
 
void drct_pause (void)
 
static void playback_finish (void)
 
static void playback_cleanup (void)
 
void playback_stop (void)
 
static bool_t end_cb (void *unused)
 
static void * playback_thread (void *unused)
 
void playback_play (int seek_time, bool_t pause)
 
bool_t drct_get_playing (void)
 
bool_t drct_get_paused (void)
 
void drct_seek (int time)
 
static void set_data (InputPlayback *p, void *data)
 
static void * get_data (InputPlayback *p)
 
static void set_params (InputPlayback *p, int bitrate, int samplerate, int channels)
 
static void set_tuple (InputPlayback *p, Tuple *tuple)
 
static void set_gain_from_playlist (InputPlayback *p)
 
char * drct_get_filename (void)
 
char * drct_get_title (void)
 
int drct_get_length (void)
 
void drct_get_info (int *bitrate, int *samplerate, int *channels)
 
void drct_get_volume (int *l, int *r)
 
void drct_set_volume (int l, int r)
 
void drct_set_ab_repeat (int a, int b)
 
void drct_get_ab_repeat (int *a, int *b)
 

Variables

static struct OutputAPI output_api
 
static InputPlayback playback_api
 
static pthread_t playback_thread_handle
 
static int end_source = 0
 
static pthread_mutex_t ready_mutex = PTHREAD_MUTEX_INITIALIZER
 
static pthread_cond_t ready_cond = PTHREAD_COND_INITIALIZER
 
static bool_t playing = FALSE
 
static bool_t restart_flag = FALSE
 
static int time_offset = 0
 
static int initial_seek = 0
 
static bool_t paused = FALSE
 
static bool_t ready_flag = FALSE
 
static bool_t playback_error = FALSE
 
static void * current_data = NULL
 
static int current_bitrate = -1
 
static int current_samplerate = -1
 
static int current_channels = -1
 
static int current_entry = -1
 
static char * current_filename = NULL
 
static char * current_title = NULL
 
static int current_length = -1
 
static InputPlugin * current_decoder = NULL
 
static VFSFilecurrent_file = NULL
 
static ReplayGainInfo gain_from_playlist
 
static int repeat_a = -1
 
static int repeat_b = -1
 
static bool_t stopped = TRUE
 
static int failed_entries = 0
 

Function Documentation

void drct_get_ab_repeat ( int a,
int b 
)

Definition at line 639 of file playback.c.

Referenced by drct_play().

char* drct_get_filename ( void  )

Definition at line 533 of file playback.c.

void drct_get_info ( int bitrate,
int samplerate,
int channels 
)

Definition at line 578 of file playback.c.

Referenced by audacious_rc_get_info(), and audacious_rc_info().

int drct_get_length ( void  )

Definition at line 570 of file playback.c.

bool_t drct_get_paused ( void  )
bool_t drct_get_playing ( void  )
bool_t drct_get_ready ( void  )

Definition at line 128 of file playback.c.

Referenced by drct_get_volume(), drct_set_volume(), set_params(), and update_cb().

int drct_get_time ( void  )
char* drct_get_title ( void  )

Definition at line 541 of file playback.c.

void drct_get_volume ( int l,
int r 
)
void drct_pause ( void  )
void drct_seek ( int  time)

Definition at line 464 of file playback.c.

Referenced by audacious_rc_seek(), drct_play(), and mpris_player_position_set().

void drct_set_ab_repeat ( int  a,
int  b 
)

Definition at line 609 of file playback.c.

void drct_set_volume ( int  l,
int  r 
)
static bool_t end_cb ( void *  unused)
static

Definition at line 301 of file playback.c.

Referenced by playback_thread().

static void* get_data ( InputPlayback *  p)
static

Definition at line 491 of file playback.c.

static void playback_cleanup ( void  )
static

Definition at line 251 of file playback.c.

Referenced by playback_play(), and playback_stop().

static void playback_finish ( void  )
static

Definition at line 220 of file playback.c.

Referenced by drct_set_ab_repeat(), playback_cleanup(), and playback_play().

void playback_play ( int  seek_time,
bool_t  pause 
)

Definition at line 417 of file playback.c.

Referenced by change_playback(), drct_set_ab_repeat(), end_cb(), and playlist_set_playing().

void playback_stop ( void  )

Definition at line 284 of file playback.c.

Referenced by playlist_delete(), and playlist_set_playing().

static void* playback_thread ( void *  unused)
static

Definition at line 352 of file playback.c.

Referenced by playback_play().

static void read_gain_from_tuple ( const Tuple *  tuple)
static

Definition at line 81 of file playback.c.

Referenced by playback_cleanup(), playback_thread(), and set_tuple().

static void set_data ( InputPlayback *  p,
void *  data 
)
static

Definition at line 485 of file playback.c.

static void set_gain_from_playlist ( InputPlayback *  p)
static

Definition at line 517 of file playback.c.

static void set_params ( InputPlayback *  p,
int  bitrate,
int  samplerate,
int  channels 
)
static

Definition at line 497 of file playback.c.

static void set_pb_ready ( InputPlayback *  p)
static

Definition at line 142 of file playback.c.

Referenced by playback_thread().

static void set_tuple ( InputPlayback *  p,
Tuple *  tuple 
)
static

Definition at line 510 of file playback.c.

static void update_cb ( void *  hook_data,
void *  user_data 
)
static

Definition at line 172 of file playback.c.

Referenced by playback_finish(), and playback_play().

static bool_t update_from_playlist ( void  )
static

Definition at line 108 of file playback.c.

Referenced by set_pb_ready(), and update_cb().

static void wait_until_ready ( void  )
static

Variable Documentation

int current_bitrate = -1
static

Definition at line 62 of file playback.c.

Referenced by drct_get_info(), playback_finish(), and set_params().

int current_channels = -1
static

Definition at line 62 of file playback.c.

Referenced by drct_get_info(), playback_finish(), and set_params().

void* current_data = NULL
static

Definition at line 61 of file playback.c.

Referenced by get_data(), playback_finish(), and set_data().

InputPlugin* current_decoder = NULL
static
int current_entry = -1
static

Definition at line 65 of file playback.c.

Referenced by drct_get_title(), playback_cleanup(), and update_from_playlist().

VFSFile* current_file = NULL
static

Definition at line 71 of file playback.c.

char* current_filename = NULL
static
int current_length = -1
static
int current_samplerate = -1
static

Definition at line 62 of file playback.c.

Referenced by drct_get_info(), playback_finish(), and set_params().

char* current_title = NULL
static

Definition at line 67 of file playback.c.

Referenced by drct_get_title(), playback_cleanup(), and update_from_playlist().

int end_source = 0
static

Definition at line 48 of file playback.c.

Referenced by playback_finish(), and playback_thread().

int failed_entries = 0
static

Definition at line 78 of file playback.c.

Referenced by end_cb(), and playback_stop().

ReplayGainInfo gain_from_playlist
static

Definition at line 72 of file playback.c.

int initial_seek = 0
static

Definition at line 56 of file playback.c.

Referenced by playback_finish(), playback_play(), and playback_thread().

struct OutputAPI output_api
static
Initial value:
= {
.open_audio = output_open_audio,
.set_replaygain_info = output_set_replaygain_info,
.write_audio = output_write_audio,
.abort_write = output_abort_write,
.pause = output_pause,
.written_time = output_written_time,
.flush = output_set_time}

Definition at line 36 of file playback.c.

bool_t paused = FALSE
static
static InputPlayback playback_api
static
Initial value:
= {
.output = & output_api,
.set_data = set_data,
.get_data = get_data,
.set_pb_ready = set_pb_ready,
.set_params = set_params,
.set_tuple = set_tuple,
.set_gain_from_playlist = set_gain_from_playlist,
}

Definition at line 45 of file playback.c.

Referenced by drct_get_time(), drct_pause(), drct_seek(), playback_finish(), and playback_thread().

bool_t playback_error = FALSE
static

Definition at line 59 of file playback.c.

Referenced by end_cb(), playback_finish(), and playback_thread().

pthread_t playback_thread_handle
static

Definition at line 47 of file playback.c.

Referenced by playback_finish(), and playback_play().

bool_t playing = FALSE
static
pthread_cond_t ready_cond = PTHREAD_COND_INITIALIZER
static

Definition at line 51 of file playback.c.

Referenced by set_pb_ready(), and wait_until_ready().

bool_t ready_flag = FALSE
static
pthread_mutex_t ready_mutex = PTHREAD_MUTEX_INITIALIZER
static

Definition at line 50 of file playback.c.

Referenced by drct_get_ready(), set_pb_ready(), and wait_until_ready().

int repeat_a = -1
static

Definition at line 74 of file playback.c.

Referenced by drct_get_ab_repeat(), drct_set_ab_repeat(), end_cb(), and playback_cleanup().

int repeat_b = -1
static
bool_t restart_flag = FALSE
static

Definition at line 55 of file playback.c.

Referenced by drct_get_ready(), playback_finish(), playback_play(), and set_pb_ready().

bool_t stopped = TRUE
static

Definition at line 77 of file playback.c.

Referenced by playback_play(), and playback_stop().

int time_offset = 0
static

Definition at line 56 of file playback.c.

Referenced by drct_get_time(), drct_seek(), playback_finish(), and playback_thread().