Gb_Apu_Buffer.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Gb_Apu_Buffer.cpp - Gb_Apu subclass which allows direct buffer access
  3. * Copyright (c) 2017 Tres Finocchiaro <tres.finocchiaro/at/gmail.com>
  4. *
  5. * This file is part of LMMS - https://lmms.io
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public
  18. * License along with this program (see COPYING); if not, write to the
  19. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  20. * Boston, MA 02110-1301 USA.
  21. *
  22. */
  23. #include "Gb_Apu_Buffer.h"
  24. Gb_Apu_Buffer::Gb_Apu_Buffer() {}
  25. Gb_Apu_Buffer::~Gb_Apu_Buffer() {}
  26. void Gb_Apu_Buffer::end_frame(blip_time_t end_time) {
  27. Gb_Apu::end_frame(end_time);
  28. m_buf.end_frame(end_time);
  29. }
  30. // Sets specified sample rate and clock rate in Multi_Buffer
  31. blargg_err_t Gb_Apu_Buffer::set_sample_rate(long sample_rate, long clock_rate) {
  32. Gb_Apu_Buffer::output(m_buf.center(), m_buf.left(), m_buf.right());
  33. m_buf.clock_rate(clock_rate);
  34. return m_buf.set_sample_rate(sample_rate);
  35. }
  36. // Wrap Multi_Buffer::samples_avail()
  37. long Gb_Apu_Buffer::samples_avail() const {
  38. return m_buf.samples_avail();
  39. }
  40. // Wrap Multi_Buffer::read_samples(...)
  41. long Gb_Apu_Buffer::read_samples(sample_t* out, long count) {
  42. return m_buf.read_samples(out, count);
  43. }
  44. void Gb_Apu_Buffer::bass_freq(int freq) {
  45. m_buf.bass_freq(freq);
  46. }