Delta.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Delta.cpp
  2. *
  3. * Copyright (C) 1992-2005,2011,2012,2014-2017 Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "Delta.h"
  19. Thing_implement (Delta, Thing, 0);
  20. void structDelta :: v_destroy () noexcept {
  21. NUMvector_free (our tube, 1);
  22. Delta_Parent :: v_destroy ();
  23. }
  24. void Delta_init (Delta me, integer numberOfTubes) {
  25. Melder_assert (numberOfTubes >= 1);
  26. my numberOfTubes = numberOfTubes;
  27. my tube = NUMvector <struct structDelta_Tube> (1, numberOfTubes);
  28. for (int itube = 1; itube <= numberOfTubes; itube ++) {
  29. Delta_Tube t = & my tube [itube];
  30. t -> parallel = 1;
  31. }
  32. }
  33. autoDelta Delta_create (integer numberOfTubes) {
  34. autoDelta me = Thing_new (Delta);
  35. Delta_init (me.get(), numberOfTubes);
  36. return me;
  37. }
  38. /* End of file Delta.cpp */