From 44381dbda9dbf8d20894789fe8e3ea941b70a1d0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 18 Aug 2022 01:20:27 -0400 Subject: Use default member initialization --- src/gui/.clang-tidy | 1 - src/gui/App.cpp | 9 --------- src/gui/App.hpp | 18 +++++++++--------- src/gui/BreadCrumbs.cpp | 1 - src/gui/BreadCrumbs.hpp | 2 +- src/gui/ConnectWindow.cpp | 21 --------------------- src/gui/ConnectWindow.hpp | 44 +++++++++++++++++++++---------------------- src/gui/GraphCanvas.cpp | 4 ---- src/gui/GraphCanvas.hpp | 8 ++++---- src/gui/GraphPortModule.cpp | 1 - src/gui/GraphPortModule.hpp | 2 +- src/gui/GraphTreeWindow.cpp | 2 -- src/gui/GraphTreeWindow.hpp | 7 +++---- src/gui/GraphWindow.cpp | 4 ---- src/gui/GraphWindow.hpp | 8 ++++---- src/gui/MessagesWindow.hpp | 6 +++--- src/gui/NewSubgraphWindow.hpp | 10 +++++----- src/gui/NodeMenu.cpp | 1 - src/gui/NodeMenu.hpp | 10 +++++----- src/gui/NodeModule.cpp | 3 --- src/gui/NodeModule.hpp | 8 ++++---- src/gui/ObjectMenu.cpp | 7 ------- src/gui/ObjectMenu.hpp | 22 +++++++++++----------- src/gui/PortMenu.cpp | 1 - src/gui/PortMenu.hpp | 12 ++++++------ src/gui/PropertiesWindow.cpp | 1 - src/gui/PropertiesWindow.hpp | 20 ++++++++++---------- src/gui/RenameWindow.hpp | 10 +++++----- src/gui/Style.cpp | 21 +++++++-------------- src/gui/Style.hpp | 11 ++++++----- src/gui/ThreadedLoader.cpp | 2 -- src/gui/ThreadedLoader.hpp | 4 ++-- src/gui/WindowFactory.cpp | 5 ----- src/gui/WindowFactory.hpp | 12 ++++++------ src/gui/ingen_gui_lv2.cpp | 18 ++++++------------ 35 files changed, 120 insertions(+), 196 deletions(-) (limited to 'src/gui') diff --git a/src/gui/.clang-tidy b/src/gui/.clang-tidy index 775b8cd7..065c97b1 100644 --- a/src/gui/.clang-tidy +++ b/src/gui/.clang-tidy @@ -3,7 +3,6 @@ Checks: > -*-avoid-c-arrays, -*-else-after-return, -*-magic-numbers, - -*-member-init, -*-named-parameter, -*-narrowing-conversions, -*-non-private-member-variables-in-classes, diff --git a/src/gui/App.cpp b/src/gui/App.cpp index 3187548a..20d8898f 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -83,15 +83,6 @@ App::App(ingen::World& world) : _style(new Style(*this)) , _window_factory(new WindowFactory(*this)) , _world(world) - , _sample_rate(48000) - , _block_length(1024) - , _n_threads(1) - , _mean_run_load(0.0f) - , _min_run_load(0.0f) - , _max_run_load(0.0f) - , _enable_signal(true) - , _requested_plugins(false) - , _is_plugin(false) { _world.conf().load_default("ingen", "gui.ttl"); diff --git a/src/gui/App.hpp b/src/gui/App.hpp index c09d1cd5..032f5eb4 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -177,20 +177,20 @@ protected: ingen::World& _world; - int32_t _sample_rate; - int32_t _block_length; - int32_t _n_threads; - float _mean_run_load; - float _min_run_load; - float _max_run_load; + int32_t _sample_rate{48000}; + int32_t _block_length{1024}; + int32_t _n_threads{1}; + float _mean_run_load{0.0f}; + float _min_run_load{0.0f}; + float _max_run_load{0.0f}; std::string _status_text; using ActivityPorts = std::unordered_map; ActivityPorts _activity_ports; - bool _enable_signal; - bool _requested_plugins; - bool _is_plugin; + bool _enable_signal{true}; + bool _requested_plugins{false}; + bool _is_plugin{false}; }; } // namespace gui diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp index 4e257d88..0cd2c5ad 100644 --- a/src/gui/BreadCrumbs.cpp +++ b/src/gui/BreadCrumbs.cpp @@ -37,7 +37,6 @@ using std::string; BreadCrumbs::BreadCrumbs(App& app) : _active_path("/") , _full_path("/") - , _enable_signal(true) { app.sig_client()->signal_message().connect( sigc::mem_fun(this, &BreadCrumbs::message)); diff --git a/src/gui/BreadCrumbs.hpp b/src/gui/BreadCrumbs.hpp index d877d0c5..9ed6f04a 100644 --- a/src/gui/BreadCrumbs.hpp +++ b/src/gui/BreadCrumbs.hpp @@ -118,7 +118,7 @@ private: raul::Path _active_path; raul::Path _full_path; - bool _enable_signal; + bool _enable_signal{true}; std::list _breadcrumbs; }; diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index ea1a6e27..a5e6fbd4 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -70,27 +70,6 @@ ConnectWindow::ConnectWindow(BaseObjectType* cobject, Glib::RefPtr xml) : Dialog(cobject) , _xml(std::move(xml)) - , _icon(nullptr) - , _progress_bar(nullptr) - , _progress_label(nullptr) - , _url_entry(nullptr) - , _server_radio(nullptr) - , _port_spinbutton(nullptr) - , _launch_radio(nullptr) - , _internal_radio(nullptr) - , _activate_button(nullptr) - , _deactivate_button(nullptr) - , _disconnect_button(nullptr) - , _connect_button(nullptr) - , _quit_button(nullptr) - , _mode(Mode::CONNECT_REMOTE) - , _connect_uri("unix:///tmp/ingen.sock") - , _ping_id(-1) - , _attached(false) - , _finished_connecting(false) - , _widgets_loaded(false) - , _connect_stage(0) - , _quit_flag(false) { } diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp index 6fc4dbfb..b0e03850 100644 --- a/src/gui/ConnectWindow.hpp +++ b/src/gui/ConnectWindow.hpp @@ -100,28 +100,28 @@ private: const Glib::RefPtr _xml; - Gtk::Image* _icon; - Gtk::ProgressBar* _progress_bar; - Gtk::Label* _progress_label; - Gtk::Entry* _url_entry; - Gtk::RadioButton* _server_radio; - Gtk::SpinButton* _port_spinbutton; - Gtk::RadioButton* _launch_radio; - Gtk::RadioButton* _internal_radio; - Gtk::Button* _activate_button; - Gtk::Button* _deactivate_button; - Gtk::Button* _disconnect_button; - Gtk::Button* _connect_button; - Gtk::Button* _quit_button; - - Mode _mode; - URI _connect_uri; - int32_t _ping_id; - bool _attached; - bool _finished_connecting; - bool _widgets_loaded; - int _connect_stage; - bool _quit_flag; + Gtk::Image* _icon{nullptr}; + Gtk::ProgressBar* _progress_bar{nullptr}; + Gtk::Label* _progress_label{nullptr}; + Gtk::Entry* _url_entry{nullptr}; + Gtk::RadioButton* _server_radio{nullptr}; + Gtk::SpinButton* _port_spinbutton{nullptr}; + Gtk::RadioButton* _launch_radio{nullptr}; + Gtk::RadioButton* _internal_radio{nullptr}; + Gtk::Button* _activate_button{nullptr}; + Gtk::Button* _deactivate_button{nullptr}; + Gtk::Button* _disconnect_button{nullptr}; + Gtk::Button* _connect_button{nullptr}; + Gtk::Button* _quit_button{nullptr}; + + Mode _mode{Mode::CONNECT_REMOTE}; + URI _connect_uri{"unix:///tmp/ingen.sock"}; + int32_t _ping_id{-1}; + bool _attached{false}; + bool _finished_connecting{false}; + bool _widgets_loaded{false}; + int _connect_stage{0}; + bool _quit_flag{false}; }; } // namespace gui diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp index 6b62e0de..636a3d9f 100644 --- a/src/gui/GraphCanvas.cpp +++ b/src/gui/GraphCanvas.cpp @@ -129,10 +129,6 @@ GraphCanvas::GraphCanvas(App& app, : Canvas(width, height) , _app(app) , _graph(std::move(graph)) - , _auto_position_count(0) - , _menu_x(0) - , _menu_y(0) - , _paste_count(0) { Glib::RefPtr xml = WidgetFactory::create("canvas_menu"); xml->get_widget("canvas_menu", _menu); diff --git a/src/gui/GraphCanvas.hpp b/src/gui/GraphCanvas.hpp index b1e60aa3..3ebd61df 100644 --- a/src/gui/GraphCanvas.hpp +++ b/src/gui/GraphCanvas.hpp @@ -141,12 +141,12 @@ private: using Views = std::map, Ganv::Module*>; Views _views; - int _auto_position_count; + int _auto_position_count{0}; std::pair _auto_position_scroll_offsets; - int _menu_x; - int _menu_y; - int _paste_count; + int _menu_x{0}; + int _menu_y{0}; + int _paste_count{0}; // Track pasted objects so they can be selected when they arrive std::set _pastees; diff --git a/src/gui/GraphPortModule.cpp b/src/gui/GraphPortModule.cpp index 3206f80b..a7e60444 100644 --- a/src/gui/GraphPortModule.cpp +++ b/src/gui/GraphPortModule.cpp @@ -50,7 +50,6 @@ GraphPortModule::GraphPortModule( const std::shared_ptr& model) : Ganv::Module(canvas, "", 0, 0, false) // FIXME: coords? , _model(model) - , _port(nullptr) { assert(model); diff --git a/src/gui/GraphPortModule.hpp b/src/gui/GraphPortModule.hpp index 5ce7ea57..b02f63a1 100644 --- a/src/gui/GraphPortModule.hpp +++ b/src/gui/GraphPortModule.hpp @@ -76,7 +76,7 @@ protected: void property_changed(const URI& key, const Atom& value); std::shared_ptr _model; - Port* _port; + Port* _port{nullptr}; }; } // namespace gui diff --git a/src/gui/GraphTreeWindow.cpp b/src/gui/GraphTreeWindow.cpp index 98b90ff0..7a787cb3 100644 --- a/src/gui/GraphTreeWindow.cpp +++ b/src/gui/GraphTreeWindow.cpp @@ -56,8 +56,6 @@ namespace gui { GraphTreeWindow::GraphTreeWindow(BaseObjectType* cobject, const Glib::RefPtr& xml) : Window(cobject) - , _graphs_treeview(nullptr) - , _enable_signal(true) { xml->get_widget_derived("graphs_treeview", _graphs_treeview); diff --git a/src/gui/GraphTreeWindow.hpp b/src/gui/GraphTreeWindow.hpp index 1a719a81..7c2a67b9 100644 --- a/src/gui/GraphTreeWindow.hpp +++ b/src/gui/GraphTreeWindow.hpp @@ -87,7 +87,7 @@ protected: find_graph(Gtk::TreeModel::Children root, const std::shared_ptr& graph); - GraphTreeView* _graphs_treeview; + GraphTreeView* _graphs_treeview{nullptr}; struct GraphTreeModelColumns : public Gtk::TreeModel::ColumnRecord { @@ -105,7 +105,7 @@ protected: GraphTreeModelColumns _graph_tree_columns; Glib::RefPtr _graph_treestore; Glib::RefPtr _graph_tree_selection; - bool _enable_signal; + bool _enable_signal{true}; }; /** Derived TreeView class to support context menus for graphs */ @@ -115,7 +115,6 @@ public: GraphTreeView(BaseObjectType* cobject, const Glib::RefPtr& xml) : Gtk::TreeView(cobject) - , _window(nullptr) {} void set_window(GraphTreeWindow* win) { _window = win; } @@ -131,7 +130,7 @@ public: } private: - GraphTreeWindow* _window; + GraphTreeWindow* _window{nullptr}; }; } // namespace gui diff --git a/src/gui/GraphWindow.cpp b/src/gui/GraphWindow.cpp index 38273a8e..94df34e0 100644 --- a/src/gui/GraphWindow.cpp +++ b/src/gui/GraphWindow.cpp @@ -32,10 +32,6 @@ namespace gui { GraphWindow::GraphWindow(BaseObjectType* cobject, const Glib::RefPtr& xml) : Window(cobject) - , _box(nullptr) - , _position_stored(false) - , _x(0) - , _y(0) { property_visible() = false; diff --git a/src/gui/GraphWindow.hpp b/src/gui/GraphWindow.hpp index 290e0e00..d1361ca5 100644 --- a/src/gui/GraphWindow.hpp +++ b/src/gui/GraphWindow.hpp @@ -85,10 +85,10 @@ protected: bool on_key_press_event(GdkEventKey* event) override; private: - GraphBox* _box; - bool _position_stored; - int _x; - int _y; + GraphBox* _box{nullptr}; + bool _position_stored{false}; + int _x{0}; + int _y{0}; }; } // namespace gui diff --git a/src/gui/MessagesWindow.hpp b/src/gui/MessagesWindow.hpp index ab82193d..45301889 100644 --- a/src/gui/MessagesWindow.hpp +++ b/src/gui/MessagesWindow.hpp @@ -67,9 +67,9 @@ private: std::mutex _mutex; std::stringstream _stream; - Gtk::TextView* _textview; - Gtk::Button* _clear_button; - Gtk::Button* _close_button; + Gtk::TextView* _textview{nullptr}; + Gtk::Button* _clear_button{nullptr}; + Gtk::Button* _close_button{nullptr}; Glib::RefPtr _error_tag; std::map< LV2_URID, Glib::RefPtr > _tags; diff --git a/src/gui/NewSubgraphWindow.hpp b/src/gui/NewSubgraphWindow.hpp index 9897e6c2..a3f9c713 100644 --- a/src/gui/NewSubgraphWindow.hpp +++ b/src/gui/NewSubgraphWindow.hpp @@ -68,11 +68,11 @@ private: Properties _initial_data; std::shared_ptr _graph; - Gtk::Entry* _name_entry; - Gtk::Label* _message_label; - Gtk::SpinButton* _poly_spinbutton; - Gtk::Button* _ok_button; - Gtk::Button* _cancel_button; + Gtk::Entry* _name_entry{nullptr}; + Gtk::Label* _message_label{nullptr}; + Gtk::SpinButton* _poly_spinbutton{nullptr}; + Gtk::Button* _ok_button{nullptr}; + Gtk::Button* _cancel_button{nullptr}; }; } // namespace gui diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index 517d0018..faddaae7 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -68,7 +68,6 @@ namespace gui { NodeMenu::NodeMenu(BaseObjectType* cobject, const Glib::RefPtr& xml) : ObjectMenu(cobject, xml) - , _presets_menu(nullptr) { xml->get_widget("node_popup_gui_menuitem", _popup_gui_menuitem); xml->get_widget("node_embed_gui_menuitem", _embed_gui_menuitem); diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp index 8a1e5f06..f109c3e4 100644 --- a/src/gui/NodeMenu.hpp +++ b/src/gui/NodeMenu.hpp @@ -79,11 +79,11 @@ protected: void on_save_preset_activated(); void on_preset_activated(const std::string& uri); - Gtk::MenuItem* _popup_gui_menuitem; - Gtk::CheckMenuItem* _embed_gui_menuitem; - Gtk::CheckMenuItem* _enabled_menuitem; - Gtk::MenuItem* _randomize_menuitem; - Gtk::Menu* _presets_menu; + Gtk::MenuItem* _popup_gui_menuitem{nullptr}; + Gtk::CheckMenuItem* _embed_gui_menuitem{nullptr}; + Gtk::CheckMenuItem* _enabled_menuitem{nullptr}; + Gtk::MenuItem* _randomize_menuitem{nullptr}; + Gtk::Menu* _presets_menu{nullptr}; sigc::connection _preset_connection; }; diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 1dbd1cd9..c80947cb 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -78,9 +78,6 @@ NodeModule::NodeModule(GraphCanvas& canvas, const std::shared_ptr& block) : Ganv::Module(canvas, block->path().symbol(), 0, 0, true) , _block(block) - , _gui_widget(nullptr) - , _gui_window(nullptr) - , _initialised(false) { block->signal_new_port().connect( sigc::mem_fun(this, &NodeModule::new_port_view)); diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp index 1ca7955c..f94a10e9 100644 --- a/src/gui/NodeModule.hpp +++ b/src/gui/NodeModule.hpp @@ -106,11 +106,11 @@ protected: bool show_menu(GdkEventButton* ev); std::shared_ptr _block; - NodeMenu* _menu; + NodeMenu* _menu{nullptr}; std::shared_ptr _plugin_ui; - Gtk::Widget* _gui_widget; - Gtk::Window* _gui_window; ///< iff popped up - bool _initialised; + Gtk::Widget* _gui_widget{nullptr}; + Gtk::Window* _gui_window{nullptr}; ///< iff popped up + bool _initialised{false}; }; } // namespace gui diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp index 5f78144f..87f6f9e9 100644 --- a/src/gui/ObjectMenu.cpp +++ b/src/gui/ObjectMenu.cpp @@ -45,13 +45,6 @@ namespace gui { ObjectMenu::ObjectMenu(BaseObjectType* cobject, const Glib::RefPtr& xml) : Gtk::Menu(cobject) - , _app(nullptr) - , _polyphonic_menuitem(nullptr) - , _disconnect_menuitem(nullptr) - , _rename_menuitem(nullptr) - , _destroy_menuitem(nullptr) - , _properties_menuitem(nullptr) - , _enable_signal(false) { xml->get_widget("object_learn_menuitem", _learn_menuitem); xml->get_widget("object_unlearn_menuitem", _unlearn_menuitem); diff --git a/src/gui/ObjectMenu.hpp b/src/gui/ObjectMenu.hpp index 214c8307..de105364 100644 --- a/src/gui/ObjectMenu.hpp +++ b/src/gui/ObjectMenu.hpp @@ -76,18 +76,18 @@ protected: void property_changed(const URI& predicate, const Atom& value); - App* _app; + App* _app{nullptr}; std::shared_ptr _object; - Gtk::MenuItem* _learn_menuitem; - Gtk::MenuItem* _unlearn_menuitem; - Gtk::CheckMenuItem* _polyphonic_menuitem; - Gtk::MenuItem* _disconnect_menuitem; - Gtk::MenuItem* _rename_menuitem; - Gtk::MenuItem* _destroy_menuitem; - Gtk::MenuItem* _properties_menuitem; - Gtk::SeparatorMenuItem* _separator_menuitem; - - bool _enable_signal; + Gtk::MenuItem* _learn_menuitem{nullptr}; + Gtk::MenuItem* _unlearn_menuitem{nullptr}; + Gtk::CheckMenuItem* _polyphonic_menuitem{nullptr}; + Gtk::MenuItem* _disconnect_menuitem{nullptr}; + Gtk::MenuItem* _rename_menuitem{nullptr}; + Gtk::MenuItem* _destroy_menuitem{nullptr}; + Gtk::MenuItem* _properties_menuitem{nullptr}; + Gtk::SeparatorMenuItem* _separator_menuitem{nullptr}; + + bool _enable_signal{false}; }; } // namespace gui diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index 652ac05d..500c48d1 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -55,7 +55,6 @@ namespace gui { PortMenu::PortMenu(BaseObjectType* cobject, const Glib::RefPtr& xml) : ObjectMenu(cobject, xml) - , _internal_graph_port(false) { xml->get_widget("object_menu", _port_menu); xml->get_widget("port_set_min_menuitem", _set_min_menuitem); diff --git a/src/gui/PortMenu.hpp b/src/gui/PortMenu.hpp index 75a25cde..71a5f48b 100644 --- a/src/gui/PortMenu.hpp +++ b/src/gui/PortMenu.hpp @@ -63,14 +63,14 @@ private: void on_menu_reset_range(); void on_menu_expose(); - Gtk::Menu* _port_menu; - Gtk::MenuItem* _set_min_menuitem; - Gtk::MenuItem* _set_max_menuitem; - Gtk::MenuItem* _reset_range_menuitem; - Gtk::MenuItem* _expose_menuitem; + Gtk::Menu* _port_menu{nullptr}; + Gtk::MenuItem* _set_min_menuitem{nullptr}; + Gtk::MenuItem* _set_max_menuitem{nullptr}; + Gtk::MenuItem* _reset_range_menuitem{nullptr}; + Gtk::MenuItem* _expose_menuitem{nullptr}; /// True iff this is a (flipped) port on a GraphPortModule in its graph - bool _internal_graph_port; + bool _internal_graph_port{false}; }; } // namespace gui diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp index cd2a6bd1..3390c53e 100644 --- a/src/gui/PropertiesWindow.cpp +++ b/src/gui/PropertiesWindow.cpp @@ -76,7 +76,6 @@ using URISet = std::set; PropertiesWindow::PropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr& xml) : Window(cobject) - , _value_type(0) { xml->get_widget("properties_vbox", _vbox); xml->get_widget("properties_scrolledwindow", _scrolledwindow); diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp index 780c2ba1..e51b1ac6 100644 --- a/src/gui/PropertiesWindow.hpp +++ b/src/gui/PropertiesWindow.hpp @@ -129,16 +129,16 @@ private: Glib::RefPtr _key_store; sigc::connection _property_connection; sigc::connection _property_removed_connection; - Gtk::VBox* _vbox; - Gtk::ScrolledWindow* _scrolledwindow; - Gtk::Table* _table; - Gtk::ComboBox* _key_combo; - LV2_URID _value_type; - Gtk::Bin* _value_bin; - Gtk::Button* _add_button; - Gtk::Button* _cancel_button; - Gtk::Button* _apply_button; - Gtk::Button* _ok_button; + Gtk::VBox* _vbox{nullptr}; + Gtk::ScrolledWindow* _scrolledwindow{nullptr}; + Gtk::Table* _table{nullptr}; + Gtk::ComboBox* _key_combo{nullptr}; + LV2_URID _value_type{0}; + Gtk::Bin* _value_bin{nullptr}; + Gtk::Button* _add_button{nullptr}; + Gtk::Button* _cancel_button{nullptr}; + Gtk::Button* _apply_button{nullptr}; + Gtk::Button* _ok_button{nullptr}; }; } // namespace gui diff --git a/src/gui/RenameWindow.hpp b/src/gui/RenameWindow.hpp index 004ca784..42db3ff6 100644 --- a/src/gui/RenameWindow.hpp +++ b/src/gui/RenameWindow.hpp @@ -63,11 +63,11 @@ private: std::shared_ptr _object; - Gtk::Entry* _symbol_entry; - Gtk::Entry* _label_entry; - Gtk::Label* _message_label; - Gtk::Button* _cancel_button; - Gtk::Button* _ok_button; + Gtk::Entry* _symbol_entry{nullptr}; + Gtk::Entry* _label_entry{nullptr}; + Gtk::Label* _message_label{nullptr}; + Gtk::Button* _cancel_button{nullptr}; + Gtk::Button* _ok_button{nullptr}; }; } // namespace gui diff --git a/src/gui/Style.cpp b/src/gui/Style.cpp index 5be83688..7b9e4dc7 100644 --- a/src/gui/Style.cpp +++ b/src/gui/Style.cpp @@ -27,22 +27,15 @@ namespace ingen { namespace gui { Style::Style(App& app) - // Colours from the Tango palette with modified V - : _app(app) + : _app(app) +{ #ifdef INGEN_USE_LIGHT_THEME - , _audio_port_color(0xC8E6ABFF) // Green - , _control_port_color(0xAAC0E6FF) // Blue - , _cv_port_color(0xACE6E0FF) // Teal (between audio and control) - , _event_port_color(0xE6ABABFF) // Red - , _string_port_color(0xD8ABE6FF) // Plum -#else - , _audio_port_color(0x4A8A0EFF) // Green - , _control_port_color(0x244678FF) // Blue - , _cv_port_color(0x248780FF) // Teal (between audio and control) - , _event_port_color(0x960909FF) // Red - , _string_port_color(0x5C3566FF) // Plum + _audio_port_color = 0xC8E6ABFF; + _control_port_color = 0xAAC0E6FF; + _cv_port_color = 0xACE6E0FF; + _event_port_color = 0xE6ABABFF; + _string_port_color = 0xD8ABE6FF; #endif -{ } /** Loads settings from the rc file. Passing no parameter will load from diff --git a/src/gui/Style.hpp b/src/gui/Style.hpp index bc94d64a..20d560a8 100644 --- a/src/gui/Style.hpp +++ b/src/gui/Style.hpp @@ -45,11 +45,12 @@ public: private: App& _app; - uint32_t _audio_port_color; - uint32_t _control_port_color; - uint32_t _cv_port_color; - uint32_t _event_port_color; - uint32_t _string_port_color; + // Colours from the Tango palette with modified V + uint32_t _audio_port_color{0x4A8A0EFF}; // Green + uint32_t _control_port_color{0x244678FF}; // Blue + uint32_t _cv_port_color{0x248780FF}; // Teal {between audio/control} + uint32_t _event_port_color{0x960909FF}; // Red + uint32_t _string_port_color{0x5C3566FF}; // Plum }; } // namespace gui diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp index 663529da..7c5fdd99 100644 --- a/src/gui/ThreadedLoader.cpp +++ b/src/gui/ThreadedLoader.cpp @@ -49,9 +49,7 @@ namespace gui { ThreadedLoader::ThreadedLoader(App& app, std::shared_ptr engine) : _app(app) - , _sem(0) , _engine(std::move(engine)) - , _exit_flag(false) , _thread(&ThreadedLoader::run, this) { if (!parser()) { diff --git a/src/gui/ThreadedLoader.hpp b/src/gui/ThreadedLoader.hpp index 5e9392bc..6466fb1d 100644 --- a/src/gui/ThreadedLoader.hpp +++ b/src/gui/ThreadedLoader.hpp @@ -95,11 +95,11 @@ private: void run(); App& _app; - raul::Semaphore _sem; + raul::Semaphore _sem{0}; std::shared_ptr _engine; std::mutex _mutex; std::list _events; - bool _exit_flag; + bool _exit_flag{false}; std::thread _thread; }; diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index b4117b08..973a236b 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -52,11 +52,6 @@ namespace gui { WindowFactory::WindowFactory(App& app) : _app(app) - , _main_box(nullptr) - , _load_plugin_win(nullptr) - , _load_graph_win(nullptr) - , _new_subgraph_win(nullptr) - , _properties_win(nullptr) { WidgetFactory::get_widget_derived("load_plugin_win", _load_plugin_win); WidgetFactory::get_widget_derived("load_graph_win", _load_graph_win); diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp index a93bb89f..d4fe8d22 100644 --- a/src/gui/WindowFactory.hpp +++ b/src/gui/WindowFactory.hpp @@ -107,13 +107,13 @@ private: const std::shared_ptr& view); App& _app; - GraphBox* _main_box; + GraphBox* _main_box{nullptr}; GraphWindowMap _graph_windows; - LoadPluginWindow* _load_plugin_win; - LoadGraphWindow* _load_graph_win; - NewSubgraphWindow* _new_subgraph_win; - PropertiesWindow* _properties_win; - RenameWindow* _rename_win; + LoadPluginWindow* _load_plugin_win{nullptr}; + LoadGraphWindow* _load_graph_win{nullptr}; + NewSubgraphWindow* _new_subgraph_win{nullptr}; + PropertiesWindow* _properties_win{nullptr}; + RenameWindow* _rename_win{nullptr}; }; } // namespace gui diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp index ffa50779..d80d92c0 100644 --- a/src/gui/ingen_gui_lv2.cpp +++ b/src/gui/ingen_gui_lv2.cpp @@ -73,19 +73,13 @@ struct IngenLV2AtomSink : public AtomSink { }; struct IngenLV2UI { - IngenLV2UI() - : argc(0) - , argv(nullptr) - , forge(nullptr) - , world(nullptr) - , sink(nullptr) - {} + IngenLV2UI() = default; - int argc; - char** argv; - Forge* forge; - World* world; - IngenLV2AtomSink* sink; + int argc{0}; + char** argv{nullptr}; + Forge* forge{nullptr}; + World* world{nullptr}; + IngenLV2AtomSink* sink{nullptr}; std::shared_ptr app; std::shared_ptr view; std::shared_ptr engine; -- cgit v1.2.1