From 5f5e293345a063ab7b274edcc76d329891503379 Mon Sep 17 00:00:00 2001
From: David Robillard <d@drobilla.net>
Date: Fri, 27 Nov 2020 17:57:43 +0100
Subject: Use consistent naming convention for enum classes

---
 src/JackDriver.cpp | 58 +++++++++++++++++++++++++++---------------------------
 1 file changed, 29 insertions(+), 29 deletions(-)

(limited to 'src/JackDriver.cpp')

diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp
index b74dd9c..e916f80 100644
--- a/src/JackDriver.cpp
+++ b/src/JackDriver.cpp
@@ -114,10 +114,10 @@ JackDriver::detach()
 static bool
 is_jack_port(const PatchagePort* port)
 {
-	return (port->type() == PortType::JACK_AUDIO ||
-	        port->type() == PortType::JACK_MIDI ||
-	        port->type() == PortType::JACK_OSC ||
-	        port->type() == PortType::JACK_CV);
+	return (port->type() == PortType::jack_audio ||
+	        port->type() == PortType::jack_midi ||
+	        port->type() == PortType::jack_osc ||
+	        port->type() == PortType::jack_cv);
 }
 
 /** Destroy all JACK (canvas) ports.
@@ -133,7 +133,7 @@ JackDriver::destroy_all()
 PatchagePort*
 JackDriver::create_port_view(Patchage* patchage, const PortID& id)
 {
-	assert(id.type == PortID::Type::JACK_ID);
+	assert(id.type == PortID::Type::jack_id);
 
 	jack_port_t* jack_port = jack_port_by_id(_client, id.id.jack_id);
 	if (!jack_port) {
@@ -148,13 +148,13 @@ JackDriver::create_port_view(Patchage* patchage, const PortID& id)
 	std::string module_name, port_name;
 	port_names(id, module_name, port_name);
 
-	ModuleType type = ModuleType::InputOutput;
+	ModuleType type = ModuleType::input_output;
 	if (_app->conf()->get_module_split(module_name,
 	                                   (jack_flags & JackPortIsTerminal))) {
 		if (jack_flags & JackPortIsInput) {
-			type = ModuleType::Input;
+			type = ModuleType::input;
 		} else {
-			type = ModuleType::Output;
+			type = ModuleType::output;
 		}
 	}
 
@@ -221,19 +221,19 @@ JackDriver::create_port(PatchageModule& parent, jack_port_t* port, PortID id)
 #endif
 
 	const char* const type_str  = jack_port_type(port);
-	PortType          port_type = PortType::JACK_AUDIO;
+	PortType          port_type = PortType::jack_audio;
 	if (!strcmp(type_str, JACK_DEFAULT_AUDIO_TYPE)) {
-		port_type = PortType::JACK_AUDIO;
+		port_type = PortType::jack_audio;
 #ifdef HAVE_JACK_METADATA
 		if (get_property(uuid, JACKEY_SIGNAL_TYPE) == "CV") {
-			port_type = PortType::JACK_CV;
+			port_type = PortType::jack_cv;
 		}
 #endif
 	} else if (!strcmp(type_str, JACK_DEFAULT_MIDI_TYPE)) {
-		port_type = PortType::JACK_MIDI;
+		port_type = PortType::jack_midi;
 #ifdef HAVE_JACK_METADATA
 		if (get_property(uuid, JACKEY_EVENT_TYPES) == "OSC") {
-			port_type = PortType::JACK_OSC;
+			port_type = PortType::jack_osc;
 		}
 #endif
 	} else {
@@ -252,7 +252,7 @@ JackDriver::create_port(PatchageModule& parent, jack_port_t* port, PortID id)
 	                             _app->show_human_names(),
 	                             order);
 
-	if (id.type != PortID::Type::NULL_PORT_ID) {
+	if (id.type != PortID::Type::nothing) {
 		dynamic_cast<PatchageCanvas*>(parent.canvas())->index_port(id, ret);
 	}
 
@@ -304,13 +304,13 @@ JackDriver::refresh()
 		client1_name = ports[i];
 		client1_name = client1_name.substr(0, client1_name.find(":"));
 
-		ModuleType type = ModuleType::InputOutput;
+		ModuleType type = ModuleType::input_output;
 		if (_app->conf()->get_module_split(
 		        client1_name, (jack_port_flags(port) & JackPortIsTerminal))) {
 			if (jack_port_flags(port) & JackPortIsInput) {
-				type = ModuleType::Input;
+				type = ModuleType::input;
 			} else {
-				type = ModuleType::Output;
+				type = ModuleType::output;
 			}
 		}
 
@@ -339,8 +339,8 @@ JackDriver::refresh()
 		client1_name = client1_name.substr(0, colon);
 
 		const ModuleType port1_type = (jack_port_flags(port) & JackPortIsInput)
-		                                  ? ModuleType::Input
-		                                  : ModuleType::Output;
+		                                  ? ModuleType::input
+		                                  : ModuleType::output;
 
 		PatchageModule* client1_module =
 		    _app->canvas()->find_module(client1_name, port1_type);
@@ -353,9 +353,9 @@ JackDriver::refresh()
 				port2_name   = client2_name.substr(colon + 1);
 				client2_name = client2_name.substr(0, colon);
 
-				const ModuleType port2_type = (port1_type == ModuleType::Input)
-				                                  ? ModuleType::Output
-				                                  : ModuleType::Input;
+				const ModuleType port2_type = (port1_type == ModuleType::input)
+				                                  ? ModuleType::output
+				                                  : ModuleType::input;
 
 				PatchageModule* client2_module =
 				    _app->canvas()->find_module(client2_name, port2_type);
@@ -397,7 +397,7 @@ JackDriver::port_names(const PortID& id,
 {
 	jack_port_t* jack_port = nullptr;
 
-	if (id.type == PortID::Type::JACK_ID) {
+	if (id.type == PortID::Type::jack_id) {
 		jack_port = jack_port_by_id(_client, id.id.jack_id);
 	}
 
@@ -476,10 +476,10 @@ JackDriver::jack_client_registration_cb(const char* name,
 
 	if (registered) {
 		me->_events.push(
-		    PatchageEvent(PatchageEvent::Type::CLIENT_CREATION, name));
+		    PatchageEvent(PatchageEvent::Type::client_creation, name));
 	} else {
 		me->_events.push(
-		    PatchageEvent(PatchageEvent::Type::CLIENT_DESTRUCTION, name));
+		    PatchageEvent(PatchageEvent::Type::client_destruction, name));
 	}
 }
 
@@ -493,10 +493,10 @@ JackDriver::jack_port_registration_cb(jack_port_id_t port_id,
 
 	if (registered) {
 		me->_events.push(
-		    PatchageEvent(PatchageEvent::Type::PORT_CREATION, port_id));
+		    PatchageEvent(PatchageEvent::Type::port_creation, port_id));
 	} else {
 		me->_events.push(
-		    PatchageEvent(PatchageEvent::Type::PORT_DESTRUCTION, port_id));
+		    PatchageEvent(PatchageEvent::Type::port_destruction, port_id));
 	}
 }
 
@@ -511,10 +511,10 @@ JackDriver::jack_port_connect_cb(jack_port_id_t src,
 
 	if (connect) {
 		me->_events.push(
-		    PatchageEvent(PatchageEvent::Type::CONNECTION, src, dst));
+		    PatchageEvent(PatchageEvent::Type::connection, src, dst));
 	} else {
 		me->_events.push(
-		    PatchageEvent(PatchageEvent::Type::DISCONNECTION, src, dst));
+		    PatchageEvent(PatchageEvent::Type::disconnection, src, dst));
 	}
 }
 
-- 
cgit v1.2.1