[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [Phonon/4.1] 3d4f447: only use an AudioEffect if the Backend lists one
From:       Matthias Kretz <kretz () kde ! org>
Date:       2011-01-02 21:59:16
Message-ID: 20110102215916.D82E4A62D1 () git ! kde ! org
[Download RAW message or body]

commit 3d4f447a639e3119412889aa73026367d3e997fa
branch 4.1
Author: Matthias Kretz <kretz@kde.org>
Date:   Mon Aug 21 13:07:10 2006 +0000

    only use an AudioEffect if the Backend lists one

diff --git a/ui/tests/mediaplayer.cpp b/ui/tests/mediaplayer.cpp
index 354d986..6de7994 100644
--- a/ui/tests/mediaplayer.cpp
+++ b/ui/tests/mediaplayer.cpp
@@ -55,12 +55,16 @@ MediaPlayer::MediaPlayer( QWidget* parent )
 	m_controls->setMediaProducer( m_media );
 	m_controls->setAudioOutput( m_aoutput );
 
-	m_effect = new AudioEffect( BackendCapabilities::availableAudioEffects().first(), m_apath );
-	m_apath->insertEffect( m_effect );
-	QPushButton* button = new QPushButton( this );
-	layout->addWidget( button );
-	button->setText( "configure effect" );
-	connect( button, SIGNAL( clicked() ), SLOT( openEffectWidget() ) );
+	QList<AudioEffectDescription> effectList = BackendCapabilities::availableAudioEffects();
+	if( !effectList.isEmpty() )
+	{
+		m_effect = new AudioEffect( BackendCapabilities::availableAudioEffects().first(), m_apath );
+		m_apath->insertEffect( m_effect );
+		QPushButton* button = new QPushButton( this );
+		layout->addWidget( button );
+		button->setText( "configure effect" );
+		connect( button, SIGNAL( clicked() ), SLOT( openEffectWidget() ) );
+	}
 }
 
 void MediaPlayer::openEffectWidget()
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic