From 25b398ea000b5529084d985bd14ed066a81578d3 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 16 Jun 2019 10:47:33 +0200 Subject: Make max channnel count controllable through the configure script to make it possible to exceed the default 16. --- src/drumgizmo.cc | 2 +- src/drumgizmo.h | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index 1e1974f..dcbb7bd 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -446,7 +446,7 @@ void DrumGizmo::setSamplerate(float samplerate) buf.reset(new sample_t[MAX_RESAMPLER_BUFFER_SIZE]); } - for(int c = 0; c < MAX_NUM_CHANNELS; ++c) + for(int c = 0; c < NUM_CHANNELS; ++c) { zita[c].reset(); auto nchan = 1u; // mono diff --git a/src/drumgizmo.h b/src/drumgizmo.h index 4592143..9d2e661 100644 --- a/src/drumgizmo.h +++ b/src/drumgizmo.h @@ -26,6 +26,8 @@ */ #pragma once +#include + #include #include #include @@ -74,7 +76,6 @@ public: void setRandomSeed(unsigned int seed); private: - static constexpr int MAX_NUM_CHANNELS = 64; static constexpr int MAX_RESAMPLER_BUFFER_SIZE = 4096 * 8; protected: @@ -83,7 +84,7 @@ protected: AudioOutputEngine& oe; AudioInputEngine& ie; - std::list< Event* > activeevents[MAX_NUM_CHANNELS]; + std::list< Event* > activeevents[NUM_CHANNELS]; bool enable_resampling{true}; @@ -101,8 +102,8 @@ protected: SettingsGetter settings_getter; Random rand; - std::array zita; - std::array, MAX_NUM_CHANNELS> resampler_input_buffer; + std::array zita; + std::array, NUM_CHANNELS> resampler_input_buffer; double ratio = 1.0; }; -- cgit v1.2.3