summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-09-25 22:01:36 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-09-25 22:32:21 +0200
commitd2c694e32ac9424f6c9bc681dab59cae3a0c4ba4 (patch)
treec683189ee900e334faaf4150fc11b55d20ad3953 /src/engine
parentf7992bbaa9eb11fa6f2a84b97a014de44df016b9 (diff)
engine/controls/loopingcontrol: Improve usage of some types
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/controls/loopingcontrol.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/engine/controls/loopingcontrol.cpp b/src/engine/controls/loopingcontrol.cpp
index fbce5c8a8d..e3fe43dca2 100644
--- a/src/engine/controls/loopingcontrol.cpp
+++ b/src/engine/controls/loopingcontrol.cpp
@@ -250,17 +250,16 @@ void LoopingControl::slotLoopScale(double scaleFactor) {
if (loopSamples.start == kNoTrigger || loopSamples.end == kNoTrigger) {
return;
}
- double loop_length = loopSamples.end - loopSamples.start;
- int trackSamples = m_pTrackSamples->get();
- loop_length *= scaleFactor;
+ const double loopLength = (loopSamples.end - loopSamples.start) * scaleFactor;
+ const int trackSamples = static_cast<int>(m_pTrackSamples->get());
// Abandon loops that are too short of extend beyond the end of the file.
- if (loop_length < MINIMUM_AUDIBLE_LOOP_SIZE ||
- loopSamples.start + loop_length > trackSamples) {
+ if (loopLength < MINIMUM_AUDIBLE_LOOP_SIZE ||
+ loopSamples.start + loopLength > trackSamples) {
return;
}
- loopSamples.end = loopSamples.start + loop_length;
+ loopSamples.end = loopSamples.start + loopLength;
// TODO(XXX) we could be smarter about taking the active beatloop, scaling
// it by the desired amount and trying to find another beatloop that matches
@@ -1031,7 +1030,7 @@ void LoopingControl::slotBeatLoop(double beats, bool keepStartPoint, bool enable
beats = minBeatSize;
}
- int samples = m_pTrackSamples->get();
+ int samples = static_cast<int>(m_pTrackSamples->get());
mixxx::BeatsPointer pBeats = m_pBeats;
if (samples == 0 || !pBeats) {
clearActiveBeatLoop();