#pragma once #include #include #include #include #include #include // Thanks stack overflow ! // https://stackoverflow.com/a/54121092/10768117 template struct Functor { template auto operator()(Args&&... args) const { return std::invoke(F, std::forward(args)...); } }; namespace aubio { using _aubio_onset_t_unique_ptr = std::unique_ptr>; struct onset_detector : _aubio_onset_t_unique_ptr { template onset_detector(Args&&... args) : _aubio_onset_t_unique_ptr(new_aubio_onset(std::forward(args)...)) {} // takes in Mono samples std::optional detect(const std::vector& samples); }; }