12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #pragma once
- #include <mutex>
- #include "Output.h"
- #include "BeatSequence.h"
- #include "CallbackClock.h"
- namespace midi {
- class BeatSequencePlayer
- {
- public:
- typedef BeatSequence::BeatIndex BeatIndex;
- typedef CallbackClock::bpm_type Bpm;
- private:
- bool looping;
- std::mutex looping_mutex;
- BeatIndex nextBeat;
- std::mutex nextBeat_mutex;
- CallbackClock clock;
- public:
- const BeatSequence* sequence;
- BeatSequencePlayer();
- BeatSequencePlayer(const BeatSequence* sequence);
- Bpm getBpm();
- void setBpm(Bpm bpm);
- bool getLooping();
- void setLooping(bool looping);
- BeatIndex getNextBeat();
- void setNextBeat(BeatIndex nextBeat);
- void play();
- void loop();
- void start();
- void stop();
- bool isPlaying();
- private:
- static void beat(void* data);
- };
- } // namespace
|