mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 23:26:40 +02:00
Add debug
This commit is contained in:
committed by
Dominik Schmidt
parent
9b4cde3ab5
commit
7ebd08c791
@@ -435,7 +435,7 @@ AudioControls::onPlaybackStopped()
|
|||||||
void
|
void
|
||||||
AudioControls::onPlaybackTimer( qint64 msElapsed )
|
AudioControls::onPlaybackTimer( qint64 msElapsed )
|
||||||
{
|
{
|
||||||
//tDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
m_phononTickCheckTimer.stop();
|
m_phononTickCheckTimer.stop();
|
||||||
|
|
||||||
@@ -459,15 +459,14 @@ AudioControls::onPlaybackTimer( qint64 msElapsed )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int currentTime = m_sliderTimeLine.currentTime();
|
int currentTime = m_sliderTimeLine.currentTime();
|
||||||
//tDebug( LOGEXTRA ) << Q_FUNC_INFO << "msElapsed =" << msElapsed << "and timer current time =" << m_sliderTimeLine.currentTime();
|
tDebug( LOGEXTRA ) << Q_FUNC_INFO << "msElapsed =" << msElapsed << "and timer current time =" << currentTime << "and audio engine state is" << (int)AudioEngine::instance()->state();
|
||||||
|
|
||||||
// First condition checks for the common case where
|
// First condition checks for the common case where
|
||||||
// 1) the track has been started
|
// 1) the track has been started
|
||||||
// 2) we haven't seeked,
|
// 2) we haven't seeked,
|
||||||
// 3) the timeline is pretty close to the actual time elapsed, within ALLOWED_MAX_DIVERSIONmsec, so no adustment needed, and
|
// 3) the timeline is pretty close to the actual time elapsed, within ALLOWED_MAX_DIVERSIONmsec, so no adustment needed, and
|
||||||
// 4) The audio engine is actually currently running
|
// 4) The audio engine is actually currently running
|
||||||
if ( msElapsed > 0
|
if ( !m_seeked
|
||||||
&& !m_seeked
|
|
||||||
&& qAbs( msElapsed - currentTime ) <= ALLOWED_MAX_DIVERSION
|
&& qAbs( msElapsed - currentTime ) <= ALLOWED_MAX_DIVERSION
|
||||||
&& AudioEngine::instance()->state() == AudioEngine::Playing )
|
&& AudioEngine::instance()->state() == AudioEngine::Playing )
|
||||||
{
|
{
|
||||||
@@ -478,14 +477,14 @@ AudioControls::onPlaybackTimer( qint64 msElapsed )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//tDebug() << Q_FUNC_INFO << "Fallthrough";
|
tDebug() << Q_FUNC_INFO << "Fallthrough";
|
||||||
// If we're in here we're offset, so we need to do some munging around
|
// If we're in here we're offset, so we need to do some munging around
|
||||||
ui->seekSlider->blockSignals( true );
|
ui->seekSlider->blockSignals( true );
|
||||||
|
|
||||||
// First handle seeks
|
// First handle seeks
|
||||||
if ( m_seeked )
|
if ( m_seeked )
|
||||||
{
|
{
|
||||||
//tDebug() << Q_FUNC_INFO << "Seeked";
|
tDebug() << Q_FUNC_INFO << "Seeked";
|
||||||
m_sliderTimeLine.setPaused( true );
|
m_sliderTimeLine.setPaused( true );
|
||||||
m_sliderTimeLine.setCurrentTime( msElapsed );
|
m_sliderTimeLine.setCurrentTime( msElapsed );
|
||||||
m_seeked = false;
|
m_seeked = false;
|
||||||
@@ -496,7 +495,7 @@ AudioControls::onPlaybackTimer( qint64 msElapsed )
|
|||||||
// However, a Phonon bug means that after a seek we'll actually have AudioEngine's state be Playing, when it ain't, so have to detect that
|
// However, a Phonon bug means that after a seek we'll actually have AudioEngine's state be Playing, when it ain't, so have to detect that
|
||||||
else if ( AudioEngine::instance()->state() == AudioEngine::Playing )
|
else if ( AudioEngine::instance()->state() == AudioEngine::Playing )
|
||||||
{
|
{
|
||||||
//tDebug() << Q_FUNC_INFO << "AudioEngine playing";
|
tDebug() << Q_FUNC_INFO << "AudioEngine playing";
|
||||||
m_sliderTimeLine.setPaused( true );
|
m_sliderTimeLine.setPaused( true );
|
||||||
m_sliderTimeLine.setCurrentTime( msElapsed );
|
m_sliderTimeLine.setCurrentTime( msElapsed );
|
||||||
if ( msElapsed != m_lastSliderCheck )
|
if ( msElapsed != m_lastSliderCheck )
|
||||||
@@ -505,7 +504,7 @@ AudioControls::onPlaybackTimer( qint64 msElapsed )
|
|||||||
// Finally, the case where the audioengine isn't playing; if the timeline is still running, pause it and catch up
|
// Finally, the case where the audioengine isn't playing; if the timeline is still running, pause it and catch up
|
||||||
else if ( AudioEngine::instance()->state() != AudioEngine::Playing )
|
else if ( AudioEngine::instance()->state() != AudioEngine::Playing )
|
||||||
{
|
{
|
||||||
//tDebug() << Q_FUNC_INFO << "AudioEngine not playing";
|
tDebug() << Q_FUNC_INFO << "AudioEngine not playing";
|
||||||
if ( msElapsed != currentTime || m_sliderTimeLine.state() == QTimeLine::Running)
|
if ( msElapsed != currentTime || m_sliderTimeLine.state() == QTimeLine::Running)
|
||||||
{
|
{
|
||||||
m_sliderTimeLine.setPaused( true );
|
m_sliderTimeLine.setPaused( true );
|
||||||
|
@@ -42,7 +42,7 @@ Q_OBJECT
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
enum AudioErrorCode { StreamReadError, AudioDeviceError, DecodeError, UnknownError, NoError };
|
enum AudioErrorCode { StreamReadError, AudioDeviceError, DecodeError, UnknownError, NoError };
|
||||||
enum AudioState { Stopped, Playing, Paused, Error, Loading };
|
enum AudioState { Stopped = 0, Playing = 1, Paused = 2, Error = 3, Loading = 4 };
|
||||||
|
|
||||||
static AudioEngine* instance();
|
static AudioEngine* instance();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user