#endif
#include "controller_widget.hpp"
+#include "controller.hpp"
#include "input_manager.hpp" /* Get notification of Volume Change */
#include "util/input_slider.hpp" /* SoundSlider */
if( b_special )
subLayout->addWidget( volumeSlider );
else
- layout->addWidget( volumeSlider );
+ layout->addWidget( volumeSlider, 0, Qt::AlignBottom );
/* Set the volume from the config */
volumeSlider->setValue( ( config_GetInt( p_intf, "volume" ) ) *
CONNECT( THEMIM, volumeChanged( void ), this, updateVolume( void ) );
}
-void SoundWidget::showVolumeMenu( QPoint pos )
-{
- volumeMenu->exec( QCursor::pos() - pos - QPoint( 0, volumeMenu->height()/2 )
- + QPoint( width(), height() /2) );
-}
-
-bool SoundWidget::eventFilter( QObject *obj, QEvent *e )
-{
- VLC_UNUSED( obj );
- if (e->type() == QEvent::MouseButtonPress )
- {
- if( volumeSlider->orientation() == Qt::Vertical )
- {
- QMouseEvent *event = static_cast<QMouseEvent*>(e);
- showVolumeMenu( event->pos() );
- }
- else
- {
- aout_VolumeMute( p_intf, NULL );
- }
- e->accept();
- return true;
- }
- else
- {
- e->ignore();
- return false;
- }
-}
-
void SoundWidget::updateVolume( int i_sliderVolume )
{
if( !b_my_volume )
/* Audio part */
audio_volume_t i_volume;
aout_VolumeGet( p_intf, &i_volume );
- i_volume = ( i_volume * VOLUME_MAX )/ (AOUT_VOLUME_MAX/2);
+ i_volume = ( ( i_volume + 1 ) * VOLUME_MAX )/ (AOUT_VOLUME_MAX/2);
int i_gauge = volumeSlider->value();
b_my_volume = false;
if( i_volume - i_gauge > 1 || i_gauge - i_volume > 1 )
}
}
-void TeletextController::enableTeletextButtons( bool b_enabled )
+void SoundWidget::showVolumeMenu( QPoint pos )
+{
+ volumeMenu->exec( QCursor::pos() - pos - QPoint( 0, volumeMenu->height()/2 )
+ + QPoint( width(), height() /2) );
+}
+
+bool SoundWidget::eventFilter( QObject *obj, QEvent *e )
{
- telexOn->setChecked( b_enabled );
- telexTransparent->setEnabled( b_enabled );
- telexPage->setEnabled( b_enabled );
+ VLC_UNUSED( obj );
+ if (e->type() == QEvent::MouseButtonPress )
+ {
+ if( volumeSlider->orientation() == Qt::Vertical )
+ {
+ QMouseEvent *event = static_cast<QMouseEvent*>(e);
+ showVolumeMenu( event->pos() );
+ }
+ else
+ {
+ aout_VolumeMute( p_intf, NULL );
+ }
+ e->accept();
+ return true;
+ }
+ else
+ {
+ e->ignore();
+ return false;
+ }
}
+/**
+ * Play Button
+ **/
void PlayButton::updateButton( bool b_playing )
{
setIcon( b_playing ? QIcon( ":/pause_b" ) : QIcon( ":/play_b" ) );