initialize all voices instead of dynamic allocation (fixes access errors)
This commit is contained in:
@@ -14,12 +14,10 @@ namespace trnr {
|
||||
template <typename t_voice, typename t_sample>
|
||||
class midi_synth : public voice_allocator<t_voice, t_sample> {
|
||||
public:
|
||||
midi_synth(size_t voice_reserve = 1)
|
||||
midi_synth(size_t num_voices = 1)
|
||||
: m_voices_active {false}
|
||||
, trnr::voice_allocator<t_voice, t_sample>(num_voices)
|
||||
{
|
||||
// call base constructor with a reserve of 1 voice
|
||||
voice_allocator<t_voice, t_sample>::set_voice_count(voice_reserve);
|
||||
|
||||
// checks whether template derives from ivoice
|
||||
typedef t_voice assert_at_compile_time[is_convertible<t_voice, t_sample>::value ? 1 : -1];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user