mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-22 08:52:12 +02:00
Pass less references around threads
This commit is contained in:
parent
52701463cc
commit
ff89f015cd
src
libtomahawk-playdarapi
libtomahawk
@ -242,14 +242,14 @@ Api_v1::sid( QxtWebRequestEvent* event, QString unused )
|
||||
return send404( event );
|
||||
}
|
||||
|
||||
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback =
|
||||
boost::function< void ( const QString, QSharedPointer< QIODevice > ) > callback =
|
||||
boost::bind( &Api_v1::processSid, this, event, rp, _1, _2 );
|
||||
Tomahawk::UrlHandler::getIODeviceForUrl( rp, rp->url(), callback );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Api_v1::processSid( QxtWebRequestEvent* event, Tomahawk::result_ptr& rp, const QString& url, QSharedPointer< QIODevice >& iodev )
|
||||
Api_v1::processSid( QxtWebRequestEvent* event, const Tomahawk::result_ptr rp, const QString url, QSharedPointer< QIODevice > iodev )
|
||||
{
|
||||
Q_UNUSED( url );
|
||||
|
||||
|
@ -89,7 +89,7 @@ protected:
|
||||
void sendPlain404( QxtWebRequestEvent* event, const QString& message, const QString& statusmessage );
|
||||
|
||||
private:
|
||||
void processSid( QxtWebRequestEvent* event, Tomahawk::result_ptr&, const QString& url, QSharedPointer< QIODevice >& );
|
||||
void processSid( QxtWebRequestEvent* event, const Tomahawk::result_ptr, const QString url, QSharedPointer< QIODevice > );
|
||||
|
||||
QSharedPointer< QIODevice > m_ioDevice;
|
||||
Api_v1_5* m_api_v1_5;
|
||||
|
@ -68,7 +68,7 @@ registerIODeviceFactory( const QString &proto, IODeviceFactoryFunc fac )
|
||||
|
||||
void
|
||||
getIODeviceForUrl( const Tomahawk::result_ptr& result, const QString& url,
|
||||
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback )
|
||||
boost::function< void ( const QString, QSharedPointer< QIODevice > ) > callback )
|
||||
{
|
||||
if ( iofactories.isEmpty() )
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ namespace UrlHandler
|
||||
{
|
||||
|
||||
DLLEXPORT void getIODeviceForUrl( const Tomahawk::result_ptr&, const QString& url,
|
||||
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback );
|
||||
boost::function< void ( const QString, QSharedPointer< QIODevice > ) > callback );
|
||||
DLLEXPORT void registerIODeviceFactory( const QString& proto, IODeviceFactoryFunc fac );
|
||||
DLLEXPORT void localFileIODeviceFactory( const Tomahawk::result_ptr& result, const QString& url,
|
||||
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback );
|
||||
|
@ -686,7 +686,7 @@ AudioEngine::performLoadIODevice( const result_ptr& result, const QString& url )
|
||||
if ( !TomahawkUtils::isLocalResult( url ) && !TomahawkUtils::isHttpResult( url )
|
||||
&& !TomahawkUtils::isRtmpResult( url ) )
|
||||
{
|
||||
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback =
|
||||
boost::function< void ( const QString, QSharedPointer< QIODevice > ) > callback =
|
||||
boost::bind( &AudioEngine::performLoadTrack, this, result, _1, _2 );
|
||||
Tomahawk::UrlHandler::getIODeviceForUrl( result, url, callback );
|
||||
}
|
||||
@ -699,7 +699,7 @@ AudioEngine::performLoadIODevice( const result_ptr& result, const QString& url )
|
||||
|
||||
|
||||
void
|
||||
AudioEngine::performLoadTrack( const Tomahawk::result_ptr& result, const QString& url, QSharedPointer< QIODevice >& io )
|
||||
AudioEngine::performLoadTrack( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io )
|
||||
{
|
||||
Q_D( AudioEngine );
|
||||
if ( currentTrack() != result )
|
||||
|
@ -178,7 +178,7 @@ signals:
|
||||
private slots:
|
||||
void loadTrack( const Tomahawk::result_ptr& result ); //async!
|
||||
void performLoadIODevice( const Tomahawk::result_ptr& result, const QString& url ); //only call from loadTrack kthxbi
|
||||
void performLoadTrack( const Tomahawk::result_ptr& result, const QString& url, QSharedPointer< QIODevice >& io ); //only call from loadTrack or performLoadIODevice kthxbi
|
||||
void performLoadTrack( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io ); //only call from loadTrack or performLoadIODevice kthxbi
|
||||
void loadPreviousTrack();
|
||||
void loadNextTrack();
|
||||
|
||||
|
@ -188,14 +188,14 @@ StreamConnection::startSending( const Tomahawk::result_ptr& result )
|
||||
m_result = result;
|
||||
qDebug() << "Starting to transmit" << m_result->url();
|
||||
|
||||
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback =
|
||||
boost::function< void ( const QString, QSharedPointer< QIODevice > ) > callback =
|
||||
boost::bind( &StreamConnection::reallyStartSending, this, result, _1, _2 );
|
||||
Tomahawk::UrlHandler::getIODeviceForUrl( m_result, m_result->url(), callback );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
StreamConnection::reallyStartSending( const Tomahawk::result_ptr& result, const QString& url, QSharedPointer< QIODevice >& io )
|
||||
StreamConnection::reallyStartSending( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io )
|
||||
{
|
||||
Q_UNUSED( url );
|
||||
|
||||
|
@ -73,7 +73,7 @@ protected slots:
|
||||
|
||||
private slots:
|
||||
void startSending( const Tomahawk::result_ptr& result );
|
||||
void reallyStartSending( const Tomahawk::result_ptr& result, const QString& url, QSharedPointer< QIODevice >& io ); //only called back from startSending
|
||||
void reallyStartSending( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io ); //only called back from startSending
|
||||
void sendSome();
|
||||
void showStats( qint64 tx, qint64 rx );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user