-void MainInterface::stop()
-{
- THEMIM->stop();
-}
-
-void MainInterface::play()
-{
- if( playlist_IsEmpty(THEPL) )
- {
- /* The playlist is empty, open a file requester */
- THEDP->openFileDialog();
- setStatus( 0 );
- return;
- }
- THEMIM->togglePlayPause();
-}
-
-void MainInterface::prev()
-{
- THEMIM->prev();
-}
-
-void MainInterface::next()
-{
- THEMIM->next();
-}
-
-void MainInterface::setDisplay( float pos, int time, int length )
-{
- char psz_length[MSTRTIME_MAX_SIZE], psz_time[MSTRTIME_MAX_SIZE];
- secstotimestr( psz_length, length );
- secstotimestr( psz_time, time );
- QString title;
- title.sprintf( "%s/%s", psz_time, psz_length );
- timeLabel->setText( " "+title+" " );
-}
-
-void MainInterface::setName( QString name )
-{
- input_name = name;
- nameLabel->setText( " " + name+" " );
-}
-
-void MainInterface::setStatus( int status )
-{
- if( status == 1 ) // Playing
- ui.playButton->setIcon( QIcon( ":/pixmaps/pause.png" ) );
- else
- ui.playButton->setIcon( QIcon( ":/pixmaps/play.png" ) );
- if( systrayMenu )
- updateSystrayMenu( status );
-}
-
-#define HELP_MENU N_("Menu")
-#define HELP_PCH N_("Previous chapter")
-#define HELP_NCH N_("Next chapter")
-#define HELP_PTR N_("Previous track")
-#define HELP_NTR N_("Next track")
-
-void MainInterface::setNavigation( int navigation )
-{
- // 1 = chapter, 2 = title, 0 = no
- if( navigation == 0 )
- {
- ui.discFrame->hide();
- } else if( navigation == 1 ) {
- ui.prevSectionButton->show();
- ui.prevSectionButton->setToolTip( qfu(HELP_PCH) );
- ui.nextSectionButton->show();
- ui.nextSectionButton->setToolTip( qfu(HELP_NCH) );
- ui.menuButton->show();
- ui.discFrame->show();
- } else {
- ui.prevSectionButton->show();
- ui.prevSectionButton->setToolTip( qfu(HELP_PCH) );
- ui.nextSectionButton->show();
- ui.nextSectionButton->setToolTip( qfu(HELP_NCH) );
- ui.menuButton->hide();
- ui.discFrame->show();
- }
-}
-
-static bool b_my_volume;
-
-void MainInterface::updateOnTimer()
-{
- /* \todo Make this event-driven */
- advControls->enableInput( THEMIM->getIM()->hasInput() );
- advControls->enableVideo( THEMIM->getIM()->hasVideo() );
-
- if( intf_ShouldDie( p_intf ) )
- {
- QApplication::closeAllWindows();
- QApplication::quit();
- }
- if( need_components_update )
- {
- doComponentsUpdate();
- need_components_update = false;
- }
-
- audio_volume_t i_volume;
- aout_VolumeGet( p_intf, &i_volume );
- i_volume = (i_volume * 200 )/ AOUT_VOLUME_MAX ;
- int i_gauge = ui.volumeSlider->value();
- b_my_volume = false;
- if( i_volume - i_gauge > 1 || i_gauge - i_volume > 1 )
- {
- b_my_volume = true;
- ui.volumeSlider->setValue( i_volume );
- b_my_volume = false;
- }
-}
-