Convert para_fade to subcommands, rename it to para_mixer. para_fade operates in one of several modes, but the command line options are shared. So most of the options are ignored for any particular mode. With lopsub we can do better and define one subcommand per mode so that options which are only relevant to one subcommand can be made local to that subcommand. With subcommands the syntax of the command changes, which breaks existing scripts. So it seems to be prudent to rename the executable from para_fade to para_mixer. The old name was a bit misleading anyway since the command can do much more than just fade the volume.
Convert para_fade to lopsub. This replaces the ggo file for the command line and config file parser of para_fade by a lopsub suite file and links para_fade against the lopsub library. As there are no subcommands, the conversion is straight forward and the bulk of the patch are simple changes which replace access to the gengetopt structure by equivalent lopsub constructs.
Merge branch 'refs/heads/t/simple_error_codes' Two patches which get rid of the concept of per-subsystem error codes. The host-compiled error2.c program can be removed, configure.ac and error.h simplified. The merge conflicted because both sides modified error.h, but this was easy to resolve. * refs/heads/t/simple_error_codes: Sort errors alphabetically. Simplify the error subsystem, get rid of error2.[ch].
Merge branch 'refs/heads/t/format-signedness' This series fixes all warnings produced by compiling with -Wformat-signedness and adds the flag to CFLAGS if the compiler supports it. * refs/heads/t/format-signedness (cooking for ~2 weeks): gcrypt: Fix a few format-signedness issues. Compile with -Wformat-signedness if possible. Fix signedness issues in format strings.
fade: Add documentation for main() and include it in doxygen. The two mixer implementations for OSS and ALSA are also included, both of which are only used by para_fade. So it makes sense to include para_fade as well. main() is the only a non-static function, so let's doxify that.
Simplify the error subsystem, get rid of error2.[ch]. This commit removes error2.c and the surrounding infrastructure of the build system, getting rid of ~600 LOC. After the change there are no more subsystems for error codes, and we don't need to host-compile error2.c any more. Since all executables now contain the text of every error code, the change has some impact on the sizes of the (stripped) executables: Before: After: 64K para_afh 71K para_afh 43K para_audioc 47K para_audioc 256K para_audiod 259K para_audiod 64K para_client 71K para_client 39K para_fade 47K para_fade 141K para_filter 144K para_filter 51K para_gui 59K para_gui 252K para_play 255K para_play 97K para_recv 104K para_recv 227K para_server 230K para_server 60K para_write 67K para_write This increase in size is justified by the major simplification.
Fix signedness issues in format strings. Compiling with -Wformat-signedness (not enabled so far) causes many warnings because of format strings which specify an unsigned type but correspond to an argument of signed type, or vice versa. This commit fixes all these mismatches. For "%u", "%d", "%lu", "%ld" we let the format string match the type of the argument, but for "%x" we need to cast the argument to a suitable unsigned type. After this patch the tree compiles cleanly with -Wformat-signedness given. The warning will be enabled in a subsequent commit.
fade: Add missing line break for log message. Fixes broken log output which looked like this: 21:33:48 21:33:48 sweet_dreams: waketime: 6:33client_cmd: /usr/local/bin/para_client stop
Update year in copyright headers. Done with files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files In previous years we ran a similar script to set the second year in the range to the current year. This is kind of silly, so let's get rid of this useless information. This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in all file headers, i.e. only the first year (A) is left in. Accurate information including time stamps for each change can be obtained from the git history.
fade.c: Don't use asctime(). POSIX.1-2008 marks asctime() as obsolete. Found by cppcheck.
doc: Change email address to maan@tuebingen.mpg.de The mail server on systemlinux.org was down for more than a week lately, so let's use an alternative official address. This commit changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de. Most .c and .h files contain the email address in the copyright header, so they must all be patched. Three other files contain the address for a different reason: * README lists email and git, gitweb and home page URLs * configure.ac needs it for configure -h * version.c contains it for the -V option of all commands
Merge branch 't/misc' Various fixes, improvements, cleanups. Cooking since 2014-02-22. * t/misc: (29 commits) build: Don't link with -lreadline if readline was not found. audiod: Skip NULL pointer check in compute_time_diff(). audiod: Make compute_time_diff() return void. com_stat(): Remove pointless uptime variable. gcrypt: Fix gcc warning on Ubuntu Lucid. flac: Try to link also without -logg. version.c: Fix comment of version_single_line(). doxygen: Expand all macros, in particular config.h. recv_common.c: Improve documentation of check_receiver_arg(). audiod: get_time_string() comment fix. configure: Really print opus audio file handler if opus lib was found. Overhaul doxygen main page. afs.h: Don't try to list all supported audio formats. Change copyright year to 2014. Add link to sideband.h in doxygen main page. Doxify error2.c and add GPL header. Add -Wdeclaration-after-statement. Add some missing includes. Makefile.real: Add clean2 to the list of phony targets. mood.c: Fix a trivial whitespace issue. ...
Change copyright year to 2014. This year, we're really on time. The changes in this patch were created by the following silly script: files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
fade: Improve error diagnostics. This adds a new generic error code "invalid mixer channel", which is returned from both ALSA and OSS in case the specified mixer channel could not be set. Prior to this patch, ALSA would return a bad channel error also when the given value was out of range. This is fixed by replacing the now unused ALSA_MIX_BAD_ELEM error code by the new ALSA_MIX_RANGE code. Finally, para_fade is changed to no longer print the list of available channels after it failed to set the initial mode.
fade: Switch to the fade-in mood *before* sleeping. This way the fade-in mood is active when para_fade is interrupted during the sleep. Currently sweet_dreams() calls change_afs_mode_and_play(), which switches to a different mood and changes the mood directly thereafter. For the new sematics we need to separate the two actions though. Hence change_afs_mode_and_play() is renamed to change_afs_mode(), and it now performs the mood switching part only. Its two callers are modified to call client_cmd("play") themselves. This allows to call change_afs_mode() before we go to sleep and client_cmd("play") on wake up.
fade: Allow to set more than one channel in sleep mode. This makes --ivol a string option which may be specified multiple times, each with its own channel:value pair. The channel part is optional, invalid channels are ignored. This change retains backwards-compatibility, i.e. providing a single value without "channel:" prefix still works as before. Unfortunately the patch is a bit large since set_channel() had to be moved to the top of fade.c. This function grew another argument to specify the channel to set.
fade: Implement new mode "set". While setting the value of a mixer channel has always been possible using --fade with a zero timeout, this method is somewhat tedious. This patch introduces the new "set" mode for this purpose.
fade: Log to stderr. Uunlike all other commands of the paraslash suite, the log function of para_fade writes to stdout rather than stderr. Make it log to stderr for the sake of consistency.
Make log functions static. All PARA_XXX_LOG() macros use the public para_log function pointer for quite some time now, so the actual implementations of the various log functions can be made static.
Use self-made help to avoid recompilations on version changes. This provides print_help() for all remaining commands so that we can get rid of the gengetopt generated help output completely. Hence the *.cmdline.[ch] files no longer depend on git-version.h which saves a lot of recompilations.