MidiClipView.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * MidiClipView.h
  3. *
  4. * Copyright (c) 2004-2014 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 MIDI_CLIP_VIEW_H
  25. #define MIDI_CLIP_VIEW_H
  26. #include "MidiClip.h"
  27. #include "ClipView.h"
  28. class MidiClip;
  29. class MidiClipView : public ClipView
  30. {
  31. Q_OBJECT
  32. public:
  33. MidiClipView( MidiClip* clip, TrackView* parent );
  34. virtual ~MidiClipView() = default;
  35. Q_PROPERTY(QColor noteFillColor READ getNoteFillColor WRITE setNoteFillColor)
  36. Q_PROPERTY(QColor noteBorderColor READ getNoteBorderColor WRITE setNoteBorderColor)
  37. Q_PROPERTY(QColor mutedNoteFillColor READ getMutedNoteFillColor WRITE setMutedNoteFillColor)
  38. Q_PROPERTY(QColor mutedNoteBorderColor READ getMutedNoteBorderColor WRITE setMutedNoteBorderColor)
  39. QColor const & getNoteFillColor() const { return m_noteFillColor; }
  40. void setNoteFillColor(QColor const & color) { m_noteFillColor = color; }
  41. QColor const & getNoteBorderColor() const { return m_noteBorderColor; }
  42. void setNoteBorderColor(QColor const & color) { m_noteBorderColor = color; }
  43. QColor const & getMutedNoteFillColor() const { return m_mutedNoteFillColor; }
  44. void setMutedNoteFillColor(QColor const & color) { m_mutedNoteFillColor = color; }
  45. QColor const & getMutedNoteBorderColor() const { return m_mutedNoteBorderColor; }
  46. void setMutedNoteBorderColor(QColor const & color) { m_mutedNoteBorderColor = color; }
  47. public slots:
  48. MidiClip* getMidiClip();
  49. void update() override;
  50. protected slots:
  51. void openInPianoRoll();
  52. void setGhostInPianoRoll();
  53. void resetName();
  54. void changeName();
  55. protected:
  56. void constructContextMenu( QMenu * ) override;
  57. void mousePressEvent( QMouseEvent * _me ) override;
  58. void mouseDoubleClickEvent( QMouseEvent * _me ) override;
  59. void paintEvent( QPaintEvent * pe ) override;
  60. void wheelEvent( QWheelEvent * _we ) override;
  61. private:
  62. static QPixmap * s_stepBtnOn0;
  63. static QPixmap * s_stepBtnOn200;
  64. static QPixmap * s_stepBtnOff;
  65. static QPixmap * s_stepBtnOffLight;
  66. MidiClip* m_clip;
  67. QPixmap m_paintPixmap;
  68. QColor m_noteFillColor;
  69. QColor m_noteBorderColor;
  70. QColor m_mutedNoteFillColor;
  71. QColor m_mutedNoteBorderColor;
  72. QStaticText m_staticTextName;
  73. bool m_legacySEPattern;
  74. } ;
  75. #endif