/* Delta.c */
/* Paul Boersma, October 15, 1995 */

#include "Delta.h"

static void destroy (I)
{
	iam (Delta);
	if (my tube)
	{
		my tube ++;
		free (my tube);
		my tube = NULL;
	}
	inherited (Delta) destroy (me);
}

class_methods (Delta, Thing)
	class_method (destroy)
class_methods_end

Delta Delta_create (int numberOfTubes)
{
	Delta me = new (Delta);
	int itube;
	if (! me) return NULL;
	Melder_assert (numberOfTubes >= 1);
	my numberOfTubes = numberOfTubes;
	my tube = (struct Delta_Tube *) calloc (numberOfTubes, sizeof (struct Delta_Tube));
	if (! my tube) { forget (me); return NULL; }
	my tube --;
	for (itube = 1; itube <= numberOfTubes; itube ++)
	{
		Delta_Tube t = my tube + itube;
		t -> parallel = 1;
	}
	return me;
}

/* End of file Delta.c */
