Commit aad09b89 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - threads assertions fixes, docking playlist and size of main interfaces fixes.

parent d7a496b7
...@@ -238,12 +238,6 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i ) : ...@@ -238,12 +238,6 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i ) :
advLayout->addWidget( ABButton ); advLayout->addWidget( ABButton );
BUTTON_SET_ACT( ABButton, "AB", qtr( "A to B" ), fromAtoB() ); BUTTON_SET_ACT( ABButton, "AB", qtr( "A to B" ), fromAtoB() );
snapshotButton = new QPushButton( "S" );
snapshotButton->setMaximumSize( QSize( 26, 26 ) );
snapshotButton->setIconSize( QSize( 20, 20 ) );
advLayout->addWidget( snapshotButton );
BUTTON_SET_ACT( snapshotButton, "S", qtr( "Take a snapshot" ), snapshot() );
//FIXME Frame by frame function //FIXME Frame by frame function
frameButton = new QPushButton( "Fr" ); frameButton = new QPushButton( "Fr" );
frameButton->setMaximumSize( QSize( 26, 26 ) ); frameButton->setMaximumSize( QSize( 26, 26 ) );
...@@ -259,11 +253,11 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i ) : ...@@ -259,11 +253,11 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i ) :
BUTTON_SET_ACT_I( recordButton, "", record_16px.png, BUTTON_SET_ACT_I( recordButton, "", record_16px.png,
qtr( "Record" ), record() ); qtr( "Record" ), record() );
normalButton = new QPushButton( "N" ); snapshotButton = new QPushButton( "S" );
normalButton->setMaximumSize( QSize( 26, 26 ) ); snapshotButton->setMaximumSize( QSize( 26, 26 ) );
normalButton->setIconSize( QSize( 20, 20 ) ); snapshotButton->setIconSize( QSize( 20, 20 ) );
advLayout->addWidget( normalButton ); advLayout->addWidget( snapshotButton );
BUTTON_SET_ACT( normalButton, "N", qtr( "Normal rate" ), normal() ); BUTTON_SET_ACT( snapshotButton, "S", qtr( "Take a snapshot" ), snapshot() );
} }
...@@ -275,7 +269,6 @@ void AdvControlsWidget::enableInput( bool enable ) ...@@ -275,7 +269,6 @@ void AdvControlsWidget::enableInput( bool enable )
{ {
ABButton->setEnabled( enable ); ABButton->setEnabled( enable );
recordButton->setEnabled( enable ); recordButton->setEnabled( enable );
normalButton->setEnabled( enable );
} }
void AdvControlsWidget::enableVideo( bool enable ) void AdvControlsWidget::enableVideo( bool enable )
{ {
...@@ -283,11 +276,6 @@ void AdvControlsWidget::enableVideo( bool enable ) ...@@ -283,11 +276,6 @@ void AdvControlsWidget::enableVideo( bool enable )
frameButton->setEnabled( enable ); frameButton->setEnabled( enable );
} }
void AdvControlsWidget::normal()
{
THEMIM->getIM()->normalRate();
}
void AdvControlsWidget::snapshot() void AdvControlsWidget::snapshot()
{ {
vout_thread_t *p_vout = (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE ); vout_thread_t *p_vout = (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
...@@ -304,18 +292,10 @@ void AdvControlsWidget::record(){} ...@@ -304,18 +292,10 @@ void AdvControlsWidget::record(){}
ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) : ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
QFrame( NULL ), p_intf( _p_i ) QFrame( NULL ), p_intf( _p_i )
{ {
//QSize size( 500, 200 );
//resize( size );
controlLayout = new QGridLayout( this ); controlLayout = new QGridLayout( this );
controlLayout->setSpacing( 0 ); controlLayout->setSpacing( 0 );
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum ); setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum );
#if DEBUG_COLOR
QPalette palette2;
palette2.setColor(this->backgroundRole(), Qt::magenta);
setPalette(palette2);
#endif
/** The main Slider **/ /** The main Slider **/
slider = new InputSlider( Qt::Horizontal, NULL ); slider = new InputSlider( Qt::Horizontal, NULL );
controlLayout->addWidget( slider, 0, 1, 1, 16 ); controlLayout->addWidget( slider, 0, 1, 1, 16 );
...@@ -327,27 +307,26 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) : ...@@ -327,27 +307,26 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
THEMIM->getIM(), sliderUpdate( float ) ); THEMIM->getIM(), sliderUpdate( float ) );
/** Slower and faster Buttons **/ /** Slower and faster Buttons **/
slowerButton = new QPushButton( "S" ); slowerButton = new QPushButton;
slowerButton->setFlat( true ); slowerButton->setFlat( true );
slowerButton->setMaximumSize( QSize( 26, 20 ) );
BUTTON_SET_ACT( slowerButton, "S", qtr( "Slower" ), slower() ); BUTTON_SET_ACT( slowerButton, "-", qtr( "Slower" ), slower() );
controlLayout->addWidget( slowerButton, 0, 0 ); controlLayout->addWidget( slowerButton, 0, 0 );
slowerButton->setMaximumSize( QSize( 26, 20 ) );
fasterButton = new QPushButton( "F" ); fasterButton = new QPushButton;
fasterButton->setFlat( true ); fasterButton->setFlat( true );
fasterButton->setMaximumSize( QSize( 26, 20 ) );
BUTTON_SET_ACT( fasterButton, "F", qtr( "Faster" ), faster() ); BUTTON_SET_ACT( fasterButton, "+", qtr( "Faster" ), faster() );
controlLayout->addWidget( fasterButton, 0, 17 ); controlLayout->addWidget( fasterButton, 0, 17 );
fasterButton->setMaximumSize( QSize( 26, 20 ) );
/* advanced Controls handling */ /* advanced Controls handling */
b_advancedVisible = b_advControls; b_advancedVisible = b_advControls;
advControls = new AdvControlsWidget( p_intf ); advControls = new AdvControlsWidget( p_intf );
controlLayout->addWidget( advControls, 1, 3, 2, 5, Qt::AlignBottom ); controlLayout->addWidget( advControls, 1, 3, 2, 4, Qt::AlignBottom );
if( !b_advancedVisible ) advControls->hide(); if( !b_advancedVisible ) advControls->hide();
// FIXME THIS should be removed. need_components_update = true;
/** Disc and Menus handling */ /** Disc and Menus handling */
discFrame = new QFrame( this ); discFrame = new QFrame( this );
...@@ -389,6 +368,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) : ...@@ -389,6 +368,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
/** TODO /** TODO
* Telextext QFrame * Telextext QFrame
* Merge with upper menu in a StackLayout
**/ **/
/** Play Buttons **/ /** Play Buttons **/
...@@ -481,7 +461,6 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) : ...@@ -481,7 +461,6 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
/** TODO: /** TODO:
* Change this slider to use a nice Amarok-like one * Change this slider to use a nice Amarok-like one
* Add a Context menu to change to the most useful %
* **/ * **/
/** FIXME /** FIXME
* THis percerntage thing has to be handled correctly * THis percerntage thing has to be handled correctly
...@@ -587,7 +566,7 @@ void ControlsWidget::updateOnTimer() ...@@ -587,7 +566,7 @@ void ControlsWidget::updateOnTimer()
volumeSlider->setValue( i_volume ); volumeSlider->setValue( i_volume );
b_my_volume = false; b_my_volume = false;
} }
/* Activate the interface buttons according to the presence of the input */ /* Activate the interface buttons according to the presence of the input */
enableInput( THEMIM->getIM()->hasInput() ); enableInput( THEMIM->getIM()->hasInput() );
//enableVideo( THEMIM->getIM()->hasVideo() ); //enableVideo( THEMIM->getIM()->hasVideo() );
...@@ -744,21 +723,16 @@ PlaylistWidget::~PlaylistWidget() ...@@ -744,21 +723,16 @@ PlaylistWidget::~PlaylistWidget()
{ {
} }
QSize PlaylistWidget::sizeHint() const
{
return widgetSize;
}
/********************************************************************** /**********************************************************************
* Speed control widget * Speed control widget
**********************************************************************/ **********************************************************************/
SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i ) : SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i ) :
QFrame( NULL ), p_intf( _p_i ) QFrame( NULL ), p_intf( _p_i )
{ {
QSizePolicy sizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed ); QSizePolicy sizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed );
sizePolicy.setHorizontalStretch( 0 ); sizePolicy.setHorizontalStretch( 0 );
sizePolicy.setVerticalStretch( 0 ); sizePolicy.setVerticalStretch( 0 );
speedSlider = new QSlider; speedSlider = new QSlider;
speedSlider->setSizePolicy( sizePolicy ); speedSlider->setSizePolicy( sizePolicy );
speedSlider->setMaximumSize( QSize( 80, 200 ) ); speedSlider->setMaximumSize( QSize( 80, 200 ) );
...@@ -769,16 +743,16 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i ) : ...@@ -769,16 +743,16 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i ) :
speedSlider->setSingleStep( 10 ); speedSlider->setSingleStep( 10 );
speedSlider->setPageStep( 20 ); speedSlider->setPageStep( 20 );
speedSlider->setTickInterval( 20 ); speedSlider->setTickInterval( 20 );
CONNECT( speedSlider, valueChanged( int ), this, updateRate( int ) ); CONNECT( speedSlider, valueChanged( int ), this, updateRate( int ) );
normalSpeedButton = new QPushButton( "N" ); normalSpeedButton = new QPushButton( "N" );
normalSpeedButton->setMaximumSize( QSize( 26, 20 ) ); normalSpeedButton->setMaximumSize( QSize( 26, 20 ) );
normalSpeedButton->setFlat( true ); normalSpeedButton->setFlat( true );
normalSpeedButton->setToolTip( qtr( "Revert to normal play speed" ) ); normalSpeedButton->setToolTip( qtr( "Revert to normal play speed" ) );
CONNECT( normalSpeedButton, clicked(), this, resetRate() ); CONNECT( normalSpeedButton, clicked(), this, resetRate() );
QVBoxLayout *speedControlLayout = new QVBoxLayout; QVBoxLayout *speedControlLayout = new QVBoxLayout;
speedControlLayout->addWidget(speedSlider); speedControlLayout->addWidget(speedSlider);
speedControlLayout->addWidget(normalSpeedButton); speedControlLayout->addWidget(normalSpeedButton);
...@@ -800,12 +774,12 @@ void SpeedControlWidget::updateControls( int rate ) ...@@ -800,12 +774,12 @@ void SpeedControlWidget::updateControls( int rate )
//We don't want to change anything if the user is using the slider //We don't want to change anything if the user is using the slider
return; return;
} }
int sliderValue; int sliderValue;
double speed = INPUT_RATE_DEFAULT / (double)rate; double speed = INPUT_RATE_DEFAULT / (double)rate;
if( rate >= INPUT_RATE_DEFAULT ) if( rate >= INPUT_RATE_DEFAULT )
{ {
if( speed < RATE_SLIDER_MINIMUM ) if( speed < RATE_SLIDER_MINIMUM )
{ {
sliderValue = speedSlider->minimum(); sliderValue = speedSlider->minimum();
...@@ -828,7 +802,7 @@ void SpeedControlWidget::updateControls( int rate ) ...@@ -828,7 +802,7 @@ void SpeedControlWidget::updateControls( int rate )
/ ( RATE_SLIDER_MAXIMUM - 1.0 ) ); / ( RATE_SLIDER_MAXIMUM - 1.0 ) );
} }
} }
//Block signals to avoid feedback loop //Block signals to avoid feedback loop
speedSlider->blockSignals( true ); speedSlider->blockSignals( true );
speedSlider->setValue( sliderValue ); speedSlider->setValue( sliderValue );
...@@ -838,7 +812,7 @@ void SpeedControlWidget::updateControls( int rate ) ...@@ -838,7 +812,7 @@ void SpeedControlWidget::updateControls( int rate )
void SpeedControlWidget::updateRate( int sliderValue ) void SpeedControlWidget::updateRate( int sliderValue )
{ {
int rate; int rate;
if( sliderValue < 0.0 ) if( sliderValue < 0.0 )
{ {
rate = INPUT_RATE_DEFAULT* RATE_SLIDER_LENGTH / rate = INPUT_RATE_DEFAULT* RATE_SLIDER_LENGTH /
...@@ -850,10 +824,10 @@ void SpeedControlWidget::updateRate( int sliderValue ) ...@@ -850,10 +824,10 @@ void SpeedControlWidget::updateRate( int sliderValue )
( sliderValue * ( RATE_SLIDER_MAXIMUM - 1.0 ) + RATE_SLIDER_LENGTH ); ( sliderValue * ( RATE_SLIDER_MAXIMUM - 1.0 ) + RATE_SLIDER_LENGTH );
} }
THEMIM->getIM()->setRate(rate); THEMIM->getIM()->setRate(rate);
} }
void SpeedControlWidget::resetRate() void SpeedControlWidget::resetRate()
{ {
THEMIM->getIM()->setRate(INPUT_RATE_DEFAULT); THEMIM->getIM()->setRate(INPUT_RATE_DEFAULT);
} }
...@@ -91,6 +91,7 @@ private: ...@@ -91,6 +91,7 @@ private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
public slots: public slots:
void setArt( QString ); void setArt( QString );
void toggle(){ TOGGLEV( this ); }
}; };
class VisualSelector : public QFrame class VisualSelector : public QFrame
...@@ -107,6 +108,7 @@ private slots: ...@@ -107,6 +108,7 @@ private slots:
void next(); void next();
}; };
/* Advanced Button Bar */
class QPushButton; class QPushButton;
class AdvControlsWidget : public QFrame class AdvControlsWidget : public QFrame
{ {
...@@ -114,22 +116,23 @@ class AdvControlsWidget : public QFrame ...@@ -114,22 +116,23 @@ class AdvControlsWidget : public QFrame
public: public:
AdvControlsWidget( intf_thread_t *); AdvControlsWidget( intf_thread_t *);
virtual ~AdvControlsWidget(); virtual ~AdvControlsWidget();
void enableInput( bool ); void enableInput( bool );
void enableVideo( bool ); void enableVideo( bool );
private: private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
QPushButton *normalButton, *recordButton, *ABButton; QPushButton *recordButton, *ABButton;
QPushButton *snapshotButton, *frameButton; QPushButton *snapshotButton, *frameButton;
private slots: private slots:
void normal();
void snapshot(); void snapshot();
void frame(); void frame();
void fromAtoB(); void fromAtoB();
void record(); void record();
}; };
/* Button Bar */
class InputSlider; class InputSlider;
class QSlider; class QSlider;
class QGridLayout; class QGridLayout;
...@@ -234,7 +237,6 @@ class PlaylistWidget : public QSplitter ...@@ -234,7 +237,6 @@ class PlaylistWidget : public QSplitter
public: public:
PlaylistWidget( intf_thread_t *_p_i ) ; PlaylistWidget( intf_thread_t *_p_i ) ;
virtual ~PlaylistWidget(); virtual ~PlaylistWidget();
QSize widgetSize;
virtual QSize sizeHint() const; virtual QSize sizeHint() const;
private: private:
PLSelector *selector; PLSelector *selector;
......
...@@ -44,8 +44,6 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -44,8 +44,6 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
setWindowTitle( qtr( "Playlist" ) ); setWindowTitle( qtr( "Playlist" ) );
setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) ); setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) );
createPlMenuBar( menuBar(), p_intf );
QHBoxLayout *l = new QHBoxLayout( centralWidget() ); QHBoxLayout *l = new QHBoxLayout( centralWidget() );
PlaylistWidget *plw = new PlaylistWidget( p_intf ); PlaylistWidget *plw = new PlaylistWidget( p_intf );
l->addWidget( plw ); l->addWidget( plw );
...@@ -58,27 +56,6 @@ PlaylistDialog::~PlaylistDialog() ...@@ -58,27 +56,6 @@ PlaylistDialog::~PlaylistDialog()
writeSettings( "playlist" ); writeSettings( "playlist" );
} }
void PlaylistDialog::createPlMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
{
QMenu *manageMenu = new QMenu();
manageMenu->setTitle( qtr("Manage") );
manageMenu->addAction( qtr("Open playlist file"), THEDP,
SLOT( openPlaylist() ), qtr( "Ctrl+X") );
manageMenu->addSeparator();
manageMenu->addAction( qtr("Dock playlist"), this, SLOT( dock() ),
qtr( "Ctrl+U" ) );
bar->addMenu( manageMenu );
bar->addMenu( QVLCMenu::SDMenu( p_intf ) );
}
void PlaylistDialog::dock()
{
hide();
QEvent *event = new QEvent( (QEvent::Type)(PLDockEvent_Type) );
QApplication::postEvent( p_intf->p_sys->p_mi, event );
}
void PlaylistDialog::dropEvent(QDropEvent *event) void PlaylistDialog::dropEvent(QDropEvent *event)
{ {
const QMimeData *mimeData = event->mimeData(); const QMimeData *mimeData = event->mimeData();
...@@ -104,4 +81,3 @@ void PlaylistDialog::dragLeaveEvent(QDragLeaveEvent *event) ...@@ -104,4 +81,3 @@ void PlaylistDialog::dragLeaveEvent(QDragLeaveEvent *event)
event->accept(); event->accept();
} }
...@@ -48,8 +48,6 @@ public: ...@@ -48,8 +48,6 @@ public:
} }
virtual ~PlaylistDialog(); virtual ~PlaylistDialog();
private: private:
void createPlMenuBar( QMenuBar *bar, intf_thread_t *p_intf );
PlaylistDialog( intf_thread_t * ); PlaylistDialog( intf_thread_t * );
void dropEvent( QDropEvent *); void dropEvent( QDropEvent *);
...@@ -58,11 +56,6 @@ private: ...@@ -58,11 +56,6 @@ private:
void dragLeaveEvent( QDragLeaveEvent * ); void dragLeaveEvent( QDragLeaveEvent * );
static PlaylistDialog *instance; static PlaylistDialog *instance;
PLSelector *selector;
PLPanel *rightPanel;
private slots:
void dock();
}; };
......
...@@ -258,6 +258,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -258,6 +258,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
var_AddCallback( p_playlist, "intf-show", IntfShowCB, p_intf ); var_AddCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
CONNECT( this, askReleaseVideo( void * ), this, releaseVideoSlot( void * ) );
// DEBUG FIXME // DEBUG FIXME
hide(); hide();
} }
...@@ -355,6 +358,7 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -355,6 +358,7 @@ void MainInterface::handleMainUi( QSettings *settings )
bgWidget->resize( bgWidget->widgetSize ); bgWidget->resize( bgWidget->widgetSize );
bgWidget->updateGeometry(); bgWidget->updateGeometry();
mainLayout->insertWidget( 0, bgWidget ); mainLayout->insertWidget( 0, bgWidget );
CONNECT( this, askBgWidgetToToggle(), bgWidget, toggle() );
} }
if( videoEmbeddedFlag ) if( videoEmbeddedFlag )
...@@ -367,8 +371,6 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -367,8 +371,6 @@ void MainInterface::handleMainUi( QSettings *settings )
p_intf->pf_request_window = ::DoRequest; p_intf->pf_request_window = ::DoRequest;
p_intf->pf_release_window = ::DoRelease; p_intf->pf_release_window = ::DoRelease;
p_intf->pf_control_window = ::DoControl; p_intf->pf_control_window = ::DoControl;
CONNECT( this, askVideoToHide(), videoWidget, hide() );
} }
/* Finish the sizing */ /* Finish the sizing */
...@@ -388,31 +390,26 @@ void MainInterface::calculateInterfaceSize() ...@@ -388,31 +390,26 @@ void MainInterface::calculateInterfaceSize()
int width = 0, height = 0; int width = 0, height = 0;
if( VISIBLE( bgWidget ) ) if( VISIBLE( bgWidget ) )
{ {
width = bgWidget->widgetSize.width(); width = bgWidget->widgetSize.width();
height = bgWidget->widgetSize.height(); height = bgWidget->widgetSize.height();
// assert( !(playlistWidget));// && playlistWidget->isVisible() ) );
}
else if( VISIBLE( playlistWidget ) )
{
width = playlistWidget->widgetSize.width();
height = playlistWidget->widgetSize.height();
} }
else if( videoIsActive ) else if( videoIsActive )
{ {
width = videoWidget->widgetSize.width() ; width = videoWidget->widgetSize.width() ;
height = videoWidget->widgetSize.height(); height = videoWidget->widgetSize.height();
} }
else else
{ {
width = PREF_W - addSize.width(); width = PREF_W - addSize.width();
height = PREF_H - addSize.height(); height = PREF_H - addSize.height();
} }
if( !dockPL->isFloating() )
{
width += dockPL->widget()->width();
height += dockPL->widget()->height();
}
if( VISIBLE( visualSelector ) ) if( VISIBLE( visualSelector ) )
height += visualSelector->height(); height += visualSelector->height();
/* if( VISIBLE( advControls) )
{
height += advControls->sizeHint().height();
}*/
mainSize = QSize( width + addSize.width(), height + addSize.height() ); mainSize = QSize( width + addSize.width(), height + addSize.height() );
} }
...@@ -428,18 +425,20 @@ void MainInterface::resizeEvent( QResizeEvent *e ) ...@@ -428,18 +425,20 @@ void MainInterface::resizeEvent( QResizeEvent *e )
} }
if( VISIBLE( playlistWidget ) ) if( VISIBLE( playlistWidget ) )
{ {
SET_WH( playlistWidget , e->size().width() - addSize.width(), //FIXME
e->size().height() - addSize.height() ); // SET_WH( playlistWidget , e->size().width() - addSize.width(),
// e->size().height() - addSize.height() );
playlistWidget->updateGeometry(); playlistWidget->updateGeometry();
} }
} }
/**************************************************************************** /****************************************************************************
* Small right-click menus * Small right-click menu for rate control
****************************************************************************/ ****************************************************************************/
void MainInterface::showSpeedMenu( QPoint pos ) void MainInterface::showSpeedMenu( QPoint pos )
{ {
speedControlMenu->exec( QCursor::pos() - pos + QPoint( 0, speedLabel->height() ) ); speedControlMenu->exec( QCursor::pos() - pos
+ QPoint( 0, speedLabel->height() ) );
} }
/**************************************************************************** /****************************************************************************
...@@ -467,22 +466,18 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x, ...@@ -467,22 +466,18 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
int *pi_y, unsigned int *pi_width, int *pi_y, unsigned int *pi_width,
unsigned int *pi_height ) unsigned int *pi_height )
{ {
msg_Dbg( p_intf, "I was here" );
void *ret = videoWidget->request( p_nvout,pi_x, pi_y, pi_width, pi_height ); void *ret = videoWidget->request( p_nvout,pi_x, pi_y, pi_width, pi_height );
if( ret ) if( ret )
{ {
videoIsActive = true; videoIsActive = true;
if( VISIBLE( playlistWidget ) )
{
embeddedPlaylistWasActive = true;
// playlistWidget->hide();
}
bool bgWasVisible = false; bool bgWasVisible = false;
if( VISIBLE( bgWidget) ) if( VISIBLE( bgWidget) )
{ {
bgWasVisible = true; bgWasVisible = true;
bgWidget->hide(); emit askBgWidgetToToggle();
} }
if( THEMIM->getIM()->hasVideo() || !bgWasVisible ) if( THEMIM->getIM()->hasVideo() || !bgWasVisible )
{ {
videoWidget->widgetSize = QSize( *pi_width, *pi_height ); videoWidget->widgetSize = QSize( *pi_width, *pi_height );
...@@ -501,9 +496,14 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x, ...@@ -501,9 +496,14 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
} }
void MainInterface::releaseVideo( void *p_win ) void MainInterface::releaseVideo( void *p_win )
{
emit askReleaseVideo( p_win );
}
void MainInterface::releaseVideoSlot( void *p_win )
{ {
videoWidget->release( p_win ); videoWidget->release( p_win );
emit askVideoToHide(); videoWidget->hide();
if( bgWidget ) if( bgWidget )
bgWidget->show(); bgWidget->show();
...@@ -515,7 +515,6 @@ void MainInterface::releaseVideo( void *p_win ) ...@@ -515,7 +515,6 @@ void MainInterface::releaseVideo( void *p_win )
int MainInterface::controlVideo( void *p_window, int i_query, va_list args ) int MainInterface::controlVideo( void *p_window, int i_query, va_list args )
{ {
int i_ret = VLC_EGENERIC; int i_ret = VLC_EGENERIC;
msg_Dbg( p_intf, "I was there" );
switch( i_query ) switch( i_query )
{ {
case VOUT_GET_SIZE: case VOUT_GET_SIZE:
...@@ -567,8 +566,9 @@ void MainInterface::togglePlaylist() ...@@ -567,8 +566,9 @@ void MainInterface::togglePlaylist()
if(bgWidget) if(bgWidget)
CONNECT( playlistWidget, artSet( QString ), bgWidget, setArt(QString) ); CONNECT( playlistWidget, artSet( QString ), bgWidget, setArt(QString) );
playlistWidget->widgetSize = settings->value( "playlistSize", //FIXME
QSize( 650, 310 ) ).toSize(); /* playlistWidget->widgetSize = settings->value( "playlistSize",
QSize( 650, 310 ) ).toSize();*/
/* Add it to the parent DockWidget */ /* Add it to the parent DockWidget */
dockPL->setWidget( playlistWidget ); dockPL->setWidget( playlistWidget );
...@@ -590,80 +590,13 @@ void MainInterface::togglePlaylist() ...@@ -590,80 +590,13 @@ void MainInterface::togglePlaylist()
/* toggle the display */ /* toggle the display */
TOGGLEV( dockPL ); TOGGLEV( dockPL );
} }
#if 0 // Toggle the playlist dialog if not embedded and return
if( !playlistEmbeddedFlag )
{
if( playlistWidget )
{
/// \todo Destroy it
}
return;
}
// Create the playlist Widget and destroy the existing dialog
if( !playlistWidget )
{
PlaylistDialog::killInstance();
mainLayout->insertWidget( 0, playlistWidget );
playlistWidget->hide();
}
// And toggle visibility
if( VISIBLE( playlistWidget ) )
{
playlistWidget->hide();
if( bgWidget ) bgWidget->show();
if( videoIsActive )
{
videoWidget->widgetSize = savedVideoSize;
videoWidget->resize( videoWidget->widgetSize );
videoWidget->updateGeometry();
if( bgWidget ) bgWidget->hide();
}
}
else
{
playlistWidget->show();
if( videoIsActive )
{
savedVideoSize = videoWidget->widgetSize;
videoWidget->widgetSize.setHeight( 0 );
videoWidget->resize( videoWidget->widgetSize );
videoWidget->updateGeometry();
}
if( VISIBLE( bgWidget ) ) bgWidget->hide();
}
#endif
doComponentsUpdate(); doComponentsUpdate();
} }
void MainInterface::undockPlaylist() void MainInterface::undockPlaylist()
{ {
dockPL->setFloating( true ); dockPL->setFloating( true );
#if 0 doComponentsUpdate();
if( playlistWidget )
{
playlistWidget->hide();
playlistWidget->deleteLater();
mainLayout->removeWidget( playlistWidget );
playlistWidget = NULL;
playlistEmbeddedFlag = false;
menuBar()->clear();
QVLCMenu::createMenuBar( this, p_intf, false, visualSelectorEnabled);
if( videoIsActive )
{
videoWidget->widgetSize = savedVideoSize;
videoWidget->resize( videoWidget->widgetSize );
videoWidget->updateGeometry();
}
doComponentsUpdate();
THEDP->playlistDialog();
}
#endif
} }
#if 0 #if 0
......
...@@ -78,7 +78,7 @@ protected: ...@@ -78,7 +78,7 @@ protected:
void dragMoveEvent( QDragMoveEvent * ); void dragMoveEvent( QDragMoveEvent * );
void dragLeaveEvent( QDragLeaveEvent * ); void dragLeaveEvent( QDragLeaveEvent * );
void closeEvent( QCloseEvent *); void closeEvent( QCloseEvent *);
friend class VolumeClickHandler; friend class VolumeClickHandler;
private: private:
QSettings *settings; QSettings *settings;
...@@ -135,6 +135,10 @@ public slots: ...@@ -135,6 +135,10 @@ public slots:
void togglePlaylist(); void togglePlaylist();
void toggleUpdateSystrayMenu(); void toggleUpdateSystrayMenu();
void toggleAdvanced(); void toggleAdvanced();
/* Manage the Video Functions from the vout threads */
void releaseVideoSlot( void * );
private slots: private slots:
void debug(); void debug();
void updateOnTimer(); void updateOnTimer();
...@@ -153,7 +157,9 @@ private slots: ...@@ -153,7 +157,9 @@ private slots:
void updateSystrayTooltipStatus( int ); void updateSystrayTooltipStatus( int );
void showSpeedMenu( QPoint ); void showSpeedMenu( QPoint );
signals: signals:
void askVideoToHide(); void askReleaseVideo( void * );
void askVideoToToggle();
void askBgWidgetToToggle();
}; };
#endif #endif
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