Commit bca0bccc authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Adding a split method for the Clip class

parent 26db1a17
......@@ -157,3 +157,11 @@ void Clip::setEnd( float end )
Q_ASSERT( end <= 1.0f );
m_end = end;
}
Clip* Clip::split( float newEnd )
{
Clip* newClip = new Clip( this, newEnd, m_end );
m_end = newEnd;
computeLength();
return newClip;
}
......@@ -99,6 +99,14 @@ class Clip : public QObject
const QString& getNotes() const;
void setNotes( const QString& notes );
/**
* \brief Split this clip in two parts.
* \param newEnd The new end for this Clip. This will be the beginning of the
* newly created Clip.
* \returns The remaining part as a new Clip.
*/
Clip* split( float newEnd );
private:
void computeLength();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment