Atrinik Client 2.5
Defines | Functions | Variables
gui/mplayer.c File Reference
#include <global.h>

Go to the source code of this file.

Defines

#define FILE_MPLAYER_BLACKLIST   "mplayer.blacklist"
#define BLACKLIST_ALL_DELAY   1500

Functions

static void list_handle_enter (list_struct *list)
static const char * list_text_color_hook (list_struct *list, const char *default_color, uint32 row, uint32 col)
static void mplayer_do_shuffle (list_struct *list)
static void mplayer_check_shuffle ()
static int mplayer_blacklisted (list_struct *list)
static void mplayer_blacklist_toggle (list_struct *list)
static void mplayer_blacklist_mass_toggle (list_struct *list, uint8 state)
static void mplayer_blacklist_save (list_struct *list)
static void mplayer_list_init (list_struct *list, const char *path, uint8 duplicates)
void widget_show_mplayer (widgetdata *widget)
void widget_mplayer_background (widgetdata *widget)
void widget_mplayer_deinit (widgetdata *widget)
void widget_mplayer_mevent (widgetdata *widget, SDL_Event *event)
void mplayer_now_playing ()

Variables

static uint8 shuffle = 0
static uint8shuffle_blacklist = NULL
static button_struct button_play
static button_struct button_shuffle
static button_struct button_blacklist
static button_struct button_close
static button_struct button_help

Detailed Description

Handles music player widget code.

Definition in file mplayer.c.


Define Documentation

#define BLACKLIST_ALL_DELAY   1500

How many milliseconds the blacklist button must be held in order to mass-change blacklist status.

Definition at line 37 of file mplayer.c.

#define FILE_MPLAYER_BLACKLIST   "mplayer.blacklist"

File where the blacklist data is stored.

Definition at line 33 of file mplayer.c.


Function Documentation

static void list_handle_enter ( list_struct list) [static]

Handle music list double-click and "Play" button.

Parameters:
listThe music list.

Definition at line 49 of file mplayer.c.

static const char* list_text_color_hook ( list_struct list,
const char *  default_color,
uint32  row,
uint32  col 
) [static]

Handle list::text_color_hook in the music player list.

Definition at line 58 of file mplayer.c.

static void mplayer_blacklist_mass_toggle ( list_struct list,
uint8  state 
) [static]

Change blacklist status of all the music files at once.

Parameters:
listThe music list.
state1 to blacklist all, 0 to clear blacklist status.

Definition at line 176 of file mplayer.c.

static void mplayer_blacklist_save ( list_struct list) [static]

Save the blacklist data to file.

Parameters:
listThe music list.

Definition at line 200 of file mplayer.c.

static void mplayer_blacklist_toggle ( list_struct list) [static]

Toggle blacklist status on the selected row.

Parameters:
listThe music list.

Definition at line 146 of file mplayer.c.

static int mplayer_blacklisted ( list_struct list) [static]

Check whether the currently selected row in the music list is blacklisted.

Parameters:
listThe music list.
Returns:
1 if the selected row is blacklisted, 0 otherwise.

Definition at line 133 of file mplayer.c.

static void mplayer_check_shuffle ( ) [static]

Check whether we need to start another song.

Definition at line 120 of file mplayer.c.

static void mplayer_do_shuffle ( list_struct list) [static]

Perform a shuffle of the selected row in the music list and start playing the shuffled music.

Parameters:
listThe music list.

Definition at line 75 of file mplayer.c.

static void mplayer_list_init ( list_struct list,
const char *  path,
uint8  duplicates 
) [static]

Initialize music player list by reading the directory 'path'.

Parameters:
listThe music player list.
pathThe directory to read.
duplicatesWhether to check for and ignore duplicates in the directory (entries already in the list).

Definition at line 224 of file mplayer.c.

void mplayer_now_playing ( )

Announce currently playing music to nearby players using /me.

Definition at line 534 of file mplayer.c.

void widget_mplayer_background ( widgetdata widget)

Process background tasks of the music player widget.

Parameters:
widgetThe music player widget.

Definition at line 449 of file mplayer.c.

void widget_mplayer_deinit ( widgetdata widget)

Deinitialize the music player widget.

Parameters:
widgetThe music player widget.

Definition at line 464 of file mplayer.c.

void widget_mplayer_mevent ( widgetdata widget,
SDL_Event *  event 
)

Handle mouse events for the music player widget.

Parameters:
widgetThe widget.
eventThe event.

Definition at line 476 of file mplayer.c.

void widget_show_mplayer ( widgetdata widget)

Render the music player widget.

Parameters:
widgetThe widget.

Definition at line 275 of file mplayer.c.


Variable Documentation

Button buffer.

Definition at line 44 of file mplayer.c.

uint8 shuffle = 0 [static]

Is shuffle enabled?

Definition at line 40 of file mplayer.c.

uint8* shuffle_blacklist = NULL [static]

Blacklisted music files.

Definition at line 42 of file mplayer.c.