Commit 61ffebcc authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

Emit a signal when a clip length change

parent 371b9815
...@@ -162,13 +162,19 @@ const QUuid& Clip::getUuid() const ...@@ -162,13 +162,19 @@ const QUuid& Clip::getUuid() const
void Clip::setBegin( float begin ) void Clip::setBegin( float begin )
{ {
Q_ASSERT( begin >= .0f ); Q_ASSERT( begin >= .0f );
if ( begin == m_begin ) return;
m_begin = begin; m_begin = begin;
computeLength();
emit lengthUpdated();
} }
void Clip::setEnd( float end ) void Clip::setEnd( float end )
{ {
Q_ASSERT( end <= 1.0f ); Q_ASSERT( end <= 1.0f );
if ( end == m_end ) return;
m_end = end; m_end = end;
computeLength();
emit lengthUpdated();
} }
Clip* Clip::split( float newEnd ) Clip* Clip::split( float newEnd )
...@@ -176,5 +182,6 @@ Clip* Clip::split( float newEnd ) ...@@ -176,5 +182,6 @@ Clip* Clip::split( float newEnd )
Clip* newClip = new Clip( this, newEnd, m_end ); Clip* newClip = new Clip( this, newEnd, m_end );
m_end = newEnd; m_end = newEnd;
computeLength(); computeLength();
emit lengthUpdated();
return newClip; return newClip;
} }
...@@ -125,6 +125,8 @@ class Clip : public QObject ...@@ -125,6 +125,8 @@ class Clip : public QObject
QStringList m_metaTags; QStringList m_metaTags;
QString m_notes; QString m_notes;
signals:
void lengthUpdated();
}; };
#endif //CLIP_H__ #endif //CLIP_H__
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