Changes in / [25db68c:bfbfafa]


Ignore:
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_code.py

    r25db68c rbfbfafa  
    33    'buf_size': 'Py_default_vector_length',
    44    'win_s': 'Py_default_vector_length',
     5    'size': 'Py_default_vector_length',
    56    # and here too
    67    'hop_size': 'Py_default_vector_length / 2',
     
    8384        'filterbank': 'self->n_filters',
    8485        'tss': 'self->buf_size',
     86        'dct': 'self->size',
    8587        }
    8688
     
    191193            out += self.gen_del()
    192194            out += self.gen_do()
     195            if len(self.prototypes['rdo']):
     196                self.do_proto = self.prototypes['rdo'][0]
     197                self.do_inputs = [get_params_types_names(self.do_proto)[1]]
     198                self.do_outputs = get_params_types_names(self.do_proto)[2:]
     199                out += self.gen_do(method='rdo')
    193200            out += self.gen_memberdef()
    194201            out += self.gen_set()
     
    371378        return out
    372379
    373     def gen_do(self):
     380    def gen_do(self, method = 'do'):
    374381        out = """
    375382// do {shortname}
    376383static PyObject*
    377 Py_{shortname}_do  (Py_{shortname} * self, PyObject * args)
    378 {{""".format(**self.__dict__)
     384Pyaubio_{shortname}_{method}  (Py_{shortname} * self, PyObject * args)
     385{{""".format(**self.__dict__, method = method)
    379386        input_params = self.do_inputs
    380387        output_params = self.do_outputs
     
    516523  {{"{shortname}", (PyCFunction) Py{name},
    517524    METH_NOARGS, ""}},""".format(name = name, shortname = shortname)
     525        for m in self.prototypes['rdo']:
     526            name = get_name(m)
     527            shortname = name.replace('aubio_%s_' % self.shortname, '')
     528            out += """
     529  {{"{shortname}", (PyCFunction) Py{name},
     530    METH_VARARGS, ""}},""".format(name = name, shortname = shortname)
    518531        out += """
    519532  {NULL} /* sentinel */
     
    541554  0,
    542555  0,
    543   (ternaryfunc)Py_{shortname}_do,
     556  (ternaryfunc)Pyaubio_{shortname}_do,
    544557  0,
    545558  0,
  • python/lib/gen_external.py

    r25db68c rbfbfafa  
    182182            shortname = o[6:-2]  # without aubio_ prefix and _t suffix
    183183
    184         lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'get': [], 'set': [], 'other': []}
     184        lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'rdo': [], 'get': [], 'set': [], 'other': []}
    185185        lib[shortname]['longname'] = o
    186186        lib[shortname]['shortname'] = shortname
     
    196196                elif '_do' in fn:
    197197                    lib[shortname]['do'].append(fn)
     198                elif '_rdo' in fn:
     199                    lib[shortname]['rdo'].append(fn)
    198200                elif 'new_' in fn:
    199201                    lib[shortname]['new'].append(fn)
  • src/aubio.h

    r25db68c rbfbfafa  
    183183#include "temporal/c_weighting.h"
    184184#include "spectral/fft.h"
     185#include "spectral/dct.h"
    185186#include "spectral/phasevoc.h"
    186187#include "spectral/filterbank.h"
Note: See TracChangeset for help on using the changeset viewer.