AutomationPatternView.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. protected slots:
  39. void resetName();
  40. void changeName();
  41. void disconnectObject( QAction * _a );
  42. void toggleRecording();
  43. void flipY();
  44. void flipX();
  45. protected:
  46. virtual void constructContextMenu( QMenu * );
  47. virtual void mouseDoubleClickEvent(QMouseEvent * me );
  48. virtual void paintEvent( QPaintEvent * pe );
  49. virtual void dragEnterEvent( QDragEnterEvent * _dee );
  50. virtual void dropEvent( QDropEvent * _de );
  51. private:
  52. AutomationPattern * m_pat;
  53. QPixmap m_paintPixmap;
  54. QStaticText m_staticTextName;
  55. static QPixmap * s_pat_rec;
  56. void scaleTimemapToFit( float oldMin, float oldMax );
  57. } ;
  58. #endif