1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +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:
void onStateChanged( AudioOutput::AudioState newState, AudioOutput::AudioState oldState );
// void onAudioDataArrived( QMap< Phonon::AudioDataOutput::Channel, QVector< qint16 > > data );
private:
QSharedPointer<QIODevice> input;

View File

@@ -263,7 +263,7 @@ AudioOutput::currentTime()
void
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 ( m_totalTime == 0 ) {
m_totalTime = AudioEngine::instance()->currentTrackTotalTime();
@@ -275,6 +275,8 @@ AudioOutput::setCurrentTime( qint64 time )
// 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;
if ( total <= 0 ) {
total = AudioEngine::instance()->currentTrackTotalTime();
@@ -332,7 +334,7 @@ void
AudioOutput::pause()
{
tDebug() << Q_FUNC_INFO;
// libvlc_media_player_pause( vlcPlayer );
libvlc_media_player_set_pause ( vlcPlayer, 1 );
setState( Paused );
@@ -442,14 +444,12 @@ AudioOutput::vlcEventCallback( const libvlc_event_t* event, void* opaque )
break;
case libvlc_MediaPlayerSeekableChanged:
// 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;
case libvlc_MediaDurationChanged:
that->setTotalTime( event->u.media_duration_changed.new_duration );
break;
case libvlc_MediaPlayerLengthChanged:
// 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;
case libvlc_MediaPlayerNothingSpecial:
case libvlc_MediaPlayerOpening:

View File

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