playlistEmbeddedFlag = settings->value( "playlist-embedded", true ).
toBool();
advControlsEnabled= settings->value( "adv-controls", false ).toBool();
+ visualSelectorEnabled= settings->value( "visual-selector", false ).toBool();
setWindowTitle( QString::fromUtf8( _("VLC media player") ) );
handleMainUi( settings );
QVLCMenu::createMenuBar( this, p_intf, playlistEmbeddedFlag,
- advControlsEnabled );
+ advControlsEnabled, visualSelectorEnabled );
/* Status bar */
timeLabel = new QLabel( 0 );
BUTTON_SET_ACT_I( ui.nextButton, "", next.png, qtr("Next"), next() );
BUTTON_SET_ACT_I( ui.playButton, "", play.png, qtr("Play"), play() );
BUTTON_SET_ACT_I( ui.stopButton, "", stop.png, qtr("Stop"), stop() );
- BUTTON_SET_ACT_I( ui.visualButton, "", stop.png,
- qtr( "Audio visualizations" ), visual() );
/* Volume */
ui.volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
{
width = playlistWidget->widgetSize.width();
height = playlistWidget->widgetSize.height();
- fprintf( stderr, "Have %ix%i playlist\n", width, height );
}
else if( videoIsActive )
{
width = videoWidget->widgetSize.width() ;
height = videoWidget->widgetSize.height();
- fprintf( stderr, "Video Size %ix%i\n", DS( videoWidget->widgetSize ) );
}
else
{
}
if( VISIBLE( visualSelector ) )
height += visualSelector->height();
- fprintf( stderr, "Adv %p - visible %i\n", advControls, advControls->isVisible() );
if( VISIBLE( advControls) )
{
- fprintf( stderr, "visible\n" );
height += advControls->sizeHint().height();
}
-
- fprintf( stderr, "Adv height %i\n", advControls->sizeHint().height() );
- fprintf( stderr, "Setting to %ix%i\n",
- width + addSize.width() , height + addSize.height() );
-
mainSize = QSize( width + addSize.width(), height + addSize.height() );
}
void MainInterface::resizeEvent( QResizeEvent *e )
{
- fprintf( stderr, "Resize event to %ix%i\n", DS( e->size() ) );
videoWidget->widgetSize.setWidth( e->size().width() - addSize.width() );
if( videoWidget && videoIsActive && videoWidget->widgetSize.height() > 1 )
{
{
/* Show the background widget */
}
+ visualSelectorEnabled = true;
}
else
{
/* Stop any currently running visualization */
visualSelector->hide();
+ visualSelectorEnabled = false;
}
doComponentsUpdate();
}
playlistEmbeddedFlag = false;
menuBar()->clear();
- QVLCMenu::createMenuBar( this, p_intf, false, advControlsEnabled );
+ QVLCMenu::createMenuBar( this, p_intf, false, advControlsEnabled,
+ visualSelectorEnabled);
if( videoIsActive )
{
PlaylistDialog::killInstance();
playlistEmbeddedFlag = true;
menuBar()->clear();
- QVLCMenu::createMenuBar(this, p_intf, true, advControlsEnabled );
+ QVLCMenu::createMenuBar(this, p_intf, true, advControlsEnabled,
+ visualSelectorEnabled);
playlist();
}
}
void MainInterface::updateOnTimer()
{
- aout_instance_t *p_aout = (aout_instance_t *)vlc_object_find( p_intf,
- VLC_OBJECT_AOUT, FIND_ANYWHERE );
- /* Todo: make this event-driven */
- if( p_aout )
- {
- ui.visualButton->setEnabled( true );
- vlc_object_release( p_aout );
- }
- else
- ui.visualButton->setEnabled( false );
-
- /* And this too */
+ /* \todo Make this event-driven */
advControls->enableInput( THEMIM->getIM()->hasInput() );
advControls->enableVideo( THEMIM->getIM()->hasVideo() );
THEDP->menusUpdateMapper->setMapping( menu, f ); }
void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
- bool playlist, bool adv_controls_enabled )
+ bool playlist, bool adv_controls_enabled,
+ bool visual_selector_enabled )
{
QMenuBar *bar = mi->menuBar();
BAR_ADD( FileMenu(), qtr("Media") );
{
BAR_ADD( PlaylistMenu( mi,p_intf ), qtr("Playlist" ) );
}
- BAR_ADD( ToolsMenu( p_intf, mi, adv_controls_enabled ), qtr("Tools") );
+ BAR_ADD( ToolsMenu( p_intf, mi, adv_controls_enabled,
+ visual_selector_enabled ), qtr("Tools") );
BAR_DADD( VideoMenu( p_intf, NULL ), qtr("Video"), 1 );
BAR_DADD( AudioMenu( p_intf, NULL ), qtr("Audio"), 2 );
BAR_DADD( NavigMenu( p_intf, NULL ), qtr("Navigation"), 3 );
}
QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
- bool adv_controls_enabled, bool with_intf )
+ bool adv_controls_enabled,
+ bool visual_selector_enabled, bool with_intf )
{
QMenu *menu = new QMenu();
if( with_intf )
mi, SLOT( advanced() ) );
adv->setCheckable( true );
if( adv_controls_enabled ) adv->setChecked( true );
+ adv = menu->addAction( qtr("Visualizations selector" ),
+ mi, SLOT( visual() ) );
+ adv->setCheckable( true );
+ if( visual_selector_enabled ) adv->setChecked( true );
}
menu->addSeparator();
DP_SADD( qtr("Preferences"), "", "", prefsDialog() );
{
Q_OBJECT;
public:
- static void createMenuBar( MainInterface *mi, intf_thread_t *, bool, bool );
+ static void createMenuBar( MainInterface *mi, intf_thread_t *, bool, bool, bool );
/* Menus */
static QMenu *FileMenu();
static QMenu *SDMenu( intf_thread_t * );
static QMenu *PlaylistMenu( MainInterface *, intf_thread_t *);
- static QMenu *ToolsMenu( intf_thread_t *, MainInterface *, bool,
+ static QMenu *ToolsMenu( intf_thread_t *, MainInterface *, bool, bool,
bool with = true );
static QMenu *NavigMenu( intf_thread_t * , QMenu * );
static QMenu *VideoMenu( intf_thread_t * , QMenu * );