shithub: aubio

Download patch

ref: 7c206dfa10609de485fb83f29776fe74cab25019
parent: d3efa4ea5862b3e38716c335d02bdd57de55bf08
author: Paul Brossier <[email protected]>
date: Tue Feb 28 02:30:11 EST 2006

[src,swig] added cvec methods to sample
[src,swig] added cvec methods to sample


--- a/src/sample.c
+++ b/src/sample.c
@@ -89,3 +89,34 @@
   AUBIO_FREE(s->phas);
   AUBIO_FREE(s);
 }
+
+void cvec_write_norm(cvec_t *s, smpl_t data, uint_t channel, uint_t position) {
+  s->norm[channel][position] = data;
+}
+void cvec_write_phas(cvec_t *s, smpl_t data, uint_t channel, uint_t position) {
+  s->phas[channel][position] = data;
+}
+smpl_t cvec_read_norm(cvec_t *s, uint_t channel, uint_t position) {
+  return s->norm[channel][position];
+}
+smpl_t cvec_read_phas(cvec_t *s, uint_t channel, uint_t position) {
+  return s->phas[channel][position];
+}
+void cvec_put_norm_channel(cvec_t *s, smpl_t * data, uint_t channel) {
+  s->norm[channel] = data;
+}
+void cvec_put_phas_channel(cvec_t *s, smpl_t * data, uint_t channel) {
+  s->phas[channel] = data;
+}
+smpl_t * cvec_get_norm_channel(cvec_t *s, uint_t channel) {
+  return s->norm[channel];
+}
+smpl_t * cvec_get_phas_channel(cvec_t *s, uint_t channel) {
+  return s->phas[channel];
+}
+smpl_t ** cvec_get_norm(cvec_t *s) {
+  return s->norm;
+}
+smpl_t ** cvec_get_phas(cvec_t *s) {
+  return s->phas;
+}
--- a/src/sample.h
+++ b/src/sample.h
@@ -71,8 +71,19 @@
 smpl_t * fvec_get_channel(fvec_t *s, uint_t channel);
 smpl_t ** fvec_get_data(fvec_t *s);
 void fvec_put_channel(fvec_t *s, smpl_t * data, uint_t channel);
+
 extern cvec_t * new_cvec(uint_t length, uint_t channels);
 extern void del_cvec(cvec_t *s);
+void cvec_write_norm(cvec_t *s, smpl_t data, uint_t channel, uint_t position);
+void cvec_write_phas(cvec_t *s, smpl_t data, uint_t channel, uint_t position);
+smpl_t cvec_read_norm(cvec_t *s, uint_t channel, uint_t position);
+smpl_t cvec_read_phas(cvec_t *s, uint_t channel, uint_t position);
+void cvec_put_norm_channel(cvec_t *s, smpl_t * data, uint_t channel);
+void cvec_put_phas_channel(cvec_t *s, smpl_t * data, uint_t channel);
+smpl_t * cvec_get_norm_channel(cvec_t *s, uint_t channel);
+smpl_t * cvec_get_phas_channel(cvec_t *s, uint_t channel);
+smpl_t ** cvec_get_norm(cvec_t *s);
+smpl_t ** cvec_get_phas(cvec_t *s);
 
 #ifdef __cplusplus
 }
--- a/swig/aubio.i
+++ b/swig/aubio.i
@@ -48,6 +48,16 @@
 /* cvec */
 extern cvec_t * new_cvec(uint_t length, uint_t channels);
 extern void del_cvec(cvec_t *s);
+extern void cvec_write_norm(cvec_t *s, smpl_t data, uint_t channel, uint_t position);
+extern void cvec_write_phas(cvec_t *s, smpl_t data, uint_t channel, uint_t position);
+extern smpl_t cvec_read_norm(cvec_t *s, uint_t channel, uint_t position);
+extern smpl_t cvec_read_phas(cvec_t *s, uint_t channel, uint_t position);
+extern void cvec_put_norm_channel(cvec_t *s, smpl_t * data, uint_t channel);
+extern void cvec_put_phas_channel(cvec_t *s, smpl_t * data, uint_t channel);
+extern smpl_t * cvec_get_norm_channel(cvec_t *s, uint_t channel);
+extern smpl_t * cvec_get_phas_channel(cvec_t *s, uint_t channel);
+extern smpl_t ** cvec_get_norm(cvec_t *s);
+extern smpl_t ** cvec_get_phas(cvec_t *s);
 
 
 /* sndfile */