JACK tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
1.8KB

  1. // ----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2012 Fons Adriaensen <fons@linuxaudio.org>
  4. //
  5. // This program 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 3 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // 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 program. If not, see <http://www.gnu.org/licenses/>.
  17. //
  18. // ----------------------------------------------------------------------------
  19. #include <assert.h>
  20. #include "lfqueue.h"
  21. Lfq_adata::Lfq_adata (int size) :
  22. _size (size),
  23. _mask (size - 1),
  24. _nwr (0),
  25. _nrd (0)
  26. {
  27. assert (!(_size & _mask));
  28. _data = new Adata [_size];
  29. }
  30. Lfq_adata::~Lfq_adata (void)
  31. {
  32. delete[] _data;
  33. }
  34. Lfq_jdata::Lfq_jdata (int size) :
  35. _size (size),
  36. _mask (size - 1),
  37. _nwr (0),
  38. _nrd (0)
  39. {
  40. assert (!(_size & _mask));
  41. _data = new Jdata [_size];
  42. }
  43. Lfq_jdata::~Lfq_jdata (void)
  44. {
  45. delete[] _data;
  46. }
  47. Lfq_int32::Lfq_int32 (int size) :
  48. _size (size),
  49. _mask (size - 1),
  50. _nwr (0),
  51. _nrd (0)
  52. {
  53. assert (!(_size & _mask));
  54. _data = new int32_t [_size];
  55. }
  56. Lfq_int32::~Lfq_int32 (void)
  57. {
  58. delete[] _data;
  59. }
  60. Lfq_audio::Lfq_audio (int nsamp, int nchan) :
  61. _size (nsamp),
  62. _mask (nsamp - 1),
  63. _nch (nchan),
  64. _nwr (0),
  65. _nrd (0)
  66. {
  67. assert (!(_size & _mask));
  68. _data = new float [_nch * _size];
  69. }
  70. Lfq_audio::~Lfq_audio (void)
  71. {
  72. delete[] _data;
  73. }