Vectorscope.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Vectorscope.h - declaration of Vectorscope class.
  2. *
  3. * Copyright (c) 2019 Martin Pavelek <he29/dot/HS/at/gmail/dot/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 VECTORSCOPE_H
  24. #define VECTORSCOPE_H
  25. #include "Effect.h"
  26. #include "LocklessRingBuffer.h"
  27. #include "VecControls.h"
  28. //! Top level class; handles LMMS interface and accumulates data for processing.
  29. class Vectorscope : public Effect
  30. {
  31. public:
  32. Vectorscope(Model *parent, const Descriptor::SubPluginFeatures::Key *key);
  33. virtual ~Vectorscope() {};
  34. bool processAudioBuffer(sampleFrame *buffer, const fpp_t frame_count) override;
  35. EffectControls *controls() override {return &m_controls;}
  36. LocklessRingBuffer<sampleFrame> *getBuffer() {return &m_inputBuffer;}
  37. private:
  38. VecControls m_controls;
  39. // Maximum LMMS buffer size (hard coded, the actual constant is hard to get)
  40. const unsigned int m_maxBufferSize = 4096;
  41. LocklessRingBuffer<sampleFrame> m_inputBuffer;
  42. };
  43. #endif // VECTORSCOPE_H