paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Macros | Typedefs | Functions | Variables
mixer.c File Reference

A volume fader and alarm clock. More...

#include <regex.h>
#include <lopsub.h>
#include <math.h>
#include "mixer.lsg.h"
#include "para.h"
#include "lsu.h"
#include "fd.h"
#include "string.h"
#include "mix.h"
#include "error.h"
#include "version.h"

Macros

#define NUM_SUPPORTED_MIXERS   (ARRAY_SIZE(mixers))
 
#define FOR_EACH_MIXER(i)   for ((i) = 0; (i) < NUM_SUPPORTED_MIXERS; (i)++)
 
#define CMD_PTR(_cmd)   (lls_cmd(LSG_MIXER_CMD_ ## _cmd, mixer_suite))
 
#define OPT_RESULT(_cmd, _opt)
 
#define OPT_GIVEN(_cmd, _opt)   (lls_opt_given(OPT_RESULT(_cmd, _opt)))
 
#define OPT_STRING_VAL(_cmd, _opt)   (lls_string_val(0, OPT_RESULT(_cmd, _opt)))
 
#define OPT_UINT32_VAL(_cmd, _opt)   (lls_uint32_val(0, OPT_RESULT(_cmd, _opt)))
 
#define EXPORT_CMD(_cmd)
 

Typedefs

typedef int(* mixer_subcommand_handler_t) (const struct mixer *)
 

Functions

int main (int argc, char *argv[])
 The main function of para_mixer. More...
 

Variables

 DEFINE_PARA_ERRLIST
 Array of error strings. More...
 
__printf_2_3 void(* para_log )(int, const char *,...) = date_log
 The log function of para_gui, always set to curses_log(). More...
 
const mixer_subcommand_handler_t lsg_mixer_com_fade_user_data = &com_fade
 
const mixer_subcommand_handler_t lsg_mixer_com_sleep_user_data = &com_sleep
 
const mixer_subcommand_handler_t lsg_mixer_com_snooze_user_data = &com_snooze
 
const mixer_subcommand_handler_t lsg_mixer_com_set_user_data = &com_set
 
const mixer_subcommand_handler_t lsg_mixer_com_help_user_data = &com_help
 

Detailed Description

A volume fader and alarm clock.

Macro Definition Documentation

◆ NUM_SUPPORTED_MIXERS

#define NUM_SUPPORTED_MIXERS   (ARRAY_SIZE(mixers))

◆ FOR_EACH_MIXER

#define FOR_EACH_MIXER (   i)    for ((i) = 0; (i) < NUM_SUPPORTED_MIXERS; (i)++)

◆ CMD_PTR

#define CMD_PTR (   _cmd)    (lls_cmd(LSG_MIXER_CMD_ ## _cmd, mixer_suite))

◆ OPT_RESULT

#define OPT_RESULT (   _cmd,
  _opt 
)
Value:
(lls_opt_result( \
LSG_MIXER_ ## _cmd ## _OPT_ ## _opt, (LSG_MIXER_CMD_ ## _cmd == 0)? lpr : sub_lpr))

◆ OPT_GIVEN

#define OPT_GIVEN (   _cmd,
  _opt 
)    (lls_opt_given(OPT_RESULT(_cmd, _opt)))

◆ OPT_STRING_VAL

#define OPT_STRING_VAL (   _cmd,
  _opt 
)    (lls_string_val(0, OPT_RESULT(_cmd, _opt)))

◆ OPT_UINT32_VAL

#define OPT_UINT32_VAL (   _cmd,
  _opt 
)    (lls_uint32_val(0, OPT_RESULT(_cmd, _opt)))

◆ EXPORT_CMD

#define EXPORT_CMD (   _cmd)
Value:
const mixer_subcommand_handler_t \
lsg_mixer_com_ ## _cmd ## _user_data = &com_ ## _cmd;

Typedef Documentation

◆ mixer_subcommand_handler_t

typedef int(* mixer_subcommand_handler_t) (const struct mixer *)

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

The main function of para_mixer.

The executable is linked with the alsa or the oss mixer API, or both. It has a custom log function which prefixes log messages with the current date.

Parameters
argcArgument counter.
argvArgument vector.
Returns
EXIT_SUCCESS or EXIT_FAILURE.

References CMD_PTR, and lls().

Variable Documentation

◆ DEFINE_PARA_ERRLIST

DEFINE_PARA_ERRLIST

Array of error strings.

◆ para_log

__printf_2_3 void(* para_log) (int, const char *,...) = date_log

The log function of para_gui, always set to curses_log().

◆ lsg_mixer_com_fade_user_data

const mixer_subcommand_handler_t lsg_mixer_com_fade_user_data = &com_fade

◆ lsg_mixer_com_sleep_user_data

const mixer_subcommand_handler_t lsg_mixer_com_sleep_user_data = &com_sleep

◆ lsg_mixer_com_snooze_user_data

const mixer_subcommand_handler_t lsg_mixer_com_snooze_user_data = &com_snooze

◆ lsg_mixer_com_set_user_data

const mixer_subcommand_handler_t lsg_mixer_com_set_user_data = &com_set

◆ lsg_mixer_com_help_user_data

const mixer_subcommand_handler_t lsg_mixer_com_help_user_data = &com_help