src/JackHandler.h
branchv_0
changeset 23 d2ad84dcf249
parent 21 70b252d02a92
child 24 427b8d799a4a
--- a/src/JackHandler.h	Wed Oct 07 01:46:03 2020 +0200
+++ b/src/JackHandler.h	Wed Oct 07 22:30:09 2020 +0200
@@ -186,7 +186,7 @@
 		pthread_mutex_lock(&realTimeContext.processingLock);
 
 		// Initialize JACK connection:
-		std::string clientName = convertor.to_bytes(configuration.jackClientName);
+		std::string clientName = convertor.to_bytes(configuration.client);
 		realTimeContext.jackClient = jack_client_open(clientName.c_str(), JackNullOption, nullptr);
 		if (realTimeContext.jackClient == nullptr) failInConstructor(L"Could not create JACK client.");
 
@@ -198,7 +198,7 @@
 		jack_set_error_function(jackErrorCallback);
 		jack_set_info_function(jackErrorCallback);
 
-		realTimeContext.jackPort = jack_port_register(realTimeContext.jackClient, "output", JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0);
+		realTimeContext.jackPort = jack_port_register(realTimeContext.jackClient, convertor.to_bytes(configuration.port).c_str(), JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0);
 		if (realTimeContext.jackPort == nullptr) failInConstructor(L"Could not register the JACK port.");
 
 		if (mlockall(MCL_CURRENT | MCL_FUTURE)) fwprintf(stderr, L"Warning: Can not lock memory.\n");
@@ -209,13 +209,13 @@
 
 		// Connect to configured destination ports:
 		const char* jackPortName = jack_port_name(realTimeContext.jackPort);
-		for (auto destinationPort : configuration.portsToConnect) {
+		for (auto destinationPort : configuration.connectTo) {
 			int error = jack_connect(realTimeContext.jackClient, jackPortName, convertor.to_bytes(destinationPort).c_str());
 			if (error) failInConstructor(L"Connection to the JACK port failed: " + destinationPort);
 		}
 
 		// Wait for a port connection, because it does not make much sense to send MIDI events nowhere:
-		while (jack_port_connected(realTimeContext.jackPort) < configuration.requiredJackConnections) usleep(10000);
+		while (jack_port_connected(realTimeContext.jackPort) < configuration.requiredConnections) usleep(10000);
 
 	}