From f27a88787da027545e4585b404be980962c5429c Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Sat, 19 Mar 2022 21:24:42 +0100 Subject: [PATCH] Add linux manpage and update main accordingly --- docs/vimix.1 | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ main.cpp | 39 +++++++++++++++++++------------- 2 files changed, 87 insertions(+), 15 deletions(-) create mode 100644 docs/vimix.1 diff --git a/docs/vimix.1 b/docs/vimix.1 new file mode 100644 index 0000000..2012129 --- /dev/null +++ b/docs/vimix.1 @@ -0,0 +1,63 @@ +.\"Created by Bruno Herbelin + +.TH vimix 1 "March 2022" "0.7.0" "vimix manpage" + +.SH NAME +vimix \- Video live mixer + +..SH SYNOPSIS +.B vimix +.RI [ OPTIONS ] +.RI [ FILE ] +.br + +.SH DESCRIPTION +.B vimix +performs graphical mixing and blending of several movie clips and computer generated graphics, with image processing effects in real-time. + +Its intuitive and hands-on user interface gives direct control on image opacity and shape for producing live graphics during concerts or VJ-ing sessions. + +The output image is typically projected full-screen on an external monitor or a projector, but can be streamed live (SRT) or recorded (no audio). + +.SH OPTIONS + +.TP +.BR \-V ", " \-\^\-version +Output the version number of +.B vimix +and exit. + +.TP +.BR \-C ", " \-\^\-clean +Clean the user stored preferences of +.B vimix +and exit. + +.TP +.BR \-T ", " \-\^\-test +Perform a minimal rendering test and exit. + +.SH FILE + +Launches +.B vimix +and tries to open the provided session file (.mix extension). + +.SH "SEE ALSO" +.SS "Regular Manual Pages" +.BR gst-launch-1.0 (1), +.BR gst-inspect-1.0 (1) + +.SS "Documentation" +A user manual and tutorials are available online (https://github.com/brunoherbelin/vimix/wiki). + +.SH BUGS +.SS "Reporting bugs" +Report bugs and issues on github (https://github.com/brunoherbelin/vimix). + +.SH COPYRIGHT +GPL3+ license +.PP +Copyright (c) 2022 Bruno Herbelin +.PP +This document is part of the vimix software. diff --git a/main.cpp b/main.cpp index 51e9adf..82bec15 100644 --- a/main.cpp +++ b/main.cpp @@ -64,26 +64,35 @@ int main(int argc, char *argv[]) // one extra argument is given if (argc == 2) { std::string argument(argv[1]); - if (argument == "--clean" || argument == "-c") { - // clean start if requested : Save empty settings before loading - Settings::Save(); - return 0; - } - else if (argument == "--version" || argument == "-v") { + if (argument[0] == '-') { + if (argument == "--clean" || argument == "-C") { + // clean start if requested : Save empty settings before loading + Settings::Save(); + fprintf(stderr, "%s: clean OK\n", APP_NAME); + return 0; + } + else if (argument == "--version" || argument == "-V") { #ifdef VIMIX_VERSION_MAJOR - fprintf(stderr, "%s %d.%d.%d\n", APP_NAME, VIMIX_VERSION_MAJOR, VIMIX_VERSION_MINOR, VIMIX_VERSION_PATCH); + fprintf(stderr, "%s: version %d.%d.%d\n", APP_NAME, VIMIX_VERSION_MAJOR, VIMIX_VERSION_MINOR, VIMIX_VERSION_PATCH); #else - fprintf(stderr, "%s\n", APP_NAME); + fprintf(stderr, "%s\n", APP_NAME); #endif - return 0; - } - else if (argument == "--test" || argument == "-t") { - if ( !Rendering::manager().init() ) { - fprintf(stderr, "%s Failed\n", APP_NAME); + return 0; + } + else if (argument == "--test" || argument == "-T") { + if ( !Rendering::manager().init() ) { + fprintf(stderr, "%s: test Failed\n", APP_NAME); + return 1; + } + fprintf(stderr, "%s: test OK\n", APP_NAME); + return 0; + } + else { + fprintf(stderr, "%s: unrecognized option '%s'\n" + "Usage: %s [-V, --version][-T, --test][-C, --clean][FILE]\n", + APP_NAME, argument.c_str(), APP_NAME); return 1; } - fprintf(stderr, "%s OK\n", APP_NAME); - return 0; } else { // try to open the file