|
LMMS
|
Base-class for all tracks. More...
#include <Track.h>
Public Types | |
| enum class | Type { Instrument , Pattern , Sample , Event , Video , Automation , HiddenAutomation , Count } |
| using | clipVector = std::vector<Clip*> |
Public Slots | |
| virtual void | setName (const QString &newName) |
| void | setMutedBeforeSolo (const bool muted) |
| void | toggleSolo () |
| Invert the track's solo state. | |
Signals | |
| void | destroyedTrack () |
| void | nameChanged () |
| void | clipAdded (lmms::Clip *) |
| void | colorChanged () |
| void | dataChanged () |
| Signals inherited from lmms::Model | |
| void | dataChanged () |
| void | dataUnchanged () |
| void | propertiesChanged () |
Public Member Functions | |
| Track (Type type, TrackContainer *tc) | |
| Create a new (empty) track object. | |
| ~Track () override | |
| Destroy this track. | |
| Track * | clone () |
| Clone a track from this track. | |
| Type | type () const |
| virtual bool | play (const TimePos &start, const f_cnt_t frames, const f_cnt_t frameBase, int clipNum=-1)=0 |
| virtual gui::TrackView * | createView (gui::TrackContainerView *view)=0 |
| virtual Clip * | createClip (const TimePos &pos)=0 |
| virtual void | saveTrackSpecificSettings (QDomDocument &doc, QDomElement &parent, bool presetMode)=0 |
| virtual void | loadTrackSpecificSettings (const QDomElement &element)=0 |
| void | savePreset (QDomDocument &doc, QDomElement &element) |
| void | loadPreset (const QDomElement &element) |
| void | saveSettings (QDomDocument &doc, QDomElement &element) override |
| void | loadSettings (const QDomElement &element) override |
| Clip * | addClip (Clip *clip) |
| Add another Clip into this track. | |
| void | removeClip (Clip *clip) |
| Remove a given Clip from this track. | |
| void | deleteClips () |
| Remove all Clips from this track. | |
| int | numOfClips () |
| Return the number of clips we contain. | |
| auto | getClip (std::size_t clipNum) -> Clip * |
| Get a Clip by number. | |
| int | getClipNum (const Clip *clip) |
| Determine the given Clip's number in our array. | |
| const clipVector & | getClips () const |
| void | getClipsInRange (clipVector &clipV, const TimePos &start, const TimePos &end) |
| Retrieve a list of clips that fall within a period. | |
| void | swapPositionOfClips (int clipNum1, int clipNum2) |
| Swap the position of two clips. | |
| void | createClipsForPattern (int pattern) |
| void | insertBar (const TimePos &pos) |
| Move all the clips after a certain time later by one bar. | |
| void | removeBar (const TimePos &pos) |
| Move all the clips after a certain time earlier by one bar. | |
| bar_t | length () const |
| Return the length of the entire track in bars. | |
| TrackContainer * | trackContainer () const |
| virtual const QString & | name () const |
| QString | displayName () const override |
| int | getHeight () |
| void | setHeight (int height) |
| void | lock () |
| void | unlock () |
| bool | tryLock () |
| auto | color () const -> const std::optional< QColor > & |
| void | setColor (const std::optional< QColor > &color) |
| bool | isMutedBeforeSolo () const |
| BoolModel * | getMutedModel () |
| 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 Track * | create (Type tt, TrackContainer *tc) |
| Create a track based on the given track type and container. | |
| static Track * | create (const QDomElement &element, TrackContainer *tc) |
| Create a track inside TrackContainer from track type in a QDomElement and restore state from XML. | |
Protected Attributes | |
| BoolModel | m_mutedModel |
| BoolModel | m_soloModel |
Private Member Functions | |
| mapPropertyFromModel (bool, isMuted, setMuted, m_mutedModel) | |
| mapPropertyFromModel (bool, isSolo, setSolo, m_soloModel) | |
| void | saveTrack (QDomDocument &doc, QDomElement &element, bool presetMode) |
| Save this track's settings to file. | |
| void | loadTrack (const QDomElement &element, bool presetMode) |
| Load the settings from a file. | |
Private Attributes | |
| TrackContainer * | m_trackContainer |
| Type | m_type |
| QString | m_name |
| int | m_height |
| bool | m_mutedBeforeSolo |
| clipVector | m_clips |
| QMutex | m_processingLock |
| std::optional< QColor > | m_color |
Friends | |
| class | gui::TrackView |
Additional Inherited Members | |
| Protected Member Functions inherited from lmms::JournallingObject | |
| void | changeID (jo_id_t _id) |
Base-class for all tracks.
| using lmms::Track::clipVector = std::vector<Clip*> |
|
strong |
| lmms::Track::Track | ( | Type | type, |
| TrackContainer * | tc ) |
Create a new (empty) track object.
The track object is the whole track, linking its contents, its automation, name, type, and so forth.
| type | The type of track (Song Editor or Pattern Editor) |
| tc | The track Container object to encapsulate in this track. |
< The track Model
< The track container object
< The track type
< The track's name
< For controlling track muting
< For controlling track soloing
< The clips (segments)
|
override |
Destroy this track.
Delete the clips and remove this track from the track container.
|
signal |
| Track * lmms::Track::clone | ( | ) |
Clone a track from this track.
|
inline |
|
signal |
|
static |
Create a track inside TrackContainer from track type in a QDomElement and restore state from XML.
| element | The QDomElement containing the type of track to create |
| tc | The track container to attach to |
|
static |
Create a track based on the given track type and container.
| tt | The type of track to create |
| tc | The track container to attach to |
Implemented in lmms::AutomationTrack, lmms::InstrumentTrack, lmms::PatternTrack, and lmms::SampleTrack.
|
pure virtual |
Implemented in lmms::AutomationTrack, lmms::InstrumentTrack, lmms::PatternTrack, and lmms::SampleTrack.
|
signal |
| void lmms::Track::deleteClips | ( | ) |
Remove all Clips from this track.
|
signal |
|
inlineoverridevirtual |
Reimplemented from lmms::Model.
| auto lmms::Track::getClip | ( | std::size_t | clipNum | ) | -> Clip * |
Get a Clip by number.
If the Clip number is less than our Clip array size then fetch that numbered object from the array. Otherwise we warn the user that we've somehow requested a Clip that is too large, and create a new Clip for them.
| clipNum | The number of the Clip to fetch. |
|
inline |
| void lmms::Track::getClipsInRange | ( | clipVector & | clipV, |
| const TimePos & | start, | ||
| const TimePos & | end ) |
Retrieve a list of clips that fall within a period.
Here we're interested in a range of clips that intersect the given time period.
We return the Clips we find in order by time, earliest Clips first.
| clipV | The list to contain the found clips. |
| start | The MIDI start time of the range. |
| end | The MIDI endi time of the range. |
|
inline |
| BoolModel * lmms::Track::getMutedModel | ( | ) |
Move all the clips after a certain time later by one bar.
| pos | The time at which we want to insert the bar. |
|
inline |
| bar_t lmms::Track::length | ( | ) | const |
Return the length of the entire track in bars.
We step through our list of Clips and determine their end position, keeping track of the latest time found in ticks. Then we return that in bars by dividing by the number of ticks per bar.
Implements lmms::SerializingObject.
Load the settings from a file.
We load the track's type and muted state and solo state, then clear out our current Clip.
Then we step through the QDomElement's children and load the track-specific settings and clip states from it one at a time.
| element | the QDomElement to load track settings from |
| presetMode | Indicates if a preset or a full track is loaded |
Implemented in lmms::AutomationTrack, lmms::InstrumentTrack, lmms::PatternTrack, and lmms::SampleTrack.
|
inline |
|
private |
|
private |
|
inlinevirtual |
|
signal |
| int lmms::Track::numOfClips | ( | ) |
Return the number of clips we contain.
|
pure virtual |
Implemented in lmms::AutomationTrack, lmms::InstrumentTrack, lmms::PatternTrack, and lmms::SampleTrack.
Move all the clips after a certain time earlier by one bar.
| pos | The time at which we want to remove the bar. |
| void lmms::Track::savePreset | ( | QDomDocument & | doc, |
| QDomElement & | element ) |
|
overridevirtual |
Implements lmms::SerializingObject.
|
private |
Save this track's settings to file.
We save the track type and its muted state and solo state, then append the track- specific settings. Then we iterate through the clips and save all their states in turn.
| doc | The QDomDocument to use to save |
| element | The The QDomElement to save into |
| presetMode | Describes whether to save the track as a preset or not. |
Does this accurately describe the parameters? I think not!?
Save the track height
|
pure virtual |
Implemented in lmms::AutomationTrack, lmms::InstrumentTrack, lmms::PatternTrack, and lmms::SampleTrack.
Reimplemented in lmms::InstrumentTrack.
|
slot |
Invert the track's solo state.
We have to go through all the tracks determining if any other track is already soloed. Then we have to save the mute state of all tracks, and set our mute state to on and all the others to off.
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
protected |
|
private |
|
private |