Skip to content

Commit

Permalink
[examples] Minor warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Oct 27, 2024
1 parent e8d7216 commit 5d7dd42
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 7 additions & 2 deletions examples/Advanced/AudioParticles/AudioParticles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
});
}
}
4 changes: 2 additions & 2 deletions examples/Advanced/MidiScaler/MidiScroller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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])
{
Expand Down
2 changes: 2 additions & 0 deletions examples/Advanced/MidiScaler/StrStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5d7dd42

Please sign in to comment.