-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathISingingSynthesizer.hpp
60 lines (46 loc) · 1.09 KB
/
ISingingSynthesizer.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
#include <string>
#include <memory>
#include "./IWaveformReceiver.hpp"
namespace cadencii {
namespace singing {
class IScoreProvider;
class ISingingSynthesizer : public IWaveformReceiver
{
public:
explicit ISingingSynthesizer(int sample_rate)
: sample_rate_(sample_rate)
{}
virtual ~ISingingSynthesizer()
{}
void bind(std::shared_ptr<cadencii::singing::IScoreProvider> const& provider)
{
provider_ = provider;
processed_samles_ = 0;
}
void unbind()
{
provider_.reset();
}
virtual bool setConfig(std::string const& key, std::string const& value) = 0;
void render(double * left, double * right, size_t length)
{
this->operator ()(left, right, length);
processed_samles_ += length;
}
size_t processedSamples() const
{
return processed_samles_;
}
size_t sampleRate() const
{
return sample_rate_;
}
protected:
std::shared_ptr<cadencii::singing::IScoreProvider> provider_;
private:
size_t processed_samles_;
size_t const sample_rate_;
};
}
}