diff --git a/examples/Advanced/AudioParticles/AudioParticles.cpp b/examples/Advanced/AudioParticles/AudioParticles.cpp index dc67031..3783545 100644 --- a/examples/Advanced/AudioParticles/AudioParticles.cpp +++ b/examples/Advanced/AudioParticles/AudioParticles.cpp @@ -96,9 +96,14 @@ void AudioParticles::operator()(const halp::tick_musical& t) } ossia::remove_erase_if(m_playheads, [this](const auto& playhead) { + if(outputs.audio.channels <= playhead.channel) + return true; + if(std::ssize(m_sounds) <= playhead.index) + return true; + auto& sound = m_sounds[playhead.index]; - return playhead.frame >= sound[0].size() || (m_sounds.size() <= playhead.index) - || (outputs.audio.channels <= playhead.channel); + SCORE_ASSERT(!sound.empty()); + return playhead.frame >= std::ssize(sound[0]); }); } } diff --git a/examples/Advanced/MidiScaler/MidiScroller.hpp b/examples/Advanced/MidiScaler/MidiScroller.hpp index 4ad29fd..f1c825c 100644 --- a/examples/Advanced/MidiScaler/MidiScroller.hpp +++ b/examples/Advanced/MidiScaler/MidiScroller.hpp @@ -68,8 +68,8 @@ struct MidiScroller if(track < 0) track = 0; - if(track >= inputs.midi.midifile.tracks.size()) - track = inputs.midi.midifile.tracks.size() - 1; + if(track >= tracks) + track = tracks - 1; for(const auto& ev : inputs.midi.midifile.tracks[track]) { diff --git a/examples/Advanced/MidiScaler/StrStream.hpp b/examples/Advanced/MidiScaler/StrStream.hpp index 3a33be7..2d6b6d1 100644 --- a/examples/Advanced/MidiScaler/StrStream.hpp +++ b/examples/Advanced/MidiScaler/StrStream.hpp @@ -481,6 +481,8 @@ inline strstreambuf::pos_type strstreambuf::seekoff( if(pos_in == pos_out) return pos_type(off_type(-1)); break; + default: + break; } if(pos_in && gptr() == nullptr)