LMMS
Loading...
Searching...
No Matches
MidiClipView.h
Go to the documentation of this file.
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
25#ifndef LMMS_GUI_MIDI_CLIP_VIEW_H
26#define LMMS_GUI_MIDI_CLIP_VIEW_H
27
28#include <QStaticText>
29#include "ClipView.h"
30#include "embed.h"
31
32namespace lmms
33{
34
35class MidiClip;
36
37namespace gui
38{
39
40
41class MidiClipView : public ClipView
42{
43 Q_OBJECT
44
45public:
47 ~MidiClipView() override = default;
48
53
54 QColor const & getNoteFillColor() const { return m_noteFillColor; }
55 void setNoteFillColor(QColor const & color) { m_noteFillColor = color; }
56
57 QColor const & getNoteBorderColor() const { return m_noteBorderColor; }
58 void setNoteBorderColor(QColor const & color) { m_noteBorderColor = color; }
59
60 QColor const & getMutedNoteFillColor() const { return m_mutedNoteFillColor; }
61 void setMutedNoteFillColor(QColor const & color) { m_mutedNoteFillColor = color; }
62
63 QColor const & getMutedNoteBorderColor() const { return m_mutedNoteBorderColor; }
64 void setMutedNoteBorderColor(QColor const & color) { m_mutedNoteBorderColor = color; }
65
66 // Returns true if selection can be merged and false if not
67 static bool canMergeSelection(QVector<ClipView*> clipvs);
68 static void mergeClips(QVector<ClipView*> clipvs);
69 static void bulkClearNotesOutOfBounds(QVector<ClipView*> clipvs);
70
71public slots:
73 void update() override;
74
75
76protected slots:
77 void openInPianoRoll();
80
81 void resetName();
82 void changeName();
83 void transposeSelection();
85
86
87protected:
88 void constructContextMenu( QMenu * ) override;
89 void mousePressEvent( QMouseEvent * _me ) override;
90 void mouseDoubleClickEvent( QMouseEvent * _me ) override;
91 void paintEvent( QPaintEvent * pe ) override;
92 void wheelEvent( QWheelEvent * _we ) override;
93
94
95private:
96 QPixmap m_stepBtnOn0 = embed::getIconPixmap("step_btn_on_0");
97 QPixmap m_stepBtnOn200 = embed::getIconPixmap("step_btn_on_200");
98 QPixmap m_stepBtnOff = embed::getIconPixmap("step_btn_off");
99 QPixmap m_stepBtnOffLight = embed::getIconPixmap("step_btn_off_light");
100 QPixmap m_stepBtnHighlight = embed::getIconPixmap("step_btn_highlight");
101
104
109
110 QStaticText m_staticTextName;
111
113
114 bool isResizableBeforeStart() override { return false; }
115
116 bool destructiveSplitClip(const TimePos pos) override;
117} ;
118
119
120} // namespace gui
121
122} // namespace lmms
123
124#endif // LMMS_GUI_MIDI_CLIP_VIEW_H
#define READ(addr)
Definition Ay_Cpu.cpp:92
#define WRITE(addr, data)
Definition Ay_Cpu.cpp:93
Definition MidiClip.h:46
Definition TimePos.h:68
ClipView(Clip *clip, TrackView *tv)
Create a new ClipView.
Definition ClipView.cpp:80
void paintEvent(QPaintEvent *pe) override
Definition MidiClipView.cpp:552
QPixmap m_paintPixmap
Definition MidiClipView.h:103
void setMutedNoteBorderColor(QColor const &color)
Definition MidiClipView.h:64
QColor const & getNoteBorderColor() const
Definition MidiClipView.h:57
void constructContextMenu(QMenu *) override
Definition MidiClipView.cpp:195
QColor const & getMutedNoteBorderColor() const
Definition MidiClipView.h:63
~MidiClipView() override=default
void clearNotesOutOfBounds()
Definition MidiClipView.cpp:372
QColor m_mutedNoteFillColor
Definition MidiClipView.h:107
void setNoteFillColor(QColor const &color)
Definition MidiClipView.h:55
void openInPianoRoll()
Definition MidiClipView.cpp:92
QColor mutedNoteBorderColor
Definition MidiClipView.h:52
QPixmap m_stepBtnOn0
Definition MidiClipView.h:96
QColor mutedNoteFillColor
Definition MidiClipView.h:51
void transposeSelection()
Definition MidiClipView.cpp:139
static void mergeClips(QVector< ClipView * > clipvs)
Definition MidiClipView.cpp:275
bool isResizableBeforeStart() override
Returns whether the user can left-resize this clip so that the start of the clip bounds is before the...
Definition MidiClipView.h:114
QPixmap m_stepBtnOffLight
Definition MidiClipView.h:99
QPixmap m_stepBtnOff
Definition MidiClipView.h:98
bool destructiveSplitClip(const TimePos pos) override
Definition MidiClipView.cpp:874
void mousePressEvent(QMouseEvent *_me) override
Definition MidiClipView.cpp:422
void setGhostInPianoRoll()
Definition MidiClipView.cpp:105
QStaticText m_staticTextName
Definition MidiClipView.h:110
QColor m_noteBorderColor
Definition MidiClipView.h:106
void resetName()
Definition MidiClipView.cpp:123
QPixmap m_stepBtnHighlight
Definition MidiClipView.h:100
QColor noteBorderColor
Definition MidiClipView.h:50
lmms::MidiClip * getMidiClip()
Definition MidiClipView.cpp:74
void setNoteBorderColor(QColor const &color)
Definition MidiClipView.h:58
QPixmap m_stepBtnOn200
Definition MidiClipView.h:97
void wheelEvent(QWheelEvent *_we) override
Definition MidiClipView.cpp:496
QColor m_noteFillColor
Definition MidiClipView.h:105
MidiClip * m_clip
Definition MidiClipView.h:102
static bool canMergeSelection(QVector< ClipView * > clipvs)
Definition MidiClipView.cpp:259
QColor m_mutedNoteBorderColor
Definition MidiClipView.h:108
void update() override
Definition MidiClipView.cpp:82
void setGhostInAutomationEditor()
Definition MidiClipView.cpp:114
static void bulkClearNotesOutOfBounds(QVector< ClipView * > clipvs)
Definition MidiClipView.cpp:404
void changeName()
Definition MidiClipView.cpp:128
void mouseDoubleClickEvent(QMouseEvent *_me) override
Definition MidiClipView.cpp:478
bool m_legacySEPattern
Definition MidiClipView.h:112
QColor const & getMutedNoteFillColor() const
Definition MidiClipView.h:60
MidiClipView(MidiClip *clip, TrackView *parent)
Definition MidiClipView.cpp:53
void setMutedNoteFillColor(QColor const &color)
Definition MidiClipView.h:61
QColor const & getNoteFillColor() const
Definition MidiClipView.h:54
QColor noteFillColor
Definition MidiClipView.h:49
Definition TrackView.h:60
static uintptr_t parent
Definition pugl.h:1644
auto getIconPixmap(std::string_view name, int width, int height, const char *const *xpm) -> QPixmap
Definition embed.cpp:107
Definition AudioPortAudio.cpp:223
Definition AudioAlsa.cpp:35
#define const
Definition zconf.h:137