Commit 4396baf0 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4: Controller Rework.

Introduction of an abstractController, that can:
- create most of the interface controller widgets
- execute their actions

All buttons connect themselve to a mapper and a doAction( id_action )
that centralize everything. The Action could go into a mainActionner, I guess. Opinions?

This cleans a lot the signal and exchanges between MI and Controller,
between Controller and FSC. The buttons do their own cooking and connect
directly to THEMIM or to some of the few signals of the Controller
(inputExist, inputHasVideo, inputCanRecord)

This reworks most of the HACKS of Teletext Buttons and AtoB Buttons

The FSC inherit from AbstractController and not Controller, which remove the b_fscreation HACK.

There will be some regressions, I tried my best to minimize them.

The code is generic enough to be able to customize the toolbars now. HAVE FUN!
parent 08cbd4da
This diff is collapsed.
...@@ -39,108 +39,185 @@ ...@@ -39,108 +39,185 @@
#include <QWidget> #include <QWidget>
#include <QFrame> #include <QFrame>
#include <QToolButton>
class QPixmap; class QPixmap;
class QLabel; class QLabel;
class QHBoxLayout; class QGridLayout;
/* Advanced Button Bar */ class InputSlider;
class QPushButton; class QAbstractSlider;
class AdvControlsWidget : public QFrame
class QAbstractButton;
class VolumeClickHandler;
class QSignalMapper;
typedef enum buttonType_e
{
PLAY_BUTTON,
PAUSE_BUTTON,
STOP_BUTTON,
OPEN_BUTTON,
PREVIOUS_BUTTON,
NEXT_BUTTON,
SLOWER_BUTTON,
FASTER_BUTTON,
FULLSCREEN_BUTTON,
EXTENDED_BUTTON,
PLAYLIST_BUTTON,
SNAPSHOT_BUTTON,
RECORD_BUTTON,
ATOB_BUTTON,
#if 0
FRAME_BUTTON,
#endif
INPUT_SLIDER,
VOLUME_SLIDER,
MENU_BUTTONS,
TELETEXT_BUTTONS,
VOLUME,
} buttonType_e;
typedef enum actionType_e
{
PLAY_ACTION,
PAUSE_ACTION,
STOP_ACTION,
PREVIOUS_ACTION,
NEXT_ACTION,
SLOWER_ACTION,
FASTER_ACTION,
FULLSCREEN_ACTION,
EXTENDED_ACTION,
PLAYLIST_ACTION,
SNAPSHOT_ACTION,
RECORD_ACTION,
ATOB_ACTION
} actionType_e;
class AbstractController : public QFrame
{ {
Q_OBJECT Q_OBJECT
public: public:
AdvControlsWidget( intf_thread_t *, bool ); AbstractController( intf_thread_t *_p_i );
virtual ~AdvControlsWidget(); virtual ~AbstractController() {};
void enableInput( bool );
void enableVideo( bool );
private: protected:
intf_thread_t *p_intf; intf_thread_t *p_intf;
QPushButton *recordButton, *ABButton;
QPushButton *snapshotButton, *frameButton;
static mtime_t timeA, timeB; QSignalMapper *toolbarActionsMapper;
int i_last_input_id; QGridLayout *controlLayout;
QWidget *createWidget( buttonType_e, bool b_flat = false,
bool b_big = false, bool b_shiny = false );
void setupButton( QAbstractButton * );
private:
QWidget *discFrame();
QWidget *telexFrame();
private slots: private slots:
void doAction( int );
protected slots:
void play();
void stop();
void prev();
void next();
void fullscreen();
void extSettings();
void faster();
void slower();
void playlist();
void snapshot(); void snapshot();
void record();
#if 0 #if 0
void frame(); void frame();
#endif #endif
void fromAtoB();
void record(); virtual void setStatus( int );
void AtoBLoop( float, int, int );
void setIcon();
signals: signals:
void timeChanged(); void inputExists( bool ); /// This might be usefull in the IM ?
void inputPlaying( bool ); /// This might be usefull in the IM ?
void inputIsRecordable( bool ); /// same ?
}; };
/* Button Bar */ class PlayButton : public QToolButton
class InputSlider; {
class QSlider; Q_OBJECT
class QGridLayout; private slots:
class VolumeClickHandler; void updateButton( bool );
class SoundSlider; };
class QAbstractSlider;
class QToolButton;
class ControlsWidget : public QFrame class AtoB_Button : public QToolButton
{ {
Q_OBJECT Q_OBJECT
public: private slots:
/* p_intf, advanced control visible or not, blingbling or not */ void setIcons( bool, bool );
ControlsWidget( intf_thread_t *_p_i, MainInterface *_p_mi, };
bool b_advControls, bool b_shiny, bool b_fsCreation = false);
virtual ~ControlsWidget();
QPushButton *playlistButton; class TeletextController : public QWidget
void setStatus( int ); {
void enableInput( bool ); Q_OBJECT
public slots: friend class AbstractController;
void setNavigation( int ); private:
protected: QToolButton *telexTransparent, *telexOn;
friend class MainInterface; QSpinBox *telexPage;
private slots:
void enableTeletextButtons( bool );
void toggleTeletextTransparency( bool );
};
class SoundWidget : public QWidget
{
Q_OBJECT
friend class VolumeClickHandler; friend class VolumeClickHandler;
protected:
public:
SoundWidget( intf_thread_t *_p_i, bool );
private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
QWidget *discFrame;
QWidget *telexFrame;
QGridLayout *controlLayout;
InputSlider *slider;
QPushButton *prevSectionButton, *nextSectionButton, *menuButton;
QPushButton *playButton, *fullscreenButton, *extSettingsButton;
QPushButton *telexTransparent, *telexOn;
QSpinBox *telexPage;
QToolButton *slowerButton, *fasterButton;
QHBoxLayout *controlButLayout;
AdvControlsWidget *advControls;
QLabel *volMuteLabel; QLabel *volMuteLabel;
QAbstractSlider *volumeSlider; QAbstractSlider *volumeSlider;
VolumeClickHandler *hVolLabel; VolumeClickHandler *hVolLabel;
bool b_my_volume;
bool b_advancedVisible;
bool b_telexTransparent;
bool b_telexEnabled;
protected slots: protected slots:
void play();
void stop();
void prev();
void next();
void updateVolume( int ); void updateVolume( int );
void updateVolume( void ); void updateVolume( void );
void updateInput(); };
void fullscreen();
void extSettings(); /* Advanced Button Bar */
void faster(); class AdvControlsWidget : public AbstractController
void slower(); {
Q_OBJECT
public:
AdvControlsWidget( intf_thread_t * );
virtual ~AdvControlsWidget();
};
/* Button Bar */
class ControlsWidget : public AbstractController
{
Q_OBJECT
public:
/* p_intf, advanced control visible or not, blingbling or not */
ControlsWidget( intf_thread_t *_p_i, bool b_advControls );
virtual ~ControlsWidget();
protected:
friend class MainInterface;
AdvControlsWidget *advControls;
bool b_advancedVisible;
protected slots:
void toggleAdvanced(); void toggleAdvanced();
void toggleTeletext();
void toggleTeletextTransparency();
void enableTeletext( bool );
void enableVideo( bool );
signals: signals:
void advancedControlsToggled( bool ); void advancedControlsToggled( bool );
}; };
...@@ -166,25 +243,24 @@ signals: ...@@ -166,25 +243,24 @@ signals:
/*********************************** /***********************************
* Fullscreen controller * Fullscreen controller
***********************************/ ***********************************/
class FullscreenControllerWidget : public ControlsWidget class FullscreenControllerWidget : public AbstractController
{ {
Q_OBJECT Q_OBJECT
public: public:
FullscreenControllerWidget( intf_thread_t *, MainInterface*, bool, bool ); FullscreenControllerWidget( intf_thread_t * );
virtual ~FullscreenControllerWidget(); virtual ~FullscreenControllerWidget();
/* */ /* Vout */
vout_thread_t *p_vout;
void attachVout( vout_thread_t *p_vout ); void attachVout( vout_thread_t *p_vout );
void detachVout(); void detachVout();
void fullscreenChanged( vout_thread_t *, bool b_fs, int i_timeout ); void fullscreenChanged( vout_thread_t *, bool b_fs, int i_timeout );
vout_thread_t *p_vout;
int i_mouse_last_move_x; int i_mouse_last_move_x;
int i_mouse_last_move_y; int i_mouse_last_move_y;
protected: protected:
friend class MainInterface; friend class MainInterface;
friend class VolumeClickHandler;
virtual void mouseMoveEvent( QMouseEvent *event ); virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mousePressEvent( QMouseEvent *event ); virtual void mousePressEvent( QMouseEvent *event );
...@@ -196,31 +272,25 @@ private slots: ...@@ -196,31 +272,25 @@ private slots:
void showFSC(); void showFSC();
void planHideFSC(); void planHideFSC();
void hideFSC(); void hideFSC();
void slowHideFSC(); void slowHideFSC();
private: private:
virtual void customEvent( QEvent *event );
QTimer *p_hideTimer; QTimer *p_hideTimer;
#if HAVE_TRANSPARENCY #if HAVE_TRANSPARENCY
QTimer *p_slowHideTimer; QTimer *p_slowHideTimer;
bool b_slow_hide_begin;
int i_slow_hide_timeout;
#endif #endif
int i_mouse_last_x; int i_mouse_last_x, i_mouse_last_y;
int i_mouse_last_y;
bool b_mouse_over; bool b_mouse_over;
bool b_slow_hide_begin;
int i_slow_hide_timeout;
#ifdef WIN32TRICK #ifdef WIN32TRICK
bool b_fscHidden; bool b_fscHidden;
#endif #endif
virtual void customEvent( QEvent *event );
/* Shared variable between FSC and VLC (protected by a lock) */ /* Shared variable between FSC and VLC (protected by a lock) */
vlc_mutex_t lock; vlc_mutex_t lock;
bool b_fullscreen; bool b_fullscreen;
......
...@@ -527,7 +527,7 @@ bool VolumeClickHandler::eventFilter( QObject *obj, QEvent *e ) ...@@ -527,7 +527,7 @@ bool VolumeClickHandler::eventFilter( QObject *obj, QEvent *e )
aout_VolumeMute( p_intf, NULL ); aout_VolumeMute( p_intf, NULL );
audio_volume_t i_volume; audio_volume_t i_volume;
aout_VolumeGet( p_intf, &i_volume ); aout_VolumeGet( p_intf, &i_volume );
m->updateVolume( i_volume * VOLUME_MAX / (AOUT_VOLUME_MAX/2) ); // m->updateVolume( i_volume * VOLUME_MAX / (AOUT_VOLUME_MAX/2) );
return true; return true;
} }
return false; return false;
......
...@@ -127,12 +127,12 @@ private slots: ...@@ -127,12 +127,12 @@ private slots:
class VolumeClickHandler : public QObject class VolumeClickHandler : public QObject
{ {
public: public:
VolumeClickHandler( intf_thread_t *_p_intf, ControlsWidget *_m ) : QObject(_m) VolumeClickHandler( intf_thread_t *_p_intf, SoundWidget *_m ) : QObject(_m)
{m = _m; p_intf = _p_intf; } {m = _m; p_intf = _p_intf; }
virtual ~VolumeClickHandler() {}; virtual ~VolumeClickHandler() {};
virtual bool eventFilter( QObject *obj, QEvent *e ); virtual bool eventFilter( QObject *obj, QEvent *e );
private: private:
ControlsWidget *m; SoundWidget *m;
intf_thread_t *p_intf; intf_thread_t *p_intf;
}; };
......
...@@ -72,7 +72,9 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) : ...@@ -72,7 +72,9 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
i_rate = 0; i_rate = 0;
i_input_id = 0; i_input_id = 0;
b_video = false; b_video = false;
b_transparentTelextext = false; timeA = 0;
timeB = 0;
} }
InputManager::~InputManager() InputManager::~InputManager()
...@@ -121,6 +123,8 @@ void InputManager::delInput() ...@@ -121,6 +123,8 @@ void InputManager::delInput()
old_name = ""; old_name = "";
artUrl = ""; artUrl = "";
b_video = false; b_video = false;
timeA = 0;
timeB = 0;
emit positionUpdated( -1.0, 0 ,0 ); emit positionUpdated( -1.0, 0 ,0 );
emit statusChanged( END_S ); emit statusChanged( END_S );
emit nameChanged( "" ); emit nameChanged( "" );
...@@ -278,18 +282,19 @@ void InputManager::UpdateNavigation() ...@@ -278,18 +282,19 @@ void InputManager::UpdateNavigation()
{ {
/* Update navigation status */ /* Update navigation status */
vlc_value_t val; val.i_int = 0; vlc_value_t val; val.i_int = 0;
if( hasInput() ) if( hasInput() )
var_Change( p_input, "title", VLC_VAR_CHOICESCOUNT, &val, NULL ); var_Change( p_input, "title", VLC_VAR_CHOICESCOUNT, &val, NULL );
if( val.i_int > 0 ) if( val.i_int > 0 )
{ {
emit titleChanged( true );
val.i_int = 0; val.i_int = 0;
var_Change( p_input, "chapter", VLC_VAR_CHOICESCOUNT, &val, NULL ); var_Change( p_input, "chapter", VLC_VAR_CHOICESCOUNT, &val, NULL );
emit navigationChanged( (val.i_int > 0) ? 1 : 2 ); emit chapterChanged( (val.i_int > 0) );
} }
else else
{ emit titleChanged( false );
emit navigationChanged( 0 );
}
} }
void InputManager::UpdateStatus() void InputManager::UpdateStatus()
...@@ -386,9 +391,9 @@ void InputManager::UpdateSPU() ...@@ -386,9 +391,9 @@ void InputManager::UpdateSPU()
void InputManager::UpdateTeletext() void InputManager::UpdateTeletext()
{ {
if( hasInput() ) if( hasInput() )
telexToggle( var_GetInteger( p_input, "teletext-es" ) >= 0 ); telexActivation( var_GetInteger( p_input, "teletext-es" ) >= 0 );
else else
telexToggle( false ); telexActivation( false );
} }
void InputManager::UpdateVout() void InputManager::UpdateVout()
...@@ -474,7 +479,12 @@ void InputManager::sectionMenu() ...@@ -474,7 +479,12 @@ void InputManager::sectionMenu()
} }
} }
void InputManager::telexGotoPage( int page ) /*
* Teletext Functions
*/
/* Set a new Teletext Page */
void InputManager::telexSetPage( int page )
{ {
if( hasInput() ) if( hasInput() )
{ {
...@@ -483,80 +493,78 @@ void InputManager::telexGotoPage( int page ) ...@@ -483,80 +493,78 @@ void InputManager::telexGotoPage( int page )
if( i_teletext_es >= 0 && i_teletext_es == i_spu_es ) if( i_teletext_es >= 0 && i_teletext_es == i_spu_es )
{ {
vlc_object_t *p_vbi; vlc_object_t *p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
"zvbi", FIND_ANYWHERE ); "zvbi", FIND_ANYWHERE );
if( p_vbi ) if( p_vbi )
{ {
var_SetInteger( p_vbi, "vbi-page", page ); var_SetInteger( p_vbi, "vbi-page", page );
vlc_object_release( p_vbi ); vlc_object_release( p_vbi );
emit newTelexPageSet( page );
} }
} }
} }
emit setNewTelexPage( page );
} }
void InputManager::telexToggle( bool b_enabled ) /* Set the transparency on teletext */
void InputManager::telexSetTransparency( bool b_transparentTelextext )
{ {
if( hasInput() ) if( hasInput() )
{ {
const int i_teletext_es = var_GetInteger( p_input, "teletext-es" ); vlc_object_t *p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
const int i_spu_es = var_GetInteger( p_input, "spu-es" );
b_enabled = (i_teletext_es >= 0);
emit teletextEnabled( b_enabled );
if( b_enabled && (i_teletext_es == i_spu_es) )
{
vlc_object_t *p_vbi;
int i_page = 100;
p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
"zvbi", FIND_ANYWHERE ); "zvbi", FIND_ANYWHERE );
if( p_vbi ) if( p_vbi )
{ {
i_page = var_GetInteger( p_vbi, "vbi-page" ); var_SetBool( p_vbi, "vbi-opaque", b_transparentTelextext );
vlc_object_release( p_vbi ); vlc_object_release( p_vbi );
i_page = b_enabled ? i_page : 0; emit teletextTransparencyActivated( b_transparentTelextext );
telexGotoPage( i_page );
}
} }
} }
else emit teletextEnabled( b_enabled );
} }
void InputManager::telexToggleButtons() void InputManager::telexActivation( bool b_enabled )
{ {
if( hasInput() ) if( hasInput() )
{ {
const int i_teletext_es = var_GetInteger( p_input, "teletext-es" ); const int i_teletext_es = var_GetInteger( p_input, "teletext-es" );
if( i_teletext_es >= 0 )
{
const int i_spu_es = var_GetInteger( p_input, "spu-es" ); const int i_spu_es = var_GetInteger( p_input, "spu-es" );
/* Teletext is possible. Show the buttons */
b_enabled = (i_teletext_es >= 0);
emit teletextPossible( b_enabled );
if( !b_enabled ) return;
/* If Teletext is selected */
if( i_teletext_es == i_spu_es ) if( i_teletext_es == i_spu_es )
var_SetInteger( p_input, "spu-es", -1 ); {
else /* Activate the buttons */
var_SetInteger( p_input, "spu-es", i_teletext_es ); teletextActivated( true );
emit toggleTelexButtons(); /* Then, find the current page */
int i_page = 100;
vlc_object_t *p_vbi = (vlc_object_t *)
vlc_object_find_name( p_input, "zvbi", FIND_ANYWHERE );
if( p_vbi )
{
i_page = var_GetInteger( p_vbi, "vbi-page" );
vlc_object_release( p_vbi );
emit newTelexPageSet( i_page );
} }
} }
}
else
emit teletextPossible( b_enabled );
} }
void InputManager::telexSetTransparency() void InputManager::activateTeletext( bool b_enable )
{ {
if( hasInput() ) if( hasInput() )
{ {
vlc_object_t *p_vbi; const int i_teletext_es = var_GetInteger( p_input, "teletext-es" );
p_vbi = (vlc_object_t *) vlc_object_find_name( p_input, if( i_teletext_es >= 0 )
"zvbi", FIND_ANYWHERE );
if( p_vbi )
{ {
var_SetBool( p_vbi, "vbi-opaque", b_transparentTelextext ); var_SetInteger( p_input, "spu-es", b_enable ? i_teletext_es : -1 );
b_transparentTelextext = !b_transparentTelextext;
vlc_object_release( p_vbi );
} }
} }
emit toggleTelexTransparency();
} }
void InputManager::slower() void InputManager::slower()
...@@ -583,6 +591,36 @@ void InputManager::setRate( int new_rate ) ...@@ -583,6 +591,36 @@ void InputManager::setRate( int new_rate )
var_SetInteger( p_input, "rate", new_rate ); var_SetInteger( p_input, "rate", new_rate );
} }
void InputManager::setAtoB()
{
if( !timeA )
{
timeA = var_GetTime( THEMIM->getInput(), "time" );
}
else if( !timeB )
{
timeB = var_GetTime( THEMIM->getInput(), "time" );
var_SetTime( THEMIM->getInput(), "time" , timeA );
}
else
{
timeA = 0;
timeB = 0;
}
emit AtoBchanged( (timeA != 0 ), (timeB != 0 ) );
}
/* Function called regularly when in an AtoB loop */
void InputManager::AtoBLoop( int i_time )
{
if( timeB )
{
if( ( i_time >= (int)( timeB/1000000 ) )
|| ( i_time < (int)( timeA/1000000 ) ) )
var_SetTime( THEMIM->getInput(), "time" , timeA );
}
}
/********************************************************************** /**********************************************************************
* MainInputManager implementation. Wrap an input manager and * MainInputManager implementation. Wrap an input manager and
* take care of updating the main playlist input. * take care of updating the main playlist input.
......
...@@ -70,7 +70,8 @@ public: ...@@ -70,7 +70,8 @@ public:
virtual ~InputManager(); virtual ~InputManager();
void delInput(); void delInput();
bool hasInput() { return p_input && !p_input->b_dead && vlc_object_alive (p_input); } bool hasInput() { return p_input && !p_input->b_dead
&& vlc_object_alive (p_input); }
bool hasAudio(); bool hasAudio();
bool hasVideo() { return hasInput() && b_video; } bool hasVideo() { return hasInput() && b_video; }
...@@ -84,8 +85,8 @@ private: ...@@ -84,8 +85,8 @@ private:
QString old_name; QString old_name;
QString artUrl; QString artUrl;
int i_rate; int i_rate;
bool b_transparentTelextext;
bool b_video; bool b_video;
mtime_t timeA, timeB;
void customEvent( QEvent * ); void customEvent( QEvent * );
void addCallbacks(); void addCallbacks();
...@@ -99,23 +100,31 @@ private: ...@@ -99,23 +100,31 @@ private:
void UpdateTeletext(); void UpdateTeletext();
void UpdateArt(); void UpdateArt();
void UpdateVout(); void UpdateVout();
void UpdateStats(); void UpdateStats(); // FIXME, remove from this file.
void AtoBLoop( int );
public slots: public slots:
void setInput( input_thread_t * ); ///< Our controlled input changed void setInput( input_thread_t * ); ///< Our controlled input changed
void sliderUpdate( float ); ///< User dragged the slider. We get new pos void sliderUpdate( float ); ///< User dragged the slider. We get new pos
void togglePlayPause(); void togglePlayPause();
/* SpeedRate Rate Management */
void slower(); void slower();
void faster(); void faster();
void normalRate(); void normalRate();
void setRate( int ); void setRate( int );
/* Menus */
void sectionNext(); void sectionNext();
void sectionPrev(); void sectionPrev();
void sectionMenu(); void sectionMenu();
void telexGotoPage( int ); ///< Goto teletext page /* Teletext */
void telexToggle( bool ); ///< Enable disable teletext buttons void telexSetPage( int ); ///< Goto teletext page
void telexToggleButtons(); ///< Toggle buttons after click void telexSetTransparency( bool ); ///< Transparency on teletext background
void telexSetTransparency(); ///< Set transparency on teletext background void telexActivation( bool ); ///< Enable disable teletext buttons
void activateTeletext( bool ); ///< Toggle buttons after click
/* A to B Loop */
void setAtoB();
signals: signals:
/// Send new position, new time and new length /// Send new position, new time and new length
...@@ -123,19 +132,20 @@ signals: ...@@ -123,19 +132,20 @@ signals:
void rateChanged( int ); void rateChanged( int );
void nameChanged( QString ); void nameChanged( QString );
/// Used to signal whether we should show navigation buttons /// Used to signal whether we should show navigation buttons
void navigationChanged( int ); void titleChanged( bool );
void chapterChanged( bool );
/// Statistics are updated /// Statistics are updated
void statisticsUpdated( input_item_t* ); void statisticsUpdated( input_item_t* );
/// Play/pause status /// Play/pause status
void statusChanged( int ); void statusChanged( int );
void artChanged( input_item_t* ); void artChanged( input_item_t* );
/// Teletext /// Teletext
void teletextEnabled( bool ); void teletextPossible( bool );
void toggleTelexButtons(); void teletextActivated( bool );
void toggleTelexTransparency(); void teletextTransparencyActivated( bool );
void setNewTelexPage( int ); void newTelexPageSet( int );
/// Advanced buttons /// Advanced buttons
void advControlsSetIcon(); void AtoBchanged( bool, bool );
/// Vout /// Vout
void voutChanged( bool ); void voutChanged( bool );
}; };
......
...@@ -374,10 +374,8 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -374,10 +374,8 @@ void MainInterface::handleMainUi( QSettings *settings )
mainLayout->setMargin( 0 ); mainLayout->setMargin( 0 );
/* Create the CONTROLS Widget */ /* Create the CONTROLS Widget */
bool b_shiny = config_GetInt( p_intf, "qt-blingbling" ); controls = new ControlsWidget( p_intf,
controls = new ControlsWidget( p_intf, this, settings->value( "adv-controls", false ).toBool() );
settings->value( "adv-controls", false ).toBool(),
b_shiny );
CONNECT( controls, advancedControlsToggled( bool ), CONNECT( controls, advancedControlsToggled( bool ),
this, doComponentsUpdate() ); this, doComponentsUpdate() );
...@@ -431,11 +429,7 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -431,11 +429,7 @@ void MainInterface::handleMainUi( QSettings *settings )
/* Create the FULLSCREEN CONTROLS Widget */ /* Create the FULLSCREEN CONTROLS Widget */
if( config_GetInt( p_intf, "qt-fs-controller" ) ) if( config_GetInt( p_intf, "qt-fs-controller" ) )
{ {
fullscreenControls = new FullscreenControllerWidget( p_intf, this, fullscreenControls = new FullscreenControllerWidget( p_intf );
settings->value( "adv-controls", false ).toBool(),
b_shiny );
CONNECT( fullscreenControls, advancedControlsToggled( bool ),
this, doComponentsUpdate() );
} }
} }
...@@ -817,7 +811,7 @@ void MainInterface::doComponentsUpdate() ...@@ -817,7 +811,7 @@ void MainInterface::doComponentsUpdate()
void MainInterface::toggleAdvanced() void MainInterface::toggleAdvanced()
{ {
controls->toggleAdvanced(); controls->toggleAdvanced();
if( fullscreenControls ) fullscreenControls->toggleAdvanced(); // if( fullscreenControls ) fullscreenControls->toggleAdvanced();
} }
/* Get the visibility status of the controls (hidden or not, advanced or not) */ /* Get the visibility status of the controls (hidden or not, advanced or not) */
...@@ -865,16 +859,6 @@ void MainInterface::setStatus( int status ) ...@@ -865,16 +859,6 @@ void MainInterface::setStatus( int status )
{ {
msg_Dbg( p_intf, "Updating the stream status: %i", status ); msg_Dbg( p_intf, "Updating the stream status: %i", status );
/* Forward the status to the controls to toggle Play/Pause */
controls->setStatus( status );
controls->updateInput();
if( fullscreenControls )
{
fullscreenControls->setStatus( status );
fullscreenControls->updateInput();
}
speedControl->setEnable( THEMIM->getIM()->hasInput() ); speedControl->setEnable( THEMIM->getIM()->hasInput() );
/* And in the systray for the menu */ /* And in the systray for the menu */
......
/***************************************************************************** /*****************************************************************************
* main_interface.hpp : Main Interface * main_interface.hpp : Main Interface
**************************************************************************** ****************************************************************************
* Copyright (C) 2006-2007 the VideoLAN team * Copyright (C) 2006-2008 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
......
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