diff options
author | David Robillard <d@drobilla.net> | 2020-11-27 17:57:42 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-27 21:42:51 +0100 |
commit | f9ff5a5586166ee2f44b43f347726f98c9a966af (patch) | |
tree | a6f13e24579d2f56e41744d15a27fe1250d532f4 /src/Configuration.hpp | |
parent | 47e93d947c4b5a468802c168be087b8145a67c62 (diff) | |
download | patchage-f9ff5a5586166ee2f44b43f347726f98c9a966af.tar.gz patchage-f9ff5a5586166ee2f44b43f347726f98c9a966af.tar.bz2 patchage-f9ff5a5586166ee2f44b43f347726f98c9a966af.zip |
Use enum classes
Diffstat (limited to 'src/Configuration.hpp')
-rw-r--r-- | src/Configuration.hpp | 14 |
1 files changed, 9 insertions, 5 deletions
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 <map> #include <string> -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<unsigned>(type)]; + } + + void set_port_color(PortType type, uint32_t rgba) + { + _port_colors[static_cast<unsigned>(type)] = rgba; } Coord get_window_location() { return _window_location; } |