Changeset 00819aa


Ignore:
Timestamp:
Apr 21, 2016, 7:38:24 PM (8 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:
a599a1b
Parents:
feb694b
Message:

src/onset/: add const qualifiers

Location:
src/onset
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/onset/onset.c

    rfeb694b r00819aa  
    4646
    4747/* execute onset detection function on iput buffer */
    48 void aubio_onset_do (aubio_onset_t *o, fvec_t * input, fvec_t * onset)
     48void aubio_onset_do (aubio_onset_t *o, const fvec_t * input, fvec_t * onset)
    4949{
    5050  smpl_t isonset = 0;
     
    8585}
    8686
    87 uint_t aubio_onset_get_last (aubio_onset_t *o)
     87uint_t aubio_onset_get_last (const aubio_onset_t *o)
    8888{
    8989  return o->last_onset - o->delay;
    9090}
    9191
    92 smpl_t aubio_onset_get_last_s (aubio_onset_t *o)
     92smpl_t aubio_onset_get_last_s (const aubio_onset_t *o)
    9393{
    9494  return aubio_onset_get_last (o) / (smpl_t) (o->samplerate);
    9595}
    9696
    97 smpl_t aubio_onset_get_last_ms (aubio_onset_t *o)
     97smpl_t aubio_onset_get_last_ms (const aubio_onset_t *o)
    9898{
    9999  return aubio_onset_get_last_s (o) * 1000.;
     
    105105}
    106106
    107 smpl_t aubio_onset_get_silence(aubio_onset_t * o) {
     107smpl_t aubio_onset_get_silence(const aubio_onset_t * o) {
    108108  return o->silence;
    109109}
     
    114114}
    115115
    116 smpl_t aubio_onset_get_threshold(aubio_onset_t * o) {
     116smpl_t aubio_onset_get_threshold(const aubio_onset_t * o) {
    117117  return aubio_peakpicker_get_threshold(o->pp);
    118118}
     
    123123}
    124124
    125 uint_t aubio_onset_get_minioi(aubio_onset_t * o) {
     125uint_t aubio_onset_get_minioi(const aubio_onset_t * o) {
    126126  return o->minioi;
    127127}
     
    131131}
    132132
    133 smpl_t aubio_onset_get_minioi_s(aubio_onset_t * o) {
     133smpl_t aubio_onset_get_minioi_s(const aubio_onset_t * o) {
    134134  return aubio_onset_get_minioi (o) / (smpl_t) o->samplerate;
    135135}
     
    139139}
    140140
    141 smpl_t aubio_onset_get_minioi_ms(aubio_onset_t * o) {
     141smpl_t aubio_onset_get_minioi_ms(const aubio_onset_t * o) {
    142142  return aubio_onset_get_minioi_s (o) * 1000.;
    143143}
     
    148148}
    149149
    150 uint_t aubio_onset_get_delay(aubio_onset_t * o) {
     150uint_t aubio_onset_get_delay(const aubio_onset_t * o) {
    151151  return o->delay;
    152152}
     
    156156}
    157157
    158 smpl_t aubio_onset_get_delay_s(aubio_onset_t * o) {
     158smpl_t aubio_onset_get_delay_s(const aubio_onset_t * o) {
    159159  return aubio_onset_get_delay (o) / (smpl_t) o->samplerate;
    160160}
     
    164164}
    165165
    166 smpl_t aubio_onset_get_delay_ms(aubio_onset_t * o) {
     166smpl_t aubio_onset_get_delay_ms(const aubio_onset_t * o) {
    167167  return aubio_onset_get_delay_s (o) * 1000.;
    168168}
    169169
    170 smpl_t aubio_onset_get_descriptor(aubio_onset_t * o) {
     170smpl_t aubio_onset_get_descriptor(const aubio_onset_t * o) {
    171171  return o->desc->data[0];
    172172}
    173173
    174 smpl_t aubio_onset_get_thresholded_descriptor(aubio_onset_t * o) {
     174smpl_t aubio_onset_get_thresholded_descriptor(const aubio_onset_t * o) {
    175175  fvec_t * thresholded = aubio_peakpicker_get_thresholded_input(o->pp);
    176176  return thresholded->data[0];
     
    178178
    179179/* Allocate memory for an onset detection */
    180 aubio_onset_t * new_aubio_onset (char_t * onset_mode,
     180aubio_onset_t * new_aubio_onset (const char_t * onset_mode,
    181181    uint_t buf_size, uint_t hop_size, uint_t samplerate)
    182182{
  • src/onset/onset.h

    rfeb694b r00819aa  
    6060
    6161*/
    62 aubio_onset_t * new_aubio_onset (char_t * method,
     62aubio_onset_t * new_aubio_onset (const char_t * method,
    6363    uint_t buf_size, uint_t hop_size, uint_t samplerate);
    6464
     
    8989
    9090*/
    91 void aubio_onset_do (aubio_onset_t *o, fvec_t * input, fvec_t * onset);
     91void aubio_onset_do (aubio_onset_t *o, const fvec_t * input, fvec_t * onset);
    9292
    9393/** get the time of the latest onset detected, in samples
     
    9898
    9999*/
    100 uint_t aubio_onset_get_last (aubio_onset_t *o);
     100uint_t aubio_onset_get_last (const aubio_onset_t *o);
    101101
    102102/** get the time of the latest onset detected, in seconds
     
    107107
    108108*/
    109 smpl_t aubio_onset_get_last_s (aubio_onset_t *o);
     109smpl_t aubio_onset_get_last_s (const aubio_onset_t *o);
    110110
    111111/** get the time of the latest onset detected, in milliseconds
     
    116116
    117117*/
    118 smpl_t aubio_onset_get_last_ms (aubio_onset_t *o);
     118smpl_t aubio_onset_get_last_ms (const aubio_onset_t *o);
    119119
    120120/** set onset detection silence threshold
     
    133133
    134134*/
    135 smpl_t aubio_onset_get_silence(aubio_onset_t * o);
     135smpl_t aubio_onset_get_silence(const aubio_onset_t * o);
    136136
    137137/** get onset detection function
     
    141141
    142142*/
    143 smpl_t aubio_onset_get_descriptor ( aubio_onset_t *o);
     143smpl_t aubio_onset_get_descriptor (const aubio_onset_t *o);
    144144
    145145/** get thresholded onset detection function
     
    149149
    150150*/
    151 smpl_t aubio_onset_get_thresholded_descriptor ( aubio_onset_t *o);
     151smpl_t aubio_onset_get_thresholded_descriptor (const aubio_onset_t *o);
    152152
    153153/** set onset detection peak picking threshold
     
    220220
    221221*/
    222 uint_t aubio_onset_get_minioi(aubio_onset_t * o);
     222uint_t aubio_onset_get_minioi(const aubio_onset_t * o);
    223223
    224224/** get minimum inter onset interval in seconds
     
    229229
    230230*/
    231 smpl_t aubio_onset_get_minioi_s(aubio_onset_t * o);
     231smpl_t aubio_onset_get_minioi_s(const aubio_onset_t * o);
    232232
    233233/** get minimum inter onset interval in milliseconds
     
    238238
    239239*/
    240 smpl_t aubio_onset_get_minioi_ms(aubio_onset_t * o);
     240smpl_t aubio_onset_get_minioi_ms(const aubio_onset_t * o);
    241241
    242242/** get delay in samples
     
    247247
    248248*/
    249 uint_t aubio_onset_get_delay(aubio_onset_t * o);
     249uint_t aubio_onset_get_delay(const aubio_onset_t * o);
    250250
    251251/** get delay in seconds
     
    256256
    257257*/
    258 smpl_t aubio_onset_get_delay_s(aubio_onset_t * o);
     258smpl_t aubio_onset_get_delay_s(const aubio_onset_t * o);
    259259
    260260/** get delay in milliseconds
     
    265265
    266266*/
    267 smpl_t aubio_onset_get_delay_ms(aubio_onset_t * o);
     267smpl_t aubio_onset_get_delay_ms(const aubio_onset_t * o);
    268268
    269269/** get onset peak picking threshold
     
    273273
    274274*/
    275 smpl_t aubio_onset_get_threshold(aubio_onset_t * o);
     275smpl_t aubio_onset_get_threshold(const aubio_onset_t * o);
    276276
    277277/** delete onset detection object
Note: See TracChangeset for help on using the changeset viewer.