mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-16 19:14:06 +02:00
Don't set time on AudioEngine's singleton instance, but emit signals to it.
This commit is contained in:
@@ -184,6 +184,7 @@ AudioEngine::AudioEngine()
|
||||
|
||||
connect( d->audioOutput, SIGNAL( stateChanged( AudioOutput::AudioState, AudioOutput::AudioState ) ), d_func(), SLOT( onStateChanged( AudioOutput::AudioState, AudioOutput::AudioState ) ) );
|
||||
connect( d->audioOutput, SIGNAL( tick( qint64 ) ), SLOT( timerTriggered( qint64 ) ) );
|
||||
connect( d->audioOutput, SIGNAL( positionChanged( float ) ), SLOT( onPositionChanged( float ) ) );
|
||||
|
||||
setVolume( TomahawkSettings::instance()->volume() );
|
||||
|
||||
@@ -600,7 +601,9 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
|
||||
}
|
||||
}
|
||||
|
||||
void AudioEngine::positionChanged(float new_position)
|
||||
|
||||
void
|
||||
AudioEngine::onPositionChanged( float new_position )
|
||||
{
|
||||
emit trackPosition( new_position );
|
||||
}
|
||||
|
@@ -147,8 +147,6 @@ public slots:
|
||||
void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode mode );
|
||||
void setShuffled( bool enabled );
|
||||
|
||||
void positionChanged(float new_position);
|
||||
|
||||
signals:
|
||||
void loading( const Tomahawk::result_ptr track );
|
||||
void started( const Tomahawk::result_ptr track );
|
||||
@@ -189,6 +187,7 @@ private slots:
|
||||
|
||||
void onVolumeChanged( qreal volume );
|
||||
void timerTriggered( qint64 time );
|
||||
void onPositionChanged( float new_position );
|
||||
|
||||
void setCurrentTrack( const Tomahawk::result_ptr& result );
|
||||
void onNowPlayingInfoReady( const Tomahawk::InfoSystem::InfoType type );
|
||||
|
@@ -302,14 +302,16 @@ AudioOutput::currentTime() const
|
||||
return m_currentTime;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioOutput::setCurrentPosition( float position )
|
||||
{
|
||||
//tDebug() << Q_FUNC_INFO << position;
|
||||
AudioEngine::instance()->positionChanged(position);
|
||||
emit positionChanged( position );
|
||||
m_havePosition = position > 0.0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioOutput::setCurrentTime( qint64 time )
|
||||
{
|
||||
|
@@ -74,6 +74,7 @@ public slots:
|
||||
signals:
|
||||
void stateChanged( AudioOutput::AudioState, AudioOutput::AudioState );
|
||||
void tick( qint64 );
|
||||
void positionChanged( float );
|
||||
|
||||
private:
|
||||
void setState( AudioState state );
|
||||
|
Reference in New Issue
Block a user