Changeset 1ece4f8


Ignore:
Timestamp:
Dec 17, 2013, 5:20:23 PM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
4ed0ed1
Parents:
941c9f9
Message:

src/fmat.h: clean up fmat api

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/fmat.c

    r941c9f9 r1ece4f8  
    4949}
    5050
    51 void fmat_write_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position) {
     51void fmat_set_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position) {
    5252  s->data[channel][position] = data;
    5353}
    54 smpl_t fmat_read_sample(fmat_t *s, uint_t channel, uint_t position) {
     54
     55smpl_t fmat_get_sample(fmat_t *s, uint_t channel, uint_t position) {
    5556  return s->data[channel][position];
    5657}
    57 void fmat_put_channel(fmat_t *s, smpl_t * data, uint_t channel) {
    58   s->data[channel] = data;
    59 }
     58
    6059void fmat_get_channel(fmat_t *s, uint_t channel, fvec_t *output) {
    6160  output->data = s->data[channel];
    6261  output->length = s->length;
    6362  return;
     63}
     64
     65smpl_t * fmat_get_channel_data(fmat_t *s, uint_t channel) {
     66  return s->data[channel];
    6467}
    6568
  • src/fmat.h

    r941c9f9 r1ece4f8  
    5151*/
    5252fmat_t * new_fmat(uint_t length, uint_t height);
     53
    5354/** fmat_t buffer deletion function
    5455
     
    5758*/
    5859void del_fmat(fmat_t *s);
     60
    5961/** read sample value in a buffer
    60 
    61   Note that this function is not used in the aubio library, since the same
    62   result can be obtained using vec->data[channel][position]. Its purpose is to
    63   access these values from wrappers, as created by swig.
    6462
    6563  \param s vector to read from
     
    6866
    6967*/
    70 smpl_t fmat_read_sample(fmat_t *s, uint_t channel, uint_t position);
     68smpl_t fmat_get_sample(fmat_t *s, uint_t channel, uint_t position);
     69
    7170/** write sample value in a buffer
    72 
    73   Note that this function is not used in the aubio library, since the same
    74   result can be obtained by assigning vec->data[channel][position]. Its purpose
    75   is to access these values from wrappers, as created by swig.
    7671
    7772  \param s vector to write to
     
    8176
    8277*/
    83 void  fmat_write_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position);
     78void  fmat_set_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position);
     79
    8480/** read channel vector from a buffer
    85 
    86   Note that this function is not used in the aubio library, since the same
    87   result can be obtained with vec->data[channel]. Its purpose is to access
    88   these values from wrappers, as created by swig.
    8981
    9082  \param s vector to read from
     
    9486*/
    9587void fmat_get_channel (fmat_t *s, uint_t channel, fvec_t *output);
    96 /** write channel vector into a buffer
    9788
    98   Note that this function is not used in the aubio library, since the same
    99   result can be obtained by assigning vec->data[channel]. Its purpose is to
    100   access these values from wrappers, as created by swig.
     89/** get vector buffer from an fmat data
    10190
    102   \param s vector to write to
    103   \param data vector of [length] values to write
    104   \param channel channel to write to
     91  \param s vector to read from
     92  \param channel channel to read from
    10593
    10694*/
    107 void fmat_put_channel(fmat_t *s, smpl_t * data, uint_t channel);
     95smpl_t * fmat_get_channel_data (fmat_t *s, uint_t channel);
     96
    10897/** read data from a buffer
    109 
    110   Note that this function is not used in the aubio library, since the same
    111   result can be obtained with vec->data. Its purpose is to access these values
    112   from wrappers, as created by swig.
    11398
    11499  \param s vector to read from
Note: See TracChangeset for help on using the changeset viewer.