-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FIXMEs for use of bpm.value() without checking #4165
Add FIXMEs for use of bpm.value() without checking #4165
Conversation
bool tryGetBeatgrid(BeatsPointer pBeats, | ||
mixxx::audio::FramePos cuePlayPos, | ||
int64_t frameCount, | ||
std::vector<djinterop::beatgrid_marker>* pBeatgrid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code in this method is essentially unchanged from before, but has been lifted out of the main exportMetadata()
function, and early-exit conditions added if any positions turn out to be invalid.
qWarning() << "Hot cue" << hotCueIndex << "exists but is invalid for track" | ||
<< pTrack->getId() << "(" << pTrack->getFileInfo().fileName() << ")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the assumption that it is a warning-worthy situation to have a cue point for a track, but for that cue point to have an invalid position.
Pull Request Test Coverage Report for Build 1085927887
💛 - Coveralls |
@@ -782,6 +782,7 @@ QVariant BaseTrackTableModel::roleValue( | |||
case ColumnCache::COLUMN_LIBRARYTABLE_BPM: { | |||
bool ok; | |||
const auto bpmValue = rawValue.toDouble(&ok); | |||
// FIXME: calling bpm.value() without checking bpm.isValid() | |||
return ok ? bpmValue : mixxx::Bpm().value(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mixxx::Bpm().value() should be replaced with mixxx::Bpm::kValueUndefined wherever it occurs
@Holzhaus Maybe add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! We can replace the FIXMEs in subsequent PRs.
|
Huh??? I merged #4058 and somehow GitHub merged this too????? |
Strange. I pressed merge once here before I noticed the conflicts and GitHub refused to merge. |
This PR does two things:
FIXME
statements any instances in the code where I could see a call toBpm::value()
without an appropriate check or assertion onBpm::isValid()
first.With regard to the FIXMEs, it may be the case that some parts of the code I highlighted in this PR are actually safe - but the point of this PR is simply to highlight where any such safety doesn't seem immediately "obvious".
Happy to review any of the FIXMEs (i.e. remove or fix them if trivial!) before this PR is approved.