summaryrefslogtreecommitdiffstats
path: root/src/server/Buffer.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-03-20 03:04:15 +0100
committerDavid Robillard <d@drobilla.net>2017-03-20 03:19:33 +0100
commit59f579df71e52207bcdda15d4abb3562fdc1d6f2 (patch)
tree0b0749c2b7da1debffebca882bc46cb30ba1bacd /src/server/Buffer.hpp
parent8bf529bb24c03ebdce884cf9a4288812bb9b2cd5 (diff)
downloadingen-59f579df71e52207bcdda15d4abb3562fdc1d6f2.tar.gz
ingen-59f579df71e52207bcdda15d4abb3562fdc1d6f2.tar.bz2
ingen-59f579df71e52207bcdda15d4abb3562fdc1d6f2.zip
Remove dubious Buffer::nframes() method
Diffstat (limited to 'src/server/Buffer.hpp')
-rw-r--r--src/server/Buffer.hpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp
index 8742445f..939f1f87 100644
--- a/src/server/Buffer.hpp
+++ b/src/server/Buffer.hpp
@@ -101,16 +101,6 @@ public:
return NULL;
}
- /// Audio buffers only
- inline SampleCount nframes() const {
- if (is_control()) {
- return 1;
- } else if (is_audio()) {
- return (_capacity / sizeof(Sample));
- }
- return 0;
- }
-
/// Numeric buffers only
inline Sample value_at(SampleCount offset) const {
if (is_audio() || is_control()) {
@@ -126,7 +116,7 @@ public:
const SampleCount end)
{
assert(is_audio() || is_control());
- assert(end <= nframes());
+ assert(end <= _capacity / sizeof(Sample));
// Note: Do not change this without ensuring GCC can still vectorize it
Sample* const buf = samples() + start;
for (SampleCount i = 0; i < (end - start); ++i) {
@@ -139,7 +129,7 @@ public:
const SampleCount end)
{
assert(is_audio() || is_control());
- assert(end <= nframes());
+ assert(end <= _capacity / sizeof(Sample));
// Note: Do not change this without ensuring GCC can still vectorize it
Sample* const buf = samples() + start;
for (SampleCount i = 0; i < (end - start); ++i) {