[Libremix] Merge with svn version 0.2.4 and removal of white space.
authorPrince Kr Dubey <prince.dubey@samsung.com>
Thu, 19 Jan 2012 12:07:59 +0000 (17:37 +0530)
committerPrince Kr Dubey <prince.dubey@samsung.com>
Thu, 19 Jan 2012 14:07:08 +0000 (19:37 +0530)
Change-Id: I3958d77c6405cf91eafb5148882ddc17a24b16f4

21 files changed:
README
configure.ac
debian/changelog
debian/control
doc/Makefile.am
include/remix/remix.h
include/remix/remix_plugin.h
include/remix/remix_types.h
remix.spec
src/ctxdata/cd_list.c
src/examples/M1F1-int16-AFsp.wav [deleted file]
src/examples/Makefile.am
src/examples/simple_sndfiledemo.c [deleted file]
src/examples/simple_squaredemo.c [deleted file]
src/libremix/remix_base.c
src/libremix/remix_context.c
src/libremix/remix_debug.c
src/libremix/remix_envelope.c
src/libremix/remix_private.h
src/libremix/remix_sndfile.c
src/libremix/remix_squaretone.c

diff --git a/README b/README
index 212f3f2..66a3364 100644 (file)
--- a/README
+++ b/README
@@ -15,10 +15,9 @@ Developers
 
 Please join the remix-devel mailing list, linked from the homepage.
 
-libremix is maintained in Subversion with anonymous read access. You can
-check out the most current version of libremix from:
+libremix is maintained in Git at Github:
 
-svn co http://svn.metadecks.org/libremix/trunk libremix
+https://github.com/kfish/remix
 
 A list of outstanding tasks is maintained in the TODO file of this source
 distribution. When implementing anything listed in this file, please update
@@ -28,7 +27,7 @@ that implements the fix.
 Copyrights
 ----------
 
-Copyright (C) 2000-2010 Conrad Parker <conrad@metadecks.org>
+Copyright (C) 2000-2011 Conrad Parker <conrad@metadecks.org>
 Copyright (C) 2001, 2002 Commonwealth Scientific and Industrial Research
 Organisation (CSIRO), Australia.
 
index 797957f..be0edf7 100644 (file)
@@ -1,9 +1,31 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(src/libremix/remix_base.c)
 
-AM_INIT_AUTOMAKE(remix, 0.2.3)
+AM_INIT_AUTOMAKE(remix, 0.2.4)
 AM_CONFIG_HEADER(config.h)
 
+example_programs="noisedemo squaredemo"
+
+################################################################################
+# Set the shared versioning info, according to section 6.3 of the libtool info #
+# pages. CURRENT:REVISION:AGE must be updated immediately before each release: #
+#                                                                              #
+#   * If the library source code has changed at all since the last             #
+#     update, then increment REVISION (`C:R:A' becomes `C:r+1:A').             #
+#                                                                              #
+#   * If any interfaces have been added, removed, or changed since the         #
+#     last update, increment CURRENT, and set REVISION to 0.                   #
+#                                                                              #
+#   * If any interfaces have been added since the last public release,         #
+#     then increment AGE.                                                      #
+#                                                                              #
+#   * If any interfaces have been removed since the last public release,       #
+#     then set AGE to 0.                                                       #
+#                                                                              #
+################################################################################
+SHARED_VERSION_INFO="1:0:1"
+SHLIB_VERSION_ARG=""
+
 dnl Checks for programs.
 AM_PROG_LIBTOOL
 AC_PROG_INSTALL
@@ -60,16 +82,15 @@ dnl
 dnl  Detect libsndfile 1.0
 dnl
 
+
 PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
                   HAVE_LIBSNDFILE1="yes", HAVE_LIBSNDFILE1="no")
 
-AC_SUBST(SNDFILE_LIBS)
-AC_SUBST(SNDFILE_CFLAGS)
-
 if test "$HAVE_LIBSNDFILE1" = "yes" ; then
   AC_DEFINE([HAVE_LIBSNDFILE1], [], [Define if libsndfile version 1 found])
   AC_SUBST(SNDFILE_LIBS)
   AC_SUBST(SNDFILE_CFLAGS)
+  example_programs="${example_programs} sndfiledemo"
 else
   AC_CHECK_LIB(sndfile, sf_open, HAVE_LIBSNDFILE1="maybe")
   if test "$HAVE_LIBSNDFILE1" = "maybe" ; then
@@ -135,7 +156,6 @@ AC_ARG_ENABLE(gcc-werror,
        AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]))
 
 dnl Use -Wall if we have gcc.
-
 if test "x$ac_cv_prog_gcc" = xyes ; then
   CFLAGS="$CFLAGS -Wall"
 
@@ -145,6 +165,9 @@ if test "x$ac_cv_prog_gcc" = xyes ; then
 
 fi
 
+AC_SUBST(SHLIB_VERSION_ARG)
+AC_SUBST(SHARED_VERSION_INFO)
+
 AC_OUTPUT([
 Makefile
 doc/Makefile
index 43ec6ac..f86fc03 100755 (executable)
@@ -1,5 +1,15 @@
+libremix (0.2.4) unstable; urgency=low
+
+  * Merge with svn version 0.2.4 and whitespace removed.
+  * Git: slp/pkgs/l/libremix
+  * Tag: 0.2.4
+
+ -- Prince Kumar Dubey <prince.dubey@samsung.com>  Thu, 19 Jan 2012 18:38:00 +0530
+
 libremix (0.2.3) unstable; urgency=low
 
   * Initial Version.
+  * Git: slp/pkgs/l/libremix
+  * Tag: 0.2.3
 
  -- Prince Kumar Dubey <prince.dubey@samsung.com> Govindaraju S M <govi.sm@samsung.com>  Tue, 20 Sep 2011 15:00:00 +0900
\ No newline at end of file
index 7008e26..33d27ff 100755 (executable)
@@ -4,7 +4,7 @@ Priority: optional
 Uploaders: Prince Kumar Dubey<prince.dubey@samsung.com> Govindaraju S M<govi.sm@samsung.com>
 Maintainer: Conrad Parker <conrad@metadecks.org>
 Build-Depends: cdbs, libsndfile1-dev, libsndfile1, pkg-config, libtool
-Standards-Version: 0.2.3
+Standards-Version: 0.2.4
 Homepage: http://www.metadecks.org/software/remix/
 
 Package: libremix
index fc9e479..6855753 100644 (file)
@@ -2,7 +2,7 @@ docdir=$(prefix)/share/doc/@PACKAGE@
 
 EXTRA_DIST = Doxyfile.in
 
-doc_DATA = doxygen-build.stamp
+noinst_DATA = doxygen-build.stamp
 
 if HAVE_DOXYGEN
 doxygen-build.stamp: Doxyfile $(top_srcdir)/include/remix/*.h
@@ -20,33 +20,35 @@ dist-hook:
        if test -d libremix; then \
          mkdir $(dist_docdir); \
          for dir in libremix/*; do \
-            if test -d $$dir; then \
-              b=`basename $$dir`; \
-              mkdir $(dist_docdir)/$$b; \
-             for f in $$dir/*; do \
-                cp -p $$f $(dist_docdir)/$$b; \
-              done \
-            fi \
-          done \
+           b=`basename $$dir`; \
+           if test $$b != "CVS"; then \
+             if test -d $$dir; then \
+               mkdir $(dist_docdir)/$$b; \
+               for f in $$dir/*; do \
+                 cp -p $$f $(dist_docdir)/$$b; \
+               done \
+             fi \
+           fi \
+         done \
        fi
 
 
 install-data-local: doxygen-build.stamp
-       $(mkinstalldirs) $(docdir)
+       $(mkinstalldirs) $(DESTDIR)$(docdir)
        if test -d libremix; then \
          for dir in libremix/*; do \
            if test -d $$dir; then \
              b=`basename $$dir`; \
-             $(mkinstalldirs) $(docdir)/$$b; \
+             $(mkinstalldirs) $(DESTDIR)$(docdir)/$$b; \
              for f in $$dir/*; do \
-               $(INSTALL_DATA) $$f $(docdir)/$$b; \
-              done \
+               $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$b; \
+             done \
            fi \
          done \
        fi
 
 uninstall-local:
-       rm -rf $(docdir)
+       rm -rf $(DESTDIR)$(docdir)
 
 clean-local:
        if test -d libremix; then rm -rf libremix; fi
index 8a4583e..4ec3427 100644 (file)
@@ -182,6 +182,13 @@ RemixTempo remix_get_tempo (RemixEnv * env);
 CDSet * remix_set_channels (RemixEnv * env, CDSet * channelset);
 CDSet * remix_get_channels (RemixEnv * env);
 
+#if 0
+  /* XXX */
+/* Sources: Plugins, Samples etc. */
+CDList * remix_open (SOUNDRENDER env, char * filename);
+void remix_close (SOUNDRENDER env, RemixPlugin plugin);
+#endif
+
 /* Base objects */
 
 RemixPlugin * remix_find_plugin (RemixEnv * env, char * identifier);
index 51c7e33..73fd5e3 100644 (file)
@@ -64,8 +64,6 @@ typedef struct _RemixPlugin RemixPlugin;
 
 typedef struct _RemixChunk RemixChunk;
 
-typedef struct _Remix_Sound_Data Remix_Sound_Data;
-
 #if defined (__REMIX__)
 #include "remix_private.h"
 #else
index 52e733a..4f379a8 100644 (file)
@@ -48,8 +48,7 @@ typedef long RemixCount;
 #define REMIX_COUNT_MIN LONG_MIN
 #define REMIX_COUNT_INFINITE REMIX_COUNT_MAX
 
-//TODO xxx : Change this
-typedef struct _RemixOpaque RemixOpaque;
+typedef void RemixOpaque;
 
 #if defined (__REMIX__)
 typedef struct _RemixBase RemixBase;
@@ -57,11 +56,6 @@ typedef struct _RemixBase RemixBase;
 typedef RemixOpaque RemixBase;
 #endif
 
-//TODO xxx : Change this
-struct _RemixOpaque {
-  void * instance_data;
-};
-
 typedef CDScalar RemixParameter;
 
 typedef int RemixFlags;
@@ -136,7 +130,6 @@ typedef enum {
 #define REMIX_HINT_LOG      (1<<0)
 #define REMIX_HINT_TIME     (1<<1)
 #define REMIX_HINT_FILENAME (1<<2)
-#define REMIX_HINT_CHANNEL (1<<3)
 
 #define REMIX_CONSTRAINT_EMPTY ((RemixConstraint){NULL})
 
index 539e8c7..624d09e 100644 (file)
@@ -1,6 +1,6 @@
 
 %define name    remix
-%define version 0.2.3
+%define version 0.2.4
 %define release 1
 %define prefix  /usr
 
index 1de9c5c..2bd38aa 100644 (file)
@@ -435,7 +435,7 @@ cd_list_destroy_with (void * ctx, CDList * list, CDDestroyFunc destroy)
 
   for (l = list; l; l = ln) {
     ln = l->next;
-//    destroy (ctx, l->data.s_pointer);
+    destroy (ctx, l->data.s_pointer);
     cd_free (l);
   }
 
diff --git a/src/examples/M1F1-int16-AFsp.wav b/src/examples/M1F1-int16-AFsp.wav
deleted file mode 100644 (file)
index 26a744b..0000000
Binary files a/src/examples/M1F1-int16-AFsp.wav and /dev/null differ
index d9f29fd..77c7b1e 100644 (file)
@@ -2,9 +2,9 @@
 INCLUDES = -I$(top_srcdir)/src/ctxdata -I$(top_srcdir)/include -I../ctxdata
 
 if BUILD_MONITOR
-monitor_programs = noisedemo squaredemo mysquaredemo
+monitor_programs = noisedemo squaredemo
 if HAVE_LIBSNDFILE1
-sndfile_programs = sndfiledemo simple_sndfiledemo
+sndfile_programs = sndfiledemo
 endif
 
 endif
@@ -24,13 +24,6 @@ noisedemo_LDADD = $(REMIX_LIBS)
 squaredemo_SOURCES = squaredemo.c
 squaredemo_LDADD = $(REMIX_LIBS)
 
-mysquaredemo_SOURCES = simple_squaredemo.c
-mysquaredemo_LDADD = $(REMIX_LIBS)
-
 sndfiledemo_CFLAGS = -DSAMPLEDIR=\"$(srcdir)\"
 sndfiledemo_SOURCES = sndfiledemo.c
 sndfiledemo_LDADD = $(REMIX_LIBS) @SNDFILE_LIBS@
-
-simple_sndfiledemo_CFLAGS = -DSAMPLEDIR=\"$(srcdir)\"
-simple_sndfiledemo_SOURCES = simple_sndfiledemo.c
-simple_sndfiledemo_LDADD = $(REMIX_LIBS) @SNDFILE_LIBS@
diff --git a/src/examples/simple_sndfiledemo.c b/src/examples/simple_sndfiledemo.c
deleted file mode 100755 (executable)
index 55bfec5..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <remix/remix.h>
-
-int
-main (int argc, char ** argv)
-{
-  RemixEnv * env;
-  RemixDeck * deck;
-  RemixTrack * track;
-  RemixLayer * l1, * l2, * sample_layer;
-  RemixBase * sf1;
-  RemixBase * player;
-  RemixCount length;
-  RemixPlugin * sf_plugin;
-  RemixPlugin * player_plugin;
-
-  CDSet * sf_parms;
-  int i;
-  int sf_path_key;
-  RemixSound * sound;
-
-  env = remix_init ();
-  remix_set_samplerate(env, 8000);
-  printf( "remix sample rate: %f\n", remix_get_samplerate(env));
-  remix_set_channels (env, REMIX_STEREO);
-
-
-  //############################   Setting files for MIXING ########################
-  sf_plugin = remix_find_plugin (env, "builtin::sndfile_reader");   // keep the plugin list, no need to lookup everytime
-   if (sf_plugin == NULL) {
-     fprintf (stderr, "sf_plugin == NULL\n");
-     exit (1);
-   }
-  sf_parms = cd_set_new (env);
-  sf_path_key = remix_get_init_parameter_key (env, sf_plugin, "path");
-  sf_parms = cd_set_insert (env, sf_parms, sf_path_key, CD_STRING(SAMPLEDIR "/M1F1-int16-AFsp.wav"));
-  sf1 = remix_new (env, sf_plugin, sf_parms);
-
-  deck = remix_deck_new (env);
-  track = remix_track_new (env, deck);
-  l1 = remix_layer_new_ontop (env, track, REMIX_TIME_SAMPLES);
-  remix_sound_new (env, (RemixBase *)sf1, l1, REMIX_SAMPLES(7000), REMIX_SAMPLES(35000) );
-  //################################################################################
-
-   /////////////////////////////////  ADDING PLAYER ////////////////
-   sample_layer = remix_layer_new_ontop (env, track, REMIX_TIME_SAMPLES);
-   player_plugin = remix_find_plugin (env, "stream_player");   // keep the plugin list, no need to lookup everytime
-     if (player_plugin == NULL) {
-       fprintf (stderr, "player_plugin == NULL\n");
-       exit (1);
-     }
-    player =  remix_new (env, player_plugin, NULL);
-   remix_sound_new (env, (RemixBase *)player, sample_layer, REMIX_SAMPLES(0), REMIX_SAMPLES(35000));
-   //////////////////////////////////////////////////////////////////
-
-   remix_process (env, deck, 35000, RemixNone, RemixNone);
-   exit (0);
-}
diff --git a/src/examples/simple_squaredemo.c b/src/examples/simple_squaredemo.c
deleted file mode 100755 (executable)
index 00d4497..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * squaredemo.c
- *
- * Copyright (C) 2001 Commonwealth Scientific and Industrial Research
- * Organisation (CSIRO), Australia.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation.  No representations are made about the suitability of this
- * software for any purpose.  It is provided "as is" without express or
- * implied warranty.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <remix/remix.h>
-
-#define remix_add_sound_B(a,s,l,t1,t2) \
-  remix_sound_new ((a), (s), (l), REMIX_BEAT24S(t1), REMIX_BEAT24S(t2))
-
-#define BEAT 24
-#define HALF_BEAT 12
-#define QUARTER_BEAT 6
-#define EIGHTH_BEAT 3
-
-int
-main (int argc, char ** argv)
-{
-  RemixEnv * env;
-  RemixDeck * deck, * deck2;
-  RemixTrack * track, * track2, * track3, * track4;
-  RemixLayer * l1, * l2, * l3, * l4, * l5;
-  RemixSound * s;
-  RemixSquareTone * square1, * square2, * square3, * square4, * square5;
-  RemixPlugin * noise_plugin;
-  RemixBase * noise;
-  RemixEnvelope * env1, * env2, * env3;
-  RemixEnvelope * ge;
-  RemixCount length;
-  RemixMonitor * monitor;
-  int b = 0, b2 = 0, mb;
-
-  env = remix_init ();
-
-  remix_set_tempo (env, 500);
-  remix_set_channels (env, REMIX_STEREO);
-
-  square1 = remix_squaretone_new (env, 100.0);
-  remix_squaretone_add_channel (env, square1, 0 );
-
-  square2 = remix_squaretone_new (env, 200.0);
-  remix_squaretone_add_channel (env, square2, 0 );
-  remix_squaretone_add_channel (env, square2, 1 );
-
-  square3 = remix_squaretone_new (env, 385.0);
-  remix_squaretone_add_channel (env, square3, 0 );
-
- // square4 = remix_squaretone_new (env, 231.0);
- // square5 = remix_squaretone_new (env, 165.0);
-
-  monitor = remix_monitor_new (env);
-
-  deck = remix_deck_new (env);
-  track = remix_track_new (env, deck);
-  l1 = remix_layer_new_ontop (env, track, REMIX_TIME_BEAT24S);
-  s =  remix_sound_new (env, square1, l1, REMIX_BEAT24S(0), REMIX_BEAT24S(6));
-  s =  remix_sound_new (env, square2, l1, REMIX_BEAT24S(8), REMIX_BEAT24S(12));
-  s =  remix_sound_new (env, square3, l1, REMIX_BEAT24S(21), REMIX_BEAT24S(12));
-
-/*
-  remix_track_set_gain (env, track2, 0.6);
-
- ge = remix_envelope_new (env, REMIX_ENVELOPE_LINEAR);
- remix_envelope_set_timetype (env, ge, REMIX_TIME_SAMPLES);
- remix_envelope_add_point (env, ge, REMIX_BEAT24S(2), 0.6);
-*/
-
-
-  length = remix_length (env, deck);
-
-  l2 = remix_layer_new_ontop (env, track, REMIX_TIME_SAMPLES);
-  s = remix_sound_new (env, monitor, l2, REMIX_SAMPLES(0), REMIX_SAMPLES(length));
-  //remix_sound_set_gain_envelope (env, s, ge);
-
-  remix_process (env, deck, length, RemixNone, RemixNone);
-
-  remix_purge (env);
-
-  exit (0);
-}
-
index 1b27484..bb51fee 100644 (file)
@@ -431,9 +431,6 @@ remix_process_fast (RemixEnv * env, RemixBase * base, RemixCount count,
     remix_set_error (env, REMIX_ERROR_INVALID);
     return -1;
   }
-
-  remix_get_meta_text (env, base);
-
   n = _remix_process (env, base, count, input, output);
   if (n > 0) base->offset += n;
   return n;
index a5398c1..02cb97e 100644 (file)
@@ -49,7 +49,7 @@ remix_context_destroy (RemixEnv * env)
 
   world->plugins = cd_list_destroy_with (env, world->plugins, remix_plugin_destroy);
   remix_plugin_defaults_unload (env);
-//need to analyse why its commented in svn version ???
+
   //world->bases = cd_list_destroy_with (env, world->bases, remix_destroy);
 
   remix_channelset_defaults_destroy (env);
index c782b7d..7b79856 100644 (file)
@@ -66,7 +66,7 @@ remix_debug_up (void)
 void
 remix_dprintf (const char * fmt, ...)
 {
-#if 0
+#ifdef DEBUG
   va_list ap;
   char buf[4096];
   int i, n;
index f039bc0..b30c125 100644 (file)
@@ -116,7 +116,6 @@ remix_envelope_new (RemixEnv * env, RemixEnvelopeType type)
   remix_envelope_init (env, (RemixBase *)envelope);
   envelope->type = type;
   remix_envelope_debug (env, envelope);
-
   return envelope;
 }
 
index b72cc4d..f10c3f9 100644 (file)
@@ -426,7 +426,6 @@ RemixCount _remix_chunk_blend_inplace (RemixEnv * env,
 /* XXX: remove these when dynamic! */
 CDList * __gain_init (RemixEnv * env);
 CDList * __sndfile_init (RemixEnv * env);
-CDList * __ogg_init (RemixEnv * env);
 
 #endif /* defined(__REMIX__) */
 
index 664ba83..912f197 100644 (file)
@@ -45,7 +45,6 @@ struct _RemixSndfileInstance {
   SF_INFO info;
   float * pcm;
   sf_count_t pcm_n;
-  CDSet * channels;
 };
 
 
@@ -319,17 +318,6 @@ static struct _RemixParameterScheme path_scheme = {
   REMIX_HINT_FILENAME,
 };
 
-
-static struct _RemixParameterScheme channels_scheme = {
-  "channels",
-  "Channel List to play file",
-  REMIX_TYPE_BOOL,
-  REMIX_CONSTRAINT_TYPE_NONE,
-  REMIX_CONSTRAINT_EMPTY,
-  REMIX_HINT_CHANNEL,
-};
-
-
 #if 0
 static RemixNamedParameter types[] = {
   REMIX_NAMED_PARAMETER ("WAV", CD_INT(SF_FORMAT_WAV)),
index d9f1c38..5a79cf1 100644 (file)
 #define __REMIX__
 #include "remix.h"
 
-typedef struct _RemixSquareToneChannelData RemixSquareToneChannelData;
+typedef struct _RemixSquareToneChannel RemixSquareToneChannel;
 typedef struct _RemixSquareTone RemixSquareTone;
 
-struct _RemixSquareToneChannelData {
+struct _RemixSquareToneChannel {
   RemixCount _cycle_offset;
 };
 
 struct _RemixSquareTone {
   RemixBase base;
   float frequency;
-  CDSet * channel_data;
   CDSet * channels;
-  RemixCount length;
 };
 
 /* Optimisation dependencies: none */
@@ -51,20 +49,20 @@ static RemixSquareTone * remix_squaretone_optimise (RemixEnv * env,
 static RemixSquareTone *
 remix_squaretone_replace_channels (RemixEnv * env, RemixSquareTone * squaretone)
 {
-  RemixSquareToneChannelData * sqch;
+  RemixSquareToneChannel * sqch;
   CDSet * s, * channels = remix_get_channels (env);
   RemixCount offset = remix_tell (env, (RemixBase *)squaretone);
 
-  cd_set_free_all (env, squaretone->channel_data);
+  cd_set_free_all (env, squaretone->channels);
 
   for (s = channels; s; s = s->next) {
     remix_dprintf ("[remix_squaretone_replace_channels] %p replacing channel %d\n",
                squaretone, s->key);
-    sqch = (RemixSquareToneChannelData *)
-      remix_malloc (sizeof (struct _RemixSquareToneChannelData));
+    sqch = (RemixSquareToneChannel *)
+      remix_malloc (sizeof (struct _RemixSquareToneChannel));
     sqch->_cycle_offset = 0;
-    squaretone->channel_data =
-      cd_set_insert (env, squaretone->channel_data, s->key, CD_POINTER(sqch));
+    squaretone->channels =
+      cd_set_insert (env, squaretone->channels, s->key, CD_POINTER(sqch));
   }
 
   if (offset > 0) remix_seek (env, (RemixBase *)squaretone, offset, SEEK_SET);
@@ -76,7 +74,7 @@ static RemixBase *
 remix_squaretone_init (RemixEnv * env, RemixBase * base)
 {
   RemixSquareTone * squaretone = (RemixSquareTone *)base;
-  squaretone->channel_data = NULL;
+  squaretone->channels = NULL;
   remix_squaretone_replace_channels (env, squaretone);
   remix_squaretone_optimise (env, squaretone);
   return base;
@@ -89,7 +87,6 @@ remix_squaretone_new (RemixEnv * env, float frequency)
     remix_base_new_subclass (env, sizeof (struct _RemixSquareTone));
   remix_squaretone_init (env, (RemixBase *)squaretone);
   squaretone->frequency = frequency;
-  squaretone->length = REMIX_COUNT_INFINITE;
 
   return (RemixBase *)squaretone;
 }
@@ -144,44 +141,6 @@ remix_squaretone_get_frequency (RemixEnv * env, RemixBase * base)
   return squaretone->frequency;
 }
 
-RemixCount
-remix_squaretone_set_length (RemixEnv * env, RemixBase * base, RemixCount length)
-{
-  RemixSquareTone * squaretone = (RemixSquareTone *)base;
-  RemixCount old = squaretone->length;
-  squaretone->length = length;
-  return old;
-}
-
-RemixCount
-remix_squaretone_get_length (RemixEnv * env, RemixBase * base)
-{
-  RemixSquareTone * squaretone = (RemixSquareTone *)base;
-  return squaretone->length;
-}
-
-void
-remix_squaretone_add_channel (RemixEnv * env, RemixBase * base, RemixChannelName channel )
-{
-  RemixSquareTone * squaretone = (RemixSquareTone *)base;
-  squaretone->channels = cd_set_replace (env, squaretone->channels, channel, CD_POINTER(NULL));;
-}
-
-void
-remix_squaretone_remove_channel (RemixEnv * env, RemixBase * base, RemixChannelName channel )
-{
-  RemixSquareTone * squaretone = (RemixSquareTone *)base;
-  squaretone->channels = cd_set_remove(env, squaretone->channels, channel );
-}
-
-CDSet *
-remix_squaretone_get_channels (RemixEnv * env, RemixBase * base )
-{
-  RemixSquareTone * squaretone = (RemixSquareTone *)base;
-  return squaretone->channels;
-}
-
-
 /* An RemixChunkFunc for creating squaretone data */
 static RemixCount
 remix_squaretone_write_chunk (RemixEnv * env, RemixChunk * chunk,
@@ -189,21 +148,18 @@ remix_squaretone_write_chunk (RemixEnv * env, RemixChunk * chunk,
                               int channelname, void * data)
 {
   RemixSquareTone * squaretone = (RemixSquareTone *)data;
-  RemixSquareToneChannelData * sqch;
+  RemixSquareToneChannel * sqch;
   RemixCount remaining = count, written = 0, n;
   RemixCount wavelength;
   RemixPCM * d, value;
   CDScalar k;
-  int channel_enabled = 0;
 
   remix_dprintf ("[remix_squaretone_write_chunk] (+%ld) @ %ld\n",
                  count, offset);
 
-  k = cd_set_find (env, squaretone->channel_data, channelname);
+  k = cd_set_find (env, squaretone->channels, channelname);
   sqch = k.s_pointer;
 
-  channel_enabled = cd_set_contains (env, squaretone->channels, channelname);
-
   if (sqch == RemixNone) {
     remix_dprintf ("[remix_squaretone_write_chunk] channel %d not found\n",
                    channelname);
@@ -224,8 +180,6 @@ remix_squaretone_write_chunk (RemixEnv * env, RemixChunk * chunk,
     value = -1.0;
   }
 
-  if(!channel_enabled ) value = 0;
-
   d = &chunk->data[offset];
   _remix_pcm_set (d, value, n);
   remaining -= n; written += n; offset += n;
@@ -258,8 +212,7 @@ remix_squaretone_process (RemixEnv * env, RemixBase * base, RemixCount count,
 static RemixCount
 remix_squaretone_length (RemixEnv * env, RemixBase * base)
 {
-  RemixSquareTone * squaretone = (RemixSquareTone *)base;
-  return squaretone->length;
+  return REMIX_COUNT_INFINITE;
 }
 
 static RemixCount
@@ -269,13 +222,13 @@ remix_squaretone_seek (RemixEnv * env, RemixBase * base, RemixCount offset)
   RemixCount wavelength;
   CDSet * s;
   RemixCount cycle_offset;
-  RemixSquareToneChannelData * sqch;
+  RemixSquareToneChannel * sqch;
 
   wavelength = (RemixCount)(remix_get_samplerate (env) / squaretone->frequency);
   cycle_offset = offset % wavelength;
 
-  for (s = squaretone->channel_data; s; s = s->next) {
-    sqch = (RemixSquareToneChannelData *)s->data.s_pointer;
+  for (s = squaretone->channels; s; s = s->next) {
+    sqch = (RemixSquareToneChannel *)s->data.s_pointer;
     sqch->_cycle_offset = cycle_offset;
   }