Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_code.py

    ra2ed169 rce79a9e  
    33    'buf_size': 'Py_default_vector_length',
    44    'win_s': 'Py_default_vector_length',
    5     'size': 'Py_default_vector_length',
    65    # and here too
    76    'hop_size': 'Py_default_vector_length / 2',
     
    8483        'filterbank': 'self->n_filters',
    8584        'tss': 'self->buf_size',
    86         'dct': 'self->size',
    8785        }
    8886
     
    179177        self.do_outputs = get_params_types_names(self.do_proto)[2:]
    180178        struct_output_str = ["PyObject *{0[name]}; {1} c_{0[name]}".format(i, i['type'][:-1]) for i in self.do_outputs]
    181         if len(self.prototypes['rdo']):
    182             rdo_outputs = get_params_types_names(prototypes['rdo'][0])[2:]
    183             struct_output_str += ["PyObject *{0[name]}; {1} c_{0[name]}".format(i, i['type'][:-1]) for i in rdo_outputs]
    184             self.outputs += rdo_outputs
    185179        self.struct_outputs = ";\n    ".join(struct_output_str)
    186180
     
    197191            out += self.gen_del()
    198192            out += self.gen_do()
    199             if len(self.prototypes['rdo']):
    200                 self.do_proto = self.prototypes['rdo'][0]
    201                 self.do_inputs = [get_params_types_names(self.do_proto)[1]]
    202                 self.do_outputs = get_params_types_names(self.do_proto)[2:]
    203                 out += self.gen_do(method='rdo')
    204193            out += self.gen_memberdef()
    205194            out += self.gen_set()
     
    382371        return out
    383372
    384     def gen_do(self, method = 'do'):
     373    def gen_do(self):
    385374        out = """
    386375// do {shortname}
    387376static PyObject*
    388 Pyaubio_{shortname}_{method}  (Py_{shortname} * self, PyObject * args)
    389 {{""".format(method = method, **self.__dict__)
     377Py_{shortname}_do  (Py_{shortname} * self, PyObject * args)
     378{{""".format(**self.__dict__)
    390379        input_params = self.do_inputs
    391380        output_params = self.do_outputs
     
    527516  {{"{shortname}", (PyCFunction) Py{name},
    528517    METH_NOARGS, ""}},""".format(name = name, shortname = shortname)
    529         for m in self.prototypes['rdo']:
    530             name = get_name(m)
    531             shortname = name.replace('aubio_%s_' % self.shortname, '')
    532             out += """
    533   {{"{shortname}", (PyCFunction) Py{name},
    534     METH_VARARGS, ""}},""".format(name = name, shortname = shortname)
    535518        out += """
    536519  {NULL} /* sentinel */
     
    558541  0,
    559542  0,
    560   (ternaryfunc)Pyaubio_{shortname}_do,
     543  (ternaryfunc)Py_{shortname}_do,
    561544  0,
    562545  0,
Note: See TracChangeset for help on using the changeset viewer.