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

Little cosmetics changes on PreviewRuler

parent 860c2a92
......@@ -254,7 +254,7 @@ void PreviewRuler::updateTimecode( qint64 frames /*= -1*/ )
void PreviewRuler::setMarker( Marker m )
{
if ( m == START )
if ( m == Start )
m_markerStart = m_frame;
else
m_markerStop = m_frame;
......@@ -262,15 +262,15 @@ void PreviewRuler::setMarker( Marker m )
qint64 PreviewRuler::getMarker( Marker m ) const
{
return ( m == START ? m_markerStart : m_markerStop );
return ( m == Start ? m_markerStart : m_markerStop );
}
void
PreviewRuler::hideMarker( Marker m )
{
if ( m == START )
if ( m == Start )
m_markerStart = -1;
else if ( m == STOP )
else if ( m == Stop )
m_markerStop = -1;
}
......
......@@ -40,29 +40,29 @@ class PreviewRuler : public QWidget
public:
enum Marker
{
START,
STOP
Start,
Stop
};
PreviewRuler( QWidget* parent = 0 );
virtual ~PreviewRuler() { }
void setRenderer( GenericRenderer* renderer );
void setMarker( Marker m );
void hideMarker( Marker m );
qint64 getMarker( Marker m ) const;
void setRenderer( GenericRenderer* renderer );
void setMarker( Marker m );
void hideMarker( Marker m );
qint64 getMarker( Marker m ) const;
public slots:
void setFrame( qint64 frame, bool broadcastEvent = false );
void setFrame( qint64 frame, bool broadcastEvent = false );
protected:
virtual void paintEvent( QPaintEvent* event );
virtual void mousePressEvent( QMouseEvent* event );
virtual void mouseMoveEvent( QMouseEvent* event );
virtual void mouseReleaseEvent( QMouseEvent * event );
virtual void paintEvent( QPaintEvent* event );
virtual void mousePressEvent( QMouseEvent* event );
virtual void mouseMoveEvent( QMouseEvent* event );
virtual void mouseReleaseEvent( QMouseEvent * event );
private slots:
void updateTimecode( qint64 frames = -1 );
void clear();
void updateTimecode( qint64 frames = -1 );
void clear();
private:
GenericRenderer* m_renderer;
......@@ -72,8 +72,8 @@ private:
bool m_isSliding;
signals:
void frameChanged( qint64, MainWorkflow::FrameChangedReason );
void timeChanged( int h, int m, int s, int f );
void frameChanged( qint64, MainWorkflow::FrameChangedReason );
void timeChanged( int h, int m, int s, int f );
};
#endif // PREVIEWRULER_H
......@@ -169,32 +169,32 @@ void PreviewWidget::stop()
void PreviewWidget::markerStartClicked()
{
m_ui->rulerWidget->setMarker( PreviewRuler::START );
m_ui->rulerWidget->setMarker( PreviewRuler::Start );
qint64 beg = m_ui->rulerWidget->getMarker( PreviewRuler::START );
qint64 end = m_ui->rulerWidget->getMarker( PreviewRuler::STOP );
qint64 beg = m_ui->rulerWidget->getMarker( PreviewRuler::Start );
qint64 end = m_ui->rulerWidget->getMarker( PreviewRuler::Stop );
if ( beg > end )
{
m_ui->rulerWidget->hideMarker( PreviewRuler::STOP );;
m_ui->rulerWidget->hideMarker( PreviewRuler::Stop );;
}
}
void PreviewWidget::markerStopClicked()
{
m_ui->rulerWidget->setMarker( PreviewRuler::STOP );
qint64 beg = m_ui->rulerWidget->getMarker( PreviewRuler::START );
qint64 end = m_ui->rulerWidget->getMarker( PreviewRuler::STOP );
m_ui->rulerWidget->setMarker( PreviewRuler::Stop );
qint64 beg = m_ui->rulerWidget->getMarker( PreviewRuler::Start );
qint64 end = m_ui->rulerWidget->getMarker( PreviewRuler::Stop );
if ( beg > end )
{
m_ui->rulerWidget->hideMarker( PreviewRuler::START );;
m_ui->rulerWidget->hideMarker( PreviewRuler::Start );;
}
}
void PreviewWidget::createNewClipFromMarkers()
{
Media* selectedMedia = m_renderer->getMedia();
qint64 beg = m_ui->rulerWidget->getMarker( PreviewRuler::START );
qint64 end = m_ui->rulerWidget->getMarker( PreviewRuler::STOP );
qint64 beg = m_ui->rulerWidget->getMarker( PreviewRuler::Start );
qint64 end = m_ui->rulerWidget->getMarker( PreviewRuler::Stop );
if ( beg == -1 && end == -1 )
return ;
......
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