#pragma once #include #include namespace tc::audio { namespace filter { class Filter; } namespace recorder { class AudioConsumerWrapper; class AudioFilterWrapper : public Nan::ObjectWrap { friend class AudioConsumerWrapper; public: static NAN_MODULE_INIT(Init); static NAN_METHOD(NewInstance); static inline Nan::Persistent & constructor() { static Nan::Persistent my_constructor; return my_constructor; } static inline Nan::Persistent & constructor_template() { static Nan::Persistent my_constructor_template; return my_constructor_template; } AudioFilterWrapper(std::string name, std::shared_ptr /* handle */); ~AudioFilterWrapper() override; static NAN_METHOD(_get_name); /* VAD and Threshold */ static NAN_METHOD(_get_margin_time); static NAN_METHOD(_set_margin_time); /* VAD relevant */ static NAN_METHOD(_get_level); /* threshold filter relevant */ static NAN_METHOD(_get_threshold); static NAN_METHOD(_set_threshold); static NAN_METHOD(_get_attack_smooth); static NAN_METHOD(_set_attack_smooth); static NAN_METHOD(_get_release_smooth); static NAN_METHOD(_set_release_smooth); static NAN_METHOD(_set_analyze_filter); /* consume filter */ static NAN_METHOD(_is_consuming); static NAN_METHOD(_set_consuming); inline std::shared_ptr filter() { return this->_filter; } private: std::shared_ptr _filter; std::string _name; void do_wrap(const v8::Local& /* object */); Nan::callback_t _call_analyzed; Nan::Persistent _callback_analyzed; }; } }