diff --git a/src/libtomahawk/audio/audioengine.cpp b/src/libtomahawk/audio/audioengine.cpp index b8d7abad3..9baeaeb71 100644 --- a/src/libtomahawk/audio/audioengine.cpp +++ b/src/libtomahawk/audio/audioengine.cpp @@ -219,12 +219,6 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result ) if ( !m_input.isNull() || m_isPlayingHttp ) { - if ( !m_input.isNull() ) - { - m_input->close(); - m_input.clear(); - } - m_expectStop = true; } @@ -233,6 +227,12 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result ) m_mediaObject->setCurrentSource( io.data() ); m_mediaObject->currentSource().setAutoDelete( false ); m_isPlayingHttp = false; + + if ( !m_input.isNull() ) + { + m_input->close(); + m_input.clear(); + } } else { diff --git a/src/libtomahawk/audio/dummytranscode.cpp b/src/libtomahawk/audio/dummytranscode.cpp deleted file mode 100644 index 92b5efc6e..000000000 --- a/src/libtomahawk/audio/dummytranscode.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* === This file is part of Tomahawk Player - === - * - * Copyright 2010-2011, Christian Muehlhaeuser - * - * Tomahawk is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Tomahawk is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Tomahawk. If not, see . - */ - -#include "dummytranscode.h" - -#include - -DummyTranscode::DummyTranscode() - : m_init( false ) -{ - qDebug() << Q_FUNC_INFO; -} - - -DummyTranscode::~DummyTranscode() -{ - qDebug() << Q_FUNC_INFO; -} - - -void -DummyTranscode::processData( const QByteArray &buffer, bool finish ) -{ - Q_UNUSED( finish ); - m_buffer.append( buffer ); -// qDebug() << "DUMMYTRANSCODING:" << buffer.size(); - - if( !m_init && m_buffer.size() >= 16364 ) { - m_init = true; - emit streamInitialized( 44100, 2 ); - } -} - - -void -DummyTranscode::onSeek( int seconds ) -{ - Q_UNUSED( seconds ); - m_buffer.clear(); -} - - -void -DummyTranscode::clearBuffers() -{ - m_buffer.clear(); - m_init = false; -} - diff --git a/src/libtomahawk/audio/dummytranscode.h b/src/libtomahawk/audio/dummytranscode.h deleted file mode 100644 index d38774ffd..000000000 --- a/src/libtomahawk/audio/dummytranscode.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - - Copyright (C) 2011 Leo Franchi - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - - -#ifndef DUMMYTRANSCODE_H -#define DUMMYTRANSCODE_H - -#include "audio/transcodeinterface.h" -#include "dllmacro.h" - -#define _BUFFER_PREFERRED 32768 - -class DLLEXPORT DummyTranscode : public TranscodeInterface -{ - Q_OBJECT - -public: - DummyTranscode(); - virtual ~DummyTranscode(); - - const QStringList supportedTypes() const { QStringList l; l << "audio/basic"; return l; } - - int needData() { return true; } // always eats data - bool haveData() { return !m_buffer.isEmpty(); } - - unsigned int preferredDataSize() { return _BUFFER_PREFERRED; } - - QByteArray data() { QByteArray b = m_buffer; m_buffer.clear(); return b; } - - virtual void setBufferCapacity( int bytes ) { m_bufferCapacity = bytes; } - int bufferSize() { return m_buffer.size(); } - -public slots: - virtual void clearBuffers(); - virtual void onSeek( int seconds ); - virtual void processData( const QByteArray& data, bool finish ); - -signals: - void streamInitialized( long sampleRate, int channels ); - void timeChanged( int seconds ); - -private: - QByteArray m_buffer; - int m_bufferCapacity; - bool m_init; -}; - -#endif // DUMMYTRANSCODE_H diff --git a/src/tomahawk.protocol b/src/tomahawk.protocol deleted file mode 100644 index 3a393aa61..000000000 --- a/src/tomahawk.protocol +++ /dev/null @@ -1,12 +0,0 @@ -[Protocol] -exec=/home/leo/kde/tomahawk/build/tomahawk "%u" -protocol=tomahawk -input=none -output=none -helper=true -listing= -reading=false -writing=false -makedir=false -deleting=false -