Commit 9906af38 authored by Clément Stenac's avatar Clément Stenac

Rework of the embedded stuff. This breaks everything :)

parent 3dda1153
...@@ -92,7 +92,7 @@ VideoWidget::~VideoWidget() ...@@ -92,7 +92,7 @@ VideoWidget::~VideoWidget()
QSize VideoWidget::sizeHint() const QSize VideoWidget::sizeHint() const
{ {
return p_intf->p_sys->p_mi->videoSize; return widgetSize;
} }
static void *DoRequest( intf_thread_t *p_intf, vout_thread_t *p_vout, static void *DoRequest( intf_thread_t *p_intf, vout_thread_t *p_vout,
...@@ -112,7 +112,7 @@ void *VideoWidget::Request( vout_thread_t *p_nvout, int *pi_x, int *pi_y, ...@@ -112,7 +112,7 @@ void *VideoWidget::Request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
p_vout = p_nvout; p_vout = p_nvout;
setMinimumSize( 1,1 ); setMinimumSize( 1,1 );
p_intf->p_sys->p_mi->videoSize = QSize( *pi_width, *pi_height ); widgetSize = QSize( *pi_width, *pi_height );
updateGeometry(); updateGeometry();
need_update = true; need_update = true;
return (void*)winId(); return (void*)winId();
...@@ -128,7 +128,7 @@ void VideoWidget::Release( void *p_win ) ...@@ -128,7 +128,7 @@ void VideoWidget::Release( void *p_win )
p_vout = NULL; p_vout = NULL;
if( config_GetInt( p_intf, "qt-always-video" ) == 0 ) if( config_GetInt( p_intf, "qt-always-video" ) == 0 )
{ {
p_intf->p_sys->p_mi->videoSize = QSize ( 1,1 ); widgetSize = QSize ( 1,1 );
updateGeometry(); updateGeometry();
need_update = true; need_update = true;
} }
...@@ -161,7 +161,7 @@ int VideoWidget::Control( void *p_window, int i_query, va_list args ) ...@@ -161,7 +161,7 @@ int VideoWidget::Control( void *p_window, int i_query, va_list args )
if( !i_width && p_vout ) i_width = p_vout->i_window_width; if( !i_width && p_vout ) i_width = p_vout->i_window_width;
if( !i_height && p_vout ) i_height = p_vout->i_window_height; if( !i_height && p_vout ) i_height = p_vout->i_window_height;
p_intf->p_sys->p_mi->videoSize = QSize( i_width, i_height ); widgetSize = QSize( i_width, i_height );
updateGeometry(); updateGeometry();
need_update = true; need_update = true;
i_ret = VLC_SUCCESS; i_ret = VLC_SUCCESS;
...@@ -219,6 +219,11 @@ int BackgroundWidget::CleanBackground() ...@@ -219,6 +219,11 @@ int BackgroundWidget::CleanBackground()
return 0; return 0;
} }
QSize BackgroundWidget::sizeHint() const
{
return widgetSize;
}
void BackgroundWidget::hasAudio() void BackgroundWidget::hasAudio()
{ {
/* We have video already, do nothing */ /* We have video already, do nothing */
...@@ -240,3 +245,39 @@ void BackgroundWidget::resizeEvent( QResizeEvent *e ) ...@@ -240,3 +245,39 @@ void BackgroundWidget::resizeEvent( QResizeEvent *e )
else else
label->setMaximumWidth( ICON_SIZE ); label->setMaximumWidth( ICON_SIZE );
} }
/**********************************************************************
* Playlist Widget. The embedded playlist
**********************************************************************/
#include "components/playlist/panels.hpp"
#include "components/playlist/selector.hpp"
PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) : QFrame(NULL),
p_intf( _p_intf )
{
selector = new PLSelector( this, p_intf, THEPL );
selector->setMaximumWidth( 130 );
playlist_item_t *p_root = playlist_GetPreferredNode( THEPL,
THEPL->p_local_category );
rightPanel = qobject_cast<PLPanel *>(new StandardPLPanel( this,
p_intf, THEPL, p_root ) );
CONNECT( selector, activated( int ), rightPanel, setRoot( int ) );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( selector, 0 );
layout->addWidget( rightPanel, 10 );
setLayout( layout );
}
PlaylistWidget::~PlaylistWidget()
{
}
QSize PlaylistWidget::sizeHint() const
{
return widgetSize;
}
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
class QLabel; class QLabel;
class QHBoxLayout; class QHBoxLayout;
class QColor;
/******************** Video Widget ****************/
class VideoWidget : public QFrame class VideoWidget : public QFrame
{ {
Q_OBJECT Q_OBJECT
...@@ -43,14 +43,16 @@ public: ...@@ -43,14 +43,16 @@ public:
VideoWidget( intf_thread_t * ); VideoWidget( intf_thread_t * );
virtual ~VideoWidget(); virtual ~VideoWidget();
virtual QSize sizeHint() const;
void *Request( vout_thread_t *, int *, int *, void *Request( vout_thread_t *, int *, int *,
unsigned int *, unsigned int * ); unsigned int *, unsigned int * );
void Release( void * ); void Release( void * );
int Control( void *, int, va_list ); int Control( void *, int, va_list );
int i_video_height, i_video_width; int i_video_height, i_video_width;
vout_thread_t *p_vout; vout_thread_t *p_vout;
QSize widgetSize;
virtual QSize sizeHint() const;
private: private:
QWidget *frame; QWidget *frame;
intf_thread_t *p_intf; intf_thread_t *p_intf;
...@@ -59,12 +61,15 @@ private slots: ...@@ -59,12 +61,15 @@ private slots:
void update(); void update();
}; };
/******************** Background Widget ****************/
class BackgroundWidget : public QFrame class BackgroundWidget : public QFrame
{ {
Q_OBJECT Q_OBJECT
public: public:
BackgroundWidget( intf_thread_t * ); BackgroundWidget( intf_thread_t * );
virtual ~BackgroundWidget(); virtual ~BackgroundWidget();
QSize widgetSize;
virtual QSize sizeHint() const;
private: private:
QPalette plt; QPalette plt;
QLabel *label; QLabel *label;
...@@ -79,7 +84,24 @@ private slots: ...@@ -79,7 +84,24 @@ private slots:
}; };
/******************** Playlist Widget ****************/
#include <QModelIndex>
class QSignalMapper;
class PLSelector;
class PLPanel;
class PlaylistWidget : public QFrame
{
Q_OBJECT;
public:
PlaylistWidget( intf_thread_t * );
virtual ~PlaylistWidget();
QSize widgetSize;
virtual QSize sizeHint() const;
private:
PLSelector *selector;
PLPanel *rightPanel;
intf_thread_t *p_intf;
};
#endif #endif
This diff is collapsed.
...@@ -28,13 +28,20 @@ ...@@ -28,13 +28,20 @@
#include "ui/main_interface.h" #include "ui/main_interface.h"
#include "util/qvlcframe.hpp" #include "util/qvlcframe.hpp"
#include <QSize>
class QSettings;
class QCloseEvent; class QCloseEvent;
class QKeyEvent; class QKeyEvent;
class QLabel; class QLabel;
class InputManager; class InputManager;
class InputSlider; class InputSlider;
class VideoWidget; class VideoWidget;
class BackgroundWidget;
class PlaylistWidget;
class VolumeClickHandler; class VolumeClickHandler;
class MainInterface : public QVLCMW class MainInterface : public QVLCMW
{ {
Q_OBJECT; Q_OBJECT;
...@@ -44,21 +51,33 @@ public: ...@@ -44,21 +51,33 @@ public:
void resizeEvent( QResizeEvent * ); void resizeEvent( QResizeEvent * );
QSize videoSize, addSize;
protected: protected:
void closeEvent( QCloseEvent *); void closeEvent( QCloseEvent *);
Ui::MainInterfaceUI ui; Ui::MainInterfaceUI ui;
friend class VolumeClickHandler; friend class VolumeClickHandler;
private: private:
QSettings *settings;
QSize mainSize, addSize;
void calculateInterfaceSize();
void handleMainUi( QSettings* );
virtual void keyPressEvent( QKeyEvent *); virtual void keyPressEvent( QKeyEvent *);
/* All the stuff that goes in the main position */
VideoWidget *videoWidget; VideoWidget *videoWidget;
BackgroundWidget *bgWidget;
PlaylistWidget *playlistWidget;
bool playlistEmbeddedFlag;
bool videoEmbeddedFlag;
InputManager *main_input_manager; InputManager *main_input_manager;
InputSlider *slider;
input_thread_t *p_input; ///< Main input associated to the playlist
QLabel *timeLabel; QLabel *timeLabel;
QLabel *nameLabel; QLabel *nameLabel;
InputSlider *slider;
/// Main input associated to the playlist
input_thread_t *p_input;
private slots: private slots:
void setStatus( int ); void setStatus( int );
void setName( QString ); void setName( QString );
...@@ -68,6 +87,7 @@ private slots: ...@@ -68,6 +87,7 @@ private slots:
void stop(); void stop();
void prev(); void prev();
void next(); void next();
void playlist();
void updateVolume( int sliderVolume ); void updateVolume( int sliderVolume );
}; };
......
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