From af5ec4bdda21e9a2f76f22050216a0b1cbbed575 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 9 Feb 2020 14:34:20 +0100 Subject: Format all code with clang-format This configuration tries to get as close to the previous style as possible so the changes aren't too dramatic. It's still far from ideal and the code could use some adaptation, but this makes things much easier to work on. --- src/Legend.hpp | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'src/Legend.hpp') diff --git a/src/Legend.hpp b/src/Legend.hpp index 52a4851..9b2b63d 100644 --- a/src/Legend.hpp +++ b/src/Legend.hpp @@ -22,30 +22,34 @@ #include #include -class Legend : public Gtk::HBox { +class Legend : public Gtk::HBox +{ public: - Legend(const Configuration& configuration) { - add_button(JACK_AUDIO, "Audio", configuration.get_port_color(JACK_AUDIO)); + Legend(const Configuration& configuration) + { + add_button( + JACK_AUDIO, "Audio", configuration.get_port_color(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(JACK_CV, "CV", configuration.get_port_color(JACK_CV)); + add_button(JACK_OSC, "OSC", configuration.get_port_color(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(JACK_MIDI, "MIDI", configuration.get_port_color(JACK_MIDI)); + add_button( + ALSA_MIDI, "ALSA MIDI", configuration.get_port_color(ALSA_MIDI)); show_all_children(); } - void add_button(int id, const std::string& label, uint32_t rgba) { + void add_button(int id, const std::string& label, uint32_t rgba) + { Gdk::Color col; col.set_rgb(((rgba >> 24) & 0xFF) * 0x100, - ((rgba>> 16) & 0xFF) * 0x100, - ((rgba >> 8) & 0xFF) * 0x100); + ((rgba >> 16) & 0xFF) * 0x100, + ((rgba >> 8) & 0xFF) * 0x100); Gtk::HBox* box = new Gtk::HBox(); Gtk::ColorButton* but = new Gtk::ColorButton(col); but->set_use_alpha(false); - but->signal_color_set().connect( - sigc::bind(sigc::mem_fun(this, &Legend::on_color_set), - id, label, but)); + but->signal_color_set().connect(sigc::bind( + sigc::mem_fun(this, &Legend::on_color_set), id, label, but)); box->pack_end(*Gtk::manage(but)); box->pack_end(*Gtk::manage(new Gtk::Label(label)), false, false, 2); @@ -55,12 +59,12 @@ public: void on_color_set(const int id, const std::string& label, - const Gtk::ColorButton* but) { + const Gtk::ColorButton* but) + { const Gdk::Color col = but->get_color(); const uint32_t rgba = (((col.get_red() / 0x100) << 24) | - ((col.get_green() / 0x100) << 16) | - ((col.get_blue() / 0x100) << 8) | - 0xFF); + ((col.get_green() / 0x100) << 16) | + ((col.get_blue() / 0x100) << 8) | 0xFF); signal_color_changed.emit(id, label, rgba); } -- cgit v1.2.1