Skip to content

Commit

Permalink
Added Bezier curves
Browse files Browse the repository at this point in the history
Added Bezier curves for automation tracks.
  • Loading branch information
codythecoder committed Jan 25, 2016
1 parent 8c18344 commit bca1ca9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/core/AutomationPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,16 @@ void AutomationPattern::saveSettings( QDomDocument & _doc, QDomElement & _this )
_this.appendChild( element );
}

for( controlPointTimeMap::const_iterator it = m_controlPoints.begin();
it != m_controlPoints.end(); ++it )
{
QDomElement element = _doc.createElement( "ctrlpnt" );
element.setAttribute( "pos", it.key() );
element.setAttribute( "value1", it.value()[0] );
element.setAttribute( "value2", it.value()[1] );
_this.appendChild( element );
}

for( objectVector::const_iterator it = m_objects.begin();
it != m_objects.end(); ++it )
{
Expand Down Expand Up @@ -747,6 +757,13 @@ void AutomationPattern::loadSettings( const QDomElement & _this )
m_timeMap[element.attribute( "pos" ).toInt()]
= element.attribute( "value" ).toFloat();
}
else if( element.tagName() == "ctrlpnt" )
{
m_controlPoints[element.attribute( "pos" ).toInt()][0]
= element.attribute( "value1" ).toFloat();
m_controlPoints[element.attribute( "pos" ).toInt()][1]
= element.attribute( "value2" ).toFloat();
}
else if( element.tagName() == "object" )
{
m_idsToResolve << element.attribute( "id" ).toInt();
Expand Down

0 comments on commit bca1ca9

Please sign in to comment.