summaryrefslogtreecommitdiffstats
path: root/src/progs/om/main.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-21 05:53:27 +0000
committerDavid Robillard <d@drobilla.net>2006-06-21 05:53:27 +0000
commitadac9032064d973ff6cfe1f94d8619c71fe199a3 (patch)
treeb2427a03222042cb79ff530ab1ad7c612475e7b7 /src/progs/om/main.cpp
parent9e6189fadd0fa1ff3636b50e84549da01fdbe7ba (diff)
downloadingen-adac9032064d973ff6cfe1f94d8619c71fe199a3.tar.gz
ingen-adac9032064d973ff6cfe1f94d8619c71fe199a3.tar.bz2
ingen-adac9032064d973ff6cfe1f94d8619c71fe199a3.zip
Reorganized directory tree/names
git-svn-id: http://svn.drobilla.net/lad/ingen@73 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/om/main.cpp')
-rw-r--r--src/progs/om/main.cpp153
1 files changed, 0 insertions, 153 deletions
diff --git a/src/progs/om/main.cpp b/src/progs/om/main.cpp
deleted file mode 100644
index a69c7e76..00000000
--- a/src/progs/om/main.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-/* This file is part of Om. Copyright (C) 2006 Dave Robillard.
- *
- * Om is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Om is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <iostream>
-#include <cstddef>
-#include <signal.h>
-#include "config.h"
-#include "util.h"
-#include "cmdline.h"
-#include "Om.h"
-#include "OmApp.h"
-#ifdef HAVE_LASH
-#include "LashDriver.h"
-#endif
-#ifdef BUILD_IN_PROCESS_ENGINE
-#include <jack/jack.h>
-#include <jack/intclient.h>
-#endif
-
-using std::cout; using std::endl; using std::cerr;
-
-
-void
-catch_int(int)
-{
- signal(SIGINT, catch_int);
- signal(SIGTERM, catch_int);
-
- std::cout << "[Main] Om interrupted." << std::endl;
- Om::om->quit();
-}
-
-
-#ifdef BUILD_IN_PROCESS_ENGINE
-
-jack_client_t* jack_client;
-jack_intclient_t jack_intclient;
-
-
-void
-unload_in_process_engine(int)
-{
- jack_status_t status;
- int ret = EXIT_SUCCESS;
-
- cout << "Unloading...";
- status = jack_internal_client_unload(jack_client, jack_intclient);
- if (status & JackFailure) {
- cout << "failed" << endl;
- ret = EXIT_FAILURE;
- } else {
- cout << "done" << endl;
- }
- jack_client_close(jack_client);
- exit(ret);
-}
-
-
-int
-load_in_process_engine(const char* port)
-{
- int ret = EXIT_SUCCESS;
-
- jack_status_t status;
-
- if ((jack_client = jack_client_open("om_load", JackNoStartServer,
- &status)) != NULL) {
- jack_intclient =
- jack_internal_client_load(jack_client, "Om",
- (jack_options_t)(JackLoadName|JackLoadInit),
- &status, "om", port);
- if (status == 0) {
- cout << "Engine loaded" << endl;
- signal(SIGINT, unload_in_process_engine);
- signal(SIGTERM, unload_in_process_engine);
-
- while (1) {
- sleep(1);
- }
- } else if (status & JackFailure) {
- cerr << "Could not load om.so" << endl;
- ret = EXIT_FAILURE;
- }
-
- jack_client_close(jack_client);
- } else {
- cerr << "jack_client_open failed" << endl;
- ret = EXIT_FAILURE;
- }
-}
-
-#endif // BUILD_IN_PROCESS_ENGINE
-
-
-int
-main(int argc, char** argv)
-{
-#ifdef HAVE_LASH
- lash_args_t* lash_args = lash_extract_args(&argc, &argv);
-#endif
-
- int ret = EXIT_SUCCESS;
-
- /* Parse command line options */
- gengetopt_args_info args_info;
- if (cmdline_parser (argc, argv, &args_info) != 0)
- return EXIT_FAILURE;
-
-
- if (args_info.in_jackd_flag) {
-#ifdef BUILD_IN_PROCESS_ENGINE
- ret = load_in_process_engine(args_info.port_arg);
-#else
- cerr << "In-process Jack client support not enabled in this build." << endl;
- ret = EXIT_FAILURE;
-#endif // JACK_IN_PROCESS_ENGINE
- } else {
- signal(SIGINT, catch_int);
- signal(SIGTERM, catch_int);
-
- Om::set_denormal_flags();
-
- Om::om = new Om::OmApp(args_info.port_arg);
-
-#ifdef HAVE_LASH
- Om::lash_driver = new Om::LashDriver(Om::om, lash_args);
-#endif
-
- Om::om->main();
-
-#ifdef HAVE_LASH
- delete Om::lash_driver;
-#endif
-
- delete Om::om;
- }
-
- return ret;
-}
-