Paraslash Audio Streaming | |
About News Download Documentation Development |
Paraslash's standalone player. More...
#include <regex.h>
#include <signal.h>
#include <lopsub.h>
#include "recv_cmd.lsg.h"
#include "filter_cmd.lsg.h"
#include "play_cmd.lsg.h"
#include "write_cmd.lsg.h"
#include "play.lsg.h"
#include "para.h"
#include "lsu.h"
#include "list.h"
#include "error.h"
#include "buffer_tree.h"
#include "version.h"
#include "string.h"
#include "sched.h"
#include "filter.h"
#include "afh.h"
#include "recv.h"
#include "write.h"
#include "fd.h"
#include "interactive.h"
Macros | |
#define | CMD_PTR (lls_cmd(0, play_suite)) |
#define | OPT_RESULT(_name) (lls_opt_result(LSG_PLAY_PARA_PLAY_OPT_ ## _name, play_lpr)) |
#define | OPT_GIVEN(_name) (lls_opt_given(OPT_RESULT(_name))) |
#define | OPT_UINT32_VAL(_name) (lls_uint32_val(0, OPT_RESULT(_name))) |
#define | OPT_STRING_VAL(_name) (lls_string_val(0, OPT_RESULT(_name))) |
#define | AFH_RECV_CMD (lls_cmd(LSG_RECV_CMD_CMD_AFH, recv_cmd_suite)) |
#define | AFH_RECV ((struct receiver *)lls_user_data(AFH_RECV_CMD)) |
#define | INTERNAL_KEYMAP_ENTRIES |
#define | KEYMAP_ENTRY(a, b) a |
#define | KEYMAP_ENTRY(a, b) b |
#define | NUM_INTERNALLY_MAPPED_KEYS ARRAY_SIZE(default_commands) |
#define | NUM_MAPPED_KEYS (NUM_INTERNALLY_MAPPED_KEYS + OPT_GIVEN(KEY_MAP)) |
#define | FOR_EACH_MAPPED_KEY(i) for (i = 0; i < NUM_MAPPED_KEYS; i++) |
#define | LSG_PLAY_CMD_CMD(_name) |
#define | EXPORT_PLAY_CMD_HANDLER(_cmd) |
Typedefs | |
typedef int(* | play_cmd_handler_t) (struct lls_parse_result *lpr) |
Enumerations | |
enum | state_change_request_type { CRT_NONE, CRT_REPOS, CRT_FILE_CHANGE, CRT_TERM_RQ } |
Describes a request to change the state of para_play. More... | |
Functions | |
int | main (int argc, char *argv[]) |
The main function of para_play. More... | |
Variables | |
DEFINE_PARA_ERRLIST | |
Array of error strings. More... | |
__printf_2_3 void(* | para_log )(int, const char *,...) = stderr_log |
The log function of para_gui, always set to curses_log(). More... | |
char * | stat_item_values [NUM_STAT_ITEMS] = {NULL} |
The array of status items sent by para_server. More... | |
const struct play_command_info | lsg_play_cmd_com_quit_user_data = { .handler = com_quit } |
const struct play_command_info | lsg_play_cmd_com_help_user_data = { .handler = com_help } |
const struct play_command_info | lsg_play_cmd_com_info_user_data = { .handler = com_info } |
const struct play_command_info | lsg_play_cmd_com_tasks_user_data = { .handler = com_tasks } |
const struct play_command_info | lsg_play_cmd_com_ls_user_data = { .handler = com_ls } |
const struct play_command_info | lsg_play_cmd_com_play_user_data = { .handler = com_play } |
const struct play_command_info | lsg_play_cmd_com_pause_user_data = { .handler = com_pause } |
const struct play_command_info | lsg_play_cmd_com_prev_user_data = { .handler = com_prev } |
const struct play_command_info | lsg_play_cmd_com_next_user_data = { .handler = com_next } |
const struct play_command_info | lsg_play_cmd_com_fg_user_data = { .handler = com_fg } |
const struct play_command_info | lsg_play_cmd_com_bg_user_data = { .handler = com_bg } |
const struct play_command_info | lsg_play_cmd_com_jmp_user_data = { .handler = com_jmp } |
const struct play_command_info | lsg_play_cmd_com_ff_user_data = { .handler = com_ff } |
Paraslash's standalone player.
#define CMD_PTR (lls_cmd(0, play_suite)) |
#define OPT_RESULT | ( | _name | ) | (lls_opt_result(LSG_PLAY_PARA_PLAY_OPT_ ## _name, play_lpr)) |
#define OPT_GIVEN | ( | _name | ) | (lls_opt_given(OPT_RESULT(_name))) |
#define OPT_UINT32_VAL | ( | _name | ) | (lls_uint32_val(0, OPT_RESULT(_name))) |
#define OPT_STRING_VAL | ( | _name | ) | (lls_string_val(0, OPT_RESULT(_name))) |
#define AFH_RECV_CMD (lls_cmd(LSG_RECV_CMD_CMD_AFH, recv_cmd_suite)) |
#define AFH_RECV ((struct receiver *)lls_user_data(AFH_RECV_CMD)) |
#define INTERNAL_KEYMAP_ENTRIES |
#define KEYMAP_ENTRY | ( | a, | |
b | |||
) | a |
#define KEYMAP_ENTRY | ( | a, | |
b | |||
) | b |
#define NUM_INTERNALLY_MAPPED_KEYS ARRAY_SIZE(default_commands) |
#define NUM_MAPPED_KEYS (NUM_INTERNALLY_MAPPED_KEYS + OPT_GIVEN(KEY_MAP)) |
#define FOR_EACH_MAPPED_KEY | ( | i | ) | for (i = 0; i < NUM_MAPPED_KEYS; i++) |
#define LSG_PLAY_CMD_CMD | ( | _name | ) |
#define EXPORT_PLAY_CMD_HANDLER | ( | _cmd | ) |
typedef int(* play_cmd_handler_t) (struct lls_parse_result *lpr) |
Describes a request to change the state of para_play.
There is only one variable of this type: rq of the global play task structure. Command handlers only set this variable and the post_monitor() function of the play task investigates its value during each iteration of the scheduler run and performs the actual work.
int main | ( | int | argc, |
char * | argv[] | ||
) |
The main function of para_play.
argc | See man page. |
argv | See man page. |
para_play distributes its work by submitting various tasks to the paraslash scheduler. The receiver, filter and writer tasks, which are used to play an audio file, require one task each to maintain their underlying buffer tree node. These tasks only exist when an audio file is playing.
The i9 task, which is submitted and maintained by the i9e subsystem, reads an input line and calls the corresponding command handler such as com_stop() which is implemented in this file. The command handlers typically write a request to the global play_task structure, whose contents are read and acted upon by another task, the play task.
As a rule, playlist handling is performed exclusively in play context, i.e. in the post-monitor step of the play task, while command handlers are only called in i9e context.
References sched::default_timeout.
DEFINE_PARA_ERRLIST |
Array of error strings.
__printf_2_3 void(* para_log) (int, const char *,...) = stderr_log |
The log function of para_gui, always set to curses_log().
char* stat_item_values[NUM_STAT_ITEMS] = {NULL} |
The array of status items sent by para_server.
The array of status items sent by para_server.
This is used by the amp filter which first tries to obtain the amplification value from an element in this array.
Referenced by audiod_status_dump(), clear_and_dump_items(), and stat_client_write_item().
const struct play_command_info lsg_play_cmd_com_quit_user_data = { .handler = com_quit } |
const struct play_command_info lsg_play_cmd_com_help_user_data = { .handler = com_help } |
const struct play_command_info lsg_play_cmd_com_info_user_data = { .handler = com_info } |
const struct play_command_info lsg_play_cmd_com_tasks_user_data = { .handler = com_tasks } |
const struct play_command_info lsg_play_cmd_com_ls_user_data = { .handler = com_ls } |
const struct play_command_info lsg_play_cmd_com_play_user_data = { .handler = com_play } |
const struct play_command_info lsg_play_cmd_com_pause_user_data = { .handler = com_pause } |
const struct play_command_info lsg_play_cmd_com_prev_user_data = { .handler = com_prev } |
const struct play_command_info lsg_play_cmd_com_next_user_data = { .handler = com_next } |
const struct play_command_info lsg_play_cmd_com_fg_user_data = { .handler = com_fg } |
const struct play_command_info lsg_play_cmd_com_bg_user_data = { .handler = com_bg } |
const struct play_command_info lsg_play_cmd_com_jmp_user_data = { .handler = com_jmp } |
const struct play_command_info lsg_play_cmd_com_ff_user_data = { .handler = com_ff } |