src/JackCommand.h
branchv_0
changeset 12 e8aae4d42c01
parent 11 07247893054e
child 13 326935d1bfab
--- a/src/JackCommand.h	Wed Oct 07 01:45:30 2020 +0200
+++ b/src/JackCommand.h	Wed Oct 07 22:29:38 2020 +0200
@@ -247,7 +247,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.");
 
@@ -258,7 +258,7 @@
 		jack_set_error_function(jackErrorCallback);
 		jack_set_info_function(jackErrorCallback);
 
-		realTimeContext.jackPort = jack_port_register(realTimeContext.jackClient, "input", JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0);
+		realTimeContext.jackPort = jack_port_register(realTimeContext.jackClient, convertor.to_bytes(configuration.port).c_str(), JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 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");
@@ -269,7 +269,7 @@
 
 		// Connect to configured destination ports:
 		const char* jackPortName = jack_port_name(realTimeContext.jackPort);
-		for (auto sourcePort : configuration.portsToConnect) {
+		for (auto sourcePort : configuration.connectTo) {
 			int error = jack_connect(realTimeContext.jackClient, convertor.to_bytes(sourcePort).c_str(), jackPortName);
 			if (error) failInConstructor(L"Connection to the JACK port failed: " + sourcePort);
 		}
@@ -281,7 +281,7 @@
 		using namespace relpipe::writer;
 		vector<AttributeMetadata> metadata;
 
-		if (configuration.listJackPorts) listPorts(writer);
+		if (configuration.listPorts) listPorts(writer);
 		if (!configuration.listMidiMessages) return;
 
 		metadata.push_back({L"event", TypeId::STRING});
@@ -306,10 +306,10 @@
 			waitForRTCycle();
 
 			// Once the Configuration::requiredJackConnections count was reached, we will disconnect if the count drops under this level.
-			if (configuration.requiredJackConnections) {
+			if (configuration.requiredConnections) {
 				int currentConnectionCount = jack_port_connected(realTimeContext.jackPort);
 				if (currentConnectionCount > maxJackPortConnections) maxJackPortConnections = currentConnectionCount;
-				else if (maxJackPortConnections >= configuration.requiredJackConnections && currentConnectionCount < configuration.requiredJackConnections) break;
+				else if (maxJackPortConnections >= configuration.requiredConnections && currentConnectionCount < configuration.requiredConnections) break;
 			}
 		}
 	}