rename the whole thing to baudmine >:-)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(baudline VERSION 1.0.0 LANGUAGES C CXX)
|
project(baudmine VERSION 1.0.0 LANGUAGES C CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
@@ -145,12 +145,12 @@ if(EMSCRIPTEN)
|
|||||||
target_compile_options(imgui PUBLIC -sUSE_SDL=2)
|
target_compile_options(imgui PUBLIC -sUSE_SDL=2)
|
||||||
target_link_options(imgui PUBLIC -sUSE_SDL=2)
|
target_link_options(imgui PUBLIC -sUSE_SDL=2)
|
||||||
|
|
||||||
add_executable(baudline ${SOURCES})
|
add_executable(baudmine ${SOURCES})
|
||||||
target_include_directories(baudline PRIVATE src)
|
target_include_directories(baudmine PRIVATE src)
|
||||||
target_link_libraries(baudline PRIVATE imgui fftw3f_wasm)
|
target_link_libraries(baudmine PRIVATE imgui fftw3f_wasm)
|
||||||
|
|
||||||
# Emscripten linker flags
|
# Emscripten linker flags
|
||||||
target_link_options(baudline PRIVATE
|
target_link_options(baudmine PRIVATE
|
||||||
-sUSE_SDL=2
|
-sUSE_SDL=2
|
||||||
-sALLOW_MEMORY_GROWTH=1
|
-sALLOW_MEMORY_GROWTH=1
|
||||||
-sINITIAL_MEMORY=67108864
|
-sINITIAL_MEMORY=67108864
|
||||||
@@ -161,8 +161,8 @@ if(EMSCRIPTEN)
|
|||||||
--shell-file=${CMAKE_SOURCE_DIR}/web/shell.html
|
--shell-file=${CMAKE_SOURCE_DIR}/web/shell.html
|
||||||
)
|
)
|
||||||
|
|
||||||
# Output baudline.html + .js + .wasm
|
# Output baudmine.html + .js + .wasm
|
||||||
set_target_properties(baudline PROPERTIES
|
set_target_properties(baudmine PROPERTIES
|
||||||
SUFFIX ".html"
|
SUFFIX ".html"
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/web"
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/web"
|
||||||
)
|
)
|
||||||
@@ -185,9 +185,9 @@ else()
|
|||||||
|
|
||||||
target_link_libraries(imgui PUBLIC PkgConfig::SDL2 OpenGL::GL)
|
target_link_libraries(imgui PUBLIC PkgConfig::SDL2 OpenGL::GL)
|
||||||
|
|
||||||
add_executable(baudline ${SOURCES})
|
add_executable(baudmine ${SOURCES})
|
||||||
target_include_directories(baudline PRIVATE src)
|
target_include_directories(baudmine PRIVATE src)
|
||||||
target_link_libraries(baudline PRIVATE
|
target_link_libraries(baudmine PRIVATE
|
||||||
imgui
|
imgui
|
||||||
PkgConfig::SDL2
|
PkgConfig::SDL2
|
||||||
PkgConfig::FFTW3F
|
PkgConfig::FFTW3F
|
||||||
@@ -198,7 +198,7 @@ else()
|
|||||||
|
|
||||||
# Link math library and dl on Unix (dl needed by miniaudio for backend loading)
|
# Link math library and dl on Unix (dl needed by miniaudio for backend loading)
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
target_link_libraries(baudline PRIVATE m dl)
|
target_link_libraries(baudmine PRIVATE m dl)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Emscripten/WASM build for Baudline
|
# Emscripten/WASM build for Baudmine
|
||||||
# Usage:
|
# Usage:
|
||||||
# source ~/emsdk/emsdk_env.sh
|
# source ~/emsdk/emsdk_env.sh
|
||||||
# emcmake cmake -B build_wasm -C CMakeLists_wasm.cmake
|
# emcmake cmake -B build_wasm -C CMakeLists_wasm.cmake
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Build Baudline for WebAssembly
|
# Build Baudmine for WebAssembly
|
||||||
# Prerequisites: Emscripten SDK installed at ~/emsdk
|
# Prerequisites: Emscripten SDK installed at ~/emsdk
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -13,6 +13,6 @@ echo "=== Building ==="
|
|||||||
cmake --build build_wasm -j$(nproc)
|
cmake --build build_wasm -j$(nproc)
|
||||||
|
|
||||||
echo "=== Done ==="
|
echo "=== Done ==="
|
||||||
echo "Output: build_wasm/web/baudline.html"
|
echo "Output: build_wasm/web/baudmine.html"
|
||||||
echo "To test: cd build_wasm/web && python3 -m http.server 8080"
|
echo "To test: cd build_wasm/web && python3 -m http.server 8080"
|
||||||
echo "Then open http://localhost:8080/baudline.html"
|
echo "Then open http://localhost:8080/baudmine.html"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
// Abstract audio source. All sources deliver interleaved float samples.
|
// Abstract audio source. All sources deliver interleaved float samples.
|
||||||
// For I/Q data channels()==2: [I0, Q0, I1, Q1, ...].
|
// For I/Q data channels()==2: [I0, Q0, I1, Q1, ...].
|
||||||
@@ -24,4 +24,4 @@ public:
|
|||||||
virtual bool isEOF() const = 0;
|
virtual bool isEOF() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
FileSource::FileSource(const std::string& path, InputFormat format,
|
FileSource::FileSource(const std::string& path, InputFormat format,
|
||||||
double sampleRate, bool loop)
|
double sampleRate, bool loop)
|
||||||
@@ -178,4 +178,4 @@ size_t FileSource::readRawUint8(float* buffer, size_t frames) {
|
|||||||
return samplesRead / 2;
|
return samplesRead / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
// Reads WAV files and raw I/Q files (float32, int16, uint8).
|
// Reads WAV files and raw I/Q files (float32, int16, uint8).
|
||||||
// Native builds use libsndfile; WASM builds use a built-in WAV reader.
|
// Native builds use libsndfile; WASM builds use a built-in WAV reader.
|
||||||
@@ -65,4 +65,4 @@ private:
|
|||||||
size_t rawFileSize_ = 0;
|
size_t rawFileSize_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
// ── Shared context (lazy-initialized) ────────────────────────────────────────
|
// ── Shared context (lazy-initialized) ────────────────────────────────────────
|
||||||
|
|
||||||
@@ -166,4 +166,4 @@ size_t MiniAudioSource::read(float* buffer, size_t frames) {
|
|||||||
return ringBuf_->read(buffer, frames * channels_) / channels_;
|
return ringBuf_->read(buffer, frames * channels_) / channels_;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
struct ma_device;
|
struct ma_device;
|
||||||
struct ma_context;
|
struct ma_context;
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
class MiniAudioSource : public AudioSource {
|
class MiniAudioSource : public AudioSource {
|
||||||
public:
|
public:
|
||||||
@@ -50,4 +50,4 @@ private:
|
|||||||
std::unique_ptr<RingBuffer<float>> ringBuf_;
|
std::unique_ptr<RingBuffer<float>> ringBuf_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
static bool sPaInitialized = false;
|
static bool sPaInitialized = false;
|
||||||
|
|
||||||
@@ -111,4 +111,4 @@ std::vector<PortAudioSource::DeviceInfo> PortAudioSource::listInputDevices() {
|
|||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
class PortAudioSource : public AudioSource {
|
class PortAudioSource : public AudioSource {
|
||||||
public:
|
public:
|
||||||
@@ -51,4 +51,4 @@ private:
|
|||||||
std::unique_ptr<RingBuffer<float>> ringBuf_;
|
std::unique_ptr<RingBuffer<float>> ringBuf_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
// Read a little-endian uint16/uint32 from raw bytes.
|
// Read a little-endian uint16/uint32 from raw bytes.
|
||||||
static uint16_t readU16(const uint8_t* p) { return p[0] | (p[1] << 8); }
|
static uint16_t readU16(const uint8_t* p) { return p[0] | (p[1] << 8); }
|
||||||
@@ -138,4 +138,4 @@ void WavReader::seekFrame(size_t frame) {
|
|||||||
file_.seekg(static_cast<std::streamoff>(byteOffset));
|
file_.seekg(static_cast<std::streamoff>(byteOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
class WavReader {
|
class WavReader {
|
||||||
public:
|
public:
|
||||||
@@ -38,4 +38,4 @@ private:
|
|||||||
std::vector<uint8_t> readBuf_; // scratch for format conversion
|
std::vector<uint8_t> readBuf_; // scratch for format conversion
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
// ── WASM: persist settings via browser localStorage ─────────────────────────
|
// ── WASM: persist settings via browser localStorage ─────────────────────────
|
||||||
|
|
||||||
EM_JS(char*, js_loadSettings, (), {
|
EM_JS(char*, js_loadSettings, (), {
|
||||||
var s = localStorage.getItem("baudline_settings");
|
var s = localStorage.getItem("baudmine_settings");
|
||||||
if (!s) return 0;
|
if (!s) return 0;
|
||||||
var len = lengthBytesUTF8(s) + 1;
|
var len = lengthBytesUTF8(s) + 1;
|
||||||
var buf = _malloc(len);
|
var buf = _malloc(len);
|
||||||
@@ -18,14 +18,14 @@ EM_JS(char*, js_loadSettings, (), {
|
|||||||
});
|
});
|
||||||
|
|
||||||
EM_JS(void, js_saveSettings, (const char* data), {
|
EM_JS(void, js_saveSettings, (const char* data), {
|
||||||
localStorage.setItem("baudline_settings", UTF8ToString(data));
|
localStorage.setItem("baudmine_settings", UTF8ToString(data));
|
||||||
});
|
});
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
std::string Config::defaultPath() {
|
std::string Config::defaultPath() {
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
@@ -39,7 +39,7 @@ std::string Config::defaultPath() {
|
|||||||
const char* home = std::getenv("HOME");
|
const char* home = std::getenv("HOME");
|
||||||
base = home ? std::string(home) + "/.config" : ".";
|
base = home ? std::string(home) + "/.config" : ".";
|
||||||
}
|
}
|
||||||
return base + "/baudline/settings.ini";
|
return base + "/baudmine/settings.ini";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ static void ensureDir(const std::string& path) {
|
|||||||
bool Config::save(const std::string& path) const {
|
bool Config::save(const std::string& path) const {
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
std::ostringstream f;
|
std::ostringstream f;
|
||||||
f << "# Baudline settings\n";
|
f << "# Baudmine settings\n";
|
||||||
for (const auto& [k, v] : data_)
|
for (const auto& [k, v] : data_)
|
||||||
f << k << " = " << v << "\n";
|
f << k << " = " << v << "\n";
|
||||||
js_saveSettings(f.str().c_str());
|
js_saveSettings(f.str().c_str());
|
||||||
@@ -107,7 +107,7 @@ bool Config::save(const std::string& path) const {
|
|||||||
std::ofstream f(p);
|
std::ofstream f(p);
|
||||||
if (!f.is_open()) return false;
|
if (!f.is_open()) return false;
|
||||||
|
|
||||||
f << "# Baudline settings\n";
|
f << "# Baudmine settings\n";
|
||||||
for (const auto& [k, v] : data_)
|
for (const auto& [k, v] : data_)
|
||||||
f << k << " = " << v << "\n";
|
f << k << " = " << v << "\n";
|
||||||
return true;
|
return true;
|
||||||
@@ -146,4 +146,4 @@ bool Config::getBool(const std::string& key, bool def) const {
|
|||||||
return it->second == "1" || it->second == "true";
|
return it->second == "1" || it->second == "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
// Simple INI-style config: key = value, one per line. Lines starting with # are
|
// Simple INI-style config: key = value, one per line. Lines starting with # are
|
||||||
// comments. No sections. Stored at ~/.config/baudline/settings.ini.
|
// comments. No sections. Stored at ~/.config/baudmine/settings.ini.
|
||||||
class Config {
|
class Config {
|
||||||
public:
|
public:
|
||||||
static std::string defaultPath();
|
static std::string defaultPath();
|
||||||
@@ -29,4 +29,4 @@ private:
|
|||||||
std::string resolvedPath(const std::string& path) const;
|
std::string resolvedPath(const std::string& path) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
// Single-producer single-consumer lock-free ring buffer for audio data.
|
// Single-producer single-consumer lock-free ring buffer for audio data.
|
||||||
// Producer: audio callback thread. Consumer: main/render thread.
|
// Producer: audio callback thread. Consumer: main/render thread.
|
||||||
@@ -97,4 +97,4 @@ private:
|
|||||||
alignas(64) std::atomic<size_t> readPos_{0};
|
alignas(64) std::atomic<size_t> readPos_{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
// ── FFT configuration ────────────────────────────────────────────────────────
|
// ── FFT configuration ────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -157,4 +157,4 @@ struct Color3 {
|
|||||||
uint8_t r, g, b;
|
uint8_t r, g, b;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
FFTProcessor::FFTProcessor() = default;
|
FFTProcessor::FFTProcessor() = default;
|
||||||
|
|
||||||
@@ -94,4 +94,4 @@ void FFTProcessor::processComplex(const float* inputIQ, std::vector<float>& outp
|
|||||||
processComplex(inputIQ, outputDB, scratchCplx_);
|
processComplex(inputIQ, outputDB, scratchCplx_);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <complex>
|
#include <complex>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
// Wraps FFTW for real->complex and complex->complex transforms.
|
// Wraps FFTW for real->complex and complex->complex transforms.
|
||||||
// Produces magnitude output in dB and optionally retains the complex spectrum.
|
// Produces magnitude output in dB and optionally retains the complex spectrum.
|
||||||
@@ -55,4 +55,4 @@ private:
|
|||||||
std::vector<std::complex<float>> scratchCplx_;
|
std::vector<std::complex<float>> scratchCplx_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
SpectrumAnalyzer::SpectrumAnalyzer() {
|
SpectrumAnalyzer::SpectrumAnalyzer() {
|
||||||
settings_.fftSize = 0;
|
settings_.fftSize = 0;
|
||||||
@@ -137,4 +137,4 @@ void SpectrumAnalyzer::clearHistory() {
|
|||||||
newSpectrumReady_ = false;
|
newSpectrumReady_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
class SpectrumAnalyzer {
|
class SpectrumAnalyzer {
|
||||||
public:
|
public:
|
||||||
@@ -70,4 +70,4 @@ private:
|
|||||||
float windowCorrection_ = 0.0f;
|
float windowCorrection_ = 0.0f;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
static constexpr double kPi = 3.14159265358979323846;
|
static constexpr double kPi = 3.14159265358979323846;
|
||||||
|
|
||||||
@@ -97,4 +97,4 @@ double WindowFunctions::besselI0(double x) {
|
|||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "core/Types.h"
|
#include "core/Types.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
class WindowFunctions {
|
class WindowFunctions {
|
||||||
public:
|
public:
|
||||||
@@ -29,4 +29,4 @@ private:
|
|||||||
static double besselI0(double x);
|
static double besselI0(double x);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
// Keep app alive for the Emscripten main loop.
|
// Keep app alive for the Emscripten main loop.
|
||||||
static baudline::Application* g_app = nullptr;
|
static baudmine::Application* g_app = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
static baudline::Application app;
|
static baudmine::Application app;
|
||||||
|
|
||||||
if (!app.init(argc, argv)) {
|
if (!app.init(argc, argv)) {
|
||||||
std::fprintf(stderr, "Failed to initialize application\n");
|
std::fprintf(stderr, "Failed to initialize application\n");
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
Application::Application() = default;
|
Application::Application() = default;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ Application::~Application() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Application::init(int argc, char** argv) {
|
bool Application::init(int argc, char** argv) {
|
||||||
// Parse command line: baudline [file] [--format fmt] [--rate sr]
|
// Parse command line: baudmine [file] [--format fmt] [--rate sr]
|
||||||
for (int i = 1; i < argc; ++i) {
|
for (int i = 1; i < argc; ++i) {
|
||||||
std::string arg = argv[i];
|
std::string arg = argv[i];
|
||||||
if (arg == "--format" && i + 1 < argc) {
|
if (arg == "--format" && i + 1 < argc) {
|
||||||
@@ -59,7 +59,7 @@ bool Application::init(int argc, char** argv) {
|
|||||||
#endif
|
#endif
|
||||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||||
|
|
||||||
window_ = SDL_CreateWindow("Baudline Spectrum Analyzer",
|
window_ = SDL_CreateWindow("Baudmine Spectrum Analyzer",
|
||||||
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
||||||
1400, 900,
|
1400, 900,
|
||||||
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE |
|
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE |
|
||||||
@@ -1503,4 +1503,4 @@ void Application::saveConfig() const {
|
|||||||
cfg.save();
|
cfg.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
// ── Channel math operations ──────────────────────────────────────────────────
|
// ── Channel math operations ──────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -203,4 +203,4 @@ private:
|
|||||||
std::vector<ChannelStyle> stylesScratch_;
|
std::vector<ChannelStyle> stylesScratch_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
// Interpolation helper for colormaps defined as control points.
|
// Interpolation helper for colormaps defined as control points.
|
||||||
struct ColorStop {
|
struct ColorStop {
|
||||||
@@ -105,4 +105,4 @@ void ColorMap::buildLUT() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "core/Types.h"
|
#include "core/Types.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
class ColorMap {
|
class ColorMap {
|
||||||
public:
|
public:
|
||||||
@@ -28,4 +28,4 @@ private:
|
|||||||
std::vector<Color3> lut_; // 256 entries
|
std::vector<Color3> lut_; // 256 entries
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
static double binToFreqHelper(int bin, double sampleRate, bool isIQ, int fftSize) {
|
static double binToFreqHelper(int bin, double sampleRate, bool isIQ, int fftSize) {
|
||||||
if (isIQ) {
|
if (isIQ) {
|
||||||
@@ -194,4 +194,4 @@ int Cursors::findLocalPeak(const std::vector<float>& spectrumDB,
|
|||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
struct CursorInfo {
|
struct CursorInfo {
|
||||||
bool active = false;
|
bool active = false;
|
||||||
@@ -68,4 +68,4 @@ private:
|
|||||||
void pushAvg(AvgState& st, float dB, int bin) const;
|
void pushAvg(AvgState& st, float dB, int bin) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
double Measurements::binToFreq(int bin, double sampleRate, bool isIQ, int fftSize) {
|
double Measurements::binToFreq(int bin, double sampleRate, bool isIQ, int fftSize) {
|
||||||
// Use bin center (+0.5) for more accurate frequency estimation.
|
// Use bin center (+0.5) for more accurate frequency estimation.
|
||||||
@@ -301,4 +301,4 @@ void Measurements::drawPanel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "ui/SpectrumDisplay.h"
|
#include "ui/SpectrumDisplay.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
struct PeakInfo {
|
struct PeakInfo {
|
||||||
int bin = 0;
|
int bin = 0;
|
||||||
@@ -66,4 +66,4 @@ private:
|
|||||||
static double binToFreq(int bin, double sampleRate, bool isIQ, int fftSize);
|
static double binToFreq(int bin, double sampleRate, bool isIQ, int fftSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
static float freqToLogFrac(double freq, double minFreq, double maxFreq) {
|
static float freqToLogFrac(double freq, double minFreq, double maxFreq) {
|
||||||
if (freq <= 0 || minFreq <= 0) return 0.0f;
|
if (freq <= 0 || minFreq <= 0) return 0.0f;
|
||||||
@@ -296,4 +296,4 @@ void SpectrumDisplay::clearPeakHold() {
|
|||||||
peakHold_.clear();
|
peakHold_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
struct ChannelStyle {
|
struct ChannelStyle {
|
||||||
ImU32 lineColor;
|
ImU32 lineColor;
|
||||||
@@ -54,4 +54,4 @@ private:
|
|||||||
mutable std::vector<std::vector<float>> peakHold_;
|
mutable std::vector<std::vector<float>> peakHold_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
WaterfallDisplay::WaterfallDisplay() = default;
|
WaterfallDisplay::WaterfallDisplay() = default;
|
||||||
|
|
||||||
@@ -160,4 +160,4 @@ void WaterfallDisplay::uploadRow(int row) {
|
|||||||
// Note: no unbind — ImGui will bind its own textures before drawing.
|
// Note: no unbind — ImGui will bind its own textures before drawing.
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
|
||||||
namespace baudline {
|
namespace baudmine {
|
||||||
|
|
||||||
struct WaterfallChannelInfo {
|
struct WaterfallChannelInfo {
|
||||||
float r, g, b;
|
float r, g, b;
|
||||||
@@ -55,4 +55,4 @@ private:
|
|||||||
std::vector<ActiveCh> activeChBuf_;
|
std::vector<ActiveCh> activeChBuf_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace baudline
|
} // namespace baudmine
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Baudline Spectrum Analyzer</title>
|
<title>Baudmine Spectrum Analyzer</title>
|
||||||
<style>
|
<style>
|
||||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||||
html, body { width: 100%; height: 100%; overflow: hidden; background: #111; }
|
html, body { width: 100%; height: 100%; overflow: hidden; background: #111; }
|
||||||
|
|||||||
Reference in New Issue
Block a user