#include <ClipView.h>
◆ Action
| Enumerator |
|---|
| None | |
| Move | |
| MoveSelection | |
| Resize | |
| ResizeLeft | |
| Split | |
| CopySelection | |
| ToggleSelected | |
◆ ContextMenuAction
| Enumerator |
|---|
| Remove | |
| Cut | |
| Copy | |
| Paste | |
| Mute | |
◆ ClipView()
Create a new ClipView.
Creates a new clip view for the given clip in the given track view.
- Parameters
-
| _clip | The clip to be displayed |
| _tv | The track view that will contain the new object |
◆ ~ClipView()
| lmms::gui::ClipView::~ClipView |
( |
| ) |
|
|
override |
◆ close
| bool lmms::gui::ClipView::close |
( |
| ) |
|
|
virtualslot |
Close a ClipView.
Closes a ClipView by asking the track view to remove us and then asking the QWidget to close us.
- Returns
- Boolean state of whether the QWidget was able to close.
◆ constructContextMenu()
| virtual void lmms::gui::ClipView::constructContextMenu |
( |
QMenu * | | ) |
|
|
inlineprotectedvirtual |
◆ contextMenuAction()
◆ contextMenuEvent()
| void lmms::gui::ClipView::contextMenuEvent |
( |
QContextMenuEvent * | cme | ) |
|
|
overrideprotected |
Set up the context menu for this ClipView.
Set up the various context menu events that can apply to a ClipView.
- Parameters
-
| cme | The QContextMenuEvent to add the actions to. |
◆ copy()
| void lmms::gui::ClipView::copy |
( |
QVector< ClipView * > | clipvs | ) |
|
◆ createClipDataFiles()
Create a DataFile suitable for copying multiple clips.
Clips in the vector are written to the "clips" node in the
DataFile. The ClipView's initial mouse position is written to the "initialMouseX" node in the DataFile. When dropped on a track, this is used to create copies of the Clips.
- Parameters
-
| clips | The trackContectObjects to save in a DataFile |
◆ cut()
| void lmms::gui::ClipView::cut |
( |
QVector< ClipView * > | clipvs | ) |
|
◆ destructiveSplitClip()
| virtual bool lmms::gui::ClipView::destructiveSplitClip |
( |
const TimePos | pos | ) |
|
|
inlineprivatevirtual |
Destructively split this Clip into two clips. If the clip type does not implement this feature, it will default to normal splitting.
- Parameters
-
| pos | the position of the split, relative to the start of the clip |
- Returns
- true if the clip could be split
Reimplemented in lmms::gui::MidiClipView.
◆ dragEnterEvent()
| void lmms::gui::ClipView::dragEnterEvent |
( |
QDragEnterEvent * | dee | ) |
|
|
overrideprotected |
Change the ClipView's display when something being dragged enters it.
We need to notify Qt to change our display if something being dragged has entered our 'airspace'.
- Parameters
-
| dee | The QDragEnterEvent to watch. |
◆ draggedClipPos()
| TimePos lmms::gui::ClipView::draggedClipPos |
( |
QMouseEvent * | me | ) |
|
|
private |
Calculate the new position of a dragged Clip from a mouse event.
- Parameters
-
◆ dropEvent()
| void lmms::gui::ClipView::dropEvent |
( |
QDropEvent * | de | ) |
|
|
overrideprotected |
Handle something being dropped on this ClipObjectView.
When something has been dropped on this ClipView, and it's a clip, then use an instance of our dataFile reader to take the xml of the clip and turn it into something we can write over our current state.
- Parameters
-
| de | The QDropEvent to handle. |
◆ fixedClips()
| bool lmms::gui::ClipView::fixedClips |
( |
| ) |
|
Does this ClipView have a fixed Clip?
Returns whether the containing trackView has fixed Clips.
- Todo
- In what circumstance are they fixed?
◆ getClickedClips()
| QVector< ClipView * > lmms::gui::ClipView::getClickedClips |
( |
| ) |
|
◆ getClip()
| Clip * lmms::gui::ClipView::getClip |
( |
| ) |
|
|
inline |
◆ getColorForDisplay()
| QColor lmms::gui::ClipView::getColorForDisplay |
( |
QColor | defaultColor | ) |
|
◆ getTrackView()
| TrackView * lmms::gui::ClipView::getTrackView |
( |
| ) |
|
|
inline |
◆ gradient()
| bool lmms::gui::ClipView::gradient |
( |
| ) |
const |
◆ hasCustomColor()
| auto lmms::gui::ClipView::hasCustomColor |
( |
| ) |
const -> bool |
|
protected |
◆ isResizableBeforeStart()
| virtual bool lmms::gui::ClipView::isResizableBeforeStart |
( |
| ) |
|
|
inlineprivatevirtual |
◆ knifeMarkerPos()
| int lmms::gui::ClipView::knifeMarkerPos |
( |
QMouseEvent * | me | ) |
|
|
private |
◆ markerColor()
| QColor lmms::gui::ClipView::markerColor |
( |
| ) |
const |
◆ mouseMovedDistance()
| bool lmms::gui::ClipView::mouseMovedDistance |
( |
QMouseEvent * | me, |
|
|
int | distance ) |
|
private |
Detect whether the mouse moved more than n pixels on screen.
- Parameters
-
| _me | The QMouseEvent. |
| distance | The threshold distance that the mouse has moved to return true. |
◆ mouseMoveEvent()
| void lmms::gui::ClipView::mouseMoveEvent |
( |
QMouseEvent * | me | ) |
|
|
overrideprotected |
Handle a mouse movement (drag) on this ClipView.
Handles the various ways in which a ClipView can be used with a mouse drag.
- If in move mode, move ourselves in the track,
- or if in move-selection mode, move the entire selection,
- or if in resize mode, resize ourselves,
- otherwise ???
- Parameters
-
| me | The QMouseEvent to handle. |
- Todo
- what does the final else case do here?
◆ mousePressEvent()
| void lmms::gui::ClipView::mousePressEvent |
( |
QMouseEvent * | me | ) |
|
|
overrideprotected |
Handle a mouse press on this ClipView.
Handles the various ways in which a ClipView can be used with a click of a mouse button.
- If our container supports rubber band selection then handle selection events.
- or if shift-left button, add this object to the selection
- or if ctrl-left button, start a drag-copy event
- or if just plain left button, resize if we're resizeable
- or if ctrl-middle button, mute the clip
- or if middle button, maybe delete the clip.
- Parameters
-
| me | The QMouseEvent to handle. |
◆ mouseReleaseEvent()
| void lmms::gui::ClipView::mouseReleaseEvent |
( |
QMouseEvent * | me | ) |
|
|
overrideprotected |
Handle a mouse release on this ClipView.
If we're in move or resize mode, journal the change as appropriate. Then tidy up.
- Parameters
-
| me | The QMouseEvent to handle. |
◆ mutedBackgroundColor()
| QColor lmms::gui::ClipView::mutedBackgroundColor |
( |
| ) |
const |
◆ mutedColor()
| QColor lmms::gui::ClipView::mutedColor |
( |
| ) |
const |
CSS theming qproperty access method.
◆ needsUpdate()
| bool lmms::gui::ClipView::needsUpdate |
( |
| ) |
|
◆ paintTextLabel()
| void lmms::gui::ClipView::paintTextLabel |
( |
QString const & | text, |
|
|
QPainter & | painter ) |
|
protectedvirtual |
◆ paste()
| void lmms::gui::ClipView::paste |
( |
| ) |
|
◆ patternClipBackground()
| QColor lmms::gui::ClipView::patternClipBackground |
( |
| ) |
const |
◆ pixelsPerBar()
| float lmms::gui::ClipView::pixelsPerBar |
( |
| ) |
|
|
protected |
How many pixels a bar takes for this ClipView.
- Returns
- the number of pixels per bar.
◆ quantizeSplitPos()
◆ randomizeColor
| void lmms::gui::ClipView::randomizeColor |
( |
| ) |
|
|
slot |
◆ remove [1/2]
| void lmms::gui::ClipView::remove |
( |
| ) |
|
|
slot |
Removes a ClipView from its track view.
Like the close() method, this asks the track view to remove this ClipView. However, the clip is scheduled for later deletion rather than closed immediately.
◆ remove() [2/2]
| void lmms::gui::ClipView::remove |
( |
QVector< ClipView * > | clipvs | ) |
|
|
static |
◆ resetColor
| void lmms::gui::ClipView::resetColor |
( |
| ) |
|
|
slot |
◆ resizeEvent()
| void lmms::gui::ClipView::resizeEvent |
( |
QResizeEvent * | re | ) |
|
|
inlineoverrideprotected |
◆ selectColor
| void lmms::gui::ClipView::selectColor |
( |
| ) |
|
|
slot |
◆ selectedColor()
| QColor lmms::gui::ClipView::selectedColor |
( |
| ) |
const |
◆ setColor()
| void lmms::gui::ClipView::setColor |
( |
const std::optional< QColor > & | color | ) |
|
|
private |
Change color of all selected clips.
- Parameters
-
◆ setGradient()
| void lmms::gui::ClipView::setGradient |
( |
const bool & | b | ) |
|
◆ setInitialOffsets()
| void lmms::gui::ClipView::setInitialOffsets |
( |
| ) |
|
|
private |
Save the offsets between all selected tracks and a clicked track.
◆ setInitialPos()
| void lmms::gui::ClipView::setInitialPos |
( |
QPoint | pos | ) |
|
|
inlineprivate |
◆ setMarkerColor()
| void lmms::gui::ClipView::setMarkerColor |
( |
const QColor & | c | ) |
|
◆ setMarkerEnabled()
| void lmms::gui::ClipView::setMarkerEnabled |
( |
bool | e | ) |
|
|
inline |
◆ setMarkerPos()
| void lmms::gui::ClipView::setMarkerPos |
( |
int | x | ) |
|
|
inline |
◆ setMutedBackgroundColor()
| void lmms::gui::ClipView::setMutedBackgroundColor |
( |
const QColor & | c | ) |
|
◆ setMutedColor()
| void lmms::gui::ClipView::setMutedColor |
( |
const QColor & | c | ) |
|
CSS theming qproperty access method.
◆ setNeedsUpdate()
| void lmms::gui::ClipView::setNeedsUpdate |
( |
bool | b | ) |
|
◆ setPatternClipBackground()
| void lmms::gui::ClipView::setPatternClipBackground |
( |
const QColor & | c | ) |
|
◆ setSelectedColor()
| void lmms::gui::ClipView::setSelectedColor |
( |
const QColor & | c | ) |
|
◆ setTextBackgroundColor()
| void lmms::gui::ClipView::setTextBackgroundColor |
( |
const QColor & | c | ) |
|
◆ setTextColor()
| void lmms::gui::ClipView::setTextColor |
( |
const QColor & | c | ) |
|
◆ setTextShadowColor()
| void lmms::gui::ClipView::setTextShadowColor |
( |
const QColor & | c | ) |
|
◆ splitClip()
Split this Clip into two clips
- Parameters
-
| pos | the position of the split, relative to the start of the clip |
- Returns
- true if the clip could be split
◆ textBackgroundColor()
| QColor lmms::gui::ClipView::textBackgroundColor |
( |
| ) |
const |
◆ textColor()
| QColor lmms::gui::ClipView::textColor |
( |
| ) |
const |
◆ textShadowColor()
| QColor lmms::gui::ClipView::textShadowColor |
( |
| ) |
const |
◆ toggleMute()
| void lmms::gui::ClipView::toggleMute |
( |
QVector< ClipView * > | clipvs | ) |
|
|
static |
◆ toggleSelectedAutoResize()
| void lmms::gui::ClipView::toggleSelectedAutoResize |
( |
| ) |
|
◆ unquantizedModHeld()
| bool lmms::gui::ClipView::unquantizedModHeld |
( |
QMouseEvent * | me | ) |
|
|
protected |
◆ update
| void lmms::gui::ClipView::update |
( |
| ) |
|
|
overrideslot |
Update a ClipView.
Clip's get drawn only when needed, and when a Clip is updated, it needs to be redrawn.
◆ updateCursor()
| void lmms::gui::ClipView::updateCursor |
( |
QMouseEvent * | me | ) |
|
|
private |
◆ updateLength
| void lmms::gui::ClipView::updateLength |
( |
| ) |
|
|
protectedslot |
Updates a ClipView's length.
If this ClipView has a fixed Clip, then we must keep the width of our parent. Otherwise, calculate our width from the clip's length in pixels adding in the border.
◆ updatePosition
| void lmms::gui::ClipView::updatePosition |
( |
| ) |
|
|
protectedslot |
Updates a ClipView's position.
Ask our track view to change our position. Then make sure that the track view is updated in case this position has changed the track view's length.
◆ BORDER_WIDTH
| const int lmms::gui::ClipView::BORDER_WIDTH = 2 |
|
static |
◆ m_action
| Action lmms::gui::ClipView::m_action |
|
private |
◆ m_clip
| Clip* lmms::gui::ClipView::m_clip |
|
private |
◆ m_gradient
| bool lmms::gui::ClipView::m_gradient |
|
private |
◆ m_hint
◆ m_initialClipEnd
| TimePos lmms::gui::ClipView::m_initialClipEnd |
|
protected |
◆ m_initialClipPos
| TimePos lmms::gui::ClipView::m_initialClipPos |
|
protected |
◆ m_initialMouseGlobalPos
| QPoint lmms::gui::ClipView::m_initialMouseGlobalPos |
|
private |
◆ m_initialMousePos
| QPoint lmms::gui::ClipView::m_initialMousePos |
|
private |
◆ m_initialOffsets
| QVector<TimePos> lmms::gui::ClipView::m_initialOffsets |
|
private |
◆ m_marker
| bool lmms::gui::ClipView::m_marker = false |
|
protected |
◆ m_markerColor
| QColor lmms::gui::ClipView::m_markerColor |
|
private |
◆ m_markerPos
| int lmms::gui::ClipView::m_markerPos = 0 |
|
protected |
◆ m_mutedBackgroundColor
| QColor lmms::gui::ClipView::m_mutedBackgroundColor |
|
private |
◆ m_mutedColor
| QColor lmms::gui::ClipView::m_mutedColor |
|
private |
◆ m_needsUpdate
| bool lmms::gui::ClipView::m_needsUpdate |
|
private |
◆ m_patternClipBackground
| QColor lmms::gui::ClipView::m_patternClipBackground |
|
private |
◆ m_selectedColor
| QColor lmms::gui::ClipView::m_selectedColor |
|
private |
◆ m_textBackgroundColor
| QColor lmms::gui::ClipView::m_textBackgroundColor |
|
private |
◆ m_textColor
| QColor lmms::gui::ClipView::m_textColor |
|
private |
◆ m_textShadowColor
| QColor lmms::gui::ClipView::m_textShadowColor |
|
private |
◆ m_trackView
◆ s_textFloat
A pointer for that text bubble used when moving segments, etc.
In a number of situations, LMMS displays a floating text bubble beside the cursor as you move or resize elements of a track about. This pointer keeps track of it, as you only ever need one at a time.
◆ gradient
| bool lmms::gui::ClipView::gradient |
|
readwrite |
◆ markerColor
| QColor lmms::gui::ClipView::markerColor |
|
readwrite |
◆ mutedBackgroundColor
| QColor lmms::gui::ClipView::mutedBackgroundColor |
|
readwrite |
◆ mutedColor
| QColor lmms::gui::ClipView::mutedColor |
|
readwrite |
◆ patternClipBackground
| QColor lmms::gui::ClipView::patternClipBackground |
|
readwrite |
◆ selectedColor
| QColor lmms::gui::ClipView::selectedColor |
|
readwrite |
◆ textBackgroundColor
| QColor lmms::gui::ClipView::textBackgroundColor |
|
readwrite |
◆ textColor
| QColor lmms::gui::ClipView::textColor |
|
readwrite |
◆ textShadowColor
| QColor lmms::gui::ClipView::textShadowColor |
|
readwrite |
The documentation for this class was generated from the following files:
- /home/runner/work/lmms-fork/lmms-fork/include/ClipView.h
- /home/runner/work/lmms-fork/lmms-fork/src/gui/clips/ClipView.cpp