[src,swig] added cvec methods to sample
authorPaul Brossier <piem@altern.org>
Tue, 28 Feb 2006 07:30:11 +0000 (07:30 +0000)
committerPaul Brossier <piem@altern.org>
Tue, 28 Feb 2006 07:30:11 +0000 (07:30 +0000)
[src,swig] added cvec methods to sample

src/sample.c
src/sample.h
swig/aubio.i

index 670f62e..c85694a 100644 (file)
@@ -89,3 +89,34 @@ void del_cvec(cvec_t *s) {
   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;
+}
index 1e88140..e0970af 100644 (file)
@@ -71,8 +71,19 @@ void  fvec_write_sample(fvec_t *s, smpl_t data, uint_t channel, uint_t position)
 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
 }
index 27ed411..c4f6ff0 100644 (file)
@@ -48,6 +48,16 @@ public:
 /* 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 */