Q-W1 pt2: core/shell/app relocation + sub-namespaces; one concrete ui::Rect (LTRB fork retired); slot_map split from bank_book; BankIndex→BankModel; 59/59 green
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
// clamp01 — the ONE unit-interval clamp (Q-W1, T4-24). Replaces the per-module
|
||||
// static copies (master_gain / param_slider / envelope_overlay / reasampler_editor).
|
||||
// Deliberately the ternary form: comparisons with NaN are false, so a NaN input
|
||||
// passes through unchanged rather than silently collapsing to a bound — the
|
||||
// behavior of the majority of the retired copies.
|
||||
//
|
||||
// PURE: standard library only (not even that).
|
||||
|
||||
namespace reasampler::util {
|
||||
|
||||
constexpr double clamp01(double v) { return v < 0.0 ? 0.0 : (v > 1.0 ? 1.0 : v); }
|
||||
|
||||
} // namespace reasampler::util
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
namespace reasampler {
|
||||
namespace reasampler::util {
|
||||
|
||||
std::vector<std::uint8_t> readFileBytes(const std::string& path) {
|
||||
std::ifstream f(path, std::ios::binary | std::ios::ate);
|
||||
@@ -18,4 +18,4 @@ std::vector<std::uint8_t> readFileBytes(const std::string& path) {
|
||||
return bytes;
|
||||
}
|
||||
|
||||
} // namespace reasampler
|
||||
} // namespace reasampler::util
|
||||
@@ -9,11 +9,11 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace reasampler {
|
||||
namespace reasampler::util {
|
||||
|
||||
// Reads the whole file at `path` into a byte buffer. Empty on ANY failure —
|
||||
// unopenable, empty file, or short read — so the caller has exactly one
|
||||
// "nothing to work with" branch.
|
||||
std::vector<std::uint8_t> readFileBytes(const std::string& path);
|
||||
|
||||
} // namespace reasampler
|
||||
} // namespace reasampler::util
|
||||
Reference in New Issue
Block a user