Atrinik Client  4.0
Macros | Enumerations | Functions | Variables
mplayer.c File Reference
#include <global.h>
#include <toolkit/path.h>

Go to the source code of this file.

Macros

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

Enumerations

enum  {
  BUTTON_PLAY, BUTTON_SHUFFLE, BUTTON_BLACKLIST, BUTTON_CLOSE,
  BUTTON_HELP, BUTTON_NUM
}
 

Functions

static void list_handle_enter (list_struct *list, SDL_Event *event)
 
static void list_text_color_hook (list_struct *list, uint32_t row, uint32_t col, const char **color, const char **color_shadow)
 
static void mplayer_do_shuffle (list_struct *list)
 
static void mplayer_check_shuffle (void)
 
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_t state)
 
static void mplayer_blacklist_save (list_struct *list)
 
static void mplayer_list_init (list_struct *list, const char *path, uint8_t duplicates)
 
static void widget_draw (widgetdata *widget)
 
static void widget_background (widgetdata *widget, int draw)
 
static int widget_event (widgetdata *widget, SDL_Event *event)
 
static void widget_deinit (widgetdata *widget)
 
void widget_mplayer_init (widgetdata *widget)
 

Variables

static uint8_t shuffle = 0
 
static uint8_t * shuffle_blacklist = NULL
 
static button_struct buttons [BUTTON_NUM]
 
static scrollbar_struct scrollbar_progress
 
static scrollbar_info_struct scrollbar_progress_info
 
static list_structlist_mplayer = NULL
 

Detailed Description

Implements mplayer type widgets.

Author
Alex Tokar

Definition in file mplayer.c.

Macro Definition 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 43 of file mplayer.c.

#define FILE_MPLAYER_BLACKLIST   "mplayer.blacklist"

File where the blacklist data is stored.

Definition at line 38 of file mplayer.c.

Function Documentation

static void list_handle_enter ( list_struct list,
SDL_Event *  event 
)
static

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

Parameters
listThe music list.

Definition at line 85 of file mplayer.c.

static void list_text_color_hook ( list_struct list,
uint32_t  row,
uint32_t  col,
const char **  color,
const char **  color_shadow 
)
static

Hook to use for setting text color based on row/column.

Parameters
listList.
rowText row.
colColumn.
[out]colorWhat color to use.
[out]color_shadowWhat color to use for the text's shadow, NULL to disable shadow.

Definition at line 93 of file mplayer.c.

static void mplayer_blacklist_mass_toggle ( list_struct list,
uint8_t  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 206 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 229 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 177 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 163 of file mplayer.c.

static void mplayer_check_shuffle ( void  )
static

Check whether we need to start another song.

Definition at line 148 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 106 of file mplayer.c.

static void mplayer_list_init ( list_struct list,
const char *  path,
uint8_t  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 261 of file mplayer.c.

static void widget_background ( widgetdata widget,
int  draw 
)
static

Definition at line 442 of file mplayer.c.

static void widget_deinit ( widgetdata widget)
static

Definition at line 575 of file mplayer.c.

static void widget_draw ( widgetdata widget)
static

Definition at line 310 of file mplayer.c.

static int widget_event ( widgetdata widget,
SDL_Event *  event 
)
static

Definition at line 505 of file mplayer.c.

void widget_mplayer_init ( widgetdata widget)

Initialize one mplayer widget.

Definition at line 595 of file mplayer.c.

Variable Documentation

button_struct buttons[BUTTON_NUM]
static

Button buffer.

Definition at line 66 of file mplayer.c.

list_struct* list_mplayer = NULL
static

The music player list.

Definition at line 78 of file mplayer.c.

scrollbar_struct scrollbar_progress
static

Scrollbar buffer.

Definition at line 70 of file mplayer.c.

scrollbar_info_struct scrollbar_progress_info
static

Scrollbar info buffer.

Definition at line 74 of file mplayer.c.

uint8_t shuffle = 0
static

Is shuffle enabled?

Definition at line 58 of file mplayer.c.

uint8_t* shuffle_blacklist = NULL
static

Blacklisted music files.

Definition at line 62 of file mplayer.c.