velipso / sndfilter

Algorithms for sound filters, like reverb, dynamic range compression, lowpass, highpass, notch, etc
BSD Zero Clause License
445 stars 70 forks source link

compatible c and c++ #18

Open tk-aria opened 3 years ago

tk-aria commented 3 years ago

Hey @velipso Modified so that it can be used as a library from c++. please merge this!

velipso commented 3 years ago

I'm confused... isn't it possible to use as an external library from C++ via something like:

extern "C" {
#include "reverb.h"
}

?

tk-aria commented 3 years ago

sure. That way is also possible! but I think many developers don't understand the difference between C and C++ about mangling and demangling, so I think it's better to use it simply.

don't you think so?

velipso commented 3 years ago

I can leave the PR open and if someone wants it they can grab it

tk-aria commented 3 years ago

hmm... Why don't you want to incorporate the changes?

velipso commented 3 years ago

Well, it's a judgement call, so there isn't a hard rule... this does make it easier to incorporate into a C++ project, but it also makes the code more complicated. For this library, I've tried to keep the code as simple as possible, so I don't think the trade is worth it in this case. I like keeping the PR open so that if someone in the future asks for a C++ version, I can simply point to this PR.