#ifndef WINARY_T_H
#define WINARY_T_H

//Funktionen fuer PD-Externals

#include "wabor_t_definitions.h"

enum _eWinaryType { eWINARY_ADD, eWINARY_FILTER, eWINARY_THRESHOLD, eWINARY_SHIFT}; 

static t_class *pcWinary_t;

typedef t_inlet *pt_inlet;
typedef t_outlet *pt_outlet;

struct _sWinary_t {
    t_object x_obj; //t_object has to be the first entry in the structure!!
    t_float const_sig;
    pt_inlet *a_in;
    pt_outlet *a_out;
    t_int num_inlet;
    t_int num_outlet;
    
#define WINARY_T_MAXPARAM (8)
    t_float float_param[WINARY_T_MAXPARAM];  //Used to store paramters
    t_int int_param[WINARY_T_MAXPARAM];  //Used to store paramters
    
#define WINARY_T_STRINGLENGTH (255)
    enum _eWinaryType type;
    t_int dsp_num_pointers;
    
    sWabor_Coeff **pawc; //Array of sWabor_Coeff    
};
typedef struct _sWinary_t sWinary_t;




void   winary_t_setup(void);
void   winary_t_set_pointers_to_NULL(sWinary_t *psW);
void  *winary_t_new(t_symbol UNUSED *whichone, t_float val0, t_float val1, t_float val2);
void   winary_t_initialize( sWinary_t *psW);
void   winary_t_delete( sWinary_t *psW);
void   winary_t_dsp( sWinary_t *psW, t_signal **sp);
t_int *winary_t_perform_filter(t_int *aw);
t_int *winary_t_perform_add(t_int *aw);
t_int *winary_t_perform_threshold(t_int *aw);
t_int *winary_t_perform_shift(t_int *aw);
void   winary_t_bang( sWinary_t *psW);
void winary_t_set_float_param(sWinary_t *psW, t_float index, t_float val);
void winary_t_set_int_param(sWinary_t *psW, t_float index, t_float val);

#endif //WINARY_T_H


