Paraslash Audio Streaming | |
About News Download Documentation Development |
Curses-based interface for paraslash. More...
#include <regex.h>
#include <signal.h>
#include <sys/types.h>
#include <curses.h>
#include <locale.h>
#include <sys/time.h>
#include <lopsub.h>
#include "gui.lsg.h"
#include "para.h"
#include "gui.h"
#include "lsu.h"
#include "string.h"
#include "ringbuffer.h"
#include "fd.h"
#include "error.h"
#include "list.h"
#include "sched.h"
#include "version.h"
Macros | |
#define | CMD_PTR (lls_cmd(0, gui_suite)) |
#define | OPT_RESULT(_name) (lls_opt_result(LSG_GUI_PARA_GUI_OPT_ ## _name, lpr)) |
#define | OPT_GIVEN(_name) (lls_opt_given(OPT_RESULT(_name))) |
#define | OPT_STRING_VAL(_name) (lls_string_val(0, OPT_RESULT(_name))) |
#define | OPT_UINT32_VAL(_name) (lls_uint32_val(0, OPT_RESULT(_name))) |
#define | FOR_EACH_KEY_MAP(_i) for (_i = 0; _i < OPT_GIVEN(KEY_MAP); _i++) |
#define | RINGBUFFER_SIZE 512 |
How many lines of output to remember. More... | |
#define | GUI_COMMANDS |
#define | GUI_COMMAND(_c, _k, _d) static void com_ ## _c(void); |
#define | GUI_COMMAND(_c, _k, _d) |
#define | COMMAND_BUF_SIZE 32768 |
Stdout/stderr of the executing process is read in chunks of this size. More... | |
#define | NUM_LINES(len) (1 + (len) / get_num_cols(&bot)) |
Number of lines of the window are occupied by an output line. More... | |
Enumerations | |
enum | exec_status { EXEC_IDLE, EXEC_DCMD, EXEC_XCMD } |
Type of the process currently being executed. More... | |
enum | gui_color_pair { COLOR_STATUSBAR = NUM_STAT_ITEMS + 1, COLOR_COMMAND, COLOR_OUTPUT, COLOR_MSG, COLOR_ERRMSG, COLOR_SEPARATOR, COLOR_TOP, COLOR_BOT } |
Codes for various colors. More... | |
Functions | |
int | main (int argc, char *argv[]) |
The main function of para_gui. More... | |
Variables | |
DEFINE_PARA_ERRLIST | |
Array of error strings. More... | |
__printf_2_3 void(* | para_log )(int, const char *,...) = curses_log |
The log function of para_gui, always set to curses_log(). More... | |
Curses-based interface for paraslash.
#define CMD_PTR (lls_cmd(0, gui_suite)) |
#define OPT_RESULT | ( | _name | ) | (lls_opt_result(LSG_GUI_PARA_GUI_OPT_ ## _name, lpr)) |
#define OPT_GIVEN | ( | _name | ) | (lls_opt_given(OPT_RESULT(_name))) |
#define OPT_STRING_VAL | ( | _name | ) | (lls_string_val(0, OPT_RESULT(_name))) |
#define OPT_UINT32_VAL | ( | _name | ) | (lls_uint32_val(0, OPT_RESULT(_name))) |
#define FOR_EACH_KEY_MAP | ( | _i | ) | for (_i = 0; _i < OPT_GIVEN(KEY_MAP); _i++) |
#define RINGBUFFER_SIZE 512 |
How many lines of output to remember.
#define GUI_COMMANDS |
#define GUI_COMMAND | ( | _c, | |
_k, | |||
_d | |||
) | static void com_ ## _c(void); |
#define GUI_COMMAND | ( | _c, | |
_k, | |||
_d | |||
) |
#define COMMAND_BUF_SIZE 32768 |
Stdout/stderr of the executing process is read in chunks of this size.
#define NUM_LINES | ( | len | ) | (1 + (len) / get_num_cols(&bot)) |
Number of lines of the window are occupied by an output line.
enum static enum exec_status exec_status | ( | void | ) |
enum gui_color_pair |
int main | ( | int | argc, |
char * | argv[] | ||
) |
The main function of para_gui.
argc | Usual argument count. |
argv | Usual argument vector. |
After initialization para_gui registers the following tasks to the paraslash scheduler: status, exec, signal, input.
The status task executes the para_audioc stat command to obtain the status of para_server and para_audiod, and displays this information in the top window of para_gui.
The exec task is responsible for printing the output of the currently running executable to the bottom window.
The signal task performs various actions according to signals received. For example, it reloads the configuration file on SIGUSR1, and it shuts down the curses system on SIGTERM to restore the terminal settings before exit.
The input task reads single key strokes from stdin. For each key pressed, it executes the command handler associated with this key.
EXIT_SUCCESS
or EXIT_FAILURE
. DEFINE_PARA_ERRLIST |
Array of error strings.
__printf_2_3 void(* para_log) (int, const char *,...) = curses_log |
The log function of para_gui, always set to curses_log().