LMMS
Loading...
Searching...
No Matches
TrackGrip.h
Go to the documentation of this file.
1/*
2 * TrackGrip.h - Grip that can be used to move tracks
3 *
4 * Copyright (c) 2024- Michael Gregorius
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_TRACK_GRIP_H
26#define LMMS_GUI_TRACK_GRIP_H
27
28#include <QWidget>
29
30
31class QPixmap;
32
33namespace lmms
34{
35
36class Track;
37
38namespace gui
39{
40
41class TrackGrip : public QWidget
42{
43 Q_OBJECT
44public:
45 TrackGrip(Track* track, QWidget* parent = 0);
46 ~TrackGrip() override = default;
47
48signals:
49 void grabbed();
50 void released();
51
52protected:
53 void mousePressEvent(QMouseEvent*) override;
54 void mouseReleaseEvent(QMouseEvent*) override;
55 void paintEvent(QPaintEvent*) override;
56
57private:
58 Track* m_track = nullptr;
59 bool m_isGrabbed = false;
60 static QPixmap* s_grabbedPixmap;
61 static QPixmap* s_releasedPixmap;
62};
63
64} // namespace gui
65
66} // namespace lmms
67
68#endif // LMMS_GUI_TRACK_GRIP_H
Base-class for all tracks.
Definition Track.h:68
static QPixmap * s_releasedPixmap
Definition TrackGrip.h:61
bool m_isGrabbed
Definition TrackGrip.h:59
~TrackGrip() override=default
TrackGrip(Track *track, QWidget *parent=0)
Definition TrackGrip.cpp:43
void mouseReleaseEvent(QMouseEvent *) override
Definition TrackGrip.cpp:76
void paintEvent(QPaintEvent *) override
Definition TrackGrip.cpp:88
static QPixmap * s_grabbedPixmap
Definition TrackGrip.h:60
void mousePressEvent(QMouseEvent *) override
Definition TrackGrip.cpp:64
Track * m_track
Definition TrackGrip.h:58
static uintptr_t parent
Definition pugl.h:1644
Definition AudioPortAudio.cpp:223
Definition AudioAlsa.cpp:35