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