/*****************************************************************************
* interface_widgets.cpp : Custom widgets for the main interface
****************************************************************************
- * Copyright ( C ) 2006 the VideoLAN team
+ * Copyright (C) 2006-2008 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
# include "config.h"
#endif
-#include <vlc_vout.h>
-
-#include "dialogs_provider.hpp"
#include "components/interface_widgets.hpp"
-#include "main_interface.hpp"
-#include "input_manager.hpp"
-#include "menus.hpp"
-#include "util/input_slider.hpp"
-#include "util/customwidgets.hpp"
+
+#include "input_manager.hpp" /* Rate control */
+#include "menus.hpp" /* Popup menu on bgWidget */
+
+#include <vlc_vout.h>
#include <QLabel>
-#include <QSpacerItem>
-#include <QCursor>
-#include <QPushButton>
#include <QToolButton>
-#include <QHBoxLayout>
-#include <QMenu>
#include <QPalette>
#include <QResizeEvent>
#include <QDate>
#include <math.h>
-#define I_PLAY_TOOLTIP N_("Play\nIf the playlist is empty, open a media")
-
/**********************************************************************
* Video Widget. A simple frame on which video is drawn
* This class handles resize issues
}
#if 0
+#include <QPushButton>
+#include <QHBoxLayout>
+
/**********************************************************************
* Visualization selector panel
**********************************************************************/
speedSlider->setOrientation( Qt::Vertical );
speedSlider->setTickPosition( QSlider::TicksRight );
- speedSlider->setRange( -24, 24 );
+ speedSlider->setRange( -34, 34 );
speedSlider->setSingleStep( 1 );
speedSlider->setPageStep( 1 );
- speedSlider->setTickInterval( 12 );
+ speedSlider->setTickInterval( 17 );
CONNECT( speedSlider, valueChanged( int ), this, updateRate( int ) );
return;
}
- double value = 12 * log( (double)INPUT_RATE_DEFAULT / rate ) / log( 2 );
+ double value = 17 * log( (double)INPUT_RATE_DEFAULT / rate ) / log( 2 );
int sliderValue = (int) ( ( value > 0 ) ? value + .5 : value - .5 );
if( sliderValue < speedSlider->minimum() )
void SpeedControlWidget::updateRate( int sliderValue )
{
- double speed = pow( 2, (double)sliderValue / 12 );
+ double speed = pow( 2, (double)sliderValue / 17 );
int rate = INPUT_RATE_DEFAULT / speed;
THEMIM->getIM()->setRate(rate);
void SpeedControlWidget::resetRate()
{
- THEMIM->getIM()->setRate(INPUT_RATE_DEFAULT);
+ THEMIM->getIM()->setRate( INPUT_RATE_DEFAULT );
}
-
-
static int downloadCoverCallback( vlc_object_t *p_this,
char const *psz_var,
vlc_value_t oldvar, vlc_value_t newvar,
/*****************************************************************************
* interface_widgets.hpp : Custom widgets for the main interface
****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2006-2008 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
# include "config.h"
#endif
-#include <vlc_common.h>
-#include <vlc_interface.h>
-//#include <vlc_aout.h> Visualizer
-
-#include "qt4.hpp"
#include "main_interface.hpp"
#include "input_manager.hpp"
+
#include "components/controller.hpp"
#include "components/controller_widget.hpp"
+//#include <vlc_aout.h> Visualizer
+
#include <QWidget>
#include <QFrame>
#include <QLabel>
{
Q_OBJECT
public:
- SpeedLabel( intf_thread_t *_p_intf, const QString text ): QLabel( text)
+ SpeedLabel( intf_thread_t *_p_intf, const QString text ): QLabel( text )
{ p_intf = _p_intf; }
protected:
private:
intf_thread_t *p_intf;
QSlider *speedSlider;
+
public slots:
void setEnable( bool );
+
private slots:
void updateRate( int );
void resetRate();
vlc_object_t *p_this,
input_item_t *p_input = NULL );
virtual ~CoverArtLabel()
- { if( p_input ) vlc_gc_decref( p_input ); };
+ { if( p_input ) vlc_gc_decref( p_input ); }
private:
input_item_t *p_input;
vlc_object_t *p_this;
+
QString prevArt;
public slots:
void requestUpdate() { emit updateRequested(); };
void update( input_item_t* p_item )
- { if( p_input ) vlc_gc_decref( p_input );
- if( ( p_input = p_item ) ) vlc_gc_incref( p_input );
- requestUpdate(); }
+ {
+ if( p_input ) vlc_gc_decref( p_input );
+ if( ( p_input = p_item ) )
+ vlc_gc_incref( p_input );
+ requestUpdate();
+ }
private slots:
void doUpdate();