+void AdvControlsWidget::snapshot()
+{
+}
+
+void AdvControlsWidget::frame(){}
+void AdvControlsWidget::fromAtoB(){}
+void AdvControlsWidget::record(){}
+
+/*****************************
+ * DA Control Widget !
+ *****************************/
+ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
+ QFrame( NULL ), p_intf( _p_i )
+{
+ //QSize size( 500, 200 );
+ //resize( size );
+ controlLayout = new QGridLayout( this );
+
+#if DEBUG_COLOR
+ QPalette palette2;
+ palette2.setColor(this->backgroundRole(), Qt::magenta);
+ setPalette(palette2);
+#endif
+
+ /** The main Slider **/
+ slider = new InputSlider( Qt::Horizontal, NULL );
+ controlLayout->addWidget( slider, 0, 1, 1, 16 );
+ /* Update the position when the IM has changed */
+ CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
+ slider, setPosition( float,int, int ) );
+ /* And update the IM, when the position has changed */
+ CONNECT( slider, sliderDragged( float ),
+ THEMIM->getIM(), sliderUpdate( float ) );
+
+ /** Slower and faster Buttons **/
+ slowerButton = new QPushButton( "S" );
+ BUTTON_SET_ACT( slowerButton, "S", qtr( "Slower" ), slower() );
+ controlLayout->addWidget( slowerButton, 0, 0 );
+ slowerButton->setMaximumSize( QSize( 26, 20 ) );
+
+ fasterButton = new QPushButton( "F" );
+ BUTTON_SET_ACT( fasterButton, "F", qtr( "Faster" ), faster() );
+ controlLayout->addWidget( fasterButton, 0, 17 );
+ fasterButton->setMaximumSize( QSize( 26, 20 ) );
+
+ /** TODO: Insert here the AdvControls Widget
+ * Then fix all the size issues in main_interface.cpp
+ **/
+ /* advanced Controls handling */
+ b_advancedVisible = b_advControls;
+
+ advControls = new AdvControlsWidget( p_intf );
+ controlLayout->addWidget( advControls, 1, 3, 2, 5, Qt::AlignBottom );
+ if( !b_advancedVisible ) advControls->hide();
+//THIS should be removed. need_components_update = true;
+
+ /** Disc and Menus handling */
+ discFrame = new QFrame( this );
+
+ QHBoxLayout *discLayout = new QHBoxLayout( discFrame );
+ discLayout->setSpacing( 0 );
+ discLayout->setMargin( 0 );
+
+ prevSectionButton = new QPushButton( discFrame );
+ setupSmallButton( prevSectionButton );
+ discLayout->addWidget( prevSectionButton );
+
+ menuButton = new QPushButton( discFrame );
+ setupSmallButton( menuButton );
+ discLayout->addWidget( menuButton );
+
+ nextSectionButton = new QPushButton( discFrame );
+ setupSmallButton( nextSectionButton );
+ discLayout->addWidget( nextSectionButton );
+
+ controlLayout->addWidget( discFrame, 1, 10, 2, 3, Qt::AlignBottom );
+
+ BUTTON_SET_IMG( prevSectionButton, "", previous.png, "" );
+ BUTTON_SET_IMG( nextSectionButton, "", next.png, "" );
+ BUTTON_SET_IMG( menuButton, "", previous.png, "" );
+
+ discFrame->hide();
+
+ /* Change the navigation button display when the IM navigation changes */
+ CONNECT( THEMIM->getIM(), navigationChanged( int ),
+ this, setNavigation( int ) );
+ /* Changes the IM navigation when triggered on the nav buttons */
+ CONNECT( prevSectionButton, clicked(), THEMIM->getIM(),
+ sectionPrev() );
+ CONNECT( nextSectionButton, clicked(), THEMIM->getIM(),
+ sectionNext() );
+ CONNECT( menuButton, clicked(), THEMIM->getIM(),
+ sectionMenu() );
+
+ /** TODO
+ * Telextext QFrame
+ **/
+
+ /** Play Buttons **/
+ QSizePolicy sizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed );
+ sizePolicy.setHorizontalStretch( 0 );
+ sizePolicy.setVerticalStretch( 0 );
+// sizePolicy.setHeightForWidth( playButton->sizePolicy().hasHeightForWidth() );
+
+ /* Play */
+ playButton = new QPushButton;
+ playButton->setSizePolicy( sizePolicy );
+ playButton->setMaximumSize( QSize( 45, 45 ) );
+ playButton->setIconSize( QSize( 30, 30 ) );
+
+ controlLayout->addWidget( playButton, 2, 0, 2, 2, Qt::AlignBottom );
+
+ controlLayout->setColumnMinimumWidth( 2, 20 );
+ controlLayout->setColumnStretch( 2, 0 );
+
+ /** Prev + Stop + Next Block **/
+ QHBoxLayout *controlButLayout = new QHBoxLayout;
+ controlButLayout->setSpacing( 0 ); /* Don't remove that, will be useful */
+
+ /* Prev */
+ QPushButton *prevButton = new QPushButton;
+ prevButton->setSizePolicy( sizePolicy );
+ setupSmallButton( prevButton );
+
+ controlButLayout->addWidget( prevButton );
+
+ /* Stop */
+ QPushButton *stopButton = new QPushButton;
+ stopButton->setSizePolicy( sizePolicy );
+ setupSmallButton( stopButton );
+
+ controlButLayout->addWidget( stopButton );
+
+ /* next */
+ QPushButton *nextButton = new QPushButton;
+ nextButton->setSizePolicy( sizePolicy );
+ setupSmallButton( nextButton );
+
+ controlButLayout->addWidget( nextButton );
+
+ /* Add this block to the main layout */
+ controlLayout->addLayout( controlButLayout, 3, 3, 1, 3 );
+
+ BUTTON_SET_ACT_I( playButton, "", play.png, qtr( "Play" ), play() );
+ BUTTON_SET_ACT_I( prevButton, "" , previous.png,
+ qtr( "Previous" ), prev() );
+ BUTTON_SET_ACT_I( nextButton, "", next.png, qtr( "Next" ), next() );
+ BUTTON_SET_ACT_I( stopButton, "", stop.png, qtr( "Stop" ), stop() );
+
+ controlLayout->setColumnStretch( 8 , 10 );
+ controlLayout->setColumnStretch( 9, 0 );
+
+ /*
+ * Other first Line buttons
+ * Might need to be inside a frame to avoid a few resizing pb
+ * FIXME
+ */
+ /** Fullscreen/Visualisation **/
+ fullscreenButton = new QPushButton( "F" );
+ BUTTON_SET_ACT( fullscreenButton, "F", qtr( "Fullscreen" ), fullscreen() );
+ setupSmallButton( fullscreenButton );
+ controlLayout->addWidget( fullscreenButton, 3, 10 );
+
+ /** Playlist Button **/
+ playlistButton = new QPushButton;
+ setupSmallButton( playlistButton );
+
+ controlLayout->addWidget( playlistButton, 3, 11 );
+
+ /** extended Settings **/
+ QPushButton *extSettingsButton = new QPushButton( "F" );
+ BUTTON_SET_ACT( extSettingsButton, "Ex", qtr( "Extended Settings" ),
+ extSettings() );
+ setupSmallButton( extSettingsButton );
+ controlLayout->addWidget( extSettingsButton, 3, 12 );
+
+ /** Preferences **/
+ QPushButton *prefsButton = new QPushButton( "P" );
+ BUTTON_SET_ACT( prefsButton, "P", qtr( "Preferences / Settings" ),
+ prefs() );
+ setupSmallButton( prefsButton );
+ controlLayout->addWidget( prefsButton, 3, 13 );
+
+ controlLayout->setColumnStretch( 14, 5 );
+
+ /* Volume */
+ VolumeClickHandler *h = new VolumeClickHandler( p_intf, this );
+
+ QLabel *volMuteLabel = new QLabel;
+ volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
+ volMuteLabel->setToolTip( qtr( "Mute" ) );
+ volMuteLabel->installEventFilter( h );
+
+ /** TODO:
+ * Change this slider to use a nice Amarok-like one
+ * Add a Context menu to change to the most useful %
+ * **/
+ /** FIXME
+ * THis percerntage thing has to be handled correctly
+ * This has to match to the OSD
+ **/
+ volumeSlider = new QSlider;
+ volumeSlider->setSizePolicy( sizePolicy );
+ volumeSlider->setMaximumSize( QSize( 80, 200 ) );
+ volumeSlider->setOrientation( Qt::Horizontal );
+
+ volumeSlider->setMaximum( 100 );
+ volumeSlider->setFocusPolicy( Qt::NoFocus );
+ controlLayout->addWidget( volMuteLabel, 3, 15 );
+ controlLayout->addWidget( volumeSlider, 3, 16, 1, 2 );
+
+ /* Volume control connection */
+ CONNECT( volumeSlider, valueChanged( int ), this, updateVolume( int ) );
+
+}