Gb_Apu_Buffer.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #ifndef GB_APU_BUFFER_H
  24. #define GB_APU_BUFFER_H
  25. #include "Gb_Apu.h"
  26. #include "Multi_Buffer.h"
  27. #include "MemoryManager.h"
  28. class Gb_Apu_Buffer : public Gb_Apu {
  29. MM_OPERATORS
  30. public:
  31. Gb_Apu_Buffer();
  32. ~Gb_Apu_Buffer();
  33. void end_frame(blip_time_t);
  34. blargg_err_t set_sample_rate(long sample_rate, long clock_rate);
  35. long samples_avail() const;
  36. typedef blip_sample_t sample_t;
  37. long read_samples(sample_t* out, long count);
  38. void bass_freq(int freq);
  39. private:
  40. Stereo_Buffer m_buf;
  41. };
  42. #endif