1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-12 00:30:31 +00:00

Fixed uninitialised error and incorrect default constructor.

This commit is contained in:
Thomas Harte 2016-02-12 22:35:16 -05:00
parent fd2d5c78f8
commit f57d6d350b

View File

@ -16,19 +16,15 @@ namespace SignalProcessing {
class Stepper
{
public:
Stepper()
{
Stepper(1, 1);
}
Stepper() : Stepper(1,1) {}
Stepper(uint64_t output_rate, uint64_t input_rate)
{
input_rate_ = input_rate;
output_rate_ = output_rate;
whole_step_ = output_rate / input_rate;
adjustment_up_ = (int64_t)(output_rate % input_rate) << 1;
adjustment_down_ = (int64_t)input_rate << 1;
}
Stepper(uint64_t output_rate, uint64_t input_rate) :
accumulated_error_(0),
input_rate_(input_rate),
output_rate_(output_rate),
whole_step_(output_rate / input_rate),
adjustment_up_((int64_t)(output_rate % input_rate) << 1),
adjustment_down_((int64_t)input_rate << 1) {}
inline uint64_t step()
{