voice interface and type checks

This commit is contained in:
Christopher Herb
2023-07-10 18:10:25 +02:00
parent 92fe1eea22
commit 7c1bd1c982
4 changed files with 41 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "midi_event.h"
#include "ivoice.h"
#include <vector>
namespace trnr {
@@ -12,6 +13,8 @@ public:
voice_allocator()
: voices(8, t_voice())
{
// checks whether template derives from ivoice
typedef t_voice assert_at_compile_time[is_convertible<t_voice>::value ? 1 : -1];
}
void set_voice_count(const int& voice_count)