1 #ifndef __AMUSE_SONGSTATE_HPP__ 2 #define __AMUSE_SONGSTATE_HPP__ 7 #include "optional.hpp" 14 enum class SongPlayState
29 uint32_t m_chanIdxOff;
30 uint32_t m_chanMapOff;
31 uint32_t m_tempoTableOff;
32 uint32_t m_initialTempo;
34 uint32_t m_chanOffs[64];
46 uint32_t m_startTick2;
77 const unsigned char* m_dataBase;
78 const unsigned char* m_data;
79 const unsigned char* m_pitchWheelData =
nullptr;
80 const unsigned char* m_modWheelData =
nullptr;
81 uint32_t m_lastPitchTick = 0;
82 int32_t m_lastPitchVal = 0;
83 uint32_t m_lastModTick = 0;
84 int32_t m_lastModVal = 0;
85 std::array<uint16_t, 128> m_remNoteLengths = {};
87 int32_t m_waitCountdown = 0;
89 Channel(
SongState& parent, uint8_t midiChan, uint32_t startTick,
90 const unsigned char* song,
const unsigned char* chan);
91 bool advance(
Sequencer& seq, int32_t ticks);
93 std::array<std::experimental::optional<Channel>, 64> m_channels;
96 const TempoChange* m_tempoPtr =
nullptr;
97 uint32_t m_tempo = 120;
99 uint32_t m_curTick = 0;
100 SongPlayState m_songState = SongPlayState::Playing;
101 double m_curDt = 0.f;
105 void initialize(
const unsigned char* ptr);
115 #endif // __AMUSE_SONGSTATE_HPP__