Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
77d69e2
First commit
IanCaio Oct 13, 2020
fb2107d
Implements inValue/outValue on Automation Nodes
IanCaio Oct 14, 2020
28611b8
Fixes and refactor code on AutomationEditor.cpp
IanCaio Oct 15, 2020
e5c9669
Avoids unnecessary check in putValue
IanCaio Oct 15, 2020
ab0aeb0
Adds upgrade routine for the automation nodes
IanCaio Oct 15, 2020
2ed2a66
Allows dragging outValues on the Automation Editor
IanCaio Oct 16, 2020
7b6729b
Small fix inside AutomationPattern.cpp
IanCaio Oct 16, 2020
a800943
Creates separate files for AutomationNode
IanCaio Oct 16, 2020
3932106
Adds more members to AutomationNode
IanCaio Oct 16, 2020
9f55d2c
Removes unused code from AutomationEditor
IanCaio Oct 16, 2020
c42c46b
Changes to the outValues now update the tangents
IanCaio Oct 16, 2020
504143c
Keeps discrete jumps when flipping patterns
IanCaio Oct 16, 2020
d67942b
Allows reseting outValues on the AutomationEditor
IanCaio Oct 16, 2020
7c269bd
Makes so dragging nodes keep the outValue
IanCaio Oct 16, 2020
64fcec0
Fixes code style on modified code
IanCaio Oct 16, 2020
578367e
Adds a QProperty for the node outValue color
IanCaio Oct 16, 2020
c4960a1
Adds doxygen comments on methods
IanCaio Oct 16, 2020
5c94591
Refactor flipX and flipY methods
IanCaio Oct 16, 2020
939596a
Add a new edit mode to Automation Editor
IanCaio Oct 16, 2020
5a38f74
Improves the Draw OutValue edit mode
IanCaio Oct 17, 2020
7925196
Adds mutex to AutomationPattern
IanCaio Oct 17, 2020
9e325dc
Veratil's review changes
IanCaio Oct 19, 2020
61d20ff
Changes the inValue sphere to be draw first
IanCaio Oct 19, 2020
ff92b56
Merge branch 'master' into feature/automationProgression
IanCaio Oct 21, 2020
3d4be23
Changes comments and variables names
IanCaio Oct 21, 2020
caa43ad
Changes QProperty variables to use MEMBER
IanCaio Oct 22, 2020
61ef27a
Overloads some AutomationNode's operators
IanCaio Oct 22, 2020
932a46e
Improves getNodeAt method
IanCaio Oct 22, 2020
a64942a
Changes behavior of setDragValue
IanCaio Oct 22, 2020
3b6f238
Moves getNodeAt to an upper level, reducing lines
IanCaio Oct 22, 2020
53f4afa
Changes icon of Draw OutValue edit mode
IanCaio Oct 22, 2020
108323d
Merge branch 'master' into feature/automationProgression
IanCaio Oct 24, 2020
203d3b5
Removes unnecessary non-const methods
IanCaio Nov 12, 2020
1531668
Merge branch 'master' into feature/automationProgression
IanCaio Nov 12, 2020
5184d79
Fixes formatting and doxygen comments
IanCaio Nov 13, 2020
9805321
Adds helper macros for AutomationNodes
IanCaio Nov 13, 2020
055c95f
Removes tabs from ternary operator
IanCaio Nov 13, 2020
1c3502c
Update files to use AutomationNode macros
IanCaio Nov 13, 2020
3471b8f
Merge branch 'master' into feature/automationProgression
IanCaio Nov 26, 2020
7559a41
Addresses my own code review
IanCaio Nov 26, 2020
2cf33e1
Addresses Veratil's review
IanCaio Nov 26, 2020
e0c3563
Adds helper MACROs for node tangents
IanCaio Nov 26, 2020
85a0ca3
Merge branch 'master' into feature/automationProgression
IanCaio Dec 5, 2020
cbf73dc
Fixes header inclusion order
IanCaio Dec 5, 2020
de6d7c9
Removes mutex from AutomationEditor
IanCaio Dec 6, 2020
7d1f196
Locks mutex on AutomationPattern copy assignment
IanCaio Dec 6, 2020
128c723
Changes resetOutValue() so it generates tangents
IanCaio Dec 6, 2020
adc223b
Changes some methods to use for loops
IanCaio Dec 11, 2020
169cc3b
Move removeNodes/resetNodes to AutomationPattern
IanCaio Dec 11, 2020
033bfab
Optimizes loop inside putValue/putValues
IanCaio Dec 11, 2020
fe53845
Adds comment to mysterious calculation
IanCaio Dec 12, 2020
1f28a45
Merge branch 'master' into feature/automationProgression
IanCaio Dec 16, 2020
1e1e5f8
Reduces indentation on getNodeAt
IanCaio Dec 16, 2020
6bec055
Applies Veratil suggestions
IanCaio Dec 16, 2020
1d23334
Updates comment from changed code
IanCaio Dec 16, 2020
8c5f9d4
Uses lambda functions to extract code
IanCaio Dec 16, 2020
1d1d57c
Fixes behavior of AutomationPattern::flipX
IanCaio Dec 20, 2020
d9862c5
Changes pattern XML for backwards compatibility
IanCaio Dec 20, 2020
2d1fbd0
Fixes bug on AutomationPattern::resetNodes
IanCaio Dec 20, 2020
2226108
Implements fine tuning with double click
tecknixia Dec 26, 2020
4b4ac2b
Adds comment about copy-assignment
IanCaio Jan 7, 2021
93c0c65
Merge branch 'master' into feature/automationProgression
IanCaio Jan 30, 2021
5a66667
Changes flipY logic and address PhysSong review
IanCaio Jan 30, 2021
174f335
Merge branch 'feature/automationProgression' into feature/automationP…
IanCaio Feb 25, 2021
5a2a5db
Merge branch 'master' into feature/automationProgressionFineTuning
IanCaio Feb 28, 2021
5f3e69b
Fixes bug with double clicking on erase mode
IanCaio Feb 28, 2021
5290c71
Small change to the fine tuning of inValues
IanCaio Feb 28, 2021
df67e46
Addresses Spekular change requests
IanCaio Mar 26, 2021
0334021
Addresses Veratil's review
IanCaio Mar 26, 2021
7eae19c
Improves indentation on fineTuneValue
IanCaio Mar 28, 2021
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
Prev Previous commit
Next Next commit
Changes comments and variables names
	Fixes some comments pointed out on Spekular's review. Changes the AutomationNode's variable m_key to m_pos (leaving a comment on the header reminding that it matches the timeMap key). Removes comments related to removed code. Fixes code style on a pointer declaration.
  • Loading branch information
IanCaio committed Oct 21, 2020
commit 3d4be23c41bd99056a838d6e63fc82ea11271fcc
6 changes: 1 addition & 5 deletions include/AutomationEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ public slots:
float yCoordOfLevel( float level );
inline void drawLevelTick( QPainter & p, int tick, float value);// bool is_selected ); //NEEDS Change in CSS

// Returns the an iterator pointing to the AutomationNode on a radius of
// r pixels of the x,y mouse coordinates, or timeMap.end() if there are none.
// If outValue is true, we will check if the coordinates in relation to the
// outValue sphere instead of the inValue.
timeMap::iterator getNodeAt(int x, int y, bool outValue = false, int r = 5);

void drawLine( int x0, float y0, int x1, float y1 );
Expand Down Expand Up @@ -236,7 +232,7 @@ protected slots:
int m_y_delta;
bool m_y_auto;

// Time position (key) of automation node whose's outValue is being dragged
// Time position (key) of automation node whose outValue is being dragged
int m_draggedOutValueKey;

EditModes m_editMode;
Expand Down
8 changes: 4 additions & 4 deletions include/AutomationNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class AutomationNode
{
public:
AutomationNode(); // Dummy constructor for the QMap
AutomationNode(AutomationPattern* pat, float value, int key);
AutomationNode(AutomationPattern* pat, float inValue, float outValue, int key);
AutomationNode(AutomationPattern* pat, float value, int pos);
AutomationNode(AutomationPattern* pat, float inValue, float outValue, int pos);

inline float getInValue()
{
Expand Down Expand Up @@ -118,8 +118,8 @@ class AutomationNode
// Pattern that this node belongs to
AutomationPattern* m_pattern;

// Time position of this node
int m_key;
// Time position of this node (matches the timeMap key)
int m_pos;

// Values of this node
float m_inValue;
Expand Down
14 changes: 7 additions & 7 deletions src/core/AutomationNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@
// Dummy constructor for the QMap
AutomationNode::AutomationNode() :
m_pattern(nullptr),
m_key(0),
m_pos(0),
m_inValue(0),
m_outValue(0),
m_inTangent(0),
m_outTangent(0)
{
}

AutomationNode::AutomationNode(AutomationPattern* pat, float value, int key) :
AutomationNode::AutomationNode(AutomationPattern* pat, float value, int pos) :
m_pattern(pat),
m_key(key),
m_pos(pos),
m_inValue(value),
m_outValue(value),
m_inTangent(0),
m_outTangent(0)
{
}

AutomationNode::AutomationNode(AutomationPattern* pat, float inValue, float outValue, int key) :
AutomationNode::AutomationNode(AutomationPattern* pat, float inValue, float outValue, int pos) :
m_pattern(pat),
m_key(key),
m_pos(pos),
m_inValue(inValue),
m_outValue(outValue),
m_inTangent(0),
Expand All @@ -71,7 +71,7 @@ void AutomationNode::setInValue(float value)
AutomationPattern::timeMap & tm = m_pattern->getTimeMap();

// Get an iterator pointing to this node
AutomationPattern::timeMap::iterator it = tm.lowerBound(m_key);
AutomationPattern::timeMap::iterator it = tm.lowerBound(m_pos);
// If it's not the first node, get the one immediately behind it
if (it != tm.begin())
{
Expand All @@ -94,7 +94,7 @@ void AutomationNode::setOutValue(float value)
AutomationPattern::timeMap & tm = m_pattern->getTimeMap();

// Get an iterator pointing to this node
AutomationPattern::timeMap::iterator it = tm.lowerBound(m_key);
AutomationPattern::timeMap::iterator it = tm.lowerBound(m_pos);
// If it's not the first node, get the one immediately behind it
if (it != tm.begin())
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/AutomationPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const AutomatableModel * AutomationPattern::firstObject() const
{
QMutexLocker m(&m_patternMutex);

AutomatableModel * model;
AutomatableModel* model;
if (!m_objects.isEmpty() && (model = m_objects.first()) != nullptr)
{
return model;
Expand Down Expand Up @@ -409,7 +409,7 @@ float AutomationPattern::valueAt( const MidiTime & _time ) const



// This method will get the value at a offset from a node, so we use the outValue of
// This method will get the value at an offset from a node, so we use the outValue of
// that node and the inValue of the next node to the calculations. This assumes that offset
// will not be zero, because when the midi time given to AutomationPattern::valueAt(MidiTime)
// matches a node's position, that node's value will be returned and this method won't be even
Expand Down
12 changes: 5 additions & 7 deletions src/gui/editors/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,13 +1016,13 @@ inline void AutomationEditor::drawAutomationPoint(QPainter & p, timeMap::iterato
int y;
const int outerRadius = qBound(3, (m_ppb * AutomationPattern::quantization()) / 576, 5); // man, getting this calculation right took forever

// Draws an ellipse for the outValue
// Draw a circle for the outValue
y = yCoordOfLevel(it.value().getOutValue());
p.setPen(QPen(nodeOutValueColor().lighter(200)));
p.setBrush(QBrush(nodeOutValueColor()));
p.drawEllipse(x - outerRadius, y - outerRadius, outerRadius * 2, outerRadius * 2);

// Draws an ellipse for the inValue
// Draw a circle for the inValue
y = yCoordOfLevel(it.value().getInValue());
p.setPen(QPen(nodeInValueColor().lighter(200)));
p.setBrush(QBrush(nodeInValueColor()));
Expand Down Expand Up @@ -1403,9 +1403,7 @@ float AutomationEditor::yCoordOfLevel(float level )



//NEEDS Change in CSS
void AutomationEditor::drawLevelTick(QPainter & p, int tick, float value)
// bool is_selected )
{
QMutexLocker m(&m_patternEditorMutex);

Expand Down Expand Up @@ -1904,9 +1902,9 @@ void AutomationEditor::updateTopBottomLevels()


/* @brief Given a mouse coordinate, returns a timeMap::iterator that points to
* the latest node that is inside a square of side "r" pixels from those
* coordinates. In simpler terms, returns the automation node that was
* clicked.
* the latest node inside a square of side "r" pixels from those
* coordinates. In simpler terms, returns the automation node on those
* coordinates.
* @param Int X coordinate
* @param Int Y coordinate
* @param Boolean. True to check if the outValue of the node was clicked instead
Expand Down
4 changes: 2 additions & 2 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,8 @@ void PianoRoll::drawDetuningInfo( QPainter & _p, const Note * _n, int _x,
width() - m_whiteKeyWidth,
keyAreaBottom() - PR_TOP_MARGIN);

// Draws the lines for the detuning automation. Just as previously, we are still
// drawing cubic hermit curves as lines too. Now account for discrete jumps.
// Draw lines for the detuning automation, treating cubic hermit curves
// as straight lines. Also draw discrete jumps.
int old_x = 0;
int old_y = 0;

Expand Down