From f28c0965eccb80bd506b50ab18cab8599c85fe36 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 23 Aug 2023 19:57:01 +0800 Subject: [PATCH] add pocketfft --- Makefile | 2 +- flake.nix | 6 ++++++ main.cpp | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 30fba95..9d5b183 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) -CXXFLAGS = -std=c++14 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends +CXXFLAGS = -std=c++14 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I$(POCKETFFT_DIR) CXXFLAGS += -g -Wall -Wformat -O2 LIBS = -L$(TINYALSA_DIR)/lib diff --git a/flake.nix b/flake.nix index 497aecc..b87d1db 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,11 @@ let pkgs = import nixpkgs { system = "x86_64-linux"; }; imgui_dir = "${pkgs.imgui}/include/imgui"; + pocketfft = pkgs.fetchgit { + url = "https://gitlab.mpcdf.mpg.de/mtr/pocketfft.git"; + rev = "ecd78caa1c862e18fb1a55bcd4e30a05430b01f6"; + hash = "sha256-xl7Tr1A1cqXhAL1Bljfk68R3AB1xOgkH15LHKxjYoSc="; + }; in rec { packages.x86_64-linux.microsa = pkgs.stdenv.mkDerivation { name = "microsa"; @@ -15,6 +20,7 @@ propagatedBuildInputs = [ pkgs.wayland pkgs.glfw-wayland pkgs.libffi pkgs.alsa-lib ]; preBuild = '' export IMGUI_DIR=${imgui_dir} + export POCKETFFT_DIR=${pocketfft} ''; installPhase = '' mkdir -p $out/bin diff --git a/main.cpp b/main.cpp index 4017f6c..60e30e0 100644 --- a/main.cpp +++ b/main.cpp @@ -14,6 +14,9 @@ #include +#include + + static std::atomic terminate_dsp; static snd_pcm_t* pcm;