MCPcopy Create free account
hub / github.com/BambooTracker/BambooTracker / checkValidPosition

Method checkValidPosition

BambooTracker/playback.cpp:364–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364void PlaybackManager::checkValidPosition()
365{
366 auto& song = mod_.lock()->getSong(curSongNum_);
367 int orderSize = static_cast<int>(song.getOrderSize());
368 if (playingPos_.order >= orderSize) {
369 playingPos_.set(0, 0);
370 nextReadPos_ = playingPos_;
371 }
372 else if (playingPos_.step >= static_cast<int>(song.getPatternSizeFromOrderNumber(playingPos_.order))) {
373 if (playingPos_.order == orderSize - 1) {
374 playingPos_.set(0, 0);
375 nextReadPos_ = playingPos_;
376 }
377 else {
378 ++playingPos_.order;
379 playingPos_.step = 0;
380 nextReadPos_ = playingPos_;
381 }
382 }
383}
384
385/// Register update order: volume -> instrument -> effect -> key on
386void PlaybackManager::stepProcess()

Callers

nothing calls this directly

Calls 3

setMethod · 0.80
getOrderSizeMethod · 0.45

Tested by

no test coverage detected