From 7929f46d0a78e5cac7c35c6da8e4ac7fbe2668e9 Mon Sep 17 00:00:00 2001 From: John Glover Date: Wed, 24 Aug 2011 09:23:11 +0100 Subject: Change frame objects to have pointers to number arrays instead of having their own std::vector of samples --- src/simpl/base.cpp | 8 -------- src/simpl/base.h | 9 +++++---- tests/testbase.cpp | 8 -------- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/simpl/base.cpp b/src/simpl/base.cpp index cc9dc2c..42832d6 100644 --- a/src/simpl/base.cpp +++ b/src/simpl/base.cpp @@ -93,10 +93,6 @@ Frame::~Frame() void Frame::init() { - audio.resize(_size); - synth.resize(_size); - residual.resize(_size); - synth_residual.resize(_size); _max_peaks = 100; peaks.resize(_max_peaks); _max_partials = 100; @@ -111,10 +107,6 @@ int Frame::size() void Frame::size(int new_size) { _size = new_size; - audio.resize(_size); - synth.resize(_size); - residual.resize(_size); - synth_residual.resize(_size); } int Frame::max_peaks() diff --git a/src/simpl/base.h b/src/simpl/base.h index 7649f86..a0064f1 100644 --- a/src/simpl/base.h +++ b/src/simpl/base.h @@ -30,6 +30,7 @@ namespace Simpl { typedef double number; +typedef std::vector samples; // --------------------------------------------------------------------------- // Peak @@ -89,10 +90,10 @@ protected: public: Peaks peaks; Partials partials; - std::vector audio; - std::vector synth; - std::vector residual; - std::vector synth_residual; + number* audio; + number* synth; + number* residual; + number* synth_residual; Frame(); Frame(int frame_size); diff --git a/tests/testbase.cpp b/tests/testbase.cpp index 34cefde..4e1293a 100644 --- a/tests/testbase.cpp +++ b/tests/testbase.cpp @@ -125,10 +125,6 @@ protected: void test_constructor() { CPPUNIT_ASSERT(frame->size() == 512); - CPPUNIT_ASSERT(frame->audio.size() == 512); - CPPUNIT_ASSERT(frame->synth.size() == 512); - CPPUNIT_ASSERT(frame->residual.size() == 512); - CPPUNIT_ASSERT(frame->synth_residual.size() == 512); CPPUNIT_ASSERT(frame->max_peaks() == 100); CPPUNIT_ASSERT(frame->peaks.size() == 100); CPPUNIT_ASSERT(frame->max_partials() == 100); @@ -139,10 +135,6 @@ protected: { frame->size(1024); CPPUNIT_ASSERT(frame->size() == 1024); - CPPUNIT_ASSERT(frame->audio.size() == 1024); - CPPUNIT_ASSERT(frame->synth.size() == 1024); - CPPUNIT_ASSERT(frame->residual.size() == 1024); - CPPUNIT_ASSERT(frame->synth_residual.size() == 1024); frame->size(512); } -- cgit v1.2.3