Made it such that the signal generator always starts from the start (pos 0)
This commit is contained in:
parent
4cd390871a
commit
cf672dc9d7
@ -38,6 +38,7 @@ protected:
|
||||
int _interruption_frame_count = 0;
|
||||
|
||||
virtual void resetImpl() = 0;
|
||||
virtual void resetPos() = 0;
|
||||
virtual vd genSignalUnscaled(const us nframes) = 0;
|
||||
|
||||
public:
|
||||
@ -75,7 +76,7 @@ public:
|
||||
*
|
||||
* @param mute if true
|
||||
*/
|
||||
void setMute(bool mute = true) { _muted = mute; _interruption_frame_count=0; }
|
||||
void setMute(bool mute = true) { _muted = mute; _interruption_frame_count=0; resetPos();}
|
||||
|
||||
/**
|
||||
* @brief Set the level of the signal generator
|
||||
|
@ -29,6 +29,7 @@ vd Noise::genSignalUnscaled(us nframes)
|
||||
return arma::randn<vd>(nframes);
|
||||
}
|
||||
void Noise::resetImpl() {}
|
||||
void Noise::resetPos() {}
|
||||
|
||||
Sine::Sine(const d freq) : omg(2 * arma::datum::pi * freq) { DEBUGTRACE_ENTER; }
|
||||
|
||||
|
@ -18,6 +18,7 @@ class Noise : public Siggen {
|
||||
d level_linear;
|
||||
virtual vd genSignalUnscaled(const us nframes) override;
|
||||
void resetImpl() override;
|
||||
void resetPos() override;
|
||||
|
||||
public:
|
||||
/**
|
||||
@ -39,6 +40,7 @@ class Sine : public Siggen {
|
||||
|
||||
protected:
|
||||
void resetImpl() override final { phase = 0; }
|
||||
void resetPos() override final { phase = 0; }
|
||||
virtual vd genSignalUnscaled(const us nframes) override final;
|
||||
|
||||
public:
|
||||
@ -73,6 +75,8 @@ class Periodic: public Siggen {
|
||||
|
||||
void setA(const vd& A);
|
||||
|
||||
void resetPos() override final { _cur_pos = 0; }
|
||||
|
||||
virtual vd genSignalUnscaled(const us nframes) override final;
|
||||
|
||||
vd getA() const { return A_; }
|
||||
@ -91,7 +95,7 @@ class Sweep : public Periodic {
|
||||
vd fn_ { 1, arma::fill::zeros};
|
||||
|
||||
void resetImpl() override;
|
||||
|
||||
|
||||
public:
|
||||
static constexpr int ForwardSweep = 1 << 0;
|
||||
static constexpr int BackwardSweep = 1 << 1;
|
||||
|
Loading…
Reference in New Issue
Block a user