LMMS
Loading...
Searching...
No Matches
lmms::Clip Class Referenceabstract

#include <Clip.h>

Inheritance diagram for lmms::Clip:
lmms::Model lmms::JournallingObject lmms::SerializingObject lmms::AutomationClip lmms::MidiClip lmms::PatternClip lmms::SampleClip

Public Slots

void toggleMute ()
 Mutes this Clip.

Signals

void lengthChanged ()
void positionChanged ()
void destroyedClip ()
void colorChanged ()
Signals inherited from lmms::Model
void dataChanged ()
void dataUnchanged ()
void propertiesChanged ()

Public Member Functions

 Clip (Track *track)
 Create a new Clip.
 ~Clip () override
 Destroy a Clip.
Track * getTrack () const
const QString & name () const
void setName (const QString &name)
QString displayName () const override
const TimePos & startPosition () const
TimePos endPosition () const
const TimePos & length () const
bool hasTrackContainer () const
bool isInPattern () const
bool manuallyResizable () const
void setAutoResize (const bool r)
 Set whether a clip has been resized yet by the user or the knife tool.
bool getAutoResize () const
auto color () const -> const std::optional< QColor > &
void setColor (const std::optional< QColor > &color)
virtual void movePosition (const TimePos &pos)
 Move this Clip's position in time.
virtual void changeLength (const TimePos &length)
 Change the length of this Clip.
virtual void updateLength ()
virtual gui::ClipView * createView (gui::TrackView *tv)=0
void selectViewOnCreate (bool select)
bool getSelectViewOnCreate ()
TimePos startTimeOffset () const
void setStartTimeOffset (const TimePos &startTimeOffset)
virtual Clip * clone ()=0
Public Member Functions inherited from lmms::Model
 Model (Model *parent, QString displayName=QString(), bool defaultConstructed=false)
 ~Model () override=default
bool isDefaultConstructed () const
Model * parentModel () const
virtual void setDisplayName (const QString &displayName)
virtual QString fullDisplayName () const
Public Member Functions inherited from lmms::JournallingObject
 JournallingObject ()
 ~JournallingObject () override
jo_id_t id () const
void saveJournallingState (const bool newState)
void restoreJournallingState ()
void addJournalCheckPoint ()
QDomElement saveState (QDomDocument &_doc, QDomElement &_parent) override
void restoreState (const QDomElement &_this) override
bool isJournalling () const
void setJournalling (const bool _sr)
bool testAndSetJournalling (const bool newState)
bool isJournallingStateStackEmpty () const
Public Member Functions inherited from lmms::SerializingObject
 SerializingObject ()
virtual ~SerializingObject ()
virtual QString nodeName () const =0
void setHook (SerializingObjectHook *_hook)
SerializingObjectHook * hook ()

Static Public Member Functions

static bool comparePosition (const Clip *a, const Clip *b)
 Returns true if and only if a->startPosition() < b->startPosition().
static void copyStateTo (Clip *src, Clip *dst)
 Copies the state of a Clip to another Clip.

Protected Member Functions

 Clip (const Clip &other)
 Copy a Clip.
Protected Member Functions inherited from lmms::JournallingObject
void changeID (jo_id_t _id)
Protected Member Functions inherited from lmms::SerializingObject
virtual void saveSettings (QDomDocument &doc, QDomElement &element)=0
virtual void loadSettings (const QDomElement &element)=0

Private Member Functions

 mapPropertyFromModel (bool, isMuted, setMuted, m_mutedModel)
 mapPropertyFromModel (bool, isSolo, setSolo, m_soloModel)

Private Attributes

Track * m_track
QString m_name
TimePos m_startPosition
TimePos m_length
TimePos m_startTimeOffset
BoolModel m_mutedModel
BoolModel m_soloModel
bool m_autoResize = true
bool m_selectViewOnCreate
std::optional< QColor > m_color

Friends

class ClipView

Constructor & Destructor Documentation

◆ Clip() [1/2]

Clip::Clip ( Track * track)

Create a new Clip.

Creates a new clip for the given track.

Parameters
_trackThe track that will contain the new object

◆ ~Clip()

Clip::~Clip ( )
override

Destroy a Clip.

Destroys the given clip.

◆ Clip() [2/2]

Clip::Clip ( const Clip & other)
protected

Copy a Clip.

Creates a duplicate clip of the one provided.

Parameters
otherThe clip object which will be copied.

Member Function Documentation

◆ changeLength()

void Clip::changeLength ( const TimePos & length)
virtual

Change the length of this Clip.

If the clip's length has changed, update it. We also add a journal entry for undo and update the display.

Parameters
_lengthThe new length of the clip.

Reimplemented in lmms::SampleClip.

◆ clone()

virtual Clip * lmms::Clip::clone ( )
pure virtual

Creates a copy of this clip

Returns
pointer to the new clip object

Implemented in lmms::AutomationClip, lmms::MidiClip, lmms::PatternClip, and lmms::SampleClip.

◆ color()

auto lmms::Clip::color ( ) const -> const std::optional< QColor > &
inline

◆ colorChanged

void lmms::Clip::colorChanged ( )
signal

◆ comparePosition()

bool Clip::comparePosition ( const Clip * a,
const Clip * b )
static

Returns true if and only if a->startPosition() < b->startPosition().

◆ copyStateTo()

void Clip::copyStateTo ( Clip * src,
Clip * dst )
static

Copies the state of a Clip to another Clip.

This method copies the state of a Clip to another Clip

◆ createView()

virtual gui::ClipView * lmms::Clip::createView ( gui::TrackView * tv)
pure virtual

◆ destroyedClip

void lmms::Clip::destroyedClip ( )
signal

◆ displayName()

QString lmms::Clip::displayName ( ) const
inlineoverridevirtual

Reimplemented from lmms::Model.

◆ endPosition()

TimePos lmms::Clip::endPosition ( ) const
inline

◆ getAutoResize()

bool lmms::Clip::getAutoResize ( ) const
inline

◆ getSelectViewOnCreate()

bool lmms::Clip::getSelectViewOnCreate ( )
inline

◆ getTrack()

Track * lmms::Clip::getTrack ( ) const
inline

◆ hasTrackContainer()

bool Clip::hasTrackContainer ( ) const

◆ isInPattern()

bool Clip::isInPattern ( ) const

◆ length()

const TimePos & lmms::Clip::length ( ) const
inline

◆ lengthChanged

void lmms::Clip::lengthChanged ( )
signal

◆ manuallyResizable()

bool Clip::manuallyResizable ( ) const

◆ mapPropertyFromModel() [1/2]

lmms::Clip::mapPropertyFromModel ( bool ,
isMuted ,
setMuted ,
m_mutedModel  )
private

◆ mapPropertyFromModel() [2/2]

lmms::Clip::mapPropertyFromModel ( bool ,
isSolo ,
setSolo ,
m_soloModel  )
private

◆ movePosition()

void Clip::movePosition ( const TimePos & pos)
virtual

Move this Clip's position in time.

If the clip has moved, update its position. We also add a journal entry for undo and update the display.

Parameters
_posThe new position of the clip.

◆ name()

const QString & lmms::Clip::name ( ) const
inline

◆ positionChanged

void lmms::Clip::positionChanged ( )
signal

◆ selectViewOnCreate()

void lmms::Clip::selectViewOnCreate ( bool select)
inline

◆ setAutoResize()

void lmms::Clip::setAutoResize ( const bool r)
inline

Set whether a clip has been resized yet by the user or the knife tool.

If a clip has been resized previously, it will not automatically resize when editing it.

◆ setColor()

void Clip::setColor ( const std::optional< QColor > & color)

◆ setName()

void lmms::Clip::setName ( const QString & name)
inline

◆ setStartTimeOffset()

void Clip::setStartTimeOffset ( const TimePos & startTimeOffset)

◆ startPosition()

const TimePos & lmms::Clip::startPosition ( ) const
inline

◆ startTimeOffset()

TimePos Clip::startTimeOffset ( ) const

◆ toggleMute

void Clip::toggleMute ( )
slot

Mutes this Clip.

Restore the previous state of this clip. This will restore the position or the length of the clip depending on what was changed.

Parameters
_jeThe journal entry to undo

◆ updateLength()

virtual void lmms::Clip::updateLength ( )
inlinevirtual

Reimplemented in lmms::AutomationClip, and lmms::MidiClip.

◆ ClipView

friend class ClipView
friend

Member Data Documentation

◆ m_autoResize

bool lmms::Clip::m_autoResize = true
private

◆ m_color

std::optional<QColor> lmms::Clip::m_color
private

◆ m_length

TimePos lmms::Clip::m_length
private

◆ m_mutedModel

BoolModel lmms::Clip::m_mutedModel
private

◆ m_name

QString lmms::Clip::m_name
private

◆ m_selectViewOnCreate

bool lmms::Clip::m_selectViewOnCreate
private

◆ m_soloModel

BoolModel lmms::Clip::m_soloModel
private

◆ m_startPosition

TimePos lmms::Clip::m_startPosition
private

◆ m_startTimeOffset

TimePos lmms::Clip::m_startTimeOffset
private

◆ m_track

Track* lmms::Clip::m_track
private

The documentation for this class was generated from the following files: