1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-12 00:54:20 +02:00

Merge remote-tracking branch 'origin/master' into tweetsip

This commit is contained in:
Jeff Mitchell
2011-02-12 22:54:12 -05:00
4 changed files with 21 additions and 10 deletions

View File

@@ -77,9 +77,10 @@ DynamicModel::newTrackGenerated( const Tomahawk::query_ptr& query )
}
void
DynamicModel::stopOnDemand()
DynamicModel::stopOnDemand( bool stopPlaying )
{
m_onDemandRunning = false;
if( stopPlaying )
AudioEngine::instance()->stop();
disconnect( AudioEngine::instance(), SIGNAL( loading( Tomahawk::result_ptr ) ), this, SLOT( newTrackLoading() ) );

View File

@@ -37,7 +37,7 @@ public:
virtual ~DynamicModel();
void startOnDemand();
void stopOnDemand();
void stopOnDemand( bool stopPlaying = true );
void changeStation();
void loadPlaylist( const dynplaylist_ptr& playlist );

View File

@@ -65,7 +65,7 @@ DynamicWidget::DynamicWidget( const Tomahawk::dynplaylist_ptr& playlist, QWidget
m_layout->addWidget( m_view, 1 );
connect( m_model, SIGNAL( collapseFromTo( int, int ) ), m_view, SLOT( collapseEntries( int, int ) ) );
connect( m_model, SIGNAL( trackGenerationFailure( QString ) ), m_view, SLOT( showMessage( QString ) ) );
connect( m_model, SIGNAL( trackGenerationFailure( QString ) ), this, SLOT( stationFailed( QString ) ) );
m_setup = new DynamicSetupWidget( playlist, this );
@@ -227,6 +227,17 @@ DynamicWidget::generate( int num )
}
}
void
DynamicWidget::stationFailed( const QString& msg )
{
m_view->showMessage( msg );
if( m_runningOnDemand ) {
stopStation( false );
}
}
void
DynamicWidget::pausePressed()
{
@@ -249,13 +260,14 @@ DynamicWidget::playPressed()
void
DynamicWidget::stopStation()
DynamicWidget::stopStation( bool stopPlaying )
{
m_model->stopOnDemand();
m_model->stopOnDemand( stopPlaying );
m_runningOnDemand = false;
// TODO until i add a qwidget interface
QMetaObject::invokeMethod( m_steering, "fadeOut", Qt::DirectConnection );
m_setup->fadeIn();
}
void
@@ -333,9 +345,6 @@ void
DynamicWidget::generatorError( const QString& title, const QString& content )
{
m_view->showMessageTimeout( title, content );
if( m_runningOnDemand )
stopStation();
}
void

View File

@@ -77,10 +77,11 @@ public slots:
void playlistTypeChanged(QString);
void startStation();
void stopStation();
void stopStation( bool stopPlaying = true );
void playPressed();
void pausePressed();
void stationFailed( const QString& );
private slots:
void generate( int = -1 );