From dc0bf938e8c4794a7c02bd8895a9ab1fff2fc107 Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Mon, 2 Apr 2018 16:27:54 +0200 Subject: [PATCH] remove hardcoded clip numbers --- src/avtk/clipselector.cxx | 2 +- src/avtk/clipselector.hxx | 3 +-- src/looper.cxx | 2 +- src/looper.hxx | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/avtk/clipselector.cxx b/src/avtk/clipselector.cxx index b0ab6bf..5b6fccb 100644 --- a/src/avtk/clipselector.cxx +++ b/src/avtk/clipselector.cxx @@ -45,7 +45,7 @@ ClipSelector::ClipSelector( int _x, int _y, int _w, int _h, _master = master; if ( _master ) { - for(int i = 0; i < 10; i++ ) { + for(int i = 0; i < NSCENES; i++ ) { stringstream s; s << "Scene " << i + 1; clips[i].setName( s.str() ); diff --git a/src/avtk/clipselector.hxx b/src/avtk/clipselector.hxx index 35ba47d..001db14 100644 --- a/src/avtk/clipselector.hxx +++ b/src/avtk/clipselector.hxx @@ -77,8 +77,7 @@ public: int ID; - // FIXME: NSCENES? - static const int numClips = 10; + static const int numClips = NSCENES; ClipState clips[numClips]; /// indicates if a clip is the "special" clip diff --git a/src/looper.cxx b/src/looper.cxx index a79892b..ad376d1 100644 --- a/src/looper.cxx +++ b/src/looper.cxx @@ -42,7 +42,7 @@ Looper::Looper(int t) : //tmpRecordBuffer = (float*)malloc( sizeof(float) * MAX_BUFFER_SIZE ); //memset( tmpRecordBuffer, 0, sizeof(float) * MAX_BUFFER_SIZE ); - for(int i = 0; i < 10; i++ ) { + for(int i = 0; i < NSCENES; i++ ) { clips[i] = new LooperClip(track, i); } diff --git a/src/looper.hxx b/src/looper.hxx index 5bc3720..2f37814 100644 --- a/src/looper.hxx +++ b/src/looper.hxx @@ -70,7 +70,7 @@ private: int fpb; //vector tmpRecordBuffer; - LooperClip* clips[10]; + LooperClip* clips[NSCENES]; // Pitch Shifting void pitchShift(int count, float* input, float* output);