1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 13:47:26 +02:00

let's clean it a bit

This commit is contained in:
dridri
2014-10-01 19:20:46 +02:00
committed by Uwe L. Korn
parent a1e7af361e
commit abba474373
3 changed files with 4 additions and 12 deletions

View File

@@ -32,7 +32,6 @@ public:
public slots: public slots:
void onStateChanged( AudioOutput::AudioState newState, AudioOutput::AudioState oldState ); void onStateChanged( AudioOutput::AudioState newState, AudioOutput::AudioState oldState );
// void onAudioDataArrived( QMap< Phonon::AudioDataOutput::Channel, QVector< qint16 > > data );
private: private:
QSharedPointer<QIODevice> input; QSharedPointer<QIODevice> input;

View File

@@ -263,7 +263,7 @@ AudioOutput::currentTime()
void void
AudioOutput::setCurrentTime( qint64 time ) AudioOutput::setCurrentTime( qint64 time )
{ {
// TODO : This is a bit hacky, but m_totalTime is only used to determine // FIXME : This is a bit hacky, but m_totalTime is only used to determine
// if we are about to finish // if we are about to finish
if ( m_totalTime == 0 ) { if ( m_totalTime == 0 ) {
m_totalTime = AudioEngine::instance()->currentTrackTotalTime(); m_totalTime = AudioEngine::instance()->currentTrackTotalTime();
@@ -275,6 +275,8 @@ AudioOutput::setCurrentTime( qint64 time )
// tDebug() << "Current time : " << m_currentTime << " / " << m_totalTime; // tDebug() << "Current time : " << m_currentTime << " / " << m_totalTime;
// FIXME pt 2 : we use temporary variable to avoid overriding m_totalTime
// in the case it is < 0 (which means that the media is not seekable)
qint64 total = m_totalTime; qint64 total = m_totalTime;
if ( total <= 0 ) { if ( total <= 0 ) {
total = AudioEngine::instance()->currentTrackTotalTime(); total = AudioEngine::instance()->currentTrackTotalTime();
@@ -332,7 +334,7 @@ void
AudioOutput::pause() AudioOutput::pause()
{ {
tDebug() << Q_FUNC_INFO; tDebug() << Q_FUNC_INFO;
// libvlc_media_player_pause( vlcPlayer );
libvlc_media_player_set_pause ( vlcPlayer, 1 ); libvlc_media_player_set_pause ( vlcPlayer, 1 );
setState( Paused ); setState( Paused );
@@ -442,14 +444,12 @@ AudioOutput::vlcEventCallback( const libvlc_event_t* event, void* opaque )
break; break;
case libvlc_MediaPlayerSeekableChanged: case libvlc_MediaPlayerSeekableChanged:
// tDebug() << Q_FUNC_INFO << " : seekable changed : " << event->u.media_player_seekable_changed.new_seekable; // tDebug() << Q_FUNC_INFO << " : seekable changed : " << event->u.media_player_seekable_changed.new_seekable;
//TODO, bool event->u.media_player_seekable_changed.new_seekable
break; break;
case libvlc_MediaDurationChanged: case libvlc_MediaDurationChanged:
that->setTotalTime( event->u.media_duration_changed.new_duration ); that->setTotalTime( event->u.media_duration_changed.new_duration );
break; break;
case libvlc_MediaPlayerLengthChanged: case libvlc_MediaPlayerLengthChanged:
// tDebug() << Q_FUNC_INFO << " : length changed : " << event->u.media_player_length_changed.new_length; // tDebug() << Q_FUNC_INFO << " : length changed : " << event->u.media_player_length_changed.new_length;
// that->setTotalTime( event->u.media_player_length_changed.new_length );
break; break;
case libvlc_MediaPlayerNothingSpecial: case libvlc_MediaPlayerNothingSpecial:
case libvlc_MediaPlayerOpening: case libvlc_MediaPlayerOpening:

View File

@@ -164,8 +164,6 @@ MediaStream::readCallback ( void* data, const char* cookie, int64_t* dts, int64_
qint64 bufsize = 0; qint64 bufsize = 0;
*bufferSize = 0; *bufferSize = 0;
// tDebug() << Q_FUNC_INFO << " ---- type : " << that->m_type;
if ( that->m_eos == true ) { if ( that->m_eos == true ) {
return -1; return -1;
} }
@@ -176,7 +174,6 @@ MediaStream::readCallback ( void* data, const char* cookie, int64_t* dts, int64_
else if ( that->m_type == IODevice ) { else if ( that->m_type == IODevice ) {
bufsize = that->m_ioDevice->read( that->m_buffer, BLOCK_SIZE ); bufsize = that->m_ioDevice->read( that->m_buffer, BLOCK_SIZE );
*buffer = that->m_buffer; *buffer = that->m_buffer;
// tDebug() << "readCallback(QIODevice) returning bufsize : " << bufsize;
} }
if ( bufsize > 0 ) { if ( bufsize > 0 ) {
@@ -199,8 +196,6 @@ MediaStream::readCallback ( void* data, const char* cookie, int64_t* dts, int64_
int int
MediaStream::readDoneCallback ( void *data, const char *cookie, size_t bufferSize, void *buffer ) MediaStream::readDoneCallback ( void *data, const char *cookie, size_t bufferSize, void *buffer )
{ {
// tDebug() << Q_FUNC_INFO;
Q_UNUSED(cookie); Q_UNUSED(cookie);
Q_UNUSED(bufferSize); Q_UNUSED(bufferSize);
@@ -217,8 +212,6 @@ MediaStream::readDoneCallback ( void *data, const char *cookie, size_t bufferSiz
int int
MediaStream::seekCallback ( void *data, const uint64_t pos ) MediaStream::seekCallback ( void *data, const uint64_t pos )
{ {
tDebug() << Q_FUNC_INFO;
MediaStream* that = static_cast < MediaStream * > ( data ); MediaStream* that = static_cast < MediaStream * > ( data );
if ( that->m_type == Stream && static_cast < int64_t > ( pos ) > that->streamSize() ) { if ( that->m_type == Stream && static_cast < int64_t > ( pos ) > that->streamSize() ) {