diff options
author | David Robillard <d@drobilla.net> | 2020-02-09 14:34:20 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-02-09 14:34:20 +0100 |
commit | af5ec4bdda21e9a2f76f22050216a0b1cbbed575 (patch) | |
tree | f93ddc033b70297abb472f7e28a06f9e936cf0ee /src/PatchageModule.cpp | |
parent | c321c02a6b9c67b4b106e36a77167ee279b9ef78 (diff) | |
download | patchage-af5ec4bdda21e9a2f76f22050216a0b1cbbed575.tar.gz patchage-af5ec4bdda21e9a2f76f22050216a0b1cbbed575.tar.bz2 patchage-af5ec4bdda21e9a2f76f22050216a0b1cbbed575.zip |
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.
Diffstat (limited to 'src/PatchageModule.cpp')
-rw-r--r-- | src/PatchageModule.cpp | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/src/PatchageModule.cpp b/src/PatchageModule.cpp index 5f3c8c0..db61392 100644 --- a/src/PatchageModule.cpp +++ b/src/PatchageModule.cpp @@ -20,19 +20,21 @@ #include "PatchageCanvas.hpp" #include "PatchagePort.hpp" -PatchageModule::PatchageModule( - Patchage* app, const std::string& name, ModuleType type, double x, double y) - : Module(*app->canvas().get(), name, x, y) - , _app(app) - , _menu(NULL) - , _name(name) - , _type(type) +PatchageModule::PatchageModule(Patchage* app, + const std::string& name, + ModuleType type, + double x, + double y) + : Module(*app->canvas().get(), name, x, y) + , _app(app) + , _menu(NULL) + , _name(name) + , _type(type) { - signal_event().connect( - sigc::mem_fun(this, &PatchageModule::on_event)); + signal_event().connect(sigc::mem_fun(this, &PatchageModule::on_event)); signal_moved().connect( - sigc::mem_fun(this, &PatchageModule::store_location)); + sigc::mem_fun(this, &PatchageModule::store_location)); // Set as source by default, turned off if input ports added set_is_source(true); @@ -72,22 +74,19 @@ PatchageModule::update_menu() bool PatchageModule::show_menu(GdkEventButton* ev) { - _menu = new Gtk::Menu(); + _menu = new Gtk::Menu(); Gtk::Menu::MenuList& items = _menu->items(); if (_type == InputOutput) { - items.push_back( - Gtk::Menu_Helpers::MenuElem( - "_Split", sigc::mem_fun(this, &PatchageModule::split))); + items.push_back(Gtk::Menu_Helpers::MenuElem( + "_Split", sigc::mem_fun(this, &PatchageModule::split))); update_menu(); } else { - items.push_back( - Gtk::Menu_Helpers::MenuElem( - "_Join", sigc::mem_fun(this, &PatchageModule::join))); + items.push_back(Gtk::Menu_Helpers::MenuElem( + "_Join", sigc::mem_fun(this, &PatchageModule::join))); } - items.push_back( - Gtk::Menu_Helpers::MenuElem( - "_Disconnect All", - sigc::mem_fun(this, &PatchageModule::menu_disconnect_all))); + items.push_back(Gtk::Menu_Helpers::MenuElem( + "_Disconnect All", + sigc::mem_fun(this, &PatchageModule::menu_disconnect_all))); _menu->popup(ev->button, ev->time); return true; @@ -110,8 +109,7 @@ PatchageModule::load_location() if (_app->conf()->get_module_location(_name, _type, loc)) move_to(loc.x, loc.y); else - move_to(20 + rand() % 640, - 20 + rand() % 480); + move_to(20 + rand() % 640, 20 + rand() % 480); } void |