diff options
author | David Robillard <d@drobilla.net> | 2021-01-02 14:02:44 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-01-02 14:02:44 +0100 |
commit | 663a5d01b1931b97370ed8feff3ae229a9cc7ea4 (patch) | |
tree | aba74794cb45f06734bd80bbf53d79f947008e54 /src/Legend.cpp | |
parent | 1936aace80b5594078d874e9b661a9a91e461279 (diff) | |
download | patchage-663a5d01b1931b97370ed8feff3ae229a9cc7ea4.tar.gz patchage-663a5d01b1931b97370ed8feff3ae229a9cc7ea4.tar.bz2 patchage-663a5d01b1931b97370ed8feff3ae229a9cc7ea4.zip |
Format all code with clang-format
Diffstat (limited to 'src/Legend.cpp')
-rw-r--r-- | src/Legend.cpp | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/src/Legend.cpp b/src/Legend.cpp index ff9fe4b..e8e4743 100644 --- a/src/Legend.cpp +++ b/src/Legend.cpp @@ -35,48 +35,47 @@ namespace patchage { Legend::Legend(const Configuration& configuration) { - add_button(PortType::jack_audio, - "Audio", - configuration.get_port_color(PortType::jack_audio)); + add_button(PortType::jack_audio, + "Audio", + configuration.get_port_color(PortType::jack_audio)); #ifdef HAVE_JACK_METADATA - 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)); + 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(PortType::jack_midi, - "MIDI", - configuration.get_port_color(PortType::jack_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)); + add_button(PortType::alsa_midi, + "ALSA MIDI", + configuration.get_port_color(PortType::alsa_midi)); - show_all_children(); + show_all_children(); } void Legend::add_button(const PortType 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); + Gdk::Color col; + col.set_rgb(((rgba >> 24) & 0xFF) * 0x100, + ((rgba >> 16) & 0xFF) * 0x100, + ((rgba >> 8) & 0xFF) * 0x100); - auto* box = new Gtk::HBox(); - auto* 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)); + auto* box = new Gtk::HBox(); + auto* 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)); - box->pack_end(*Gtk::manage(but)); - box->pack_end(*Gtk::manage(new Gtk::Label(label)), false, false, 2); + box->pack_end(*Gtk::manage(but)); + box->pack_end(*Gtk::manage(new Gtk::Label(label)), false, false, 2); - this->pack_start(*Gtk::manage(box), false, false, 6); + this->pack_start(*Gtk::manage(box), false, false, 6); } void @@ -84,12 +83,12 @@ Legend::on_color_set(const PortType id, const std::string& label, 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); + 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); - signal_color_changed.emit(id, label, rgba); + signal_color_changed.emit(id, label, rgba); } } // namespace patchage |