lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
Clip.h
Go to the documentation of this file.
1
/*
2
* TrackConteintObject.h - declaration of Clip class
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_CLIP_H
26
#define LMMS_CLIP_H
27
28
#include <optional>
29
30
#include <QColor>
31
32
#include "
AutomatableModel.h
"
33
34
35
namespace
lmms
36
{
37
38
class
Track
;
39
40
namespace
gui
41
{
42
43
class
ClipView
;
44
class
TrackView
;
45
46
}
// namespace gui
47
48
49
class
LMMS_EXPORT
Clip
:
public
Model
,
public
JournallingObject
50
{
51
Q_OBJECT
52
mapPropertyFromModel
(
bool
,isMuted,setMuted,
m_mutedModel
);
53
mapPropertyFromModel
(
bool
,isSolo,setSolo,
m_soloModel
);
54
public
:
57
Clip
(
Track
* track);
58
~Clip
()
override
;
59
60
inline
Track
*
getTrack
()
const
61
{
62
return
m_track
;
63
}
64
65
inline
const
QString &
name
()
const
66
{
67
return
m_name
;
68
}
69
70
inline
void
setName
(
const
QString &
name
)
71
{
72
m_name
=
name
;
73
emit
dataChanged
();
74
}
75
76
QString
displayName
()
const override
77
{
78
return
name
();
79
}
80
81
82
inline
const
TimePos
&
startPosition
()
const
83
{
84
return
m_startPosition
;
85
}
86
87
inline
TimePos
endPosition
()
const
88
{
89
const
int
sp =
m_startPosition
;
90
return
sp +
m_length
;
91
}
92
93
inline
const
TimePos
&
length
()
const
94
{
95
return
m_length
;
96
}
97
98
99
bool
hasTrackContainer()
const
;
100
101
bool
isInPattern()
const
;
102
103
bool
manuallyResizable()
const
;
104
108
void
setAutoResize
(
const
bool
r) {
m_autoResize
= r; }
109
110
bool
getAutoResize
()
const
111
{
112
return
m_autoResize
;
113
}
114
115
auto
color
() const -> const std::optional<QColor>& {
return
m_color
; }
116
void
setColor(
const
std::optional<QColor>& color);
117
123
virtual
void
movePosition(
const
TimePos
& pos);
124
130
virtual
void
changeLength(
const
TimePos
& length);
131
virtual
void
updateLength
() {};
132
133
virtual
gui::ClipView
*
createView
(
gui::TrackView
* tv ) = 0;
134
135
inline
void
selectViewOnCreate
(
bool
select )
136
{
137
m_selectViewOnCreate
= select;
138
}
139
140
inline
bool
getSelectViewOnCreate
()
141
{
142
return
m_selectViewOnCreate
;
143
}
144
146
static
bool
comparePosition(
const
Clip
* a,
const
Clip
* b);
147
148
TimePos
startTimeOffset()
const
;
149
virtual
void
setStartTimeOffset(
const
TimePos
& startTimeOffset);
150
152
static
void
copyStateTo(
Clip
* src,
Clip
* dst);
153
156
virtual
Clip
*
clone
() = 0;
157
158
public
slots:
159
void
toggleMute
();
160
161
signals:
162
void
lengthChanged
();
163
void
positionChanged
();
164
void
destroyedClip
();
165
void
colorChanged
();
166
167
protected
:
168
171
Clip
(
const
Clip
& other);
172
173
private
:
174
Track
*
m_track
;
175
QString
m_name
;
176
177
TimePos
m_startPosition
;
178
TimePos
m_length
;
179
TimePos
m_startTimeOffset
;
180
181
BoolModel
m_mutedModel
;
182
BoolModel
m_soloModel
;
183
bool
m_autoResize
=
true
;
184
185
bool
m_selectViewOnCreate
;
186
187
std::optional<QColor>
m_color
;
188
189
friend
class
ClipView
;
190
};
191
192
193
}
// namespace lmms
194
195
#endif
// LMMS_CLIP_H
AutomatableModel.h
lmms::BoolModel
Definition
AutomatableModel.h:502
lmms::Clip
Definition
Clip.h:50
lmms::Clip::clone
virtual Clip * clone()=0
Creates a copy of this clip.
lmms::Clip::ClipView
friend class ClipView
Definition
Clip.h:189
lmms::Clip::mapPropertyFromModel
mapPropertyFromModel(bool, isMuted, setMuted, m_mutedModel)
lmms::Clip::m_startTimeOffset
TimePos m_startTimeOffset
Definition
Clip.h:179
lmms::Clip::toggleMute
void toggleMute()
Mutes this Clip.
Definition
Clip.cpp:154
lmms::Clip::m_mutedModel
BoolModel m_mutedModel
Definition
Clip.h:181
lmms::Clip::m_name
QString m_name
Definition
Clip.h:175
lmms::Clip::createView
virtual gui::ClipView * createView(gui::TrackView *tv)=0
lmms::Clip::updateLength
virtual void updateLength()
Definition
Clip.h:131
lmms::Clip::selectViewOnCreate
void selectViewOnCreate(bool select)
Definition
Clip.h:135
lmms::Clip::m_color
std::optional< QColor > m_color
Definition
Clip.h:187
lmms::Clip::displayName
QString displayName() const override
Definition
Clip.h:76
lmms::Clip::name
const QString & name() const
Definition
Clip.h:65
lmms::Clip::positionChanged
void positionChanged()
lmms::Clip::colorChanged
void colorChanged()
lmms::Clip::m_autoResize
bool m_autoResize
Definition
Clip.h:183
lmms::Clip::startPosition
const TimePos & startPosition() const
Definition
Clip.h:82
lmms::Clip::color
auto color() const -> const std::optional< QColor > &
Definition
Clip.h:115
lmms::Clip::destroyedClip
void destroyedClip()
lmms::Clip::getSelectViewOnCreate
bool getSelectViewOnCreate()
Definition
Clip.h:140
lmms::Clip::endPosition
TimePos endPosition() const
Definition
Clip.h:87
lmms::Clip::m_track
Track * m_track
Definition
Clip.h:174
lmms::Clip::getAutoResize
bool getAutoResize() const
Definition
Clip.h:110
lmms::Clip::getTrack
Track * getTrack() const
Definition
Clip.h:60
lmms::Clip::m_selectViewOnCreate
bool m_selectViewOnCreate
Definition
Clip.h:185
lmms::Clip::m_soloModel
BoolModel m_soloModel
Definition
Clip.h:182
lmms::Clip::Clip
Clip(Track *track)
Creates a new clip for the given track track.
Definition
Clip.cpp:41
lmms::Clip::mapPropertyFromModel
mapPropertyFromModel(bool, isSolo, setSolo, m_soloModel)
lmms::Clip::length
const TimePos & length() const
Definition
Clip.h:93
lmms::Clip::m_startPosition
TimePos m_startPosition
Definition
Clip.h:177
lmms::Clip::lengthChanged
void lengthChanged()
lmms::Clip::m_length
TimePos m_length
Definition
Clip.h:178
lmms::Clip::setAutoResize
void setAutoResize(const bool r)
Set whether a clip has been resized yet by the user or the knife tool.
Definition
Clip.h:108
lmms::Clip::setName
void setName(const QString &name)
Definition
Clip.h:70
lmms::JournallingObject::JournallingObject
JournallingObject()
Definition
JournallingObject.cpp:36
lmms::Model::dataChanged
void dataChanged()
lmms::Model::Model
Model(Model *parent, QString displayName=QString(), bool defaultConstructed=false)
Definition
Model.cpp:30
lmms::TimePos
Definition
TimePos.h:68
lmms::Track
Base-class for all tracks.
Definition
Track.h:67
lmms::gui::ClipView
Definition
ClipView.h:52
lmms::gui::TrackView
Definition
TrackView.h:60
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms
Definition
RemotePluginBase.cpp:34
Generated on
for lmms by
1.18.0