Skip to content

Commit 1322a7e

Browse files
committed
copypaste typo
1 parent 0f8aad2 commit 1322a7e

8 files changed

+60
-95
lines changed

VAlgorithm.c++

-36
Original file line numberDiff line numberDiff line change
@@ -75,31 +75,6 @@ VAlgorithm::VAlgorithm(void) :
7575
hpf_d.setHiAllLopassGain(1., 0., 0.);
7676
}
7777

78-
//===========================================================================
79-
// VAlgorithm copy constructor
80-
//
81-
// The buffer should not be shared, and the
82-
// new object needs its own place in the Generators
83-
// list. Don't copy amp modulation either.
84-
// ;; Probably bugs in here, but it's not called as far as I can tell.
85-
//
86-
VAlgorithm::VAlgorithm(VAlgorithm& alg) :
87-
mute(alg.mute),
88-
pause(alg.pause),
89-
pan(alg.pan),
90-
elev(alg.elev),
91-
modGain(0L),
92-
modScale(0L),
93-
modPan(0L),
94-
modElev(0L),
95-
fLinearEnv(0)
96-
{
97-
position = Generators.insert( Generators.end(), this );
98-
setGain(alg.getGain());
99-
scaleGain(alg.getGainScale());
100-
setInputGain(alg.getInputGain());
101-
}
102-
10378
VAlgorithm::~VAlgorithm()
10479
{
10580
// remove the dead generator from the list
@@ -111,10 +86,6 @@ void VAlgorithm::invertAmp(int fInvert)
11186
fInvertAmp = fInvert;
11287
}
11388

114-
//===========================================================================
115-
// setAmps
116-
//
117-
11889
void VAlgorithm::setAmp(float a, float t)
11990
{
12091
if (!fLinearEnv)
@@ -612,11 +583,9 @@ VAlgorithm::updateDistance(void)
612583
}
613584
}
614585

615-
//===========================================================================
616586
//===========================================================================
617587
//===================== The final mixing bus of VSS ========================
618588
//===========================================================================
619-
//===========================================================================
620589

621590
// FOutputSamples 1,2
622591
// Utility functions to handle pause and mute states,
@@ -847,7 +816,6 @@ VAlgorithm::OutputSamples4(int howMany, float* putEmHere, int nchansAlgorithm, i
847816
// for copying and scaling their samples into putEmHere[]).
848817
//
849818
// Update amplitudes every sample.
850-
//
851819
void
852820
VAlgorithm::outputSamples( int howMany, float* putEmHere, int nchans )
853821
{
@@ -867,7 +835,3 @@ VAlgorithm::outputSamples( int howMany, float* putEmHere, int nchans )
867835
// Store the result in the output buffer putEmHere[].
868836
OutputSamples3(howMany, putEmHere, nchans);
869837
}
870-
871-
void VAlgorithm::generateSamples(int)
872-
{
873-
}

VAlgorithm.h

+9-12
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ using VAlgorithmList = std::set<VAlgorithm*>;
3232
// in VSS. All other synthesis algorithms must be derived from VAlgorithm.
3333
class VAlgorithm
3434
{
35-
// internal parameters (all private, only accessible thru access members)
36-
private:
3735
// If mute is true, this instance is _not_ directly contributing to output.
3836
int mute;
3937

@@ -161,13 +159,12 @@ class VAlgorithm
161159
public:
162160
virtual void outputSamples(int howMany, float* putEmHere, int nchans);
163161

164-
// generateSamples() should be overridden by all derived algorithms
165-
// that do not override outputSamples(). generateSamples() computes
166-
// samples and stuffs them in the local circular buffer. If a derived
167-
// algorithm class overrides outputSamples(), then it may not use/need
168-
// a generateSamples() member. Otherwise we would make it pure virtual.
169162
protected:
170-
virtual void generateSamples(int);
163+
// generateSamples() must be overridden by any class that does
164+
// not override outputSamples(). It computes samples and stuffs
165+
// them in the local circular buffer. If a derived class overrides
166+
// outputSamples(), then it may not need a generateSamples().
167+
virtual void generateSamples(int) {}
171168

172169
// Flag and utility functions called by the default implementation of outputSamples()
173170
// If outputSamples() must be overridden by the algorithm, the author may choose to use
@@ -189,9 +186,10 @@ class VAlgorithm
189186
inline void setDistanceImmediately(void);
190187

191188
public:
192-
VAlgorithm(void);
193-
VAlgorithm(VAlgorithm&);
194-
virtual ~VAlgorithm();
189+
VAlgorithm();
190+
VAlgorithm(const VAlgorithm&) = delete;
191+
VAlgorithm& operator=(const VAlgorithm&) = delete;
192+
virtual ~VAlgorithm();
195193

196194
// "buffer" is private, not protected... derived classes get at it through
197195
// ZeroBuf(), Input(), Output(), operator[](), etc.
@@ -222,5 +220,4 @@ class VAlgorithm
222220
{ bufDst = buffer; // Copy samples from *this to bufDst.
223221
bufDst.Map(howMany, nchansAlg, nchansDst); // Transform the samples.
224222
}
225-
226223
};

VFloatParam.h

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#pragma once
33
#include "VModulator.h"
44

5+
// Included only by stk4/stk.h.
6+
57
// Class FloatParam updates a smoothly (linearly) modulating float
68
// parameter. FloatParam should be set inactive whenever the slope
79
// is zero.
@@ -41,6 +43,8 @@ class FloatParam : public VModulatorOld<float, RcvrType>
4143
void init(VHandler* p) { pparent = p; }
4244

4345
~FloatParam() {}
46+
FloatParam(const FloatParam&) = delete;
47+
FloatParam& operator=(const FloatParam&) = delete;
4448

4549
// Return the current value of the modulation.
4650
float currentValue(void);

VGenActor.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ class HandlerListIterator
127127
HandlerListIterator(const HandlerListIterator &hli) : it(hli.it) {}
128128
~HandlerListIterator() {}
129129

130-
HandlerListIterator & operator ++() { it++; return *this; }
131-
HandlerListIterator & operator ++(int) { it++; return *this; }
130+
HandlerListIterator & operator ++() { ++it; return *this; }
131+
HandlerListIterator & operator ++(int) { ++it; return *this; }
132132
HandlerListIterator & operator=( HandlerList::iterator i )
133133
{ it = i; return *this; }
134134

VHandler.h

+3
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ class VFloatArray : public VModulator
7878
public:
7979
VFloatArray(int sizeArg, const float* oldVals, const float* newVals, float modTime);
8080
~VFloatArray();
81+
VFloatArray(const VFloatArray&) = delete;
82+
VFloatArray& operator=(const VFloatArray&) = delete;
8183
int SetAttribute(VHandler*, IParam);
8284
};
8385

@@ -147,6 +149,7 @@ class VHandler : public VActor
147149
VHandler(VAlgorithm* const);
148150
virtual ~VHandler();
149151
VHandler() = delete;
152+
VHandler(const VHandler&) = delete;
150153
VHandler& operator=(const VHandler&) = delete;
151154

152155
void setInputGain(float, float time = timeDefault);

VModulator.h

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// This fragment of the vss renaissance brought to you by Kelly Fitz, 1996.
21
#pragma once
32
#include "VActor.h"
43

@@ -22,9 +21,9 @@
2221
template<class ParamType, class RcvrType>
2322
class VModulatorOld : public VActor
2423
{
25-
// If the updateFn member is set, then it will be called with the
26-
// current value of the modulation whenever act() is called (at the
27-
// vss control rate).
24+
// If the updateFn member is set, then it will be called with the
25+
// current value of the modulation whenever act() is called (at the
26+
// vss control rate).
2827
public:
2928
typedef void (RcvrType::*UpdtFn)(ParamType);
3029
// this fails, so UpdtFn is public not protected: friend class FloatParam<>;
@@ -35,24 +34,25 @@ class VModulatorOld : public VActor
3534
public:
3635
VModulatorOld(void) : VActor(), updateFn(NULL), receiver(NULL) {}
3736
VModulatorOld(RcvrType * r, UpdtFn f) : VActor(), updateFn(f), receiver(r) {}
38-
virtual ~VModulatorOld() {}
37+
virtual ~VModulatorOld() {}
38+
VModulatorOld(const VModulatorOld&) = delete;
39+
VModulatorOld& operator=(const VModulatorOld&) = delete;
3940

40-
// Member for implementing asynchronous modulation behavior.
41-
// The default behavior is to call a parameter update function
42-
// (if it has been set) with the current value of the modulation.
43-
virtual void act(void)
41+
// Member for implementing asynchronous modulation behavior.
42+
// The default behavior is to call a parameter update function
43+
// (if it has been set) with the current value of the modulation.
44+
virtual void act()
4445
{
4546
VActor::act();
46-
4747
if (isActive() && updateFn)
4848
(receiver->*updateFn)(currentValue());
4949
}
5050

51-
// Current value access for converting to type ParamType.
52-
operator ParamType(void) { return currentValue(); }
51+
// Current value access for converting to type ParamType.
52+
operator ParamType() { return currentValue(); }
5353

54-
// Derived classes _must_ provide a member for returning their
55-
// current modulation value. This is the only member that must
56-
// be provided by derived classes.
57-
virtual ParamType currentValue(void) = 0;
54+
// Derived classes _must_ provide a member for returning their
55+
// current modulation value. This is the only member that must
56+
// be provided by derived classes.
57+
virtual ParamType currentValue() = 0;
5858
};

filter.h

+24-29
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
class filter
1111
{
12-
private:
13-
// Internal synthesis stateholders.
12+
// Internal state.
1413
float za0, zb0, zb1; // prewarped analog filter coefficients
1514
float zA0, zB0, zB1; // BLT-mapped digital filter coefficients
1615
float stateZi1; // first-order state variable
@@ -21,13 +20,11 @@ class filter
2120
float Alp, Ahp, Aap; // Lowpass, Highpass, and Allpass gains
2221

2322
public:
24-
// Parameter access members.
25-
float getFrequency(void) const { return w0 / (2.0 * M_PI); }
26-
float getLowpassGain(void) const { return Alp; }
27-
float getHighpassGain(void) const { return Ahp; }
28-
float getAllpassGain(void) const { return Aap; }
23+
float getFrequency() const { return w0 / (2.0 * M_PI); }
24+
float getLowpassGain() const { return Alp; }
25+
float getHighpassGain() const { return Ahp; }
26+
float getAllpassGain() const { return Aap; }
2927

30-
// Parameter update members.
3128
void setFrequency(float f)
3229
{
3330
const float fNyquist = globs.SampleRate / 2.0;
@@ -37,18 +34,16 @@ class filter
3734
za0 = tan(w0 * globs.OneOverSR / 2.0);
3835
computeCoef();
3936
}
40-
void setLowpassGain (float A) { Alp = A; computeCoef(); }
41-
void setHighpassGain (float A) { Ahp = A; computeCoef(); }
42-
void setAllpassGain (float A) { Aap = A; computeCoef(); }
43-
void setHiAllLopassGain (float H, float A, float L)
44-
{ Ahp=H; Aap=A; Alp=L; computeCoef(); }
37+
void setLowpassGain(float A) { Alp = A; computeCoef(); }
38+
void setHighpassGain(float A) { Ahp = A; computeCoef(); }
39+
void setAllpassGain(float A) { Aap = A; computeCoef(); }
40+
void setHiAllLopassGain(float H, float A, float L) { Ahp=H; Aap=A; Alp=L; computeCoef(); }
4541

46-
// Input/output access members.
47-
float getOutput(void) { return output; }
48-
void setInput(float In) { input = In; }
42+
float getOutput() const { return output; }
43+
void setInput(float In) { input = In; }
4944

5045
// Utility members.
51-
void computeCoef(void)
46+
void computeCoef()
5247
{
5348
// za0 is computed in setFrequency()
5449
zb0 = za0 * (Alp - Aap);
@@ -59,22 +54,22 @@ class filter
5954
}
6055

6156
// Sample generation.
62-
void computeSamp(void)
57+
void computeSamp()
6358
{
64-
float state = input - zA0 * stateZi1; // state equation
59+
const auto state = input - zA0 * stateZi1; // state equation
6560
output = zB0 * stateZi1 + zB1 * state; // output equation
6661
stateZi1 = state; // state update
6762
}
6863

69-
// Construction/destruction.
70-
filter(void) :
71-
stateZi1(0.0),
72-
input(0.0),
73-
output(0.0),
74-
w0(2.0 * M_PI * 1000.0),
75-
Alp(1.0),
76-
Ahp(0.0),
77-
Aap(0.0)
78-
{ setFrequency(1000.); }
64+
// setFrequency() clobbers za0 w0 zb0 zb1 zA0 zB0 zB1,
65+
// but they're in the init list anyways to satisfy -Weffc++.
66+
filter() :
67+
za0(0.0), zb0(0.0), zb1(0.0),
68+
zA0(0.0), zB0(0.0), zB1(0.0),
69+
stateZi1(0.0),
70+
input(0.0), output(0.0),
71+
w0(2.0 * M_PI * 1000.0),
72+
Alp(1.0), Ahp(0.0), Aap(0.0)
73+
{ setFrequency(1000.); }
7974
~filter() {}
8075
};

vssglobals.h

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class VSSglobals
4747

4848
VSSglobals();
4949
~VSSglobals();
50+
VSSglobals(const VSSglobals&) = delete;
51+
VSSglobals& operator=(const VSSglobals&) = delete;
5052
};
5153

5254
//;; These public members should be hidden behind set/get function calls,

0 commit comments

Comments
 (0)