You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
618 B
35 lines
618 B
#ifndef __VOICEMANAGER_H__
|
|
#define __VOICEMANAGER_H__
|
|
|
|
#include <unordered_set>
|
|
#include <thread>
|
|
|
|
#include "voice.h"
|
|
|
|
#define NUM_VOICES 24
|
|
|
|
class VoiceManager {
|
|
public:
|
|
typedef unsigned int channel_t;
|
|
|
|
VoiceManager();
|
|
Voice* get(channel_t channel);
|
|
Voice** getChannelVoices(channel_t channel);
|
|
|
|
private:
|
|
typedef unsigned int serial_t;
|
|
typedef unsigned int score_t;
|
|
|
|
struct VoiceData {
|
|
channel_t channel;
|
|
serial_t serial;
|
|
Voice voice;
|
|
};
|
|
|
|
unsigned int serial;
|
|
VoiceData voices[NUM_VOICES];
|
|
|
|
unsigned int scoreVoice(VoiceData& voiceData);
|
|
};
|
|
|
|
#endif
|
|
|