@@ -9,8 +9,6 @@ namespace rack { | |||||
template <size_t CHANNELS> | template <size_t CHANNELS> | ||||
struct Frame { | struct Frame { | ||||
float samples[CHANNELS]; | float samples[CHANNELS]; | ||||
Frame() {} | |||||
}; | }; | ||||
} // namespace rack | } // namespace rack |
@@ -67,7 +67,8 @@ struct Module { | |||||
/** Advances the module by 1 audio frame with duration 1.0 / gSampleRate */ | /** Advances the module by 1 audio frame with duration 1.0 / gSampleRate */ | ||||
virtual void step() {} | virtual void step() {} | ||||
/** Called when the engine sample rate is changed */ | |||||
/** Called when the engine sample rate is changed | |||||
*/ | |||||
virtual void onSampleRateChange() {} | virtual void onSampleRateChange() {} | ||||
/** Called when module is created by the Add Module popup, cloning, or when loading a patch or autosave */ | /** Called when module is created by the Add Module popup, cloning, or when loading a patch or autosave */ | ||||
virtual void onCreate() {} | virtual void onCreate() {} | ||||
@@ -143,9 +143,10 @@ inline void cmult(float *cr, float *ci, float ar, float ai, float br, float bi) | |||||
struct Rect; | struct Rect; | ||||
struct Vec { | struct Vec { | ||||
float x, y; | |||||
float x = 0.f; | |||||
float y = 0.f; | |||||
Vec() : x(0.0f), y(0.0f) {} | |||||
Vec() {} | |||||
Vec(float x, float y) : x(x), y(y) {} | Vec(float x, float y) : x(x), y(y) {} | ||||
Vec neg() { | Vec neg() { | ||||
@@ -175,6 +176,9 @@ struct Vec { | |||||
float norm() { | float norm() { | ||||
return hypotf(x, y); | return hypotf(x, y); | ||||
} | } | ||||
Vec flip() { | |||||
return Vec(y, x); | |||||
} | |||||
Vec min(Vec b) { | Vec min(Vec b) { | ||||
return Vec(rack::min(x, b.x), rack::min(y, b.y)); | return Vec(rack::min(x, b.x), rack::min(y, b.y)); | ||||
} | } | ||||