diff options
Diffstat (limited to 'src/progs/server')
-rw-r--r-- | src/progs/server/Makefile.am | 7 | ||||
-rw-r--r-- | src/progs/server/cmdline.c | 63 | ||||
-rw-r--r-- | src/progs/server/cmdline.ggo | 1 | ||||
-rw-r--r-- | src/progs/server/cmdline.h | 6 | ||||
-rwxr-xr-x | src/progs/server/ingen_dev | 3 | ||||
-rw-r--r-- | src/progs/server/main.cpp | 41 |
6 files changed, 47 insertions, 74 deletions
diff --git a/src/progs/server/Makefile.am b/src/progs/server/Makefile.am index 7584ee87..ab384494 100644 --- a/src/progs/server/Makefile.am +++ b/src/progs/server/Makefile.am @@ -1,6 +1,7 @@ -AM_CXXFLAGS = @RAUL_CFLAGS@ @SLV2_CFLAGS@ @JACK_CFLAGS@ @LOSC_CFLAGS@ @ALSA_CFLAGS@ @LASH_CFLAGS@ -I$(top_srcdir)/src/common -I$(top_srcdir)/src/libs/engine -I$(top_srcdir)/src/libs/engine/events +AM_CXXFLAGS = @RAUL_CFLAGS@ @JACK_CFLAGS@ @LOSC_CFLAGS@ @ALSA_CFLAGS@ @LASH_CFLAGS@ @SLV2_CFLAGS@ -I$(top_srcdir)/src/common -I$(top_srcdir)/src/libs -DINGEN_MODULE_DIR=\"$(libdir)/ingen\" MAINTAINERCLEANFILES = Makefile.in +EXTRA_DIST = ingen_dev # # Stand-alone engine @@ -8,8 +9,8 @@ MAINTAINERCLEANFILES = Makefile.in if BUILD_SERVER bin_PROGRAMS = ingen -ingen_DEPENDENCIES = ../../libs/engine/libingen.la -ingen_LDADD = @RAUL_LIBS@ @SLV2_LIBS@ @JACK_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ @LASH_LIBS@ -lrt ../../libs/engine/libingen.la +ingen_LDADD = @RAUL_LIBS@ @JACK_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ @LASH_LIBS@ @SLV2_LIBS@ -lrt ../../libs/module/libingen_module.la +ingen_DEPENDENCIES = ../../libs/module/libingen_module.la ingen_SOURCES = \ main.cpp \ diff --git a/src/progs/server/cmdline.c b/src/progs/server/cmdline.c index 6a697a04..1e97e1ef 100644 --- a/src/progs/server/cmdline.c +++ b/src/progs/server/cmdline.c @@ -1,5 +1,5 @@ /* - File autogenerated by gengetopt version 2.18 + File autogenerated by gengetopt version 2.19.1 generated with the following command: gengetopt -u @@ -23,14 +23,15 @@ const char *gengetopt_args_info_purpose = ""; -const char *gengetopt_args_info_usage = "Usage: Om - An OSC controlled realtime modular synthesizer [OPTIONS]... [FILES]..."; +const char *gengetopt_args_info_usage = "Usage: Om - An OSC controlled realtime modular synthesizer [OPTIONS]... \n [FILES]..."; + +const char *gengetopt_args_info_description = ""; const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -p, --port=STRING OSC port to listen on (default=`16180')", - " -j, --jack-server=STRING Name of Jack server to attach to", - " -i, --in-jackd Run engine as in-process JACK client (default=off)", + " -h, --help Print help and exit", + " -V, --version Print version and exit", + " -p, --port=STRING OSC port to listen on (default=`16180')", + " -i, --in-jackd Run engine as in-process JACK client (default=off)", 0 }; @@ -52,7 +53,6 @@ void clear_given (struct gengetopt_args_info *args_info) args_info->help_given = 0 ; args_info->version_given = 0 ; args_info->port_given = 0 ; - args_info->jack_server_given = 0 ; args_info->in_jackd_given = 0 ; } @@ -61,8 +61,6 @@ void clear_args (struct gengetopt_args_info *args_info) { args_info->port_arg = gengetopt_strdup ("16180"); args_info->port_orig = NULL; - args_info->jack_server_arg = NULL; - args_info->jack_server_orig = NULL; args_info->in_jackd_flag = 0; } @@ -73,8 +71,7 @@ void init_args_info(struct gengetopt_args_info *args_info) args_info->help_help = gengetopt_args_info_help[0] ; args_info->version_help = gengetopt_args_info_help[1] ; args_info->port_help = gengetopt_args_info_help[2] ; - args_info->jack_server_help = gengetopt_args_info_help[3] ; - args_info->in_jackd_help = gengetopt_args_info_help[4] ; + args_info->in_jackd_help = gengetopt_args_info_help[3] ; } @@ -94,6 +91,10 @@ cmdline_parser_print_help (void) printf("\n%s\n", gengetopt_args_info_purpose); printf("\n%s\n\n", gengetopt_args_info_usage); + + if (strlen(gengetopt_args_info_description) > 0) + printf("%s\n", gengetopt_args_info_description); + while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } @@ -124,16 +125,6 @@ cmdline_parser_release (struct gengetopt_args_info *args_info) free (args_info->port_orig); /* free previous argument */ args_info->port_orig = 0; } - if (args_info->jack_server_arg) - { - free (args_info->jack_server_arg); /* free previous argument */ - args_info->jack_server_arg = 0; - } - if (args_info->jack_server_orig) - { - free (args_info->jack_server_orig); /* free previous argument */ - args_info->jack_server_orig = 0; - } for (i = 0; i < args_info->inputs_num; ++i) free (args_info->inputs [i]); @@ -171,13 +162,6 @@ cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_ fprintf(outfile, "%s\n", "port"); } } - if (args_info->jack_server_given) { - if (args_info->jack_server_orig) { - fprintf(outfile, "%s=\"%s\"\n", "jack-server", args_info->jack_server_orig); - } else { - fprintf(outfile, "%s\n", "jack-server"); - } - } if (args_info->in_jackd_given) { fprintf(outfile, "%s\n", "in-jackd"); } @@ -266,13 +250,12 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { "port", 1, NULL, 'p' }, - { "jack-server", 1, NULL, 'j' }, { "in-jackd", 0, NULL, 'i' }, { NULL, 0, NULL, 0 } }; stop_char = 0; - c = getopt_long (argc, argv, "hVp:j:i", long_options, &option_index); + c = getopt_long (argc, argv, "hVp:i", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -306,24 +289,6 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf args_info->port_orig = gengetopt_strdup (optarg); break; - case 'j': /* Name of Jack server to attach to. */ - if (local_args_info.jack_server_given) - { - fprintf (stderr, "%s: `--jack-server' (`-j') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); - goto failure; - } - if (args_info->jack_server_given && ! override) - continue; - local_args_info.jack_server_given = 1; - args_info->jack_server_given = 1; - if (args_info->jack_server_arg) - free (args_info->jack_server_arg); /* free previous string */ - args_info->jack_server_arg = gengetopt_strdup (optarg); - if (args_info->jack_server_orig) - free (args_info->jack_server_orig); /* free previous string */ - args_info->jack_server_orig = gengetopt_strdup (optarg); - break; - case 'i': /* Run engine as in-process JACK client. */ if (local_args_info.in_jackd_given) { diff --git a/src/progs/server/cmdline.ggo b/src/progs/server/cmdline.ggo index ce50cea1..9635a8f5 100644 --- a/src/progs/server/cmdline.ggo +++ b/src/progs/server/cmdline.ggo @@ -3,6 +3,5 @@ package "Om - An OSC controlled realtime modular synthesizer" option "port" p "OSC port to listen on" string default="16180" no -option "jack-server" j "Name of Jack server to attach to" string no option "in-jackd" i "Run engine as in-process JACK client" flag off diff --git a/src/progs/server/cmdline.h b/src/progs/server/cmdline.h index 8ced9534..5253162c 100644 --- a/src/progs/server/cmdline.h +++ b/src/progs/server/cmdline.h @@ -1,6 +1,6 @@ /* cmdline.h */ -/* File autogenerated by gengetopt version 2.18 */ +/* File autogenerated by gengetopt version 2.19.1 */ #ifndef CMDLINE_H #define CMDLINE_H @@ -29,16 +29,12 @@ struct gengetopt_args_info char * port_arg; /* OSC port to listen on (default='16180'). */ char * port_orig; /* OSC port to listen on original value given at command line. */ const char *port_help; /* OSC port to listen on help description. */ - char * jack_server_arg; /* Name of Jack server to attach to. */ - char * jack_server_orig; /* Name of Jack server to attach to original value given at command line. */ - const char *jack_server_help; /* Name of Jack server to attach to help description. */ int in_jackd_flag; /* Run engine as in-process JACK client (default=off). */ const char *in_jackd_help; /* Run engine as in-process JACK client help description. */ int help_given ; /* Whether help was given. */ int version_given ; /* Whether version was given. */ int port_given ; /* Whether port was given. */ - int jack_server_given ; /* Whether jack-server was given. */ int in_jackd_given ; /* Whether in-jackd was given. */ char **inputs ; /* unamed options */ diff --git a/src/progs/server/ingen_dev b/src/progs/server/ingen_dev new file mode 100755 index 00000000..bd8857f7 --- /dev/null +++ b/src/progs/server/ingen_dev @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +INGEN_MODULE_PATH=../../libs/engine/.libs ./ingen diff --git a/src/progs/server/main.cpp b/src/progs/server/main.cpp index ea9b37d8..e92b635f 100644 --- a/src/progs/server/main.cpp +++ b/src/progs/server/main.cpp @@ -19,19 +19,18 @@ #include <cstddef> #include <signal.h> #include "config.h" -#include "util.h" -#include "cmdline.h" -#include "tuning.h" -#include "Engine.h" -#include "JackAudioDriver.h" -#include "OSCEngineReceiver.h" +#include "module/Module.h" +#include "engine/util.h" +#include "engine/Engine.h" +#include "engine/EventSource.h" #ifdef HAVE_LASH -#include "LashDriver.h" +#include "engine/LashDriver.h" #endif #ifdef BUILD_IN_PROCESS_ENGINE #include <jack/jack.h> #include <jack/intclient.h> #endif +#include "cmdline.h" using std::cout; using std::endl; using std::cerr; using namespace Ingen; @@ -139,18 +138,28 @@ main(int argc, char** argv) set_denormal_flags(); - engine = SharedPtr<Engine>(new Engine()); + SharedPtr<Glib::Module> module = Ingen::Shared::load_module("ingen_engine"); + + if (!module) { + cerr << "Aborting. If you are running from the source tree, run ingen_dev." << endl; + return -1; + } - std::string jack_name - = (args_info.jack_server_given) ? args_info.jack_server_arg : ""; + Engine* (*new_engine)() = NULL; + + bool found = module->get_symbol("new_engine", (void*&)new_engine); + + if (!found) { + cerr << "Unable to find module entry point, exiting." << endl; + return -1; + } - SharedPtr<AudioDriver> audio_driver( - new JackAudioDriver(*engine.get(), jack_name) ); + SharedPtr<Engine> engine(new_engine()); - SharedPtr<EventSource> event_source(new OSCEngineReceiver( - engine, pre_processor_queue_size, args_info.port_arg )); + engine->start_jack_driver(); + engine->start_osc_driver(args_info.port_arg); - engine->activate(audio_driver, event_source); + engine->activate(); #ifdef HAVE_LASH lash_driver = new LashDriver(engine, lash_args); @@ -158,7 +167,7 @@ main(int argc, char** argv) engine->main(); - event_source->deactivate(); + engine->event_source()->deactivate(); #ifdef HAVE_LASH delete lash_driver; |