Commit 583032e6 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Relocating FrameChangedReason to Types.h

parent 99ae5567
......@@ -73,7 +73,7 @@ MainWindow::MainWindow( QWidget *parent ) :
m_ui.setupUi( this );
qRegisterMetaType<Workflow::TrackType>( "Workflow::TrackType" );
qRegisterMetaType<MainWorkflow::FrameChangedReason>( "MainWorkflow::FrameChangedReason" );
qRegisterMetaType<Vlmc::FrameChangedReason>( "MainWorkflow::FrameChangedReason" );
qRegisterMetaType<QVariant>( "QVariant" );
//We only install message handler here cause it uses configuration.
......
......@@ -42,13 +42,13 @@ void PreviewRuler::setRenderer( GenericRenderer* renderer )
{
if ( m_renderer )
{
disconnect( m_renderer, SIGNAL( frameChanged(qint64, MainWorkflow::FrameChangedReason ) ) );
disconnect( m_renderer, SIGNAL( frameChanged(qint64, Vlmc::FrameChangedReason ) ) );
}
m_renderer = renderer;
connect( m_renderer, SIGNAL( frameChanged(qint64, MainWorkflow::FrameChangedReason) ),
connect( m_renderer, SIGNAL( frameChanged(qint64, Vlmc::FrameChangedReason) ),
this, SLOT( update() ) );
connect( m_renderer, SIGNAL( frameChanged(qint64, MainWorkflow::FrameChangedReason) ),
connect( m_renderer, SIGNAL( frameChanged(qint64, Vlmc::FrameChangedReason) ),
this, SLOT( updateTimecode( qint64 ) ) );
connect( m_renderer, SIGNAL( stopped() ),
this, SLOT( clear() ) );
......@@ -222,7 +222,7 @@ void PreviewRuler::setFrame( qint64 frame, bool broadcastEvent /*= false*/ )
m_frame = frame;
if ( m_isSliding && broadcastEvent == true )
{
emit frameChanged( frame, MainWorkflow::PreviewCursor );
emit frameChanged( frame, Vlmc::PreviewCursor );
}
update();
}
......
......@@ -72,7 +72,7 @@ private:
bool m_isSliding;
signals:
void frameChanged( qint64, MainWorkflow::FrameChangedReason );
void frameChanged( qint64, Vlmc::FrameChangedReason );
void timeChanged( int h, int m, int s, int f );
};
......
......@@ -80,10 +80,10 @@ PreviewWidget::setRenderer( GenericRenderer *renderer )
connect( m_renderer, SIGNAL( stopped() ), this, SLOT( videoStopped() ) );
connect( m_renderer, SIGNAL( paused() ), this, SLOT( videoPaused() ) );
connect( m_renderer, SIGNAL( playing() ), this, SLOT( videoPlaying() ) );
connect( m_renderer, SIGNAL( frameChanged(qint64, MainWorkflow::FrameChangedReason) ),
this, SLOT( frameChanged(qint64, MainWorkflow::FrameChangedReason ) ) );
connect( m_renderer, SIGNAL( frameChanged(qint64, Vlmc::FrameChangedReason) ),
this, SLOT( frameChanged(qint64, Vlmc::FrameChangedReason ) ) );
connect( m_renderer, SIGNAL( endReached() ), this, SLOT( endReached() ) );
connect( m_ui->rulerWidget, SIGNAL( frameChanged(qint64, MainWorkflow::FrameChangedReason) ),
connect( m_ui->rulerWidget, SIGNAL( frameChanged(qint64, Vlmc::FrameChangedReason) ),
m_renderer, SLOT( previewWidgetCursorChanged(qint64) ) );
connect( m_renderer, SIGNAL( error() ), this, SLOT( error() ) );
}
......@@ -100,9 +100,9 @@ void PreviewWidget::changeEvent( QEvent *e )
}
}
void PreviewWidget::frameChanged( qint64 currentFrame, MainWorkflow::FrameChangedReason reason )
void PreviewWidget::frameChanged( qint64 currentFrame, Vlmc::FrameChangedReason reason )
{
if ( m_previewStopped == false && reason != MainWorkflow::PreviewCursor )
if ( m_previewStopped == false && reason != Vlmc::PreviewCursor )
{
m_ui->rulerWidget->setFrame( currentFrame, false );
}
......
......@@ -62,7 +62,7 @@ private slots:
void on_pushButtonStop_clicked();
void on_pushButtonNextFrame_clicked();
void on_pushButtonPreviousFrame_clicked();
void frameChanged( qint64, MainWorkflow::FrameChangedReason reason );
void frameChanged( qint64, Vlmc::FrameChangedReason reason );
void videoPaused();
void videoPlaying();
void videoStopped();
......
......@@ -96,9 +96,9 @@ void GraphicsCursorItem::mouseReleaseEvent( QGraphicsSceneMouseEvent* event )
QGraphicsItem::mouseReleaseEvent( event );
}
void GraphicsCursorItem::frameChanged( qint64 newFrame, MainWorkflow::FrameChangedReason reason )
void GraphicsCursorItem::frameChanged( qint64 newFrame, Vlmc::FrameChangedReason reason )
{
if ( reason != MainWorkflow::TimelineCursor )
if ( reason != Vlmc::TimelineCursor )
{
setPos( newFrame, pos().y() );
}
......
......@@ -64,7 +64,7 @@ signals:
void cursorMoved( qint64 pos );
public slots:
void frameChanged( qint64 position, MainWorkflow::FrameChangedReason );
void frameChanged( qint64 position, Vlmc::FrameChangedReason );
};
#endif // GRAPHICSCURSORITEM_H
......@@ -107,12 +107,12 @@ Timeline::Timeline( WorkflowRenderer* renderer, QWidget *parent ) :
m_tracksControls, SLOT( removeAudioTrack() ) );
// Frames updates
connect( m_renderer, SIGNAL( frameChanged(qint64, MainWorkflow::FrameChangedReason) ),
m_tracksView->tracksCursor(), SLOT( frameChanged( qint64, MainWorkflow::FrameChangedReason ) ),
connect( m_renderer, SIGNAL( frameChanged(qint64, Vlmc::FrameChangedReason) ),
m_tracksView->tracksCursor(), SLOT( frameChanged( qint64, Vlmc::FrameChangedReason ) ),
Qt::QueuedConnection );
connect( m_renderer, SIGNAL( frameChanged(qint64,MainWorkflow::FrameChangedReason) ),
connect( m_renderer, SIGNAL( frameChanged(qint64,Vlmc::FrameChangedReason) ),
m_tracksRuler, SLOT( update() ) );
connect( m_tracksRuler, SIGNAL( frameChanged(qint64,MainWorkflow::FrameChangedReason) ),
connect( m_tracksRuler, SIGNAL( frameChanged(qint64,Vlmc::FrameChangedReason) ),
m_renderer, SLOT( rulerCursorChanged(qint64)) );
// Cursor position updates
......
......@@ -172,7 +172,7 @@ void TracksRuler::mousePressEvent( QMouseEvent* event )
if ( event->buttons() == Qt::LeftButton &&
event->modifiers() == Qt::NoModifier )
{
emit frameChanged( qMax( (qreal)0, (qreal)( event->x() + offset() ) / m_factor ), MainWorkflow::RulerCursor );
emit frameChanged( qMax( (qreal)0, (qreal)( event->x() + offset() ) / m_factor ), Vlmc::RulerCursor );
}
}
......@@ -181,7 +181,7 @@ void TracksRuler::mouseMoveEvent( QMouseEvent* event )
if ( event->buttons() == Qt::LeftButton &&
event->modifiers() == Qt::NoModifier )
{
emit frameChanged( qMax( (qreal)0, (qreal)( event->x() + offset() ) / m_factor ), MainWorkflow::RulerCursor );
emit frameChanged( qMax( (qreal)0, (qreal)( event->x() + offset() ) / m_factor ), Vlmc::RulerCursor );
}
}
......
......@@ -109,7 +109,7 @@ signals:
/**
* \brief Emitted when the user is seeking.
*/
void frameChanged( qint64, MainWorkflow::FrameChangedReason );
void frameChanged( qint64, Vlmc::FrameChangedReason );
};
#endif // TRACKSRULER_H
......@@ -1038,7 +1038,7 @@ TracksView::setCursorPos( qint64 pos )
{
if ( pos < 0 )
pos = 0;
m_cursorLine->frameChanged( pos, MainWorkflow::TimelineCursor );
m_cursorLine->frameChanged( pos, Vlmc::TimelineCursor );
}
qint64
......
......@@ -126,7 +126,7 @@ ClipRenderer::togglePlayPause( bool forcePause )
{
if ( m_clipLoaded == false )
{
emit frameChanged( 0, MainWorkflow::Renderer );
emit frameChanged( 0, Vlmc::Renderer );
startPreview();
return ;
}
......@@ -238,7 +238,7 @@ ClipRenderer::previewWidgetCursorChanged( qint64 newFrame )
void
ClipRenderer::__videoStopped()
{
emit frameChanged( 0, MainWorkflow::Renderer );
emit frameChanged( 0, Vlmc::Renderer );
emit stopped();
}
......@@ -255,7 +255,7 @@ ClipRenderer::__timeChanged( qint64 time )
return ;
}
f = f - m_begin;
emit frameChanged( f, MainWorkflow::Renderer );
emit frameChanged( f, Vlmc::Renderer );
}
void
......
......@@ -204,7 +204,7 @@ signals:
* \param reason The reason for changing frame
*/
void frameChanged( qint64 newFrame,
MainWorkflow::FrameChangedReason reason );
Vlmc::FrameChangedReason reason );
/**
* \brief Emmited when render end is reached.
*
......
......@@ -46,7 +46,7 @@ void WorkflowFileRenderer::run( const QString& outputFileName, quint32 wi
quint32 height, double fps, quint32 vbitrate,
quint32 abitrate )
{
m_mainWorkflow->setCurrentFrame( 0, MainWorkflow::Renderer );
m_mainWorkflow->setCurrentFrame( 0, Vlmc::Renderer );
setupRenderer( width, height, fps );
......@@ -61,8 +61,8 @@ void WorkflowFileRenderer::run( const QString& outputFileName, quint32 wi
m_mediaPlayer->setMedia( m_media );
connect( m_mainWorkflow, SIGNAL( mainWorkflowEndReached() ), this, SLOT( stop() ) );
connect( m_mainWorkflow, SIGNAL( frameChanged( qint64, MainWorkflow::FrameChangedReason) ),
this, SLOT( __frameChanged( qint64,MainWorkflow::FrameChangedReason ) ) );
connect( m_mainWorkflow, SIGNAL( frameChanged( qint64, Vlmc::FrameChangedReason) ),
this, SLOT( __frameChanged( qint64,Vlmc::FrameChangedReason ) ) );
m_isRendering = true;
m_stopping = false;
......@@ -118,7 +118,7 @@ WorkflowFileRenderer::lock( void *datas, const char* cookie, qint64 *dts, qint64
}
void
WorkflowFileRenderer::__frameChanged( qint64 frame, MainWorkflow::FrameChangedReason )
WorkflowFileRenderer::__frameChanged( qint64 frame, Vlmc::FrameChangedReason )
{
emit frameChanged( frame );
}
......
......@@ -64,7 +64,7 @@ protected:
private slots:
void stop();
void __frameChanged( qint64 frame,
MainWorkflow::FrameChangedReason reason );
Vlmc::FrameChangedReason reason );
void __endReached();
signals:
......
......@@ -65,8 +65,8 @@ void WorkflowRenderer::initializeRenderer()
//Workflow part
connect( m_mainWorkflow, SIGNAL( mainWorkflowEndReached() ), this, SLOT( __endReached() ), Qt::QueuedConnection );
connect( m_mainWorkflow, SIGNAL( frameChanged( qint64, MainWorkflow::FrameChangedReason ) ),
this, SIGNAL( frameChanged( qint64, MainWorkflow::FrameChangedReason ) ) );
connect( m_mainWorkflow, SIGNAL( frameChanged( qint64, Vlmc::FrameChangedReason ) ),
this, SIGNAL( frameChanged( qint64, Vlmc::FrameChangedReason ) ) );
connect( m_mainWorkflow, SIGNAL( lengthChanged( qint64 ) ),
this, SLOT(mainWorkflowLenghtChanged(qint64) ) );
//Media player part: to update PreviewWidget
......@@ -339,17 +339,17 @@ float WorkflowRenderer::getFps() const
void WorkflowRenderer::timelineCursorChanged( qint64 newFrame )
{
m_mainWorkflow->setCurrentFrame( newFrame, MainWorkflow::TimelineCursor );
m_mainWorkflow->setCurrentFrame( newFrame, Vlmc::TimelineCursor );
}
void WorkflowRenderer::previewWidgetCursorChanged( qint64 newFrame )
{
m_mainWorkflow->setCurrentFrame( newFrame, MainWorkflow::PreviewCursor );
m_mainWorkflow->setCurrentFrame( newFrame, Vlmc::PreviewCursor );
}
void WorkflowRenderer::rulerCursorChanged( qint64 newFrame )
{
m_mainWorkflow->setCurrentFrame( newFrame, MainWorkflow::RulerCursor );
m_mainWorkflow->setCurrentFrame( newFrame, Vlmc::RulerCursor );
}
void* WorkflowRenderer::getLockCallback()
......
......@@ -152,7 +152,7 @@ MainWorkflow::nextFrame( Workflow::TrackType trackType )
++m_currentFrame[trackType];
if ( trackType == Workflow::VideoTrack )
emit frameChanged( m_currentFrame[Workflow::VideoTrack], Renderer );
emit frameChanged( m_currentFrame[Workflow::VideoTrack], Vlmc::Renderer );
}
void
......@@ -162,7 +162,7 @@ MainWorkflow::previousFrame( Workflow::TrackType trackType )
--m_currentFrame[trackType];
if ( trackType == Workflow::VideoTrack )
emit frameChanged( m_currentFrame[Workflow::VideoTrack], Renderer );
emit frameChanged( m_currentFrame[Workflow::VideoTrack], Vlmc::Renderer );
}
qint64
......@@ -192,7 +192,7 @@ MainWorkflow::stop()
m_tracks[i]->stop();
m_currentFrame[i] = 0;
}
emit frameChanged( 0, Renderer );
emit frameChanged( 0, Vlmc::Renderer );
}
void
......@@ -257,7 +257,7 @@ MainWorkflow::unmuteClip( const QUuid& uuid, unsigned int trackId,
}
void
MainWorkflow::setCurrentFrame( qint64 currentFrame, MainWorkflow::FrameChangedReason reason )
MainWorkflow::setCurrentFrame( qint64 currentFrame, Vlmc::FrameChangedReason reason )
{
QWriteLocker lock( m_currentFrameLock );
......
......@@ -56,25 +56,6 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
Q_OBJECT
public:
/**
* \enum Used to know which part required a change of rendered frame.
* The main use of this enum is to avoid infinite information propagation
* such as the timeline informing itself that the frame as changed, which
* would cause a signal to be emmited to inform every other part that the
* rendered frame has changed, and so on.
*/
enum FrameChangedReason
{
Renderer, ///< Used by the WorkflowRenderer
/**
* \brief Used by the timeline cursor.
* \warning The timeline cursor is not the timeline ruler
*/
TimelineCursor,
PreviewCursor, ///< Used by the preview widget, when using the time cursor.
RulerCursor, ///< Used by the timeline's ruler.
};
/**
* \brief Add a clip to the workflow
*
......@@ -123,7 +104,7 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
(to avoid cyclic events)
*/
void setCurrentFrame( qint64 currentFrame,
MainWorkflow::FrameChangedReason reason );
Vlmc::FrameChangedReason reason );
/**
* \brief Get the workflow length in frames.
......@@ -436,7 +417,7 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
* from the MainWorkflow, this should be "Renderer"
*/
void frameChanged( qint64 newFrame,
MainWorkflow::FrameChangedReason reason );
Vlmc::FrameChangedReason reason );
/**
* \brief Emitted when workflow end is reached
......
......@@ -102,4 +102,26 @@ namespace Workflow
};
}
namespace Vlmc
{
/**
* \enum Used to know which part required a change of rendered frame.
* The main use of this enum is to avoid infinite information propagation
* such as the timeline informing itself that the frame as changed, which
* would cause a signal to be emmited to inform every other part that the
* rendered frame has changed, and so on.
*/
enum FrameChangedReason
{
Renderer, ///< Used by the WorkflowRenderer
/**
* \brief Used by the timeline cursor.
* \warning The timeline cursor is not the timeline ruler
*/
TimelineCursor,
PreviewCursor, ///< Used by the preview widget, when using the time cursor.
RulerCursor, ///< Used by the timeline's ruler.
};
}
#endif // TYPES_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