From f9ff5a5586166ee2f44b43f347726f98c9a966af Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 27 Nov 2020 17:57:42 +0100 Subject: Use enum classes --- src/Configuration.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/Configuration.hpp') diff --git a/src/Configuration.hpp b/src/Configuration.hpp index 27cd331..3ea564b 100644 --- a/src/Configuration.hpp +++ b/src/Configuration.hpp @@ -23,14 +23,14 @@ #include #include -enum ModuleType +enum class ModuleType { Input, Output, InputOutput }; -enum PortType +enum class PortType { JACK_AUDIO, JACK_MIDI, @@ -100,10 +100,14 @@ public: int get_messages_height() const { return _messages_height; } void set_messages_height(int height) { _messages_height = height; } - uint32_t get_port_color(PortType type) const { return _port_colors[type]; } - void set_port_color(PortType type, uint32_t rgba) + uint32_t get_port_color(PortType type) const { - _port_colors[type] = rgba; + return _port_colors[static_cast(type)]; + } + + void set_port_color(PortType type, uint32_t rgba) + { + _port_colors[static_cast(type)] = rgba; } Coord get_window_location() { return _window_location; } -- cgit v1.2.1