mirror of
https://github.com/LMMS/lmms.git
synced 2026-05-10 07:47:16 -04:00
Define fpp_t and f_cnt_t to be of size_t (#7363)
Defines `fpp_t` and `f_cnt_t` to be of `size_t` within `lmms_basics.h`. Most of the codebase used `fpp_t` to represent the size of an array of sample frames, which is incorrect, given that `fpp_t` was only 16 bits when sizes greater than 32767 are very possible. `f_cnt_t` was defined as `size_t` as well for consistency. --------- Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "SampleLoader.h"
|
||||
#include "Song.h"
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "plugin_export.h"
|
||||
|
||||
#include <QDomElement>
|
||||
@@ -276,7 +277,7 @@ QString AudioFileProcessor::nodeName() const
|
||||
|
||||
|
||||
|
||||
auto AudioFileProcessor::beatLen(NotePlayHandle* note) const -> int
|
||||
auto AudioFileProcessor::beatLen(NotePlayHandle* note) const -> f_cnt_t
|
||||
{
|
||||
// If we can play indefinitely, use the default beat note duration
|
||||
if (static_cast<Sample::Loop>(m_loopModel.value()) != Sample::Loop::Off) { return 0; }
|
||||
@@ -292,7 +293,7 @@ auto AudioFileProcessor::beatLen(NotePlayHandle* note) const -> int
|
||||
: m_nextPlayStartPoint;
|
||||
const auto duration = m_sample.endFrame() - startFrame;
|
||||
|
||||
return static_cast<int>(std::floor(duration * freqFactor));
|
||||
return static_cast<f_cnt_t>(std::floor(duration * freqFactor));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user