AutomationPatternView.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * AutomationPatternView.h - declaration of class AutomationPatternView
  3. *
  4. * Copyright (c) 2008-2010 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 AUTOMATION_PATTERN_VIEW_H
  25. #define AUTOMATION_PATTERN_VIEW_H
  26. #include <QStaticText>
  27. #include "Track.h"
  28. class AutomationPattern;
  29. class AutomationPatternView : public TrackContentObjectView
  30. {
  31. Q_OBJECT
  32. public:
  33. AutomationPatternView( AutomationPattern * _pat, TrackView * _parent );
  34. virtual ~AutomationPatternView();
  35. public slots:
  36. /// Opens this view's pattern in the global automation editor
  37. void openInAutomationEditor();
  38. void update() override;
  39. protected slots:
  40. void resetName();
  41. void changeName();
  42. void disconnectObject( QAction * _a );
  43. void toggleRecording();
  44. void flipY();
  45. void flipX();
  46. protected:
  47. void constructContextMenu( QMenu * ) override;
  48. void mouseDoubleClickEvent(QMouseEvent * me ) override;
  49. void paintEvent( QPaintEvent * pe ) override;
  50. void dragEnterEvent( QDragEnterEvent * _dee ) override;
  51. void dropEvent( QDropEvent * _de ) override;
  52. private:
  53. AutomationPattern * m_pat;
  54. QPixmap m_paintPixmap;
  55. QStaticText m_staticTextName;
  56. static QPixmap * s_pat_rec;
  57. void scaleTimemapToFit( float oldMin, float oldMax );
  58. } ;
  59. #endif