Changeset 407bba9 for src/mathutils.c


Ignore:
Timestamp:
Oct 17, 2009, 2:38:47 PM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
74516f7
Parents:
858cfa7
Message:

src/mathutils.c: use a string for window type, making enum private

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    r858cfa7 r407bba9  
    2626#include "config.h"
    2727
     28
     29/** Window types */
     30typedef enum
     31{
     32  aubio_win_rectangle,
     33  aubio_win_hamming,
     34  aubio_win_hanning,
     35  aubio_win_hanningz,
     36  aubio_win_blackman,
     37  aubio_win_blackman_harris,
     38  aubio_win_gaussian,
     39  aubio_win_welch,
     40  aubio_win_parzen,
     41  aubio_win_default = aubio_win_hanningz,
     42} aubio_window_type;
     43
    2844fvec_t *
    29 new_aubio_window (uint_t size, aubio_window_type wintype)
     45new_aubio_window (char_t * window_type, uint_t size)
    3046{
    3147  // create fvec of size x 1 channel
     
    3349  smpl_t * w = win->data[0];
    3450  uint_t i;
     51  aubio_window_type wintype;
     52  if (strcmp (window_type, "rectangle") == 0)
     53      wintype = aubio_win_rectangle;
     54  else if (strcmp (window_type, "hamming") == 0)
     55      wintype = aubio_win_hamming;
     56  else if (strcmp (window_type, "hanning") == 0)
     57      wintype = aubio_win_hanning;
     58  else if (strcmp (window_type, "hanningz") == 0)
     59      wintype = aubio_win_hanningz;
     60  else if (strcmp (window_type, "blackman") == 0)
     61      wintype = aubio_win_blackman;
     62  else if (strcmp (window_type, "blackman_harris") == 0)
     63      wintype = aubio_win_blackman_harris;
     64  else if (strcmp (window_type, "gaussian") == 0)
     65      wintype = aubio_win_gaussian;
     66  else if (strcmp (window_type, "welch") == 0)
     67      wintype = aubio_win_welch;
     68  else if (strcmp (window_type, "parzen") == 0)
     69      wintype = aubio_win_parzen;
     70  else if (strcmp (window_type, "default") == 0)
     71      wintype = aubio_win_default;
     72  else {
     73      AUBIO_ERR ("unknown window type %s, using default.\n", window_type);
     74      wintype = aubio_win_default;
     75      return NULL;
     76  }
    3577  switch(wintype) {
    3678    case aubio_win_rectangle:
Note: See TracChangeset for help on using the changeset viewer.