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()
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,
......@@ -112,7 +112,7 @@ void *VideoWidget::Request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
p_vout = p_nvout;
setMinimumSize( 1,1 );
p_intf->p_sys->p_mi->videoSize = QSize( *pi_width, *pi_height );
widgetSize = QSize( *pi_width, *pi_height );
updateGeometry();
need_update = true;
return (void*)winId();
......@@ -128,7 +128,7 @@ void VideoWidget::Release( void *p_win )
p_vout = NULL;
if( config_GetInt( p_intf, "qt-always-video" ) == 0 )
{
p_intf->p_sys->p_mi->videoSize = QSize ( 1,1 );
widgetSize = QSize ( 1,1 );
updateGeometry();
need_update = true;
}
......@@ -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_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();
need_update = true;
i_ret = VLC_SUCCESS;
......@@ -219,6 +219,11 @@ int BackgroundWidget::CleanBackground()
return 0;
}
QSize BackgroundWidget::sizeHint() const
{
return widgetSize;
}
void BackgroundWidget::hasAudio()
{
/* We have video already, do nothing */
......@@ -240,3 +245,39 @@ void BackgroundWidget::resizeEvent( QResizeEvent *e )
else
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 @@
class QLabel;
class QHBoxLayout;
class QColor;
/******************** Video Widget ****************/
class VideoWidget : public QFrame
{
Q_OBJECT
......@@ -43,14 +43,16 @@ public:
VideoWidget( intf_thread_t * );
virtual ~VideoWidget();
virtual QSize sizeHint() const;
void *Request( vout_thread_t *, int *, int *,
unsigned int *, unsigned int * );
void Release( void * );
int Control( void *, int, va_list );
int i_video_height, i_video_width;
vout_thread_t *p_vout;
QSize widgetSize;
virtual QSize sizeHint() const;
private:
QWidget *frame;
intf_thread_t *p_intf;
......@@ -59,12 +61,15 @@ private slots:
void update();
};
/******************** Background Widget ****************/
class BackgroundWidget : public QFrame
{
Q_OBJECT
public:
BackgroundWidget( intf_thread_t * );
virtual ~BackgroundWidget();
QSize widgetSize;
virtual QSize sizeHint() const;
private:
QPalette plt;
QLabel *label;
......@@ -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
This diff is collapsed.
......@@ -28,13 +28,20 @@
#include "ui/main_interface.h"
#include "util/qvlcframe.hpp"
#include <QSize>
class QSettings;
class QCloseEvent;
class QKeyEvent;
class QLabel;
class InputManager;
class InputSlider;
class VideoWidget;
class BackgroundWidget;
class PlaylistWidget;
class VolumeClickHandler;
class MainInterface : public QVLCMW
{
Q_OBJECT;
......@@ -44,21 +51,33 @@ public:
void resizeEvent( QResizeEvent * );
QSize videoSize, addSize;
protected:
void closeEvent( QCloseEvent *);
Ui::MainInterfaceUI ui;
friend class VolumeClickHandler;
private:
QSettings *settings;
QSize mainSize, addSize;
void calculateInterfaceSize();
void handleMainUi( QSettings* );
virtual void keyPressEvent( QKeyEvent *);
VideoWidget *videoWidget;
InputManager *main_input_manager;
QLabel *timeLabel;
QLabel *nameLabel;
InputSlider *slider;
/// Main input associated to the playlist
input_thread_t *p_input;
/* All the stuff that goes in the main position */
VideoWidget *videoWidget;
BackgroundWidget *bgWidget;
PlaylistWidget *playlistWidget;
bool playlistEmbeddedFlag;
bool videoEmbeddedFlag;
InputManager *main_input_manager;
InputSlider *slider;
input_thread_t *p_input; ///< Main input associated to the playlist
QLabel *timeLabel;
QLabel *nameLabel;
private slots:
void setStatus( int );
void setName( QString );
......@@ -68,6 +87,7 @@ private slots:
void stop();
void prev();
void next();
void playlist();
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