15 std::string_view samplesBaseName,
unsigned numSamples,
16 std::string_view alternativeName = {});
23 void play(
unsigned sampleNum);
32 void repeat(
unsigned sampleNum);
42 [[nodiscard]]
bool isPlaying()
const {
return currentSampleNum != unsigned(-1); }
44 template<
typename Archive>
45 void serialize(Archive& ar,
unsigned version);
52 void generateChannels(std::span<float*> bufs,
unsigned num)
override;
59 unsigned currentSampleNum;
60 unsigned nextSampleNum;
bool isPlaying() const
Is there currently playing a sample.
void serialize(Archive &ar, unsigned version)
SamplePlayer(const std::string &name, static_string_view desc, const DeviceConfig &config, std::string_view samplesBaseName, unsigned numSamples, std::string_view alternativeName={})
void play(unsigned sampleNum)
Start playing a (new) sample.
void repeat(unsigned sampleNum)
Keep on repeating the given sample data.
void stopRepeat()
Stop repeat mode.
This file implemented 3 utility functions: