Commit 46b5dc71 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Corrected PreviewWidgets behavior

It just lacks a few graphic polish (for the sliders)
parent c4024fba
......@@ -57,7 +57,7 @@ void ClipPreviewWidget::setPosition( float newPos )
m_mediaPlayer->setPosition( newPos / 1000.0 );
}
void ClipPreviewWidget::togglePlayPause()
void ClipPreviewWidget::togglePlayPause( bool forcePause )
{
if ( m_clipLoaded == false)
return ;
......@@ -66,7 +66,7 @@ void ClipPreviewWidget::togglePlayPause()
if ( m_mediaPlayer->isPlaying() )
m_mediaPlayer->pause();
else
else if ( forcePause == false )
m_mediaPlayer->play();
}
......
......@@ -40,9 +40,9 @@ public:
explicit ClipPreviewWidget( QWidget* renderWidget );
virtual ~ClipPreviewWidget();
void startPreview( Media* media );
void setPosition( float newPos );
void togglePlayPause();
virtual void startPreview( Media* media );
virtual void setPosition( float newPos );
virtual void togglePlayPause( bool forcePause );
private:
bool m_clipLoaded;
......
......@@ -47,10 +47,14 @@ public:
virtual void startPreview( Media* media ) = 0;
virtual void setPosition( float newPos ) = 0;
virtual void togglePlayPause() = 0;
virtual void togglePlayPause( bool forcePause = false ) = 0;
/* float getPosition() const { return m_position; }
void setPosition( float pos ) { m_position = pos; }
*/
protected:
LibVLCpp::MediaPlayer* m_mediaPlayer;
// float m_position;
public slots:
virtual void __positionChanged() = 0;
......
......@@ -187,9 +187,14 @@ void PreviewWidget::endReached()
void PreviewWidget::changedTab( int tabId )
{
if ( tabId == PreviewWidget::clipPreviewMode )
{
m_currentPreviewRenderer = m_clipPreview;
}
else if ( tabId == PreviewWidget::renderPreviewMode )
{
m_clipPreview->togglePlayPause( true );
m_currentPreviewRenderer = m_renderPreview;
}
else
qDebug() << "Unknown and uncoherent tabId for PreviewWidget : " << tabId;
m_currentMode = !m_currentMode;
......
......@@ -37,11 +37,11 @@ void RenderPreviewWidget::startPreview( Media* )
{
}
void RenderPreviewWidget::setPosition( float newPos )
void RenderPreviewWidget::setPosition( float /*newPos*/ )
{
}
void RenderPreviewWidget::togglePlayPause()
void RenderPreviewWidget::togglePlayPause( bool /*forcePause*/ )
{
}
......
......@@ -42,7 +42,7 @@ class RenderPreviewWidget : public GenericPreviewWidget
virtual void startPreview( Media* );
virtual void setPosition( float newPos );
virtual void togglePlayPause();
virtual void togglePlayPause( bool forcePause );
private:
MainWorkflow* m_mainWorkflow;
......
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