VisualizationWidget.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * VisualizationWidget.h - widget for visualization of sound-data
  3. *
  4. * Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  5. *
  6. * This file is part of LMMS - https://lmms.io
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of"the GNU General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public
  19. * License along with this program (see COPYING); if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA.
  22. *
  23. */
  24. #ifndef _VISUALIZATION_WIDGET
  25. #define _VISUALIZATION_WIDGET
  26. #include <QWidget>
  27. #include <QPixmap>
  28. #include "lmms_basics.h"
  29. class VisualizationWidget : public QWidget
  30. {
  31. Q_OBJECT
  32. public:
  33. enum visualizationTypes
  34. {
  35. Simple // add more here
  36. } ;
  37. VisualizationWidget( const QPixmap & _bg, QWidget * _parent,
  38. visualizationTypes _vtype = Simple );
  39. virtual ~VisualizationWidget();
  40. void setActive( bool _active );
  41. protected:
  42. virtual void paintEvent( QPaintEvent * _pe );
  43. virtual void mousePressEvent( QMouseEvent * _me );
  44. protected slots:
  45. void updateAudioBuffer( const surroundSampleFrame * buffer );
  46. private:
  47. QPixmap s_background;
  48. QPointF * m_points;
  49. sampleFrame * m_buffer;
  50. bool m_active;
  51. } ;
  52. #endif