NO-OP: whitespace

This commit is contained in:
Robin Gareus 2019-07-04 22:35:07 +02:00
parent 83d54e79d3
commit d35ee75c77
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 78 additions and 72 deletions

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <cstdlib> #include <cstdlib>
#include <getopt.h> #include <getopt.h>
#include <iostream>
#ifndef PLATFORM_WINDOWS #ifndef PLATFORM_WINDOWS
#include <signal.h> #include <signal.h>
@ -10,9 +10,9 @@
#include "pbd/convert.h" #include "pbd/convert.h"
#include "pbd/crossthread.h" #include "pbd/crossthread.h"
#include "pbd/failed_constructor.h"
#include "pbd/error.h"
#include "pbd/debug.h" #include "pbd/debug.h"
#include "pbd/error.h"
#include "pbd/failed_constructor.h"
#include "ardour/ardour.h" #include "ardour/ardour.h"
#include "ardour/audioengine.h" #include "ardour/audioengine.h"
@ -29,15 +29,15 @@ using namespace PBD;
static const char* localedir = LOCALEDIR; static const char* localedir = LOCALEDIR;
static string backend_client_name; static string backend_client_name;
static string backend_name = "JACK"; static string backend_name = "JACK";
static CrossThreadChannel xthread (true); static CrossThreadChannel xthread (true);
static TestReceiver test_receiver; static TestReceiver test_receiver;
/** @param dir Session directory. /** @param dir Session directory.
* @param state Session state file, without .ardour suffix. * @param state Session state file, without .ardour suffix.
*/ */
static Session * static Session*
load_session (string dir, string state) load_session (string dir, string state)
{ {
SessionEvent::create_per_thread_pool ("test", 512); SessionEvent::create_per_thread_pool ("test", 512);
@ -86,7 +86,9 @@ engine_halted (const char* reason)
} }
#ifndef PLATFORM_WINDOWS #ifndef PLATFORM_WINDOWS
static void wearedone (int) { static void
wearedone (int)
{
cerr << "caught signal - terminating." << endl; cerr << "caught signal - terminating." << endl;
xthread.deliver ('x'); xthread.deliver ('x');
} }
@ -96,15 +98,15 @@ static void
print_version () print_version ()
{ {
cout cout
<< PROGRAM_NAME << PROGRAM_NAME
<< VERSIONSTRING << VERSIONSTRING
<< " (built using " << " (built using "
<< ARDOUR::revision << ARDOUR::revision
#ifdef __GNUC__ #ifdef __GNUC__
<< " and GCC version " << __VERSION__ << " and GCC version " << __VERSION__
#endif #endif
<< ')' << ')'
<< endl; << endl;
} }
static void static void
@ -123,13 +125,15 @@ print_help ()
#ifdef WINDOWS_VST_SUPPORT #ifdef WINDOWS_VST_SUPPORT
<< " -V, --novst Do not use VST support\n" << " -V, --novst Do not use VST support\n"
#endif #endif
; ;
} }
int main (int argc, char* argv[]) int
main (int argc, char* argv[])
{ {
const char *optstring = "vhBdD:c:VOU:P"; const char* optstring = "vhBdD:c:VOU:P";
/* clang-format off */
const struct option longopts[] = { const struct option longopts[] = {
{ "version", no_argument, 0, 'v' }, { "version", no_argument, 0, 'v' },
{ "help", no_argument, 0, 'h' }, { "help", no_argument, 0, 'h' },
@ -142,64 +146,64 @@ int main (int argc, char* argv[])
{ "no-connect-ports", no_argument, 0, 'P' }, { "no-connect-ports", no_argument, 0, 'P' },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
/* clang-format on */
bool use_vst = true; bool use_vst = true;
bool try_hw_optimization = true; bool try_hw_optimization = true;
backend_client_name = PBD::downcase (std::string(PROGRAM_NAME)); backend_client_name = PBD::downcase (std::string (PROGRAM_NAME));
int c; int c;
while ((c = getopt_long (argc, argv, optstring, longopts, (int*)0)) != EOF) { while ((c = getopt_long (argc, argv, optstring, longopts, (int*)0)) != EOF) {
switch (c) { switch (c) {
case 0: case 0:
break; break;
case 'v': case 'v':
print_version (); print_version ();
exit (EXIT_SUCCESS);
break;
case 'h':
print_help ();
exit (EXIT_SUCCESS);
break;
case 'c':
backend_client_name = optarg;
break;
case 'B':
ARDOUR::Session::set_bypass_all_loaded_plugins (true);
break;
case 'd':
ARDOUR::Session::set_disable_all_loaded_plugins (true);
break;
case 'D':
if (PBD::parse_debug_options (optarg)) {
exit (EXIT_SUCCESS); exit (EXIT_SUCCESS);
} break;
break;
case 'O': case 'h':
try_hw_optimization = false; print_help ();
break; exit (EXIT_SUCCESS);
break;
case 'P': case 'c':
ARDOUR::Port::set_connecting_blocked (true); backend_client_name = optarg;
break; break;
case 'V': case 'B':
ARDOUR::Session::set_bypass_all_loaded_plugins (true);
break;
case 'd':
ARDOUR::Session::set_disable_all_loaded_plugins (true);
break;
case 'D':
if (PBD::parse_debug_options (optarg)) {
exit (EXIT_SUCCESS);
}
break;
case 'O':
try_hw_optimization = false;
break;
case 'P':
ARDOUR::Port::set_connecting_blocked (true);
break;
case 'V':
#ifdef WINDOWS_VST_SUPPORT #ifdef WINDOWS_VST_SUPPORT
use_vst = false; use_vst = false;
#endif /* WINDOWS_VST_SUPPORT */ #endif /* WINDOWS_VST_SUPPORT */
break; break;
default: default:
print_help (); print_help ();
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
} }
@ -209,22 +213,23 @@ int main (int argc, char* argv[])
} }
if (!ARDOUR::init (use_vst, try_hw_optimization, localedir)) { if (!ARDOUR::init (use_vst, try_hw_optimization, localedir)) {
cerr << "Ardour failed to initialize\n" << endl; cerr << "Ardour failed to initialize\n"
<< endl;
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
Session* s = 0; Session* s = 0;
try { try {
s = load_session (argv[optind], argv[optind+1]); s = load_session (argv[optind], argv[optind + 1]);
} catch (failed_constructor& e) { } catch (failed_constructor& e) {
cerr << "failed_constructor: " << e.what() << "\n"; cerr << "failed_constructor: " << e.what () << "\n";
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} catch (AudioEngine::PortRegistrationFailure& e) { } catch (AudioEngine::PortRegistrationFailure& e) {
cerr << "PortRegistrationFailure: " << e.what() << "\n"; cerr << "PortRegistrationFailure: " << e.what () << "\n";
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} catch (exception& e) { } catch (exception& e) {
cerr << "exception: " << e.what() << "\n"; cerr << "exception: " << e.what () << "\n";
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} catch (...) { } catch (...) {
cerr << "unknown exception.\n"; cerr << "unknown exception.\n";
@ -243,21 +248,22 @@ int main (int argc, char* argv[])
PBD::ScopedConnectionList con; PBD::ScopedConnectionList con;
BasicUI::AccessAction.connect_same_thread (con, boost::bind (&access_action, _1, _2)); BasicUI::AccessAction.connect_same_thread (con, boost::bind (&access_action, _1, _2));
AudioEngine::instance()->Halted.connect_same_thread (con, boost::bind (&engine_halted, _1)); AudioEngine::instance ()->Halted.connect_same_thread (con, boost::bind (&engine_halted, _1));
#ifndef PLATFORM_WINDOWS #ifndef PLATFORM_WINDOWS
signal(SIGINT, wearedone); signal (SIGINT, wearedone);
signal(SIGTERM, wearedone); signal (SIGTERM, wearedone);
#endif #endif
s->request_transport_speed (1.0); s->request_transport_speed (1.0);
char msg; char msg;
do {} while (0 == xthread.receive (msg, true)); do {
} while (0 == xthread.receive (msg, true));
AudioEngine::instance()->remove_session (); AudioEngine::instance ()->remove_session ();
delete s; delete s;
AudioEngine::instance()->stop (); AudioEngine::instance ()->stop ();
AudioEngine::destroy (); AudioEngine::destroy ();
return 0; return 0;