summaryrefslogtreecommitdiffstats
path: root/src/Legend.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-27 17:57:42 +0100
committerDavid Robillard <d@drobilla.net>2020-11-27 21:42:51 +0100
commitf9ff5a5586166ee2f44b43f347726f98c9a966af (patch)
treea6f13e24579d2f56e41744d15a27fe1250d532f4 /src/Legend.hpp
parent47e93d947c4b5a468802c168be087b8145a67c62 (diff)
downloadpatchage-f9ff5a5586166ee2f44b43f347726f98c9a966af.tar.gz
patchage-f9ff5a5586166ee2f44b43f347726f98c9a966af.tar.bz2
patchage-f9ff5a5586166ee2f44b43f347726f98c9a966af.zip
Use enum classes
Diffstat (limited to 'src/Legend.hpp')
-rw-r--r--src/Legend.hpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/Legend.hpp b/src/Legend.hpp
index b9e6b23..6887238 100644
--- a/src/Legend.hpp
+++ b/src/Legend.hpp
@@ -28,19 +28,31 @@ class Legend : public Gtk::HBox
public:
Legend(const Configuration& configuration)
{
- add_button(
- JACK_AUDIO, "Audio", configuration.get_port_color(JACK_AUDIO));
+ add_button(PortType::JACK_AUDIO,
+ "Audio",
+ configuration.get_port_color(PortType::JACK_AUDIO));
+
#ifdef HAVE_JACK_METADATA
- add_button(JACK_CV, "CV", configuration.get_port_color(JACK_CV));
- add_button(JACK_OSC, "OSC", configuration.get_port_color(JACK_OSC));
+ add_button(PortType::JACK_CV,
+ "CV",
+ configuration.get_port_color(PortType::JACK_CV));
+ add_button(PortType::JACK_OSC,
+ "OSC",
+ configuration.get_port_color(PortType::JACK_OSC));
#endif
- add_button(JACK_MIDI, "MIDI", configuration.get_port_color(JACK_MIDI));
- add_button(
- ALSA_MIDI, "ALSA MIDI", configuration.get_port_color(ALSA_MIDI));
+
+ add_button(PortType::JACK_MIDI,
+ "MIDI",
+ configuration.get_port_color(PortType::JACK_MIDI));
+
+ add_button(PortType::ALSA_MIDI,
+ "ALSA MIDI",
+ configuration.get_port_color(PortType::ALSA_MIDI));
+
show_all_children();
}
- void add_button(int id, const std::string& label, uint32_t rgba)
+ void add_button(const PortType id, const std::string& label, uint32_t rgba)
{
Gdk::Color col;
col.set_rgb(((rgba >> 24) & 0xFF) * 0x100,
@@ -58,7 +70,7 @@ public:
this->pack_start(*Gtk::manage(box), false, false, 6);
}
- void on_color_set(const int id,
+ void on_color_set(const PortType id,
const std::string& label,
const Gtk::ColorButton* but)
{
@@ -70,7 +82,7 @@ public:
signal_color_changed.emit(id, label, rgba);
}
- sigc::signal<void, int, std::string, uint32_t> signal_color_changed;
+ sigc::signal<void, PortType, std::string, uint32_t> signal_color_changed;
};
#endif // PATCHAGE_LEGEND_HPP