diff options
author | Wohlstand <admin@wohlnet.ru> | 2021-10-25 05:26:48 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2021-10-25 05:26:48 +0300 |
commit | 57a8d528e877d3810deaa1ce24545512e1a46ac9 (patch) | |
tree | 437057856291966b8b813d6e8b12e3e581d2fea5 /src/midi_sequencer.hpp | |
parent | 87ed51791a8f486b48eed5aaa8f58ee8c30c8bdf (diff) | |
download | libADLMIDI-57a8d528e877d3810deaa1ce24545512e1a46ac9.tar.gz libADLMIDI-57a8d528e877d3810deaa1ce24545512e1a46ac9.tar.bz2 libADLMIDI-57a8d528e877d3810deaa1ce24545512e1a46ac9.zip |
Updated the midi sequencer code
Diffstat (limited to 'src/midi_sequencer.hpp')
-rw-r--r-- | src/midi_sequencer.hpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/midi_sequencer.hpp b/src/midi_sequencer.hpp index e89ecca..bba33e3 100644 --- a/src/midi_sequencer.hpp +++ b/src/midi_sequencer.hpp @@ -384,6 +384,9 @@ private: //! Is song at end bool m_atEnd; + //! Set the number of loops limit. Lesser than 0 - loop infinite + int m_loopCount; + /** * @brief Loop stack entry */ @@ -427,6 +430,15 @@ private: //! Are loop points invalid? bool invalidLoop; /*Loop points are invalid (loopStart after loopEnd or loopStart and loopEnd are on same place)*/ + //! Is look got temporarily broken because of post-end seek? + bool temporaryBroken; + + //! How much times the loop should start repeat? For example, if you want to loop song twice, set value 1 + int loopsCount; + + //! how many loops left until finish the song + int loopsLeft; + //! Stack of nested loops std::vector<LoopStackEntry> stack; //! Current level on the loop stack (<0 - out of loop, 0++ - the index in the loop stack) @@ -443,12 +455,15 @@ private: caughtStackEnd = false; caughtStackBreak = false; skipStackStart = false; + loopsLeft = loopsCount; } void fullReset() { + loopsCount = -1; reset(); invalidLoop = false; + temporaryBroken = false; stack.clear(); stackLevel = -1; } @@ -495,6 +510,8 @@ private: std::vector<bool> m_trackDisable; //! Index of solo track, or max for disabled size_t m_trackSolo; + //! MIDI channel disable (exception for extra port-prefix-based channels) + bool m_channelDisable[16]; /** * @brief Handler of callback trigger events @@ -581,6 +598,14 @@ public: bool setTrackEnabled(size_t track, bool enable); /** + * @brief Disable/enable a channel is sounding + * @param channel Channel number from 0 to 15 + * @param enable Enable the channel playback + * @return true on success, false if there was no such channel + */ + bool setChannelEnabled(size_t channel, bool enable); + + /** * @brief Enables or disables solo on a track * @param track Identifier of solo track, or max to disable */ @@ -618,6 +643,18 @@ public: void setLoopEnabled(bool enabled); /** + * @brief Get the number of loops set + * @return number of loops or -1 if loop infinite + */ + int getLoopsCount(); + + /** + * @brief How many times song should loop + * @param loops count or -1 to loop infinite + */ + void setLoopsCount(int loops); + + /** * @brief Switch loop hooks-only mode on/off * @param enabled Don't loop: trigger hooks only without loop */ |