summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-03-19 20:22:33 +0100
committerDavid Robillard <d@drobilla.net>2017-03-20 02:58:56 +0100
commitd2927c78d9719119d7db2f97742f9596d64e4003 (patch)
tree13f8d4408f410128508b5feae416788039dd098d
parent7a8cbbf3fe2a355e01d0e077395cc0876aecf019 (diff)
downloadingen-d2927c78d9719119d7db2f97742f9596d64e4003.tar.gz
ingen-d2927c78d9719119d7db2f97742f9596d64e4003.tar.bz2
ingen-d2927c78d9719119d7db2f97742f9596d64e4003.zip
Fix event timing and remove vestigial DirectDriver
-rw-r--r--ingen/EngineBase.hpp10
-rw-r--r--src/server/DirectDriver.hpp103
-rw-r--r--src/server/Engine.cpp16
-rw-r--r--src/server/Engine.hpp2
4 files changed, 1 insertions, 130 deletions
diff --git a/ingen/EngineBase.hpp b/ingen/EngineBase.hpp
index a57743fe..c52ee559 100644
--- a/ingen/EngineBase.hpp
+++ b/ingen/EngineBase.hpp
@@ -39,16 +39,6 @@ public:
virtual ~EngineBase() {}
/**
- Initialise the engine for local use (e.g. without a Jack driver).
- @param sample_rate Audio sampling rate in Hz.
- @param block_length Audio block length (i.e. buffer size) in frames.
- @param seq_size Sequence buffer size in bytes.
- */
- virtual void init(double sample_rate,
- uint32_t block_length,
- size_t seq_size) = 0;
-
- /**
Activate the engine.
*/
virtual bool activate() = 0;
diff --git a/src/server/DirectDriver.hpp b/src/server/DirectDriver.hpp
deleted file mode 100644
index 376c6ad8..00000000
--- a/src/server/DirectDriver.hpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- This file is part of Ingen.
- Copyright 2007-2016 David Robillard <http://drobilla.net/>
-
- Ingen is free software: you can redistribute it and/or modify it under the
- terms of the GNU Affero General Public License as published by the Free
- Software Foundation, either version 3 of the License, or any later version.
-
- Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU Affero General Public License for details.
-
- You should have received a copy of the GNU Affero General Public License
- along with Ingen. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef INGEN_ENGINE_DIRECT_DRIVER_HPP
-#define INGEN_ENGINE_DIRECT_DRIVER_HPP
-
-#include <boost/intrusive/slist.hpp>
-
-#include "Driver.hpp"
-
-namespace Ingen {
-namespace Server {
-
-/** Driver for running Ingen directly as a library.
- * \ingroup engine
- */
-class DirectDriver : public Driver {
-public:
- DirectDriver(double sample_rate, SampleCount block_length, size_t seq_size)
- : _sample_rate(sample_rate)
- , _block_length(block_length)
- , _seq_size(seq_size)
- {}
-
- virtual ~DirectDriver() {
- _ports.clear_and_dispose([](EnginePort* p) { delete p; });
- }
-
- bool dynamic_ports() const { return true; }
-
- virtual EnginePort* create_port(DuplexPort* graph_port) {
- return new EnginePort(graph_port);
- }
-
- virtual EnginePort* get_port(const Raul::Path& path) {
- for (auto& p : _ports) {
- if (p.graph_port()->path() == path) {
- return &p;
- }
- }
-
- return NULL;
- }
-
- virtual void add_port(RunContext& context, EnginePort* port) {
- _ports.push_back(*port);
- }
-
- virtual void remove_port(RunContext& context, EnginePort* port) {
- _ports.erase(_ports.iterator_to(*port));
- }
-
- virtual void rename_port(const Raul::Path& old_path,
- const Raul::Path& new_path) {}
-
- virtual void port_property(const Raul::Path& path,
- const Raul::URI& uri,
- const Atom& value) {}
-
- virtual void register_port(EnginePort& port) {}
- virtual void unregister_port(EnginePort& port) {}
-
- 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 0; }
-
- virtual void append_time_events(RunContext& context,
- Buffer& buffer) {}
-
- virtual int real_time_priority() { return 60; }
-
-private:
- typedef boost::intrusive::slist<EnginePort,
- boost::intrusive::cache_last<true>
- > Ports;
-
- Ports _ports;
- SampleCount _sample_rate;
- SampleCount _block_length;
- size_t _seq_size;
-};
-
-} // namespace Server
-} // namespace Ingen
-
-#endif // INGEN_ENGINE_DIRECT_DRIVER_HPP
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index 27ca83e4..c858fc6b 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -40,7 +40,6 @@
#include "Broadcaster.hpp"
#include "BufferFactory.hpp"
#include "ControlBindings.hpp"
-#include "DirectDriver.hpp"
#include "Driver.hpp"
#include "Engine.hpp"
#include "Event.hpp"
@@ -90,7 +89,6 @@ Engine::Engine(Ingen::World* world)
, _uniform_dist(0.0f, 1.0f)
, _quit_flag(false)
, _reset_load_flag(false)
- , _direct_driver(true)
, _atomic_bundles(world->conf().option("atomic-bundles").get<int32_t>())
, _activated(false)
{
@@ -379,12 +377,7 @@ Engine::event_time()
return 0;
}
- // FIXME: Jitter with direct driver
- const SampleCount now = _direct_driver
- ? run_context().start()
- : _driver->frame_time();
-
- return now + _driver->block_length();
+ return _driver->frame_time() + _driver->block_length();
}
uint64_t
@@ -399,13 +392,6 @@ Engine::reset_load()
_reset_load_flag = true;
}
-void
-Engine::init(double sample_rate, uint32_t block_length, size_t seq_size)
-{
- set_driver(SPtr<Driver>(new DirectDriver(sample_rate, block_length, seq_size)));
- _direct_driver = true;
-}
-
bool
Engine::activate()
{
diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp
index 9b0afc2f..1ea048eb 100644
--- a/src/server/Engine.hpp
+++ b/src/server/Engine.hpp
@@ -76,7 +76,6 @@ public:
virtual ~Engine();
// EngineBase methods
- virtual void init(double sample_rate, uint32_t block_length, size_t seq_size);
virtual bool activate();
virtual void deactivate();
virtual bool pending_events();
@@ -205,7 +204,6 @@ private:
bool _quit_flag;
bool _reset_load_flag;
- bool _direct_driver;
bool _atomic_bundles;
bool _activated;
};