Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename TCO and related to Clip #6044

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions data/themes/classic/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -663,14 +663,14 @@ TrackContainerView QLabel
background: none;
}

/* Patterns */
/* Clips */

/* common pattern colors */
TrackContentObjectView {
ClipView {
qproperty-mutedColor: rgb( 128, 128, 128 );
qproperty-mutedBackgroundColor: rgb( 80, 80, 80 );
qproperty-selectedColor: rgb( 0, 125, 255 );
qproperty-BBPatternBackground: rgb( 80, 80, 80 );
qproperty-BBClipBackground: rgb( 80, 80, 80 );
qproperty-textColor: rgb( 255, 255, 255 );
qproperty-textBackgroundColor: rgba(0, 0, 0, 75);
qproperty-textShadowColor: rgb( 0, 0, 0 );
Expand All @@ -683,7 +683,7 @@ TrackContentObjectView {
}

/* instrument pattern */
PatternView {
MidiClipView {
background-color: rgb( 119, 199, 216 );
color: rgb( 187, 227, 236 );

Expand All @@ -694,19 +694,19 @@ PatternView {
}

/* sample track pattern */
SampleTCOView {
SampleClipView {
background-color: rgba(42,51,59,255);
color: #FF8F05;
}

/* automation pattern */
AutomationPatternView {
AutomationClipView {
background-color: #99afff;
color: rgb( 204, 215, 255 );
}

/* bb-pattern */
BBTCOView {
BBClipView {
background-color: rgb( 128, 182, 175 ); /* default colour for bb-tracks */
}

Expand Down
14 changes: 7 additions & 7 deletions data/themes/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -709,14 +709,14 @@ TrackContainerView QLabel
background: none;
}

/* Patterns */
/* Clips */

/* common pattern colors */
TrackContentObjectView {
ClipView {
qproperty-mutedColor: rgba(255,255,255,100);
qproperty-mutedBackgroundColor: #373d48;
qproperty-selectedColor: #006B65;
qproperty-BBPatternBackground: #373d48;
qproperty-BBClipBackground: #373d48;
qproperty-textColor: #fff;
qproperty-textBackgroundColor: rgba(0, 0, 0, 75);
qproperty-textShadowColor: rgba(0,0,0,200);
Expand All @@ -729,7 +729,7 @@ TrackContentObjectView {
}

/* instrument pattern */
PatternView {
MidiClipView {
background-color: #21A14F;
color: rgba(255,255,255,220);

Expand All @@ -740,19 +740,19 @@ PatternView {
}

/* sample track pattern */
SampleTCOView {
SampleClipView {
background-color: rgba(42,51,59,255);
color: #FF8F05;
}

/* automation pattern */
AutomationPatternView {
AutomationClipView {
background-color: #663DE1;
color: rgba(255,255,255,90);
}

/* bb-pattern */
BBTCOView {
BBClipView {
background-color: #20BDB2; /* default colour for bb-tracks */
}

Expand Down
32 changes: 16 additions & 16 deletions include/AutomationPattern.h → include/AutomationClip.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* AutomationPattern.h - declaration of class AutomationPattern, which contains
* all information about an automation pattern
* AutomationClip.h - declaration of class AutomationClip, which contains
* all information about an automation clip
*
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
Expand All @@ -24,22 +24,22 @@
*
*/

#ifndef AUTOMATION_PATTERN_H
#define AUTOMATION_PATTERN_H
#ifndef AUTOMATION_CLIP_H
#define AUTOMATION_CLIP_H

#include <QtCore/QMap>
#include <QtCore/QPointer>

#include "AutomationNode.h"
#include "TrackContentObject.h"
#include "Clip.h"


class AutomationTrack;
class TimePos;



class LMMS_EXPORT AutomationPattern : public TrackContentObject
class LMMS_EXPORT AutomationClip : public Clip
{
Q_OBJECT
public:
Expand All @@ -53,9 +53,9 @@ class LMMS_EXPORT AutomationPattern : public TrackContentObject
typedef QMap<int, AutomationNode> timeMap;
typedef QVector<QPointer<AutomatableModel>> objectVector;

AutomationPattern( AutomationTrack * _auto_track );
AutomationPattern( const AutomationPattern & _pat_to_copy );
virtual ~AutomationPattern() = default;
AutomationClip( AutomationTrack * _auto_track );
AutomationClip( const AutomationClip & _pat_to_copy );
virtual ~AutomationClip() = default;

bool addObject( AutomatableModel * _obj, bool _search_dup = true );

Expand Down Expand Up @@ -147,15 +147,15 @@ class LMMS_EXPORT AutomationPattern : public TrackContentObject
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
void loadSettings( const QDomElement & _this ) override;

static const QString classNodeName() { return "automationpattern"; }
static const QString classNodeName() { return "automationclip"; }
QString nodeName() const override { return classNodeName(); }

TrackContentObjectView * createView( TrackView * _tv ) override;
ClipView * createView( TrackView * _tv ) override;


static bool isAutomated( const AutomatableModel * _m );
static QVector<AutomationPattern *> patternsForModel( const AutomatableModel * _m );
static AutomationPattern * globalAutomationPattern( AutomatableModel * _m );
static QVector<AutomationClip *> clipsForModel( const AutomatableModel * _m );
static AutomationClip * globalAutomationClip( AutomatableModel * _m );
static void resolveAllIDs();

bool isRecording() const { return m_isRecording; }
Expand All @@ -177,9 +177,9 @@ public slots:
void generateTangents(timeMap::iterator it, int numToGenerate);
float valueAt( timeMap::const_iterator v, int offset ) const;

// Mutex to make methods involving automation patterns thread safe
// Mutex to make methods involving automation clips thread safe
// Mutable so we can lock it from const objects
mutable QMutex m_patternMutex;
mutable QMutex m_clipMutex;

AutomationTrack * m_autoTrack;
QVector<jo_id_t> m_idsToResolve;
Expand All @@ -202,7 +202,7 @@ public slots:
static const float DEFAULT_MIN_VALUE;
static const float DEFAULT_MAX_VALUE;

friend class AutomationPatternView;
friend class AutomationClipView;
friend class AutomationNode;

} ;
Expand Down
20 changes: 10 additions & 10 deletions include/AutomationPatternView.h → include/AutomationClipView.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* AutomationPatternView.h - declaration of class AutomationPatternView
* AutomationClipView.h - declaration of class AutomationClipView
*
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
Expand All @@ -22,28 +22,28 @@
*
*/

#ifndef AUTOMATION_PATTERN_VIEW_H
#define AUTOMATION_PATTERN_VIEW_H
#ifndef AUTOMATION_CLIP_VIEW_H
#define AUTOMATION_CLIP_VIEW_H

#include <QStaticText>

#include "AutomationPattern.h"
#include "AutomationClip.h"
#include "Song.h"
#include "SongEditor.h"
#include "TrackContentObjectView.h"
#include "ClipView.h"


class AutomationPatternView : public TrackContentObjectView
class AutomationClipView : public ClipView
{
Q_OBJECT


public:
AutomationPatternView( AutomationPattern * _pat, TrackView * _parent );
virtual ~AutomationPatternView();
AutomationClipView( AutomationClip * _pat, TrackView * _parent );
virtual ~AutomationClipView();

public slots:
/// Opens this view's pattern in the global automation editor
/// Opens this view's clip in the global automation editor
void openInAutomationEditor();
void update() override;

Expand All @@ -65,7 +65,7 @@ protected slots:


private:
AutomationPattern * m_pat;
AutomationClip * m_clip;
QPixmap m_paintPixmap;

QStaticText m_staticTextName;
Expand Down
34 changes: 17 additions & 17 deletions include/AutomationEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "lmms_basics.h"
#include "JournallingObject.h"
#include "TimePos.h"
#include "AutomationPattern.h"
#include "AutomationClip.h"
#include "ComboBoxModel.h"
#include "Knob.h"

Expand All @@ -61,16 +61,16 @@ class AutomationEditor : public QWidget, public JournallingObject
Q_PROPERTY(QColor crossColor MEMBER m_crossColor)
Q_PROPERTY(QColor backgroundShade MEMBER m_backgroundShade)
public:
void setCurrentPattern(AutomationPattern * new_pattern);
void setCurrentClip(AutomationClip * new_clip);

inline const AutomationPattern * currentPattern() const
inline const AutomationClip * currentClip() const
{
return m_pattern;
return m_clip;
}

inline bool validPattern() const
inline bool validClip() const
{
return m_pattern != nullptr;
return m_clip != nullptr;
}

void saveSettings(QDomDocument & doc, QDomElement & parent) override;
Expand All @@ -89,11 +89,11 @@ class AutomationEditor : public QWidget, public JournallingObject

public slots:
void update();
void updateAfterPatternChange();
void updateAfterClipChange();


protected:
typedef AutomationPattern::timeMap timeMap;
typedef AutomationClip::timeMap timeMap;

void keyPressEvent(QKeyEvent * ke) override;
void leaveEvent(QEvent * e) override;
Expand Down Expand Up @@ -125,7 +125,7 @@ protected slots:
void setEditMode(AutomationEditor::EditModes mode);
void setEditMode(int mode);

void setProgressionType(AutomationPattern::ProgressionTypes type);
void setProgressionType(AutomationClip::ProgressionTypes type);
void setProgressionType(int type);
void setTension();

Expand All @@ -134,7 +134,7 @@ protected slots:
void zoomingXChanged();
void zoomingYChanged();

/// Updates the pattern's quantization using the current user selected value.
/// Updates the clip's quantization using the current user selected value.
void setQuantization();

private:
Expand Down Expand Up @@ -178,7 +178,7 @@ protected slots:

FloatModel * m_tensionModel;

AutomationPattern * m_pattern;
AutomationClip * m_clip;
float m_minLevel;
float m_maxLevel;
float m_step;
Expand Down Expand Up @@ -234,7 +234,7 @@ protected slots:


signals:
void currentPatternChanged();
void currentClipChanged();
void positionChanged( const TimePos & );
} ;

Expand All @@ -251,23 +251,23 @@ class AutomationEditorWindow : public Editor
AutomationEditorWindow();
~AutomationEditorWindow();

void setCurrentPattern(AutomationPattern* pattern);
const AutomationPattern* currentPattern();
void setCurrentClip(AutomationClip* clip);
const AutomationClip* currentClip();

void dropEvent( QDropEvent * _de ) override;
void dragEnterEvent( QDragEnterEvent * _dee ) override;

void open(AutomationPattern* pattern);
void open(AutomationClip* clip);

AutomationEditor* m_editor;

QSize sizeHint() const override;

public slots:
void clearCurrentPattern();
void clearCurrentClip();

signals:
void currentPatternChanged();
void currentClipChanged();

protected:
void focusInEvent(QFocusEvent * event) override;
Expand Down
18 changes: 9 additions & 9 deletions include/AutomationNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
#define OUTTAN(x) ((x).value().getOutTangent())
#define POS(x) ((x).key())

class AutomationPattern;
class AutomationClip;


// Note: We use the default copy-assignment on the AutomationPattern constructor. It's
// Note: We use the default copy-assignment on the AutomationClip constructor. It's
// fine for now as we don't have dynamic allocated members, but if any are added we should
// have an user-defined one to perform a deep-copy.
class AutomationNode
{
public:
AutomationNode(); // Dummy constructor for the QMap
AutomationNode(AutomationPattern* pat, float value, int pos);
AutomationNode(AutomationPattern* pat, float inValue, float outValue, int pos);
AutomationNode(AutomationClip* pat, float value, int pos);
AutomationNode(AutomationClip* pat, float inValue, float outValue, int pos);

AutomationNode& operator+=(float f)
{
Expand Down Expand Up @@ -131,18 +131,18 @@ class AutomationNode
}

/**
* @brief Sets the pattern this node belongs to
* @param AutomationPattern* pattern that m_pattern will be
* @brief Sets the clip this node belongs to
* @param AutomationClip* clip that m_clip will be
* set to
*/
inline void setPattern(AutomationPattern* pat)
inline void setClip(AutomationClip* pat)
{
m_pattern = pat;
m_clip = pat;
}

private:
// Pattern that this node belongs to
AutomationPattern* m_pattern;
AutomationClip* m_clip;

// Time position of this node (matches the timeMap key)
int m_pos;
Expand Down
Loading