diff options
author | David Robillard <d@drobilla.net> | 2013-10-28 23:52:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-10-28 23:52:58 +0000 |
commit | 9b74155f7b22cf1525d19cbad138b147aca1c124 (patch) | |
tree | c7437775ca45a602210f80d41cb89b468a0737d9 | |
parent | 4872ab2b213d9a1d9136103798781dbcc27993be (diff) | |
download | ingen-9b74155f7b22cf1525d19cbad138b147aca1c124.tar.gz ingen-9b74155f7b22cf1525d19cbad138b147aca1c124.tar.bz2 ingen-9b74155f7b22cf1525d19cbad138b147aca1c124.zip |
Pass sample rate to nodes (fix #931).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5162 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/Resource.cpp | 4 | ||||
-rw-r--r-- | src/server/LV2Options.hpp | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Resource.cpp b/src/Resource.cpp index cd448e32..aa6adf07 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -173,7 +173,6 @@ Resource::set_properties(const Properties& props) void Resource::add_properties(const Properties& props) { - typedef Resource::Properties::const_iterator iterator; for (const auto& p : props) add_property(p.first, p.second, p.second.context()); } @@ -181,7 +180,6 @@ Resource::add_properties(const Properties& props) void Resource::remove_properties(const Properties& props) { - typedef Resource::Properties::const_iterator iterator; for (const auto& p : props) remove_property(p.first, p.second); } @@ -193,8 +191,6 @@ Resource::properties(Resource::Graph ctx) const return properties(); } - typedef Resource::Properties::const_iterator iterator; - Properties props; for (const auto& p : _properties) { if (p.second.context() == Resource::Graph::DEFAULT diff --git a/src/server/LV2Options.hpp b/src/server/LV2Options.hpp index 6856fe28..e8ca6e93 100644 --- a/src/server/LV2Options.hpp +++ b/src/server/LV2Options.hpp @@ -33,6 +33,7 @@ public: explicit LV2Options(Engine& engine) : _block_length(0) , _seq_size(0) + , _sample_rate(0) { set(engine); } @@ -47,6 +48,7 @@ public: _block_length = engine.driver()->block_length(); _seq_size = engine.buffer_factory()->default_size( engine.world()->uris().atom_Sequence); + _sample_rate = (int32_t)(engine.driver()->sample_rate()); } } @@ -66,6 +68,8 @@ public: sizeof(int32_t), uris.atom_Int, &_block_length }, { LV2_OPTIONS_INSTANCE, 0, uris.bufsz_sequenceSize, sizeof(int32_t), uris.atom_Int, &_seq_size }, + { LV2_OPTIONS_INSTANCE, 0, uris.ingen_sampleRate, + sizeof(int32_t), uris.atom_Int, &_sample_rate }, { LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, NULL } }; @@ -79,6 +83,7 @@ public: private: int32_t _block_length; int32_t _seq_size; + int32_t _sample_rate; }; } // namespace Server |