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 --- 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 ++-- 43 files changed, 243 insertions(+), 235 deletions(-) (limited to 'src/server') 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