From 04b4d70f38402b1e4e4751157f42eb558bd60f9c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 23 Sep 2018 19:06:25 +0200 Subject: Use override specifiers --- ingen/client/ArcModel.hpp | 4 ++-- ingen/client/BlockModel.hpp | 22 +++++++++---------- ingen/client/GraphModel.hpp | 8 +++---- ingen/client/ObjectModel.hpp | 19 +++++++++-------- ingen/client/PluginModel.hpp | 2 +- ingen/client/PortModel.hpp | 10 ++++----- src/client/ingen_client.cpp | 2 +- src/gui/ConnectWindow.hpp | 4 ++-- src/gui/GraphCanvas.hpp | 2 +- src/gui/GraphPortModule.hpp | 2 +- src/gui/GraphTreeWindow.hpp | 2 +- src/gui/GraphWindow.hpp | 8 +++---- src/gui/LoadGraphWindow.hpp | 2 +- src/gui/LoadPluginWindow.hpp | 4 ++-- src/gui/MessagesWindow.hpp | 2 +- src/gui/NodeMenu.hpp | 2 +- src/gui/NodeModule.hpp | 4 ++-- src/gui/Port.hpp | 4 ++-- src/gui/PortMenu.hpp | 2 +- src/gui/PropertiesWindow.hpp | 2 +- src/gui/SubgraphModule.hpp | 4 ++-- src/gui/Window.hpp | 4 ++-- src/gui/ingen_gui.cpp | 4 ++-- src/gui/ingen_gui_lv2.cpp | 2 +- src/server/ArcImpl.hpp | 4 ++-- src/server/BlockImpl.hpp | 15 ++++++------- src/server/DirectDriver.hpp | 38 +++++++++++++++++---------------- src/server/DuplexPort.hpp | 24 +++++++++++---------- src/server/Engine.hpp | 30 +++++++++++++------------- src/server/GraphImpl.hpp | 16 +++++++------- src/server/GraphPlugin.hpp | 6 +++--- src/server/InputPort.hpp | 18 +++++++++------- src/server/InternalBlock.hpp | 4 ++-- src/server/InternalPlugin.hpp | 4 ++-- src/server/JackDriver.hpp | 41 +++++++++++++++++++----------------- src/server/LV2Block.hpp | 26 +++++++++++------------ src/server/LV2Options.hpp | 4 ++-- src/server/LV2Plugin.hpp | 10 ++++----- src/server/NodeImpl.hpp | 12 +++++------ src/server/PortAudioDriver.hpp | 32 ++++++++++++++-------------- src/server/PortImpl.hpp | 6 +++--- src/server/PostProcessor.cpp | 6 +++--- src/server/UndoStack.hpp | 2 +- src/server/Worker.hpp | 4 ++-- src/server/events/Connect.hpp | 8 +++---- src/server/events/Copy.hpp | 8 +++---- src/server/events/CreateBlock.hpp | 8 +++---- src/server/events/CreateGraph.hpp | 8 +++---- src/server/events/CreatePort.hpp | 8 +++---- src/server/events/Delete.hpp | 8 +++---- src/server/events/Delta.hpp | 10 ++++----- src/server/events/Disconnect.hpp | 8 +++---- src/server/events/DisconnectAll.hpp | 8 +++---- src/server/events/Get.hpp | 6 +++--- src/server/events/Mark.hpp | 8 +++---- src/server/events/Move.hpp | 8 +++---- src/server/events/SetPortValue.hpp | 6 +++--- src/server/events/Undo.hpp | 6 +++--- src/server/ingen_engine.cpp | 2 +- src/server/ingen_jack.cpp | 2 +- src/server/ingen_lv2.cpp | 42 ++++++++++++++++++------------------- src/server/ingen_portaudio.cpp | 2 +- src/server/internals/BlockDelay.hpp | 4 ++-- src/server/internals/Controller.hpp | 4 ++-- src/server/internals/Note.hpp | 6 +++--- src/server/internals/Time.hpp | 2 +- src/server/internals/Trigger.hpp | 4 ++-- 67 files changed, 304 insertions(+), 295 deletions(-) diff --git a/ingen/client/ArcModel.hpp b/ingen/client/ArcModel.hpp index 84b989a0..3016266e 100644 --- a/ingen/client/ArcModel.hpp +++ b/ingen/client/ArcModel.hpp @@ -41,8 +41,8 @@ public: SPtr tail() const { return _tail; } SPtr head() const { return _head; } - const Raul::Path& tail_path() const { return _tail->path(); } - const Raul::Path& head_path() const { return _head->path(); } + const Raul::Path& tail_path() const override { return _tail->path(); } + const Raul::Path& head_path() const override { return _head->path(); } private: friend class ClientStore; diff --git a/ingen/client/BlockModel.hpp b/ingen/client/BlockModel.hpp index da1da734..4dfd35d7 100644 --- a/ingen/client/BlockModel.hpp +++ b/ingen/client/BlockModel.hpp @@ -49,21 +49,21 @@ public: BlockModel(const BlockModel& copy); virtual ~BlockModel(); - GraphType graph_type() const { return Node::GraphType::BLOCK; } + GraphType graph_type() const override { return Node::GraphType::BLOCK; } typedef std::vector< SPtr > Ports; SPtr get_port(const Raul::Symbol& symbol) const; SPtr get_port(uint32_t index) const; - Node* port(uint32_t index) const; + Node* port(uint32_t index) const override; - const URI& plugin_uri() const { return _plugin_uri; } - const Resource* plugin() const { return _plugin.get(); } - Resource* plugin() { return _plugin.get(); } - SPtr plugin_model() const { return _plugin; } - uint32_t num_ports() const { return _ports.size(); } - const Ports& ports() const { return _ports; } + const URI& plugin_uri() const { return _plugin_uri; } + const Resource* plugin() const override { return _plugin.get(); } + Resource* plugin() { return _plugin.get(); } + SPtr plugin_model() const { return _plugin; } + uint32_t num_ports() const override { return _ports.size(); } + const Ports& ports() const { return _ports; } void default_port_value_range(SPtr port, float& min, @@ -93,12 +93,12 @@ protected: const Raul::Path& path); explicit BlockModel(const Raul::Path& path); - void add_child(SPtr c); - bool remove_child(SPtr c); + void add_child(SPtr c) override; + bool remove_child(SPtr c) override; void add_port(SPtr pm); void remove_port(SPtr port); void remove_port(const Raul::Path& port_path); - void set(SPtr model); + void set(SPtr model) override; virtual void clear(); diff --git a/ingen/client/GraphModel.hpp b/ingen/client/GraphModel.hpp index d5f4904a..659ded9e 100644 --- a/ingen/client/GraphModel.hpp +++ b/ingen/client/GraphModel.hpp @@ -36,7 +36,7 @@ class INGEN_API GraphModel : public BlockModel public: /* WARNING: Copy constructor creates a shallow copy WRT connections */ - GraphType graph_type() const { return Node::GraphType::GRAPH; } + GraphType graph_type() const override { return Node::GraphType::GRAPH; } SPtr get_arc(const ingen::Node* tail, const ingen::Node* head); @@ -58,9 +58,9 @@ private: : BlockModel(uris, uris.ingen_Graph, graph_path) {} - void clear(); - void add_child(SPtr c); - bool remove_child(SPtr o); + void clear() override; + void add_child(SPtr c) override; + bool remove_child(SPtr o) override; void remove_arcs_on(SPtr p); void add_arc(SPtr arc); diff --git a/ingen/client/ObjectModel.hpp b/ingen/client/ObjectModel.hpp index 62b115e3..0c517ccf 100644 --- a/ingen/client/ObjectModel.hpp +++ b/ingen/client/ObjectModel.hpp @@ -57,17 +57,18 @@ class INGEN_API ObjectModel : public Node public: bool is_a(const URIs::Quark& type) const; - const Atom& get_property(const URI& key) const; + const Atom& get_property(const URI& key) const override; - void on_property(const URI& uri, const Atom& value); - void on_property_removed(const URI& uri, const Atom& value); + void on_property(const URI& uri, const Atom& value) override; + void on_property_removed(const URI& uri, const Atom& value) override; - const Raul::Path& path() const { return _path; } - const Raul::Symbol& symbol() const { return _symbol; } - SPtr parent() const { return _parent; } - bool polyphonic() const; + const Raul::Path& path() const override { return _path; } + const Raul::Symbol& symbol() const override { return _symbol; } - Node* graph_parent() const { return _parent.get(); } + SPtr parent() const { return _parent; } + bool polyphonic() const; + + Node* graph_parent() const override { return _parent.get(); } // Signals INGEN_SIGNAL(new_child, void, SPtr); @@ -83,7 +84,7 @@ protected: ObjectModel(URIs& uris, const Raul::Path& path); ObjectModel(const ObjectModel& copy); - virtual void set_path(const Raul::Path& p); + void set_path(const Raul::Path& p) override; virtual void set_parent(SPtr p); virtual void add_child(SPtr c) {} virtual bool remove_child(SPtr c) { return true; } diff --git a/ingen/client/PluginModel.hpp b/ingen/client/PluginModel.hpp index 381d289b..97fbd2a0 100644 --- a/ingen/client/PluginModel.hpp +++ b/ingen/client/PluginModel.hpp @@ -62,7 +62,7 @@ public: : "http://www.w3.org/2002/07/owl#Nothing"); } - virtual const Atom& get_property(const URI& key) const; + const Atom& get_property(const URI& key) const override; Raul::Symbol default_block_symbol() const; std::string human_name() const; diff --git a/ingen/client/PortModel.hpp b/ingen/client/PortModel.hpp index a544b00b..fcb46c4f 100644 --- a/ingen/client/PortModel.hpp +++ b/ingen/client/PortModel.hpp @@ -40,7 +40,7 @@ class INGEN_API PortModel : public ObjectModel public: enum class Direction { INPUT, OUTPUT }; - GraphType graph_type() const { return Node::GraphType::PORT; } + GraphType graph_type() const override { return Node::GraphType::PORT; } bool supports(const URIs::Quark& value_type) const; @@ -63,7 +63,7 @@ public: inline bool operator==(const PortModel& pm) const { return (path() == pm.path()); } - void on_property(const URI& uri, const Atom& value); + void on_property(const URI& uri, const Atom& value) override; // Signals INGEN_SIGNAL(value_changed, void, const Atom&); @@ -82,10 +82,10 @@ private: , _direction(dir) {} - void add_child(SPtr c) { throw; } - bool remove_child(SPtr c) { throw; } + void add_child(SPtr c) override { throw; } + bool remove_child(SPtr c) override { throw; } - void set(SPtr model); + void set(SPtr model) override; uint32_t _index; Direction _direction; diff --git a/src/client/ingen_client.cpp b/src/client/ingen_client.cpp index 64162ed6..0660b66d 100644 --- a/src/client/ingen_client.cpp +++ b/src/client/ingen_client.cpp @@ -20,7 +20,7 @@ #include "ingen_config.h" struct IngenClientModule : public ingen::Module { - void load(ingen::World* world) {} + void load(ingen::World* world) override {} }; extern "C" { diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp index a6874dfc..151b8e92 100644 --- a/src/gui/ConnectWindow.hpp +++ b/src/gui/ConnectWindow.hpp @@ -75,8 +75,8 @@ private: void activate(); void deactivate(); void quit_clicked(); - void on_show(); - void on_hide(); + void on_show() override; + void on_hide() override; void load_widgets(); void set_connecting_widget_states(); diff --git a/src/gui/GraphCanvas.hpp b/src/gui/GraphCanvas.hpp index 86e47faa..509b0a4a 100644 --- a/src/gui/GraphCanvas.hpp +++ b/src/gui/GraphCanvas.hpp @@ -73,7 +73,7 @@ public: void get_new_module_location(double& x, double& y); - void clear_selection(); + void clear_selection() override; void destroy_selection(); void copy_selection(); void paste(); diff --git a/src/gui/GraphPortModule.hpp b/src/gui/GraphPortModule.hpp index 2e060eae..548b7267 100644 --- a/src/gui/GraphPortModule.hpp +++ b/src/gui/GraphPortModule.hpp @@ -63,7 +63,7 @@ protected: SPtr model); bool show_menu(GdkEventButton* ev); - void set_selected(gboolean b); + void set_selected(gboolean b) override; void set_port(Port* port) { _port = port; } diff --git a/src/gui/GraphTreeWindow.hpp b/src/gui/GraphTreeWindow.hpp index 3991671d..9ab05f94 100644 --- a/src/gui/GraphTreeWindow.hpp +++ b/src/gui/GraphTreeWindow.hpp @@ -103,7 +103,7 @@ public: void set_window(GraphTreeWindow* win) { _window = win; } - bool on_button_press_event(GdkEventButton* ev) { + bool on_button_press_event(GdkEventButton* ev) override { bool ret = Gtk::TreeView::on_button_press_event(ev); if ((ev->type == GDK_BUTTON_PRESS) && (ev->button == 3)) diff --git a/src/gui/GraphWindow.hpp b/src/gui/GraphWindow.hpp index 69b8a3d4..bdcda312 100644 --- a/src/gui/GraphWindow.hpp +++ b/src/gui/GraphWindow.hpp @@ -46,7 +46,7 @@ public: ~GraphWindow(); - void init_window(App& app); + void init_window(App& app) override; SPtr graph() const { return _box->graph(); } GraphBox* box() const { return _box; } @@ -63,9 +63,9 @@ public: } protected: - void on_hide(); - void on_show(); - bool on_key_press_event(GdkEventKey* event); + void on_hide() override; + void on_show() override; + bool on_key_press_event(GdkEventKey* event) override; private: GraphBox* _box; diff --git a/src/gui/LoadGraphWindow.hpp b/src/gui/LoadGraphWindow.hpp index d4b36a26..03cb8c05 100644 --- a/src/gui/LoadGraphWindow.hpp +++ b/src/gui/LoadGraphWindow.hpp @@ -55,7 +55,7 @@ public: Properties data); protected: - void on_show(); + void on_show() override; private: void merge_ports_selected(); diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp index dcea9d6b..0e6226c9 100644 --- a/src/gui/LoadPluginWindow.hpp +++ b/src/gui/LoadPluginWindow.hpp @@ -63,8 +63,8 @@ public: Properties data); protected: - void on_show(); - bool on_key_press_event(GdkEventKey* event); + void on_show() override; + bool on_key_press_event(GdkEventKey* event) override; private: /** Columns for the plugin list */ diff --git a/src/gui/MessagesWindow.hpp b/src/gui/MessagesWindow.hpp index b3c5114d..fae6c2c3 100644 --- a/src/gui/MessagesWindow.hpp +++ b/src/gui/MessagesWindow.hpp @@ -44,7 +44,7 @@ public: MessagesWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); - void init_window(App& app); + void init_window(App& app) override; int log(LV2_URID type, const char* fmt, va_list args); void flush(); diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp index e92e48fc..fd4962a9 100644 --- a/src/gui/NodeMenu.hpp +++ b/src/gui/NodeMenu.hpp @@ -54,7 +54,7 @@ protected: void add_preset(const URI& uri, const std::string& label); - void on_menu_disconnect(); + void on_menu_disconnect() override; void on_menu_embed_gui(); void on_menu_enabled(); void on_menu_randomize(); diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp index 51692451..ed5914de 100644 --- a/src/gui/NodeModule.hpp +++ b/src/gui/NodeModule.hpp @@ -70,13 +70,13 @@ protected: virtual bool on_double_click(GdkEventButton* ev); bool idle_init(); - bool on_event(GdkEvent* ev); + bool on_event(GdkEvent* ev) override; void on_embed_gui_toggled(bool embed); void embed_gui(bool embed); bool popup_gui(); void on_gui_window_close(); - bool on_selected(gboolean selected); + bool on_selected(gboolean selected) override; void rename(); void property_changed(const URI& key, const Atom& value); diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp index d459f7b3..d88f3f9d 100644 --- a/src/gui/Port.hpp +++ b/src/gui/Port.hpp @@ -64,7 +64,7 @@ public: void value_changed(const Atom& value); void activity(const Atom& value); - bool on_selected(gboolean b); + bool on_selected(gboolean b) override; private: Port(App& app, @@ -86,7 +86,7 @@ private: void on_value_changed(double value); void on_scale_point_activated(float f); void on_uri_activated(const URI& uri); - bool on_event(GdkEvent* ev); + bool on_event(GdkEvent* ev) override; void port_properties_changed(); void set_type_tag(); diff --git a/src/gui/PortMenu.hpp b/src/gui/PortMenu.hpp index 3de51fae..60084223 100644 --- a/src/gui/PortMenu.hpp +++ b/src/gui/PortMenu.hpp @@ -44,7 +44,7 @@ public: bool internal_graph_port = false); private: - void on_menu_disconnect(); + void on_menu_disconnect() override; void on_menu_set_min(); void on_menu_set_max(); void on_menu_reset_range(); diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp index 0cbd8b91..c1c3eee4 100644 --- a/src/gui/PropertiesWindow.hpp +++ b/src/gui/PropertiesWindow.hpp @@ -93,7 +93,7 @@ private: Atom get_value(LV2_URID type, Gtk::Widget* value_widget); void reset(); - void on_show(); + void on_show() override; std::string active_key() const; diff --git a/src/gui/SubgraphModule.hpp b/src/gui/SubgraphModule.hpp index 44241638..6f4e1c4c 100644 --- a/src/gui/SubgraphModule.hpp +++ b/src/gui/SubgraphModule.hpp @@ -45,9 +45,9 @@ public: virtual ~SubgraphModule() {} - bool on_double_click(GdkEventButton* event); + bool on_double_click(GdkEventButton* event) override; - void store_location(double ax, double ay); + void store_location(double ax, double ay) override; void browse_to_graph(); void menu_remove(); diff --git a/src/gui/Window.hpp b/src/gui/Window.hpp index 6bf5e586..5f839578 100644 --- a/src/gui/Window.hpp +++ b/src/gui/Window.hpp @@ -37,7 +37,7 @@ public: virtual void init_window(App& app) { _app = &app; } - bool on_key_press_event(GdkEventKey* event) { + bool on_key_press_event(GdkEventKey* event) override { if (event->keyval == GDK_w && event->state & GDK_CONTROL_MASK) { hide(); return true; @@ -61,7 +61,7 @@ public: virtual void init_dialog(App& app) { _app = &app; } - bool on_key_press_event(GdkEventKey* event) { + bool on_key_press_event(GdkEventKey* event) override { if (event->keyval == GDK_w && event->state & GDK_CONTROL_MASK) { hide(); return true; diff --git a/src/gui/ingen_gui.cpp b/src/gui/ingen_gui.cpp index cf1fb88f..441993f7 100644 --- a/src/gui/ingen_gui.cpp +++ b/src/gui/ingen_gui.cpp @@ -27,7 +27,7 @@ namespace gui { struct GUIModule : public Module { using SigClientInterface = client::SigClientInterface; - void load(World* world) { + void load(World* world) override { URI uri(world->conf().option("connect").ptr()); if (!world->interface()) { world->set_interface( @@ -40,7 +40,7 @@ struct GUIModule : public Module { app = gui::App::create(world); } - void run(World* world) { + void run(World* world) override { app->run(); } diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp index 56e07b44..251c75e1 100644 --- a/src/gui/ingen_gui_lv2.cpp +++ b/src/gui/ingen_gui_lv2.cpp @@ -43,7 +43,7 @@ struct IngenLV2AtomSink : public AtomSink { , _ui_controller(ui_controller) {} - bool write(const LV2_Atom* atom, int32_t default_id) { + bool write(const LV2_Atom* atom, int32_t default_id) override { _ui_write(_ui_controller, 0, lv2_atom_total_size(atom), diff --git a/src/server/ArcImpl.hpp b/src/server/ArcImpl.hpp index e42571d0..49e9674b 100644 --- a/src/server/ArcImpl.hpp +++ b/src/server/ArcImpl.hpp @@ -58,8 +58,8 @@ public: inline PortImpl* tail() const { return _tail; } inline PortImpl* head() const { return _head; } - const Raul::Path& tail_path() const; - const Raul::Path& head_path() const; + const Raul::Path& tail_path() const override; + const Raul::Path& head_path() const override; /** Get the buffer for a particular voice. * An Arc is smart - it knows the destination port requesting the diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp index fe20c1ec..34045b6d 100644 --- a/src/server/BlockImpl.hpp +++ b/src/server/BlockImpl.hpp @@ -70,7 +70,7 @@ public: virtual ~BlockImpl(); - virtual GraphType graph_type() const { return GraphType::BLOCK; } + GraphType graph_type() const override { return GraphType::BLOCK; } /** Activate this Block. * @@ -136,7 +136,7 @@ public: BufferRef buf, SampleCount offset); - virtual Node* port(uint32_t index) const; + Node* port(uint32_t index) const override; virtual PortImpl* port_impl(uint32_t index) const { return (*_ports)[index]; } /** Get a port by symbol. */ @@ -156,13 +156,13 @@ public: */ virtual void set_polyphonic(bool p) { _polyphonic = p; } - virtual bool prepare_poly(BufferFactory& bufs, uint32_t poly); - virtual bool apply_poly(RunContext& context, uint32_t poly); + bool prepare_poly(BufferFactory& bufs, uint32_t poly) override; + bool apply_poly(RunContext& context, uint32_t poly) override; /** Information about the Plugin this Block is an instance of. * Not the best name - not all blocks come from plugins (ie Graph) */ - virtual const Resource* plugin() const; + const Resource* plugin() const override; /** Information about the Plugin this Block is an instance of. * Not the best name - not all blocks come from plugins (ie Graph) @@ -177,9 +177,10 @@ public: uint32_t size); /** The Graph this Block belongs to. */ - inline GraphImpl* parent_graph() const { return (GraphImpl*)_parent; } + GraphImpl* parent_graph() const override { return (GraphImpl*)_parent; } + + uint32_t num_ports() const override { return _ports ? _ports->size() : 0; } - uint32_t num_ports() const { return _ports ? _ports->size() : 0; } virtual uint32_t polyphony() const { return _polyphony; } /** Mark used during graph compilation */ diff --git a/src/server/DirectDriver.hpp b/src/server/DirectDriver.hpp index 27ae322c..b3d49af0 100644 --- a/src/server/DirectDriver.hpp +++ b/src/server/DirectDriver.hpp @@ -44,13 +44,13 @@ public: _ports.clear_and_dispose([](EnginePort* p) { delete p; }); } - bool dynamic_ports() const { return true; } + bool dynamic_ports() const override { return true; } - virtual EnginePort* create_port(DuplexPort* graph_port) { + EnginePort* create_port(DuplexPort* graph_port) override { return new EnginePort(graph_port); } - virtual EnginePort* get_port(const Raul::Path& path) { + EnginePort* get_port(const Raul::Path& path) override { for (auto& p : _ports) { if (p.graph_port()->path() == path) { return &p; @@ -60,35 +60,37 @@ public: return nullptr; } - virtual void add_port(RunContext& context, EnginePort* port) { + void add_port(RunContext& context, EnginePort* port) override { _ports.push_back(*port); } - virtual void remove_port(RunContext& context, EnginePort* port) { + void remove_port(RunContext& context, EnginePort* port) override { _ports.erase(_ports.iterator_to(*port)); } - virtual void rename_port(const Raul::Path& old_path, - const Raul::Path& new_path) {} + void rename_port(const Raul::Path& old_path, + const Raul::Path& new_path) override {} - virtual void port_property(const Raul::Path& path, - const URI& uri, - const Atom& value) {} + void port_property(const Raul::Path& path, + const URI& uri, + const Atom& value) override {} - virtual void register_port(EnginePort& port) {} - virtual void unregister_port(EnginePort& port) {} + void register_port(EnginePort& port) override {} + void unregister_port(EnginePort& port) override {} - virtual SampleCount block_length() const { return _block_length; } + SampleCount block_length() const override { return _block_length; } - virtual size_t seq_size() const { return _seq_size; } + size_t seq_size() const override { return _seq_size; } - virtual SampleCount sample_rate() const { return _sample_rate; } + SampleCount sample_rate() const override { return _sample_rate; } - virtual SampleCount frame_time() const { return _engine.run_context().start(); } + SampleCount frame_time() const override { + return _engine.run_context().start(); + } - virtual void append_time_events(RunContext& context, Buffer& buffer) {} + void append_time_events(RunContext& context, Buffer& buffer) override {} - virtual int real_time_priority() { return 60; } + int real_time_priority() override { return 60; } private: typedef boost::intrusive::slist& voices, uint32_t poly, - size_t num_in_arcs) const; + size_t num_in_arcs) const override; - virtual void set_is_driver_port(BufferFactory& bufs); + void set_is_driver_port(BufferFactory& bufs) override; /** Set the external driver-provided buffer. * @@ -84,12 +84,14 @@ public: */ void set_driver_buffer(void* buf, uint32_t capacity); - bool setup_buffers(RunContext& ctx, BufferFactory& bufs, uint32_t poly); + bool + setup_buffers(RunContext& ctx, BufferFactory& bufs, uint32_t poly) override; - void pre_process(RunContext& context); - void post_process(RunContext& context); + void pre_process(RunContext& context) override; + void post_process(RunContext& context) override; - SampleCount next_value_offset(SampleCount offset, SampleCount end) const; + SampleCount + next_value_offset(SampleCount offset, SampleCount end) const override; }; } // namespace server diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp index 9a6534fc..02da0719 100644 --- a/src/server/Engine.hpp +++ b/src/server/Engine.hpp @@ -81,18 +81,18 @@ public: Engine& operator=(const Engine&) = delete; // EngineBase methods - virtual void init(double sample_rate, uint32_t block_length, size_t seq_size); - virtual bool supports_dynamic_ports() const; - virtual bool activate(); - virtual void deactivate(); - virtual bool pending_events() const; - virtual unsigned run(uint32_t sample_count); - virtual void quit(); - virtual bool main_iteration(); - virtual void register_client(SPtr client); - virtual bool unregister_client(SPtr client); - - void listen(); + void init(double sample_rate, uint32_t block_length, size_t seq_size) override; + bool supports_dynamic_ports() const override; + bool activate() override; + void deactivate() override; + bool pending_events() const override; + unsigned run(uint32_t sample_count) override; + void quit() override; + bool main_iteration() override; + void register_client(SPtr client) override; + bool unregister_client(SPtr client) override; + + void listen() override; /** Return a random [0..1] float with uniform distribution */ float frand() { return _uniform_dist(_rand_engine); } @@ -152,10 +152,10 @@ public: RunContext& run_context() { return *_run_contexts[0]; } - void flush_events(const std::chrono::milliseconds& sleep_ms); + void flush_events(const std::chrono::milliseconds& sleep_ms) override; + void advance(SampleCount nframes) override; + void locate(FrameTime s, SampleCount nframes) override; - void advance(SampleCount nframes); - void locate(FrameTime s, SampleCount nframes); void emit_notifications(FrameTime end); bool pending_notifications(); bool wait_for_tasks(); diff --git a/src/server/GraphImpl.hpp b/src/server/GraphImpl.hpp index d0dd8b7d..384566bf 100644 --- a/src/server/GraphImpl.hpp +++ b/src/server/GraphImpl.hpp @@ -59,23 +59,23 @@ public: virtual ~GraphImpl(); - virtual GraphType graph_type() const { return GraphType::GRAPH; } + GraphType graph_type() const override { return GraphType::GRAPH; } BlockImpl* duplicate(Engine& engine, const Raul::Symbol& symbol, - GraphImpl* parent); + GraphImpl* parent) override; - void activate(BufferFactory& bufs); - void deactivate(); + void activate(BufferFactory& bufs) override; + void deactivate() override; - void pre_process(RunContext& context); - void process(RunContext& context); - void run(RunContext& context); + void pre_process(RunContext& context) override; + void process(RunContext& context) override; + void run(RunContext& context) override; void set_buffer_size(RunContext& context, BufferFactory& bufs, LV2_URID type, - uint32_t size); + uint32_t size) override; /** Prepare for a new (internal) polyphony value. * diff --git a/src/server/GraphPlugin.hpp b/src/server/GraphPlugin.hpp index ae59b986..ef741587 100644 --- a/src/server/GraphPlugin.hpp +++ b/src/server/GraphPlugin.hpp @@ -44,13 +44,13 @@ public: bool polyphonic, GraphImpl* parent, Engine& engine, - const LilvState* state) + const LilvState* state) override { return nullptr; } - const Raul::Symbol symbol() const { return Raul::Symbol("graph"); } - const std::string name() const { return "Ingen Graph"; } + const Raul::Symbol symbol() const override { return Raul::Symbol("graph"); } + const std::string name() const { return "Ingen Graph"; } private: const std::string _symbol; diff --git a/src/server/InputPort.hpp b/src/server/InputPort.hpp index 92756b57..edb2a3a7 100644 --- a/src/server/InputPort.hpp +++ b/src/server/InputPort.hpp @@ -65,7 +65,7 @@ public: /** Return the maximum polyphony of an output connected to this input. */ virtual uint32_t max_tail_poly(RunContext& context) const; - bool apply_poly(RunContext& context, uint32_t poly); + bool apply_poly(RunContext& context, uint32_t poly) override; /** Add an arc. Realtime safe. * @@ -92,20 +92,22 @@ public: MPtr& voices, uint32_t poly) const; - bool setup_buffers(RunContext& ctx, BufferFactory& bufs, uint32_t poly); + bool + setup_buffers(RunContext& ctx, BufferFactory& bufs, uint32_t poly) override; /** Set up buffer pointers. */ - void pre_process(RunContext& context); + void pre_process(RunContext& context) override; /** Prepare buffer for access, mixing if necessary. */ - void pre_run(RunContext& context); + void pre_run(RunContext& context) override; /** Prepare buffer for next process cycle. */ - void post_process(RunContext& context); + void post_process(RunContext& context) override; - SampleCount next_value_offset(SampleCount offset, SampleCount end) const; + SampleCount + next_value_offset(SampleCount offset, SampleCount end) const override; - size_t num_arcs() const { return _num_arcs; } + size_t num_arcs() const override { return _num_arcs; } void increment_num_arcs() { ++_num_arcs; } void decrement_num_arcs() { --_num_arcs; } @@ -116,7 +118,7 @@ protected: PortImpl::GetFn get, const MPtr& voices, uint32_t poly, - size_t num_in_arcs) const; + size_t num_in_arcs) const override; size_t _num_arcs; ///< Pre-process thread Arcs _arcs; ///< Audio thread diff --git a/src/server/InternalBlock.hpp b/src/server/InternalBlock.hpp index 5b3270c3..47c1c09f 100644 --- a/src/server/InternalBlock.hpp +++ b/src/server/InternalBlock.hpp @@ -37,9 +37,9 @@ public: BlockImpl* duplicate(Engine& engine, const Raul::Symbol& symbol, - GraphImpl* parent); + GraphImpl* parent) override; - virtual void pre_process(RunContext& context); + void pre_process(RunContext& context) override; }; } // namespace server diff --git a/src/server/InternalPlugin.hpp b/src/server/InternalPlugin.hpp index 403db02e..a6998040 100644 --- a/src/server/InternalPlugin.hpp +++ b/src/server/InternalPlugin.hpp @@ -43,9 +43,9 @@ public: bool polyphonic, GraphImpl* parent, Engine& engine, - const LilvState* state); + const LilvState* state) override; - const Raul::Symbol symbol() const { return _symbol; } + const Raul::Symbol symbol() const override { return _symbol; } private: const Raul::Symbol _symbol; diff --git a/src/server/JackDriver.hpp b/src/server/JackDriver.hpp index fcda8edd..c9307623 100644 --- a/src/server/JackDriver.hpp +++ b/src/server/JackDriver.hpp @@ -65,37 +65,40 @@ public: const std::string& client_name, void* jack_client); - bool activate(); - void deactivate(); + bool activate() override; + void deactivate() override; - bool dynamic_ports() const { return true; } + bool dynamic_ports() const override { return true; } - EnginePort* create_port(DuplexPort* graph_port); - EnginePort* get_port(const Raul::Path& path); + EnginePort* create_port(DuplexPort* graph_port) override; + EnginePort* get_port(const Raul::Path& path) override; - void rename_port(const Raul::Path& old_path, const Raul::Path& new_path); - void port_property(const Raul::Path& path, const URI& uri, const Atom& value); - void add_port(RunContext& context, EnginePort* port); - void remove_port(RunContext& context, EnginePort* port); - void register_port(EnginePort& port); - void unregister_port(EnginePort& port); + void rename_port(const Raul::Path& old_path, const Raul::Path& new_path) override; + void port_property(const Raul::Path& path, const URI& uri, const Atom& value) override; + void add_port(RunContext& context, EnginePort* port) override; + void remove_port(RunContext& context, EnginePort* port) override; + void register_port(EnginePort& port) override; + void unregister_port(EnginePort& port) override; /** Transport state for this frame. * Intended to only be called from the audio thread. */ inline const jack_position_t* position() { return &_position; } inline jack_transport_state_t transport_state() { return _transport_state; } - void append_time_events(RunContext& context, - Buffer& buffer); + void append_time_events(RunContext& context, Buffer& buffer) override; - int real_time_priority() { return jack_client_real_time_priority(_client); } + int real_time_priority() override { + return jack_client_real_time_priority(_client); + } - jack_client_t* jack_client() const { return _client; } - SampleCount block_length() const { return _block_length; } - size_t seq_size() const { return _seq_size; } - SampleCount sample_rate() const { return _sample_rate; } + jack_client_t* jack_client() const { return _client; } + SampleCount block_length() const override { return _block_length; } + size_t seq_size() const override { return _seq_size; } + SampleCount sample_rate() const override { return _sample_rate; } - inline SampleCount frame_time() const { return _client ? jack_frame_time(_client) : 0; } + SampleCount frame_time() const override { + return _client ? jack_frame_time(_client) : 0; + } class PortRegistrationFailedException : public std::exception {}; diff --git a/src/server/LV2Block.hpp b/src/server/LV2Block.hpp index 27287c5e..8a362fec 100644 --- a/src/server/LV2Block.hpp +++ b/src/server/LV2Block.hpp @@ -50,35 +50,35 @@ public: bool instantiate(BufferFactory& bufs, const LilvState* state); - LilvInstance* instance() { return instance(0); } - bool save_state(const FilePath& dir) const; + LilvInstance* instance() override { return instance(0); } + bool save_state(const FilePath& dir) const override; BlockImpl* duplicate(Engine& engine, const Raul::Symbol& symbol, - GraphImpl* parent); + GraphImpl* parent) override; - bool prepare_poly(BufferFactory& bufs, uint32_t poly); - bool apply_poly(RunContext& context, uint32_t poly); + bool prepare_poly(BufferFactory& bufs, uint32_t poly) override; + bool apply_poly(RunContext& context, uint32_t poly) override; - void activate(BufferFactory& bufs); - void deactivate(); + void activate(BufferFactory& bufs) override; + void deactivate() override; LV2_Worker_Status work(uint32_t size, const void* data); - void run(RunContext& context); - void post_process(RunContext& context); + void run(RunContext& context) override; + void post_process(RunContext& context) override; - LilvState* load_preset(const URI& uri); + LilvState* load_preset(const URI& uri) override; - void apply_state(const UPtr& worker, const LilvState* state); + void apply_state(const UPtr& worker, const LilvState* state) override; boost::optional save_preset(const URI& uri, - const Properties& props); + const Properties& props) override; void set_port_buffer(uint32_t voice, uint32_t port_num, BufferRef buf, - SampleCount offset); + SampleCount offset) override; static LilvState* load_state(World* world, const FilePath& path); diff --git a/src/server/LV2Options.hpp b/src/server/LV2Options.hpp index f5f18f3d..7a8b3c20 100644 --- a/src/server/LV2Options.hpp +++ b/src/server/LV2Options.hpp @@ -36,9 +36,9 @@ public: _seq_size = seq_size; } - const char* uri() const { return LV2_OPTIONS__options; } + const char* uri() const override { return LV2_OPTIONS__options; } - SPtr feature(World* w, Node* n) { + SPtr feature(World* w, Node* n) override { const LV2_Options_Option options[] = { { LV2_OPTIONS_INSTANCE, 0, _uris.bufsz_minBlockLength, sizeof(int32_t), _uris.atom_Int, &_block_length }, diff --git a/src/server/LV2Plugin.hpp b/src/server/LV2Plugin.hpp index 9608b4e5..9d342f54 100644 --- a/src/server/LV2Plugin.hpp +++ b/src/server/LV2Plugin.hpp @@ -45,18 +45,18 @@ public: bool polyphonic, GraphImpl* parent, Engine& engine, - const LilvState* state); + const LilvState* state) override; - const Raul::Symbol symbol() const; + const Raul::Symbol symbol() const override; World* world() const { return _world; } const LilvPlugin* lilv_plugin() const { return _lilv_plugin; } - void update_properties(); + void update_properties() override; - void load_presets(); + void load_presets() override; - URI bundle_uri() const { + URI bundle_uri() const override { const LilvNode* bundle = lilv_plugin_get_bundle_uri(_lilv_plugin); return URI(lilv_node_as_uri(bundle)); } diff --git a/src/server/NodeImpl.hpp b/src/server/NodeImpl.hpp index 9a9f1c95..0ac889e0 100644 --- a/src/server/NodeImpl.hpp +++ b/src/server/NodeImpl.hpp @@ -49,13 +49,13 @@ class RunContext; class NodeImpl : public Node { public: - const Raul::Symbol& symbol() const { return _symbol; } + const Raul::Symbol& symbol() const override { return _symbol; } - Node* graph_parent() const { return _parent; } - NodeImpl* parent() const { return _parent; } + Node* graph_parent() const override { return _parent; } + NodeImpl* parent() const { return _parent; } /** Rename */ - virtual void set_path(const Raul::Path& new_path) { + void set_path(const Raul::Path& new_path) override { _path = new_path; const char* const new_sym = new_path.symbol(); if (new_sym[0] != '\0') { @@ -64,12 +64,12 @@ public: set_uri(path_to_uri(new_path)); } - const Atom& get_property(const URI& key) const; + const Atom& get_property(const URI& key) const override; /** The Graph this object is a child of. */ virtual GraphImpl* parent_graph() const; - const Raul::Path& path() const { return _path; } + const Raul::Path& path() const override { return _path; } /** Prepare for a new (external) polyphony value. * diff --git a/src/server/PortAudioDriver.hpp b/src/server/PortAudioDriver.hpp index 21a81180..e50cc8a6 100644 --- a/src/server/PortAudioDriver.hpp +++ b/src/server/PortAudioDriver.hpp @@ -52,28 +52,28 @@ public: bool attach(); - bool activate(); - void deactivate(); + bool activate() override; + void deactivate() override; - EnginePort* create_port(DuplexPort* graph_port); - EnginePort* get_port(const Raul::Path& path); + EnginePort* create_port(DuplexPort* graph_port) override; + EnginePort* get_port(const Raul::Path& path) override; - void rename_port(const Raul::Path& old_path, const Raul::Path& new_path); - void port_property(const Raul::Path& path, const URI& uri, const Atom& value); - void add_port(RunContext& context, EnginePort* port); - void remove_port(RunContext& context, EnginePort* port); - void register_port(EnginePort& port); - void unregister_port(EnginePort& port); + void rename_port(const Raul::Path& old_path, const Raul::Path& new_path) override; + void port_property(const Raul::Path& path, const URI& uri, const Atom& value) override; + void add_port(RunContext& context, EnginePort* port) override; + void remove_port(RunContext& context, EnginePort* port) override; + void register_port(EnginePort& port) override; + void unregister_port(EnginePort& port) override; - void append_time_events(RunContext& context, Buffer& buffer) {} + void append_time_events(RunContext& context, Buffer& buffer) override {} - SampleCount frame_time() const; + SampleCount frame_time() const override; - int real_time_priority() { return 80; } + int real_time_priority() override { return 80; } - SampleCount block_length() const { return _block_length; } - size_t seq_size() const { return _seq_size; } - SampleCount sample_rate() const { return _sample_rate; } + SampleCount block_length() const override { return _block_length; } + size_t seq_size() const override { return _seq_size; } + SampleCount sample_rate() const override { return _sample_rate; } private: friend class PortAudioPort; diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp index 9afcca53..d9b81a16 100644 --- a/src/server/PortImpl.hpp +++ b/src/server/PortImpl.hpp @@ -98,7 +98,7 @@ public: size_t buffer_size = 0, bool is_output = true); - virtual GraphType graph_type() const { return GraphType::PORT; } + GraphType graph_type() const override { return GraphType::PORT; } /** A port's parent is always a block, so static cast should be safe */ BlockImpl* parent_block() const { return (BlockImpl*)_parent; } @@ -110,14 +110,14 @@ public: * * Preprocessor thread, poly is actually applied by apply_poly. */ - virtual bool prepare_poly(BufferFactory& bufs, uint32_t poly); + bool prepare_poly(BufferFactory& bufs, uint32_t poly) override; /** Apply a new polyphony value. * * Audio thread. * \a poly Must be < the most recent value passed to prepare_poly. */ - virtual bool apply_poly(RunContext& context, uint32_t poly); + bool apply_poly(RunContext& context, uint32_t poly) override; /** Return the number of arcs (pre-process thraed). */ virtual size_t num_arcs() const { return 0; } diff --git a/src/server/PostProcessor.cpp b/src/server/PostProcessor.cpp index e644734b..02a6f639 100644 --- a/src/server/PostProcessor.cpp +++ b/src/server/PostProcessor.cpp @@ -28,9 +28,9 @@ class Sentinel : public Event { public: Sentinel(Engine& engine) : Event(engine) {} - bool pre_process(PreProcessContext& ctx) { return false; } - void execute(RunContext& context) {} - void post_process() {} + bool pre_process(PreProcessContext& ctx) override { return false; } + void execute(RunContext& context) override {} + void post_process() override {} }; PostProcessor::PostProcessor(Engine& engine) diff --git a/src/server/UndoStack.hpp b/src/server/UndoStack.hpp index 8ebd1482..6f0ac192 100644 --- a/src/server/UndoStack.hpp +++ b/src/server/UndoStack.hpp @@ -78,7 +78,7 @@ public: UndoStack(URIs& uris, URIMap& map) : _uris(uris), _map(map), _depth(0) {} int start_entry(); - bool write(const LV2_Atom* msg, int32_t default_id=0); + bool write(const LV2_Atom* msg, int32_t default_id=0) override; int finish_entry(); bool empty() const { return _stack.empty(); } diff --git a/src/server/Worker.hpp b/src/server/Worker.hpp index 063570ca..a2bf4a7d 100644 --- a/src/server/Worker.hpp +++ b/src/server/Worker.hpp @@ -41,9 +41,9 @@ public: struct Schedule : public LV2Features::Feature { Schedule(bool sync) : synchronous(sync) {} - const char* uri() const { return LV2_WORKER__schedule; } + const char* uri() const override { return LV2_WORKER__schedule; } - SPtr feature(World* world, Node* n); + SPtr feature(World* world, Node* n) override; const bool synchronous; }; diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index b4894875..16ea8bc9 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -49,10 +49,10 @@ public: SampleCount timestamp, const ingen::Connect& msg); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); - void undo(Interface& target); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; + void undo(Interface& target) override; private: const ingen::Connect _msg; diff --git a/src/server/events/Copy.hpp b/src/server/events/Copy.hpp index bd52baf2..f31fe4d4 100644 --- a/src/server/events/Copy.hpp +++ b/src/server/events/Copy.hpp @@ -44,10 +44,10 @@ public: SampleCount timestamp, const ingen::Copy& msg); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); - void undo(Interface& target); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; + void undo(Interface& target) override; private: bool engine_to_engine(PreProcessContext& ctx); diff --git a/src/server/events/CreateBlock.hpp b/src/server/events/CreateBlock.hpp index 35707f0d..02bfeda7 100644 --- a/src/server/events/CreateBlock.hpp +++ b/src/server/events/CreateBlock.hpp @@ -45,10 +45,10 @@ public: const Raul::Path& path, Properties& properties); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); - void undo(Interface& target); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; + void undo(Interface& target) override; private: Raul::Path _path; diff --git a/src/server/events/CreateGraph.hpp b/src/server/events/CreateGraph.hpp index 3658d359..1537283e 100644 --- a/src/server/events/CreateGraph.hpp +++ b/src/server/events/CreateGraph.hpp @@ -48,10 +48,10 @@ public: ~CreateGraph(); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); - void undo(Interface& target); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; + void undo(Interface& target) override; GraphImpl* graph() { return _graph; } diff --git a/src/server/events/CreatePort.hpp b/src/server/events/CreatePort.hpp index 13402087..6c760d29 100644 --- a/src/server/events/CreatePort.hpp +++ b/src/server/events/CreatePort.hpp @@ -52,10 +52,10 @@ public: const Raul::Path& path, const Properties& properties); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); - void undo(Interface& target); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; + void undo(Interface& target) override; private: enum class Flow { diff --git a/src/server/events/Delete.hpp b/src/server/events/Delete.hpp index 5d00c5ea..ebc57122 100644 --- a/src/server/events/Delete.hpp +++ b/src/server/events/Delete.hpp @@ -56,10 +56,10 @@ public: ~Delete(); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); - void undo(Interface& target); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; + void undo(Interface& target) override; private: using IndexChange = std::pair; diff --git a/src/server/events/Delta.hpp b/src/server/events/Delta.hpp index b3bb0537..d36e81aa 100644 --- a/src/server/events/Delta.hpp +++ b/src/server/events/Delta.hpp @@ -70,12 +70,12 @@ public: uint32_t size, uint32_t type); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); - void undo(Interface& target); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; + void undo(Interface& target) override; - Execution get_execution() const; + Execution get_execution() const override; private: enum class Type { diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp index 7649d9e4..de4bfe57 100644 --- a/src/server/events/Disconnect.hpp +++ b/src/server/events/Disconnect.hpp @@ -51,10 +51,10 @@ public: ~Disconnect(); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); - void undo(Interface& target); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; + void undo(Interface& target) override; class Impl { public: diff --git a/src/server/events/DisconnectAll.hpp b/src/server/events/DisconnectAll.hpp index aaebf872..aca5fbce 100644 --- a/src/server/events/DisconnectAll.hpp +++ b/src/server/events/DisconnectAll.hpp @@ -54,10 +54,10 @@ public: ~DisconnectAll(); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); - void undo(Interface& target); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; + void undo(Interface& target) override; private: typedef std::list Impls; diff --git a/src/server/events/Get.hpp b/src/server/events/Get.hpp index 0cfbfe43..9598010c 100644 --- a/src/server/events/Get.hpp +++ b/src/server/events/Get.hpp @@ -46,9 +46,9 @@ public: SampleCount timestamp, const ingen::Get& msg); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context) {} - void post_process(); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override {} + void post_process() override; private: const ingen::Get _msg; diff --git a/src/server/events/Mark.hpp b/src/server/events/Mark.hpp index 1d8bffdc..076b67dd 100644 --- a/src/server/events/Mark.hpp +++ b/src/server/events/Mark.hpp @@ -46,11 +46,11 @@ public: SampleCount timestamp, const ingen::BundleEnd& msg); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; - Execution get_execution() const; + Execution get_execution() const override; private: enum class Type { BUNDLE_BEGIN, BUNDLE_END }; diff --git a/src/server/events/Move.hpp b/src/server/events/Move.hpp index 455a84d4..510fcfce 100644 --- a/src/server/events/Move.hpp +++ b/src/server/events/Move.hpp @@ -41,10 +41,10 @@ public: SampleCount timestamp, const ingen::Move& msg); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); - void undo(Interface& target); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; + void undo(Interface& target) override; private: const ingen::Move _msg; diff --git a/src/server/events/SetPortValue.hpp b/src/server/events/SetPortValue.hpp index 01bad6a8..4fe42659 100644 --- a/src/server/events/SetPortValue.hpp +++ b/src/server/events/SetPortValue.hpp @@ -47,9 +47,9 @@ public: bool activity, bool synthetic = false); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; bool synthetic() const { return _synthetic; } diff --git a/src/server/events/Undo.hpp b/src/server/events/Undo.hpp index 4e09c7f3..f8469960 100644 --- a/src/server/events/Undo.hpp +++ b/src/server/events/Undo.hpp @@ -42,9 +42,9 @@ public: SampleCount timestamp, const ingen::Redo& msg); - bool pre_process(PreProcessContext& ctx); - void execute(RunContext& context); - void post_process(); + bool pre_process(PreProcessContext& ctx) override; + void execute(RunContext& context) override; + void post_process() override; private: UndoStack::Entry _entry; diff --git a/src/server/ingen_engine.cpp b/src/server/ingen_engine.cpp index 15391437..71d1c8c5 100644 --- a/src/server/ingen_engine.cpp +++ b/src/server/ingen_engine.cpp @@ -23,7 +23,7 @@ using namespace ingen; struct IngenEngineModule : public ingen::Module { - virtual void load(ingen::World* world) { + void load(ingen::World* world) override { server::set_denormal_flags(world->log()); SPtr engine(new server::Engine(world)); world->set_engine(engine); diff --git a/src/server/ingen_jack.cpp b/src/server/ingen_jack.cpp index c0fd80aa..51888972 100644 --- a/src/server/ingen_jack.cpp +++ b/src/server/ingen_jack.cpp @@ -29,7 +29,7 @@ using namespace ingen; struct IngenJackModule : public ingen::Module { - void load(ingen::World* world) { + void load(ingen::World* world) override { if (((server::Engine*)world->engine().get())->driver()) { world->log().warn("Engine already has a driver\n"); return; diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 36bafc4d..04cc5a33 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -117,7 +117,7 @@ public: , _instantiated(false) {} - virtual bool dynamic_ports() const { return !_instantiated; } + bool dynamic_ports() const override { return !_instantiated; } void pre_process_port(RunContext& context, EnginePort* port) { const URIs& uris = _engine.world()->uris(); @@ -187,7 +187,7 @@ public: _frame_time += nframes; } - virtual void deactivate() { + void deactivate() override { _engine.quit(); _main_sem.post(); } @@ -195,7 +195,7 @@ public: virtual void set_root_graph(GraphImpl* graph) { _root_graph = graph; } virtual GraphImpl* root_graph() { return _root_graph; } - virtual EnginePort* get_port(const Raul::Path& path) { + EnginePort* get_port(const Raul::Path& path) override { for (auto& p : _ports) { if (p->graph_port()->path() == path) { return p; @@ -206,7 +206,7 @@ public: } /** Add a port. Called only during init or restore. */ - virtual void add_port(RunContext& context, EnginePort* port) { + void add_port(RunContext& context, EnginePort* port) override { const uint32_t index = port->graph_port()->index(); if (_ports.size() <= index) { _ports.resize(index + 1); @@ -215,34 +215,32 @@ public: } /** Remove a port. Called only during init or restore. */ - virtual void remove_port(RunContext& context, EnginePort* port) { + void remove_port(RunContext& context, EnginePort* port) override { const uint32_t index = port->graph_port()->index(); _ports[index] = nullptr; } /** Unused since LV2 has no dynamic ports. */ - virtual void register_port(EnginePort& port) {} + void register_port(EnginePort& port) override {} /** Unused since LV2 has no dynamic ports. */ - virtual void unregister_port(EnginePort& port) {} + void unregister_port(EnginePort& port) override {} /** Unused since LV2 has no dynamic ports. */ - virtual void rename_port(const Raul::Path& old_path, - const Raul::Path& new_path) {} + void rename_port(const Raul::Path& old_path, + const Raul::Path& new_path) override {} /** Unused since LV2 has no dynamic ports. */ - virtual void port_property(const Raul::Path& path, - const URI& uri, - const Atom& value) {} + void port_property(const Raul::Path& path, + const URI& uri, + const Atom& value) override {} - virtual EnginePort* create_port(DuplexPort* graph_port) { + EnginePort* create_port(DuplexPort* graph_port) override { graph_port->set_is_driver_port(*_engine.buffer_factory()); return new EnginePort(graph_port); } - virtual void append_time_events(RunContext& context, - Buffer& buffer) - { + void append_time_events(RunContext& context, Buffer& buffer) override { const URIs& uris = _engine.world()->uris(); LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)_ports[0]->buffer(); LV2_ATOM_SEQUENCE_FOREACH(seq, ev) { @@ -258,7 +256,7 @@ public: } } - virtual int real_time_priority() { return 60; } + int real_time_priority() override { return 60; } /** Called in run thread for events received at control input port. */ bool enqueue_message(const LV2_Atom* atom) { @@ -276,7 +274,7 @@ public: /** AtomSink::write implementation called by the PostProcessor in the main * thread to write responses to the UI. */ - bool write(const LV2_Atom* atom, int32_t default_id) { + bool write(const LV2_Atom* atom, int32_t default_id) override { // Called from post-processor in main thread while (_to_ui.write(lv2_atom_total_size(atom), atom) == 0) { // Overflow, wait until ring is drained next cycle @@ -363,10 +361,10 @@ public: } } - virtual SampleCount block_length() const { return _block_length; } - virtual size_t seq_size() const { return _seq_size; } - virtual SampleCount sample_rate() const { return _sample_rate; } - virtual SampleCount frame_time() const { return _frame_time; } + SampleCount block_length() const override { return _block_length; } + size_t seq_size() const override { return _seq_size; } + SampleCount sample_rate() const override { return _sample_rate; } + SampleCount frame_time() const override { return _frame_time; } AtomReader& reader() { return _reader; } AtomWriter& writer() { return _writer; } diff --git a/src/server/ingen_portaudio.cpp b/src/server/ingen_portaudio.cpp index d1e04a6c..6d270443 100644 --- a/src/server/ingen_portaudio.cpp +++ b/src/server/ingen_portaudio.cpp @@ -29,7 +29,7 @@ using namespace ingen; struct IngenPortAudioModule : public ingen::Module { - void load(ingen::World* world) { + void load(ingen::World* world) override { if (((server::Engine*)world->engine().get())->driver()) { world->log().warn("Engine already has a driver\n"); return; diff --git a/src/server/internals/BlockDelay.hpp b/src/server/internals/BlockDelay.hpp index a4a27383..0e8fadce 100644 --- a/src/server/internals/BlockDelay.hpp +++ b/src/server/internals/BlockDelay.hpp @@ -43,9 +43,9 @@ public: ~BlockDelayNode(); - void activate(BufferFactory& bufs); + void activate(BufferFactory& bufs) override; - void run(RunContext& context); + void run(RunContext& context) override; static InternalPlugin* internal_plugin(URIs& uris); diff --git a/src/server/internals/Controller.hpp b/src/server/internals/Controller.hpp index 9d1bbf7d..d138e690 100644 --- a/src/server/internals/Controller.hpp +++ b/src/server/internals/Controller.hpp @@ -45,11 +45,11 @@ public: GraphImpl* parent, SampleRate srate); - void run(RunContext& context); + void run(RunContext& context) override; bool control(RunContext& context, uint8_t control_num, uint8_t val, FrameTime time); - void learn() { _learning = true; } + void learn() override { _learning = true; } static InternalPlugin* internal_plugin(URIs& uris); diff --git a/src/server/internals/Note.hpp b/src/server/internals/Note.hpp index 5c1b24c4..fb935179 100644 --- a/src/server/internals/Note.hpp +++ b/src/server/internals/Note.hpp @@ -45,10 +45,10 @@ public: GraphImpl* parent, SampleRate srate); - bool prepare_poly(BufferFactory& bufs, uint32_t poly); - bool apply_poly(RunContext& context, uint32_t poly); + bool prepare_poly(BufferFactory& bufs, uint32_t poly) override; + bool apply_poly(RunContext& context, uint32_t poly) override; - void run(RunContext& context); + void run(RunContext& context) override; void note_on(RunContext& context, uint8_t note_num, uint8_t velocity, FrameTime time); void note_off(RunContext& context, uint8_t note_num, FrameTime time); diff --git a/src/server/internals/Time.hpp b/src/server/internals/Time.hpp index b4b570f4..958cd239 100644 --- a/src/server/internals/Time.hpp +++ b/src/server/internals/Time.hpp @@ -44,7 +44,7 @@ public: GraphImpl* parent, SampleRate srate); - void run(RunContext& context); + void run(RunContext& context) override; static InternalPlugin* internal_plugin(URIs& uris); diff --git a/src/server/internals/Trigger.hpp b/src/server/internals/Trigger.hpp index ae661751..98d50f2c 100644 --- a/src/server/internals/Trigger.hpp +++ b/src/server/internals/Trigger.hpp @@ -48,12 +48,12 @@ public: GraphImpl* parent, SampleRate srate); - void run(RunContext& context); + void run(RunContext& context) override; bool note_on(RunContext& context, uint8_t note_num, uint8_t velocity, FrameTime time); bool note_off(RunContext& context, uint8_t note_num, FrameTime time); - void learn() { _learning = true; } + void learn() override { _learning = true; } static InternalPlugin* internal_plugin(URIs& uris); -- cgit v1.2.1