
#ifndef _INCLUDE_MULTI_FFT_H_
#define _INCLUDE_MULTI_FFT_H_

#include "android_hark.h"

#ifdef __cplusplus
extern "C" {
#endif

#define MLTFFT_4BASIS_ENABLE

typedef struct _MULTI_FFT_INFO_t_
{
    int length;
    int window_type;
    float *window;
    
    struct
    {
        COMPLEX_FLOAT *w;
        float *a;           // 窓かけ後の入力データ
        COMPLEX_FLOAT *A; // 出力データ
    } rfft;
    
    struct
    {
        COMPLEX_FLOAT *w;
        COMPLEX_FLOAT *a;
    } fft;

}MULTI_FFT_INFO_t;

extern void SetFFTWindowGain(float gain);
extern MULTI_FFT_INFO_t *InitMultiFFT(const char *window_name, int length);
extern void MultiFFT(MULTI_FFT_INFO_t *info, COMPLEX_FLOAT *out_data[], float *in_data[], int channels);
extern int  ReleaseMultiFFT(MULTI_FFT_INFO_t *info);


#ifdef __cplusplus
}
#endif

#ifdef __cplusplus

class autofree_multi_fft_info {
private:
	MULTI_FFT_INFO_t *ptr;
public:
	autofree_multi_fft_info();
	autofree_multi_fft_info(MULTI_FFT_INFO_t *ap) : ptr(ap) {}
	~autofree_multi_fft_info() {
		::ReleaseMultiFFT(ptr);
	}
};

#endif

#endif /* End of _INCLUDE_MULTI_FFT_H_ */

/* EOF */

