From 67ec646a42b8b9e851c693effbdce18327b67501 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 10 Feb 2011 18:15:12 +0100 Subject: Added help text --- synth/.depend | 12 ++++++++---- synth/Makefile | 5 +++++ synth/cli.cpp | 21 +++++++++++++-------- synth/helpstring.h | 35 +++++++++++++++++++++++++++++++++++ synth/helpstring.txt | 33 +++++++++++++++++++++++++++++++++ synth/text_to_h.sh | 1 + 6 files changed, 95 insertions(+), 12 deletions(-) create mode 100644 synth/helpstring.h create mode 100644 synth/helpstring.txt create mode 100755 synth/text_to_h.sh diff --git a/synth/.depend b/synth/.depend index ba430bb..1739b5d 100644 --- a/synth/.depend +++ b/synth/.depend @@ -1,7 +1,7 @@ channel.o: channel.cpp channel.h fixed.h programs.h note_funcs.h \ note_skel.h defines.h util.h globals.h note.h envelope.h filter.h cli.o: cli.cpp util.h programs.h fixed.h note_funcs.h globals.h channel.h \ - note_skel.h defines.h load.h + note_skel.h defines.h load.h helpstring.h defines.o: defines.cpp defines.h envelope.o: envelope.cpp envelope.h programs.h fixed.h note_funcs.h filter.o: filter.cpp filter.h fixed.h defines.h globals.h programs.h \ @@ -9,12 +9,12 @@ filter.o: filter.cpp filter.h fixed.h defines.h globals.h programs.h \ globals.o: globals.cpp globals.h programs.h fixed.h note_funcs.h \ channel.h note_skel.h defines.h util.h jack.o: jack.cpp defines.h globals.h programs.h fixed.h note_funcs.h \ - channel.h note_skel.h util.h jack.h communication.h + channel.h note_skel.h util.h jack.h communication.h lfos.h load.o: load.cpp util.h programs.h fixed.h note_funcs.h globals.h \ channel.h note_skel.h defines.h parser.h note_loader.h main.o: main.cpp jack.h load.h programs.h fixed.h note_funcs.h cli.h \ channel.h note_skel.h defines.h util.h globals.h in_synth_cli.h \ - communication.h note_loader.h + communication.h note_loader.h lfos.h watch_files.h note.o: note.cpp note.h programs.h fixed.h note_funcs.h envelope.h \ filter.h note_skel.h globals.h channel.h defines.h util.h note_skel.o: note_skel.cpp note_skel.h programs.h fixed.h note_funcs.h \ @@ -32,7 +32,11 @@ note_loader.o: note_loader.cpp note_loader.h programs.h fixed.h \ shared_object_manager.h in_synth_cli.o: in_synth_cli.cpp in_synth_cli.h util.h programs.h fixed.h \ note_funcs.h communication.h globals.h channel.h note_skel.h defines.h \ - load.h + load.h lfos.h watch_files.h communication.o: communication.cpp communication.h shared_object_manager.o: shared_object_manager.cpp util.h programs.h \ fixed.h note_funcs.h shared_object_manager.h +lfos.o: lfos.cpp lfos.h globals.h programs.h fixed.h note_funcs.h \ + channel.h note_skel.h defines.h util.h +watch_files.o: watch_files.cpp watch_files.h util.h programs.h fixed.h \ + note_funcs.h globals.h channel.h note_skel.h defines.h in_synth_cli.h diff --git a/synth/Makefile b/synth/Makefile index 39b6e80..e19546f 100644 --- a/synth/Makefile +++ b/synth/Makefile @@ -27,6 +27,11 @@ depend dep: $(SRC) %.o: %.cpp $(CXX) $(CXXFLAGS) -c $< +helpstring.h: helpstring.txt + echo '#define HELPSTRING \' > helpstring.h && \ + cat helpstring.txt | ./text_to_h.sh >> helpstring.h \ + || rm helpstring.h + .PHONY: clean dep depend clean: diff --git a/synth/cli.cpp b/synth/cli.cpp index 4d5cc2f..09c3ff3 100644 --- a/synth/cli.cpp +++ b/synth/cli.cpp @@ -5,17 +5,20 @@ #include "util.h" #include "globals.h" #include "load.h" +#include "helpstring.h" using namespace std; +#define VERSION "1.0" + void show_help() { - cout << "TODO: help text" << endl; + cout << HELPSTRING < less accurate, but faster)\n"\ +" -i --cleanup-interval N try cleaning up notes every N seconds\n"\ +"\n"\ +" --lfoN-freq --snh-freq set frequency for lfos or the sample-and-\n"\ +" --sample-and-hold-freq hold-generator\n"\ +" --max-port TIME set the maximum settable portamento time\n"\ +" --max-port(amento)-time (a MIDI value of 127 corresponds to this)\n"\ +"\n"\ +" -a --{no|dont}-connect- don't automatically connect the output\n"\ +" audio(-out) ports to the speakers\n"\ +" -m --{no|dont}-connect- don't automatically connect the output\n"\ +" midi(-in) ports to midi devices\n"\ +"\n"\ +" -w --{no|dont}-watch- turn off watching files for changes\n"\ +" files \n"\ +"" diff --git a/synth/helpstring.txt b/synth/helpstring.txt new file mode 100644 index 0000000..0c546a4 --- /dev/null +++ b/synth/helpstring.txt @@ -0,0 +1,33 @@ +Usage: ./synth [OPTIONS] + -h show this help text + -V show the version number + + -v be verbose + -q be quiet + -F --fatal-warnings make warnings fatal + + -c --conf(ig) FILE load the given config file + -d --dir(ectory) DIR read that directory + -p --program N:FILE load FILE at program number N + + -f --frameskip N only do every Nth frame + -x --xruns N:T kill all voices when N xruns or more + happen in T seconds + + -i --cleanup-interval N try cleaning up notes every N seconds + --filter-update-freq FREQ how often the filter settings, the lfo- + --lfo-update-freq FREQ or envelope-current-values get updated + --env(elope)-update-freq FREQ (low -> less accurate, but faster) + + --lfoN-freq --snh-freq set frequency for lfos or the sample-and- + --sample-and-hold-freq hold-generator + --max-port TIME set the maximum settable portamento time + --max-port(amento)-time (a MIDI value of 127 corresponds to this) + + -a --{no|dont}-connect- don't automatically connect the output + audio(-out) ports to the speakers + -m --{no|dont}-connect- don't automatically connect the output + midi(-in) ports to midi devices + + -w --{no|dont}-watch- turn off watching files for changes + files diff --git a/synth/text_to_h.sh b/synth/text_to_h.sh new file mode 100755 index 0000000..86ed89b --- /dev/null +++ b/synth/text_to_h.sh @@ -0,0 +1 @@ +sed -e 's,\\,\\\\,g' | sed -e 's,",\\",g' | sed -e 's,^\(.*\)$,"\1\\n"\\,' && echo '""' -- cgit v1.2.1