# HG changeset patch # User Vesa Norilo # Date 1642975183 -7200 # Sun Jan 23 23:59:43 2022 +0200 # Branch dev # Node ID 3cc6a9041d382e4f70dc9f9991215410c146cd2f # Parent cf8ab189f338192372ee165e3c270a51adf8a134 clean up kc.cpp and reset ubuntu version diff --git a/.builds/ubuntu.yml b/.builds/ubuntu.yml --- a/.builds/ubuntu.yml +++ b/.builds/ubuntu.yml @@ -1,6 +1,6 @@ image: ubuntu/20.04 packages: -- cmake g++ python3 libsndfile-dev libtinyxml-dev libreadline6-dev llvm-6.0-dev libcurl4-openssl-dev zlib1g-dev +- cmake g++ python3 libsndfile-dev libtinyxml-dev libreadline6-dev llvm-6.0-dev libcurl4-openssl-dev zlib1g-dev libjack-dev sources: - hg+https://hg.sr.ht/~vnorilo/kronos tasks: diff --git a/.builds/wasm.yml b/.builds/wasm.yml --- a/.builds/wasm.yml +++ b/.builds/wasm.yml @@ -21,4 +21,4 @@ triggers: - action: email condition: failure - to: a \ No newline at end of file + to: \ No newline at end of file diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,4 +1,4 @@ -7f81123f735fe08e69c218a328e4114c47a3feec library +accd03c99f036645d3f5989c8deefb01e52c59a9 library 8b4b21f3c6f21d1e6eb60d7b0debfb74597ca2f5 src/lithe d88ce622aaf77f683bb589f1089ea1ba51423818 src/pad 29a29937ee1095e5ddf1655902f1ed09c810bbf3 src/paf diff --git a/src/driver/kc.cpp b/src/driver/kc.cpp --- a/src/driver/kc.cpp +++ b/src/driver/kc.cpp @@ -202,67 +202,4 @@ return -1; } return 0; -} - -#pragma once - -#include -#include - -#pragma pack(push) -#pragma pack(1) - -#ifdef __cplusplus -extern "C" { -#endif - - typedef void* InstancePtr; - - int64_t GetSize(); - void Initialize(InstancePtr, void*); - void** GetValue(InstancePtr, int32_t slotIndex); - static void SetFreq(InstancePtr instance, const float* Freq) { - *GetValue(instance, 0) = (void*)Freq; - } - - void TickFreq(InstancePtr, float* outputBuffer, int32_t numFrames); - void TickAudio(InstancePtr, float* outputBuffer, int32_t numFrames); - - // You must set this before calling `Initialize()` - static void Set_RateAudio(InstancePtr instance, const float* _RateAudio) { - *GetValue(instance, 1) = (void*)_RateAudio; - } - - - // Convenience constructor for allocating memory, setting configuration and initializing an instance - static InstancePtr Construct(const float* _RateAudio) { - void* memory = calloc(1, GetSize()); - Set_RateAudio(memory, _RateAudio); - Initialize(memory, NULL); - return memory; - } - -#ifdef __cplusplus -} - -// c++ wrapper -class Dsp { - InstancePtr instance = nullptr; -public: - Dsp(const float* _RateAudio) { instance = Construct(_RateAudio); } - ~Dsp() { if (instance) free(instance); } -#if __cplusplus > 199711L - Dsp(Dsp const&) = delete; - Dsp(Dsp&& from) { instance = from.instance; from.instance = nullptr; }; - void operator=(Dsp const&) = delete; - Dsp& operator=(Dsp&& from) { auto tmp = from.instance; from.instance = instance; instance = tmp; } -#endif - - void SetFreq(const float* inputBuffer) { ::SetFreq(instance, inputBuffer); } - void TickFreq(float* outputBuffer, int32_t numFrames = 1) { ::TickFreq(instance, outputBuffer, numFrames); } - void TickAudio(float* outputBuffer, int32_t numFrames = 1) { ::TickAudio(instance, outputBuffer, numFrames); } -}; - - -#endif -#pragma pack(pop) \ No newline at end of file +} \ No newline at end of file