mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 16:44:05 +02:00
Merge remote branch 'origin/master' into dynamic
Conflicts: src/CMakeLists.txt src/libtomahawk/CMakeLists.txt src/libtomahawk/playlist/playlistmanager.cpp src/libtomahawk/playlist/playlistmanager.h src/tomahawkwindow.cpp
This commit is contained in:
@@ -1 +1 @@
|
||||
58
|
||||
61
|
@@ -13,7 +13,7 @@ SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
#ADD_DEFINITIONS(-Wall -O2 -DNDEBUG)
|
||||
#ADD_DEFINITIONS(-fPIC)
|
||||
ADD_DEFINITIONS(-fPIC)
|
||||
|
||||
SET(AUDIO_LIBS "")
|
||||
|
||||
|
@@ -3,14 +3,11 @@
|
||||
|
||||
#define APP TomahawkApp::instance()
|
||||
|
||||
#define RESPATH ":/data/"
|
||||
|
||||
#include "headlesscheck.h"
|
||||
|
||||
#include <QRegExp>
|
||||
#include <QFile>
|
||||
#include <QSettings>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QDir>
|
||||
|
||||
#include "QxtHttpServerConnector"
|
||||
@@ -61,16 +58,12 @@ public:
|
||||
|
||||
static TomahawkApp* instance();
|
||||
|
||||
AudioEngine* audioEngine() { return m_audioEngine; }
|
||||
SipHandler* sipHandler() { return m_sipHandler; }
|
||||
QNetworkAccessManager* nam() { return m_nam; }
|
||||
QNetworkProxy* proxy() { return m_proxy; }
|
||||
Tomahawk::InfoSystem::InfoSystem* infoSystem() { return m_infoSystem; }
|
||||
XMPPBot* xmppBot() { return m_xmppBot; }
|
||||
|
||||
#ifndef TOMAHAWK_HEADLESS
|
||||
AudioControls* audioControls();
|
||||
PlaylistManager* playlistManager();
|
||||
TomahawkWindow* mainWindow() const { return m_mainwindow; }
|
||||
#endif
|
||||
|
||||
@@ -107,9 +100,6 @@ private:
|
||||
|
||||
bool m_headless;
|
||||
|
||||
QNetworkAccessManager* m_nam;
|
||||
QNetworkProxy* m_proxy;
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem* m_infoSystem;
|
||||
|
||||
QxtHttpServerConnector m_connector;
|
||||
|
@@ -1,10 +1,3 @@
|
||||
SET( tomahawkSourcesGui ${tomahawkSourcesGui} audio/rtaudiooutput.cpp )
|
||||
SET( tomahawkHeadersGui ${tomahawkHeadersGui} audio/rtaudiooutput.h )
|
||||
|
||||
FIND_LIBRARY( COREAUDIO_LIBRARY CoreAudio )
|
||||
FIND_LIBRARY( COREFOUNDATION_LIBRARY CoreFoundation )
|
||||
MARK_AS_ADVANCED( COREAUDIO_LIBRARY COREFOUNDATION_LIBRARY )
|
||||
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
${COREAUDIO_LIBRARY}
|
||||
|
@@ -27,13 +27,6 @@ SET( TOMAHAWK_INC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../include/" )
|
||||
#ENDFOREACH( moddir )
|
||||
|
||||
SET( tomahawkSources ${tomahawkSources}
|
||||
audio/madtranscode.cpp
|
||||
audio/vorbistranscode.cpp
|
||||
audio/flactranscode.cpp
|
||||
audio/audioengine.cpp
|
||||
|
||||
utils/tomahawkutils.cpp
|
||||
|
||||
sip/SipHandler.cpp
|
||||
|
||||
infosystem/infosystem.cpp
|
||||
@@ -52,36 +45,6 @@ SET( tomahawkSources ${tomahawkSources}
|
||||
)
|
||||
|
||||
SET( tomahawkSourcesGui ${tomahawkSourcesGui}
|
||||
utils/querylabel.cpp
|
||||
utils/elidedlabel.cpp
|
||||
utils/imagebutton.cpp
|
||||
utils/progresstreeview.cpp
|
||||
utils/proxystyle.cpp
|
||||
utils/widgetdragfilter.cpp
|
||||
utils/animatedsplitter.cpp
|
||||
|
||||
playlist/collectionmodel.cpp
|
||||
playlist/collectionproxymodel.cpp
|
||||
playlist/collectionflatmodel.cpp
|
||||
playlist/collectionview.cpp
|
||||
playlist/playlistmanager.cpp
|
||||
playlist/plitem.cpp
|
||||
playlist/playlistmodel.cpp
|
||||
playlist/playlistproxymodel.cpp
|
||||
playlist/playlistview.cpp
|
||||
playlist/playlistitemdelegate.cpp
|
||||
playlist/queueproxymodel.cpp
|
||||
playlist/queueview.cpp
|
||||
playlist/trackmodel.cpp
|
||||
playlist/trackproxymodel.cpp
|
||||
playlist/trackview.cpp
|
||||
playlist/trackheader.cpp
|
||||
playlist/albumitem.cpp
|
||||
playlist/albummodel.cpp
|
||||
playlist/albumproxymodel.cpp
|
||||
playlist/albumitemdelegate.cpp
|
||||
playlist/albumview.cpp
|
||||
|
||||
sourcetree/sourcesmodel.cpp
|
||||
sourcetree/sourcetreeitem.cpp
|
||||
sourcetree/sourcetreeitemwidget.cpp
|
||||
@@ -93,17 +56,6 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui}
|
||||
topbar/lineedit.cpp
|
||||
topbar/searchbutton.cpp
|
||||
|
||||
infowidgets/sourceinfowidget.cpp
|
||||
|
||||
dynamic/widgets/DynamicWidget.cpp
|
||||
dynamic/widgets/DynamicControlWidget.cpp
|
||||
dynamic/widgets/DynamicControlList.cpp
|
||||
dynamic/widgets/ReadOrWriteWidget.cpp
|
||||
|
||||
widgets/newplaylistwidget.cpp
|
||||
widgets/welcomewidget.cpp
|
||||
|
||||
xspfloader.cpp
|
||||
transferview.cpp
|
||||
tomahawktrayicon.cpp
|
||||
audiocontrols.cpp
|
||||
@@ -115,12 +67,6 @@ SET( tomahawkHeaders ${tomahawkHeaders}
|
||||
"${TOMAHAWK_INC_DIR}/tomahawk/tomahawkapp.h"
|
||||
"${TOMAHAWK_INC_DIR}/tomahawk/infosystem.h"
|
||||
|
||||
audio/transcodeinterface.h
|
||||
audio/madtranscode.h
|
||||
audio/vorbistranscode.h
|
||||
audio/flactranscode.h
|
||||
audio/audioengine.h
|
||||
|
||||
sip/SipHandler.h
|
||||
|
||||
infosystem/infoplugins/echonestplugin.h
|
||||
@@ -135,36 +81,6 @@ SET( tomahawkHeaders ${tomahawkHeaders}
|
||||
)
|
||||
|
||||
SET( tomahawkHeadersGui ${tomahawkHeadersGui}
|
||||
utils/querylabel.h
|
||||
utils/elidedlabel.h
|
||||
utils/animatedcounterlabel.h
|
||||
utils/imagebutton.h
|
||||
utils/progresstreeview.h
|
||||
utils/widgetdragfilter.h
|
||||
utils/animatedsplitter.h
|
||||
|
||||
playlist/collectionmodel.h
|
||||
playlist/collectionproxymodel.h
|
||||
playlist/collectionflatmodel.h
|
||||
playlist/collectionview.h
|
||||
playlist/playlistmanager.h
|
||||
playlist/plitem.h
|
||||
playlist/playlistmodel.h
|
||||
playlist/playlistproxymodel.h
|
||||
playlist/playlistview.h
|
||||
playlist/playlistitemdelegate.h
|
||||
playlist/queueproxymodel.h
|
||||
playlist/queueview.h
|
||||
playlist/trackmodel.h
|
||||
playlist/trackproxymodel.h
|
||||
playlist/trackview.h
|
||||
playlist/trackheader.h
|
||||
playlist/albumitem.h
|
||||
playlist/albummodel.h
|
||||
playlist/albumproxymodel.h
|
||||
playlist/albumitemdelegate.h
|
||||
playlist/albumview.h
|
||||
|
||||
sourcetree/sourcesmodel.h
|
||||
sourcetree/sourcetreeitem.h
|
||||
sourcetree/sourcetreeitemwidget.h
|
||||
@@ -177,17 +93,6 @@ SET( tomahawkHeadersGui ${tomahawkHeadersGui}
|
||||
topbar/lineedit_p.h
|
||||
topbar/searchbutton.h
|
||||
|
||||
infowidgets/sourceinfowidget.h
|
||||
|
||||
dynamic/widgets/DynamicWidget.h
|
||||
dynamic/widgets/DynamicControlWidget.h
|
||||
dynamic/widgets/DynamicControlList.h
|
||||
dynamic/widgets/ReadOrWriteWidget.h
|
||||
|
||||
widgets/newplaylistwidget.h
|
||||
widgets/welcomewidget.h
|
||||
|
||||
xspfloader.h
|
||||
transferview.h
|
||||
tomahawktrayicon.h
|
||||
audiocontrols.h
|
||||
@@ -203,10 +108,6 @@ SET( tomahawkUI ${tomahawkUI}
|
||||
audiocontrols.ui
|
||||
sourcetree/sourcetreeitemwidget.ui
|
||||
topbar/topbar.ui
|
||||
|
||||
infowidgets/sourceinfowidget.ui
|
||||
widgets/newplaylistwidget.ui
|
||||
widgets/welcomewidget.ui
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
@@ -221,11 +122,10 @@ INCLUDE_DIRECTORIES(
|
||||
sourcetree
|
||||
topbar
|
||||
utils
|
||||
dynamic
|
||||
libtomahawk
|
||||
|
||||
../rtaudio
|
||||
../alsa-playback
|
||||
../rtaudio
|
||||
../qxt/qxtweb-standalone/qxtweb
|
||||
|
||||
/usr/include/taglib
|
||||
|
@@ -39,17 +39,8 @@ SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../build/src/libtomahawk/libtomahawklib.dll"
|
||||
)
|
||||
|
||||
SET( tomahawkSourcesGui ${tomahawkSourcesGui} audio/rtaudiooutput.cpp )
|
||||
SET( tomahawkHeadersGui ${tomahawkHeadersGui} audio/rtaudiooutput.h )
|
||||
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
"dsound.dll"
|
||||
"winmm.dll"
|
||||
"iphlpapi.a"
|
||||
"mad"
|
||||
"vorbisfile"
|
||||
"ogg"
|
||||
"FLAC++"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../rtaudio/librtaudio.dll"
|
||||
|
||||
)
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#include <QNetworkReply>
|
||||
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
#include "album.h"
|
||||
#include "audio/audioengine.h"
|
||||
#include "playlist/playlistmanager.h"
|
||||
#include "utils/imagebutton.h"
|
||||
#include "utils/tomahawkutils.h"
|
||||
|
||||
#include "audioengine.h"
|
||||
#include "imagebutton.h"
|
||||
#include "playlist/playlistmanager.h"
|
||||
#include "album.h"
|
||||
|
||||
#define LASTFM_DEFAULT_COVER "http://cdn.last.fm/flatness/catalogue/noimage"
|
||||
|
||||
@@ -83,7 +83,7 @@ AudioControls::AudioControls( QWidget* parent )
|
||||
|
||||
ui->volumeSlider->setFixedHeight( 20 );
|
||||
ui->volumeSlider->setRange( 0, 100 );
|
||||
ui->volumeSlider->setValue( APP->audioEngine()->volume() );
|
||||
ui->volumeSlider->setValue( AudioEngine::instance()->volume() );
|
||||
ui->volumeSlider->setStyleSheet( "QSlider::groove::horizontal {"
|
||||
"margin: 5px; border-width: 3px;"
|
||||
"border-image: url(" RESPATH "images/volume-slider-bkg.png) 3 3 3 3 stretch stretch;"
|
||||
@@ -113,13 +113,13 @@ AudioControls::AudioControls( QWidget* parent )
|
||||
connect( m_prevAction, SIGNAL( triggered() ), (QObject*)APP->audioEngine(), SLOT( previous() ) );
|
||||
connect( m_nextAction, SIGNAL( triggered() ), (QObject*)APP->audioEngine(), SLOT( next() ) ); */
|
||||
|
||||
connect( ui->volumeSlider, SIGNAL( valueChanged( int ) ), (QObject*)APP->audioEngine(), SLOT( setVolume( int ) ) );
|
||||
connect( ui->prevButton, SIGNAL( clicked() ), (QObject*)APP->audioEngine(), SLOT( previous() ) );
|
||||
connect( ui->playPauseButton, SIGNAL( clicked() ), (QObject*)APP->audioEngine(), SLOT( play() ) );
|
||||
connect( ui->pauseButton, SIGNAL( clicked() ), (QObject*)APP->audioEngine(), SLOT( pause() ) );
|
||||
connect( ui->nextButton, SIGNAL( clicked() ), (QObject*)APP->audioEngine(), SLOT( next() ) );
|
||||
connect( ui->volumeLowButton, SIGNAL( clicked() ), (QObject*)APP->audioEngine(), SLOT( lowerVolume() ) );
|
||||
connect( ui->volumeHighButton, SIGNAL( clicked() ), (QObject*)APP->audioEngine(), SLOT( raiseVolume() ) );
|
||||
connect( ui->volumeSlider, SIGNAL( valueChanged( int ) ), AudioEngine::instance(), SLOT( setVolume( int ) ) );
|
||||
connect( ui->prevButton, SIGNAL( clicked() ), AudioEngine::instance(), SLOT( previous() ) );
|
||||
connect( ui->playPauseButton, SIGNAL( clicked() ), AudioEngine::instance(), SLOT( play() ) );
|
||||
connect( ui->pauseButton, SIGNAL( clicked() ), AudioEngine::instance(), SLOT( pause() ) );
|
||||
connect( ui->nextButton, SIGNAL( clicked() ), AudioEngine::instance(), SLOT( next() ) );
|
||||
connect( ui->volumeLowButton, SIGNAL( clicked() ), AudioEngine::instance(), SLOT( lowerVolume() ) );
|
||||
connect( ui->volumeHighButton, SIGNAL( clicked() ), AudioEngine::instance(), SLOT( raiseVolume() ) );
|
||||
|
||||
connect( ui->repeatButton, SIGNAL( clicked() ), SLOT( onRepeatClicked() ) );
|
||||
connect( ui->shuffleButton, SIGNAL( clicked() ), SLOT( onShuffleClicked() ) );
|
||||
@@ -128,13 +128,13 @@ AudioControls::AudioControls( QWidget* parent )
|
||||
connect( ui->albumLabel, SIGNAL( clicked() ), SLOT( onAlbumClicked() ) );
|
||||
|
||||
// <From AudioEngine>
|
||||
connect( (QObject*)APP->audioEngine(), SIGNAL( loading( Tomahawk::result_ptr ) ), SLOT( onPlaybackLoading( Tomahawk::result_ptr ) ) );
|
||||
connect( (QObject*)APP->audioEngine(), SIGNAL( started( Tomahawk::result_ptr ) ), SLOT( onPlaybackStarted( Tomahawk::result_ptr ) ) );
|
||||
connect( (QObject*)APP->audioEngine(), SIGNAL( paused() ), SLOT( onPlaybackPaused() ) );
|
||||
connect( (QObject*)APP->audioEngine(), SIGNAL( resumed() ), SLOT( onPlaybackResumed() ) );
|
||||
connect( (QObject*)APP->audioEngine(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ) );
|
||||
connect( (QObject*)APP->audioEngine(), SIGNAL( timerSeconds( unsigned int ) ), SLOT( onPlaybackTimer( unsigned int ) ) );
|
||||
connect( (QObject*)APP->audioEngine(), SIGNAL( volumeChanged( int ) ), SLOT( onVolumeChanged( int ) ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( loading( Tomahawk::result_ptr ) ), SLOT( onPlaybackLoading( Tomahawk::result_ptr ) ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), SLOT( onPlaybackStarted( Tomahawk::result_ptr ) ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( paused() ), SLOT( onPlaybackPaused() ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( resumed() ), SLOT( onPlaybackResumed() ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( timerSeconds( unsigned int ) ), SLOT( onPlaybackTimer( unsigned int ) ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( volumeChanged( int ) ), SLOT( onVolumeChanged( int ) ) );
|
||||
|
||||
m_defaultCover = QPixmap( RESPATH "images/no-album-art-placeholder.png" )
|
||||
.scaled( ui->coverImage->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
|
||||
@@ -200,7 +200,7 @@ AudioControls::onCoverArtDownloaded()
|
||||
{
|
||||
// Follow HTTP redirect
|
||||
QNetworkRequest req( redir );
|
||||
QNetworkReply* reply = APP->nam()->get( req );
|
||||
QNetworkReply* reply = TomahawkUtils::nam()->get( req );
|
||||
connect( reply, SIGNAL( finished() ), SLOT( onCoverArtDownloaded() ) );
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ AudioControls::onPlaybackStarted( const Tomahawk::result_ptr& result )
|
||||
|
||||
QString imgurl = "http://ws.audioscrobbler.com/2.0/?method=album.imageredirect&artist=%1&album=%2&size=medium&api_key=7a90f6672a04b809ee309af169f34b8b";
|
||||
QNetworkRequest req( imgurl.arg( result->artist()->name() ).arg( result->album()->name() ) );
|
||||
QNetworkReply* reply = APP->nam()->get( req );
|
||||
QNetworkReply* reply = TomahawkUtils::nam()->get( req );
|
||||
connect( reply, SIGNAL( finished() ), SLOT( onCoverArtDownloaded() ) );
|
||||
}
|
||||
|
||||
@@ -359,21 +359,21 @@ AudioControls::onRepeatClicked()
|
||||
case PlaylistInterface::NoRepeat:
|
||||
{
|
||||
// switch to RepeatOne
|
||||
APP->playlistManager()->setRepeatMode( PlaylistInterface::RepeatOne );
|
||||
PlaylistManager::instance()->setRepeatMode( PlaylistInterface::RepeatOne );
|
||||
}
|
||||
break;
|
||||
|
||||
case PlaylistInterface::RepeatOne:
|
||||
{
|
||||
// switch to RepeatAll
|
||||
APP->playlistManager()->setRepeatMode( PlaylistInterface::RepeatAll );
|
||||
PlaylistManager::instance()->setRepeatMode( PlaylistInterface::RepeatAll );
|
||||
}
|
||||
break;
|
||||
|
||||
case PlaylistInterface::RepeatAll:
|
||||
{
|
||||
// switch to NoRepeat
|
||||
APP->playlistManager()->setRepeatMode( PlaylistInterface::NoRepeat );
|
||||
PlaylistManager::instance()->setRepeatMode( PlaylistInterface::NoRepeat );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -408,19 +408,19 @@ AudioControls::onShuffleModeChanged( bool enabled )
|
||||
void
|
||||
AudioControls::onShuffleClicked()
|
||||
{
|
||||
APP->playlistManager()->setShuffled( m_shuffled ^ true );
|
||||
PlaylistManager::instance()->setShuffled( m_shuffled ^ true );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioControls::onTrackClicked()
|
||||
{
|
||||
APP->playlistManager()->showCurrentTrack();
|
||||
PlaylistManager::instance()->showCurrentTrack();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioControls::onAlbumClicked()
|
||||
{
|
||||
APP->playlistManager()->show( m_currentTrack->album() );
|
||||
PlaylistManager::instance()->show( m_currentTrack->album() );
|
||||
}
|
||||
|
@@ -492,12 +492,12 @@
|
||||
<customwidget>
|
||||
<class>ImageButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>imagebutton.h</header>
|
||||
<header>utils/imagebutton.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QueryLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>querylabel.h</header>
|
||||
<header>utils/querylabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
|
@@ -44,7 +44,7 @@ void MusixMatchPlugin::getInfo(const QString &caller, const InfoType type, const
|
||||
url.addQueryItem("apikey", m_apiKey);
|
||||
url.addQueryItem("q_artist", artist);
|
||||
url.addQueryItem("q_track", track);
|
||||
QNetworkReply* reply = TomahawkApp::instance()->nam()->get(QNetworkRequest(url));
|
||||
QNetworkReply* reply = TomahawkUtils::nam()->get(QNetworkRequest(url));
|
||||
reply->setProperty("customData", QVariant::fromValue<Tomahawk::InfoSystem::InfoCustomDataHash>(customData));
|
||||
reply->setProperty("origData", data);
|
||||
reply->setProperty("caller", caller);
|
||||
@@ -104,7 +104,7 @@ void MusixMatchPlugin::trackSearchSlot()
|
||||
QUrl url(requestString);
|
||||
url.addQueryItem("apikey", m_apiKey);
|
||||
url.addQueryItem("track_id", track_id);
|
||||
QNetworkReply* newReply = TomahawkApp::instance()->nam()->get(QNetworkRequest(url));
|
||||
QNetworkReply* newReply = TomahawkUtils::nam()->get(QNetworkRequest(url));
|
||||
newReply->setProperty("origData", oldReply->property("origData"));
|
||||
newReply->setProperty("customData", oldReply->property("customData"));
|
||||
newReply->setProperty("caller", oldReply->property("caller"));
|
||||
@@ -133,4 +133,4 @@ void MusixMatchPlugin::trackLyricsSlot()
|
||||
qDebug() << "Emitting lyrics: " << lyrics;
|
||||
emit info(reply->property("caller").toString(), Tomahawk::InfoSystem::InfoTrackLyrics, reply->property("origData"), QVariant(lyrics), reply->property("customData").value<Tomahawk::InfoSystem::InfoCustomDataHash>());
|
||||
emit finished(reply->property("caller").toString(), Tomahawk::InfoSystem::InfoTrackLyrics);
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
project( tomahawklib )
|
||||
|
||||
SET( QT_USE_QTGUI TRUE )
|
||||
SET( QT_USE_QTSQL TRUE )
|
||||
SET( QT_USE_QTNETWORK TRUE )
|
||||
SET( QT_USE_QTXML TRUE )
|
||||
@@ -26,14 +27,15 @@ set( libSources
|
||||
|
||||
sip/SipPlugin.cpp
|
||||
|
||||
network/bufferiodevice.cpp
|
||||
network/msgprocessor.cpp
|
||||
network/filetransferconnection.cpp
|
||||
network/dbsyncconnection.cpp
|
||||
network/remotecollection.cpp
|
||||
network/portfwdthread.cpp
|
||||
|
||||
audio/madtranscode.cpp
|
||||
audio/vorbistranscode.cpp
|
||||
audio/flactranscode.cpp
|
||||
audio/audioengine.cpp
|
||||
|
||||
database/database.cpp
|
||||
database/fuzzyindex.cpp
|
||||
database/databasecollection.cpp
|
||||
database/databaseworker.cpp
|
||||
database/databaseimpl.cpp
|
||||
database/databaseresolver.cpp
|
||||
@@ -65,19 +67,65 @@ set( libSources
|
||||
database/databasecommand_loaddynamicplaylist.cpp
|
||||
database/databasecommand_loadalldynamicplaylists.cpp
|
||||
database/databasecommand_deletedynamicplaylist.cpp
|
||||
|
||||
dynamic/DynamicPlaylist.cpp
|
||||
dynamic/DynamicControl.cpp
|
||||
dynamic/GeneratorFactory.cpp
|
||||
dynamic/GeneratorInterface.cpp
|
||||
dynamic/echonest/EchonestGenerator.cpp
|
||||
dynamic/echonest/EchonestControl.cpp
|
||||
|
||||
database/database.cpp
|
||||
|
||||
playlist/collectionmodel.cpp
|
||||
playlist/collectionproxymodel.cpp
|
||||
playlist/collectionflatmodel.cpp
|
||||
playlist/collectionview.cpp
|
||||
playlist/playlistmanager.cpp
|
||||
playlist/plitem.cpp
|
||||
playlist/playlistmodel.cpp
|
||||
playlist/playlistproxymodel.cpp
|
||||
playlist/playlistview.cpp
|
||||
playlist/playlistitemdelegate.cpp
|
||||
playlist/queueproxymodel.cpp
|
||||
playlist/queueview.cpp
|
||||
playlist/trackmodel.cpp
|
||||
playlist/trackproxymodel.cpp
|
||||
playlist/trackview.cpp
|
||||
playlist/trackheader.cpp
|
||||
playlist/albumitem.cpp
|
||||
playlist/albummodel.cpp
|
||||
playlist/albumproxymodel.cpp
|
||||
playlist/albumitemdelegate.cpp
|
||||
playlist/albumview.cpp
|
||||
|
||||
playlist/dynamic/DynamicPlaylist.cpp
|
||||
playlist/dynamic/DynamicControl.cpp
|
||||
playlist/dynamic/GeneratorFactory.cpp
|
||||
playlist/dynamic/GeneratorInterface.cpp
|
||||
playlist/dynamic/echonest/EchonestGenerator.cpp
|
||||
playlist/dynamic/echonest/EchonestControl.cpp
|
||||
playlist/dynamic/widgets/DynamicWidget.cpp
|
||||
playlist/dynamic/widgets/DynamicControlWidget.cpp
|
||||
playlist/dynamic/widgets/DynamicControlList.cpp
|
||||
playlist/dynamic/widgets/ReadOrWriteWidget.cpp
|
||||
|
||||
|
||||
network/bufferiodevice.cpp
|
||||
network/msgprocessor.cpp
|
||||
network/filetransferconnection.cpp
|
||||
network/dbsyncconnection.cpp
|
||||
network/remotecollection.cpp
|
||||
network/portfwdthread.cpp
|
||||
network/servent.cpp
|
||||
network/connection.cpp
|
||||
network/controlconnection.cpp
|
||||
|
||||
utils/tomahawkutils.cpp
|
||||
utils/querylabel.cpp
|
||||
utils/elidedlabel.cpp
|
||||
utils/imagebutton.cpp
|
||||
utils/progresstreeview.cpp
|
||||
utils/proxystyle.cpp
|
||||
utils/widgetdragfilter.cpp
|
||||
utils/animatedsplitter.cpp
|
||||
utils/xspfloader.cpp
|
||||
|
||||
widgets/newplaylistwidget.cpp
|
||||
widgets/welcomewidget.cpp
|
||||
widgets/infowidgets/sourceinfowidget.cpp
|
||||
)
|
||||
|
||||
set( libHeaders
|
||||
@@ -100,6 +148,12 @@ set( libHeaders
|
||||
|
||||
sip/SipPlugin.h
|
||||
|
||||
audio/transcodeinterface.h
|
||||
audio/madtranscode.h
|
||||
audio/vorbistranscode.h
|
||||
audio/flactranscode.h
|
||||
audio/audioengine.h
|
||||
|
||||
database/database.h
|
||||
database/fuzzyindex.h
|
||||
database/databaseworker.h
|
||||
@@ -134,13 +188,6 @@ set( libHeaders
|
||||
database/databasecommand_deletedynamicplaylist.h
|
||||
database/databasecommand_loadalldynamicplaylists.h
|
||||
|
||||
dynamic/DynamicPlaylist.h
|
||||
dynamic/DynamicControl.h
|
||||
dynamic/GeneratorFactory.h
|
||||
dynamic/GeneratorInterface.h
|
||||
dynamic/echonest/EchonestGenerator.h
|
||||
dynamic/echonest/EchonestControl.h
|
||||
|
||||
network/bufferiodevice.h
|
||||
network/msgprocessor.h
|
||||
network/remotecollection.h
|
||||
@@ -150,6 +197,58 @@ set( libHeaders
|
||||
network/connection.h
|
||||
network/controlconnection.h
|
||||
network/portfwdthread.h
|
||||
|
||||
playlist/collectionmodel.h
|
||||
playlist/collectionproxymodel.h
|
||||
playlist/collectionflatmodel.h
|
||||
playlist/collectionview.h
|
||||
playlist/playlistmanager.h
|
||||
playlist/plitem.h
|
||||
playlist/playlistmodel.h
|
||||
playlist/playlistproxymodel.h
|
||||
playlist/playlistview.h
|
||||
playlist/playlistitemdelegate.h
|
||||
playlist/queueproxymodel.h
|
||||
playlist/queueview.h
|
||||
playlist/trackmodel.h
|
||||
playlist/trackproxymodel.h
|
||||
playlist/trackview.h
|
||||
playlist/trackheader.h
|
||||
playlist/albumitem.h
|
||||
playlist/albummodel.h
|
||||
playlist/albumproxymodel.h
|
||||
playlist/albumitemdelegate.h
|
||||
playlist/albumview.h
|
||||
|
||||
playlist/dynamic/DynamicPlaylist.h
|
||||
playlist/dynamic/DynamicControl.h
|
||||
playlist/dynamic/GeneratorFactory.h
|
||||
playlist/dynamic/GeneratorInterface.h
|
||||
playlist/dynamic/echonest/EchonestGenerator.h
|
||||
playlist/dynamic/echonest/EchonestControl.h
|
||||
playlist/dynamic/widgets/DynamicWidget.h
|
||||
playlist/dynamic/widgets/DynamicControlWidget.h
|
||||
playlist/dynamic/widgets/DynamicControlList.h
|
||||
playlist/dynamic/widgets/ReadOrWriteWidget.h
|
||||
|
||||
utils/querylabel.h
|
||||
utils/elidedlabel.h
|
||||
utils/animatedcounterlabel.h
|
||||
utils/imagebutton.h
|
||||
utils/progresstreeview.h
|
||||
utils/widgetdragfilter.h
|
||||
utils/animatedsplitter.h
|
||||
utils/xspfloader.h
|
||||
|
||||
widgets/newplaylistwidget.h
|
||||
widgets/welcomewidget.h
|
||||
widgets/infowidgets/sourceinfowidget.h
|
||||
)
|
||||
|
||||
set( libUI ${libUI}
|
||||
widgets/newplaylistwidget.ui
|
||||
widgets/welcomewidget.ui
|
||||
widgets/infowidgets/sourceinfowidget.ui
|
||||
)
|
||||
|
||||
include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
|
||||
@@ -160,26 +259,70 @@ include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
|
||||
../../include
|
||||
../network
|
||||
../../qxt/qxtweb-standalone/qxtweb
|
||||
../../rtaudio
|
||||
../../alsa-playback
|
||||
playlist
|
||||
)
|
||||
|
||||
qt4_wrap_cpp( libMoc ${libHeaders} )
|
||||
add_library( tomahawklib SHARED ${libSources} ${libMoc} )
|
||||
|
||||
IF( WIN32 )
|
||||
SET( libSources ${libSources} audio/rtaudiooutput.cpp )
|
||||
SET( libHeaders ${libHeaders} audio/rtaudiooutput.h )
|
||||
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
"iphlpapi.a"
|
||||
"ws2_32.dll"
|
||||
"dnsapi.dll"
|
||||
"dsound.dll"
|
||||
"winmm.dll"
|
||||
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../../rtaudio/librtaudio.dll"
|
||||
)
|
||||
ENDIF( WIN32 )
|
||||
|
||||
IF( APPLE )
|
||||
FIND_LIBRARY( COREAUDIO_LIBRARY CoreAudio )
|
||||
FIND_LIBRARY( COREFOUNDATION_LIBRARY CoreFoundation )
|
||||
MARK_AS_ADVANCED( COREAUDIO_LIBRARY COREFOUNDATION_LIBRARY )
|
||||
|
||||
SET( libSources ${libSources} audio/rtaudiooutput.cpp )
|
||||
SET( libHeaders ${libHeaders} audio/rtaudiooutput.h )
|
||||
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
${COREAUDIO_LIBRARY}
|
||||
${COREFOUNDATION_LIBRARY}
|
||||
rtaudio
|
||||
)
|
||||
|
||||
ENDIF( APPLE )
|
||||
|
||||
IF( UNIX AND NOT APPLE )
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
alsaplayback
|
||||
)
|
||||
ENDIF( UNIX AND NOT APPLE )
|
||||
|
||||
|
||||
qt4_wrap_ui( libUI_H ${libUI} )
|
||||
qt4_wrap_cpp( libMoc ${libHeaders} )
|
||||
|
||||
SET( libSources ${libSources} ${libUI_H} )
|
||||
|
||||
add_library( tomahawklib SHARED ${libSources} ${libMoc} )
|
||||
|
||||
target_link_libraries( tomahawklib
|
||||
${QT_LIBRARIES}
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
${LIBECHONEST_LIBRARY}
|
||||
portfwd
|
||||
qjson
|
||||
mad
|
||||
vorbisfile
|
||||
ogg
|
||||
FLAC++
|
||||
)
|
||||
|
||||
install( TARGETS tomahawklib DESTINATION lib )
|
||||
|
@@ -17,6 +17,15 @@
|
||||
#include "flactranscode.h"
|
||||
#endif
|
||||
|
||||
AudioEngine* AudioEngine::s_instance = 0;
|
||||
|
||||
|
||||
AudioEngine*
|
||||
AudioEngine::instance()
|
||||
{
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
|
||||
AudioEngine::AudioEngine()
|
||||
: QThread()
|
||||
@@ -26,6 +35,7 @@ AudioEngine::AudioEngine()
|
||||
, m_timeElapsed( 0 )
|
||||
, m_i( 0 )
|
||||
{
|
||||
s_instance = this;
|
||||
qDebug() << "Init AudioEngine";
|
||||
|
||||
moveToThread( this );
|
@@ -12,17 +12,21 @@
|
||||
#include "alsaplayback.h"
|
||||
#include "transcodeinterface.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
#define AUDIO_VOLUME_STEP 5
|
||||
|
||||
class PlaylistInterface;
|
||||
|
||||
class AudioEngine : public QThread
|
||||
class DLLEXPORT AudioEngine : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum AudioErrorCode { StreamReadError, AudioDeviceError, DecodeError };
|
||||
|
||||
static AudioEngine* instance();
|
||||
|
||||
explicit AudioEngine();
|
||||
~AudioEngine();
|
||||
|
||||
@@ -104,6 +108,8 @@ private:
|
||||
|
||||
unsigned int m_timeElapsed;
|
||||
int m_i;
|
||||
|
||||
static AudioEngine* s_instance;
|
||||
};
|
||||
|
||||
#endif // AUDIOENGINE_H
|
@@ -15,10 +15,12 @@
|
||||
#include <QMutex>
|
||||
#include <QDebug>
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
#define FLAC_BUFFER 32768 * 36
|
||||
#define FLAC_BUFFER_PREFERRED 32768
|
||||
|
||||
class FLACTranscode : public TranscodeInterface , protected FLAC::Decoder::Stream
|
||||
class DLLEXPORT FLACTranscode : public TranscodeInterface , protected FLAC::Decoder::Stream
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -14,10 +14,12 @@
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
#define MP3_BUFFER 32768
|
||||
#define MP3_BUFFER_PREFERRED 32768
|
||||
|
||||
class MADTranscode : public TranscodeInterface
|
||||
class DLLEXPORT MADTranscode : public TranscodeInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -6,7 +6,9 @@
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
|
||||
class TranscodeInterface : public QObject
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT TranscodeInterface : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -15,11 +15,13 @@
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
// Must not be smaller than 8500 bytes!
|
||||
#define OGG_BUFFER 8500
|
||||
#define OGG_BUFFER_PREFERRED 32768
|
||||
|
||||
class VorbisTranscode : public TranscodeInterface
|
||||
class DLLEXPORT VorbisTranscode : public TranscodeInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include "playlist.h"
|
||||
#include "source.h"
|
||||
#include "typedefs.h"
|
||||
#include "dynamic/DynamicPlaylist.h"
|
||||
#include "playlist/dynamic/DynamicPlaylist.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
|
@@ -8,7 +8,9 @@
|
||||
|
||||
#include "album.h"
|
||||
|
||||
class AlbumItem : public QObject
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT AlbumItem : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -1,12 +1,14 @@
|
||||
#include "albumitemdelegate.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QPainter>
|
||||
#include <QAbstractItemView>
|
||||
|
||||
#include "query.h"
|
||||
#include "result.h"
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
|
||||
#include "utils/tomahawkutils.h"
|
||||
|
||||
#include "playlist/albumitem.h"
|
||||
#include "playlist/albumproxymodel.h"
|
||||
@@ -37,7 +39,7 @@ AlbumItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
||||
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
initStyleOption( &opt, QModelIndex() );
|
||||
APP->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
||||
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
||||
|
||||
if ( option.state & QStyle::State_Selected )
|
||||
{
|
@@ -3,9 +3,11 @@
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class AlbumProxyModel;
|
||||
|
||||
class AlbumItemDelegate : public QStyledItemDelegate
|
||||
class DLLEXPORT AlbumItemDelegate : public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -5,9 +5,10 @@
|
||||
#include <QMimeData>
|
||||
#include <QNetworkReply>
|
||||
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
#include "database/database.h"
|
||||
|
||||
#include "utils/tomahawkutils.h"
|
||||
|
||||
#define LASTFM_DEFAULT_COVER "http://cdn.last.fm/flatness/catalogue/noimage"
|
||||
|
||||
using namespace Tomahawk;
|
||||
@@ -270,7 +271,7 @@ AlbumModel::onAlbumsAdded( const QList<Tomahawk::album_ptr>& albums, const Tomah
|
||||
QString imgurl = "http://ws.audioscrobbler.com/2.0/?method=album.imageredirect&artist=%1&album=%2&size=large&api_key=7a90f6672a04b809ee309af169f34b8b";
|
||||
QNetworkRequest req( imgurl.arg( album->artist()->name() ).arg( album->name() ) );
|
||||
req.setAttribute( QNetworkRequest::User, (qlonglong)albumitem );
|
||||
QNetworkReply* reply = APP->nam()->get( req );
|
||||
QNetworkReply* reply = TomahawkUtils::nam()->get( req );
|
||||
connect( reply, SIGNAL( finished() ), SLOT( onCoverArtDownloaded() ) );
|
||||
|
||||
connect( albumitem, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) );
|
||||
@@ -313,7 +314,7 @@ AlbumModel::onCoverArtDownloaded()
|
||||
// Follow HTTP redirect
|
||||
QNetworkRequest req( redir );
|
||||
req.setAttribute( QNetworkRequest::User, reply->request().attribute( QNetworkRequest::User ) );
|
||||
QNetworkReply* reply = APP->nam()->get( req );
|
||||
QNetworkReply* reply = TomahawkUtils::nam()->get( req );
|
||||
connect( reply, SIGNAL( finished() ), SLOT( onCoverArtDownloaded() ) );
|
||||
}
|
||||
|
@@ -11,9 +11,11 @@
|
||||
|
||||
#include "albumitem.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class QMetaData;
|
||||
|
||||
class AlbumModel : public QAbstractItemModel
|
||||
class DLLEXPORT AlbumModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -6,7 +6,9 @@
|
||||
#include "playlistinterface.h"
|
||||
#include "playlist/albummodel.h"
|
||||
|
||||
class AlbumProxyModel : public QSortFilterProxyModel, public PlaylistInterface
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT AlbumProxyModel : public QSortFilterProxyModel, public PlaylistInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -6,10 +6,9 @@
|
||||
#include <QPainter>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
#include "audioengine.h"
|
||||
#include "tomahawksettings.h"
|
||||
#include "audio/audioengine.h"
|
||||
|
||||
#include "tomahawksettings.h"
|
||||
#include "albumitemdelegate.h"
|
||||
#include "albummodel.h"
|
||||
#include "albumproxymodel.h"
|
||||
@@ -82,7 +81,7 @@ AlbumView::onItemActivated( const QModelIndex& index )
|
||||
// qDebug() << "Result activated:" << item->album()->tracks().first()->toString() << item->album()->tracks().first()->results().first()->url();
|
||||
// APP->audioEngine()->playItem( item->album().data(), item->album()->tracks().first()->results().first() );
|
||||
|
||||
APP->playlistManager()->show( item->album() );
|
||||
PlaylistManager::instance()->show( item->album() );
|
||||
}
|
||||
}
|
||||
|
@@ -4,10 +4,12 @@
|
||||
#include <QListView>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class AlbumModel;
|
||||
class AlbumProxyModel;
|
||||
|
||||
class AlbumView : public QListView
|
||||
class DLLEXPORT AlbumView : public QListView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -15,9 +15,11 @@
|
||||
|
||||
#include "database/databasecommand_alltracks.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class QMetaData;
|
||||
|
||||
class CollectionFlatModel : public TrackModel
|
||||
class DLLEXPORT CollectionFlatModel : public TrackModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -35,7 +37,7 @@ public:
|
||||
|
||||
void addFilteredCollection( const Tomahawk::collection_ptr& collection, unsigned int amount, DatabaseCommand_AllTracks::SortOrder order );
|
||||
|
||||
virtual void appendTrack( const Tomahawk::query_ptr& query ) {}
|
||||
virtual void append( const Tomahawk::query_ptr& query ) {}
|
||||
|
||||
signals:
|
||||
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
|
@@ -12,9 +12,11 @@
|
||||
#include "playlist.h"
|
||||
#include "playlistinterface.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class QMetaData;
|
||||
|
||||
class CollectionModel : public QAbstractItemModel
|
||||
class DLLEXPORT CollectionModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -3,7 +3,9 @@
|
||||
|
||||
#include "trackproxymodel.h"
|
||||
|
||||
class CollectionProxyModel : public TrackProxyModel
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT CollectionProxyModel : public TrackProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -3,10 +3,11 @@
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
#include "trackview.h"
|
||||
|
||||
class CollectionView : public TrackView
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT CollectionView : public TrackView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "playlist.h"
|
||||
#include "typedefs.h"
|
||||
#include "dynamic/DynamicControl.h"
|
||||
#include "playlist/dynamic/DynamicControl.h"
|
||||
|
||||
class DatabaseCommand_LoadAllDynamicPlaylists;
|
||||
class DatabaseCommand_SetDynamicPlaylistRevision;
|
@@ -4,7 +4,7 @@
|
||||
#include <QHash>
|
||||
#include <QString>
|
||||
|
||||
#include "dynamic/GeneratorInterface.h"
|
||||
#include "playlist/dynamic/GeneratorInterface.h"
|
||||
#include "typedefs.h"
|
||||
|
||||
namespace Tomahawk {
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "typedefs.h"
|
||||
#include "query.h"
|
||||
#include "dynamic/DynamicControl.h"
|
||||
#include "playlist/dynamic/DynamicControl.h"
|
||||
|
||||
namespace Tomahawk {
|
||||
|
@@ -19,9 +19,9 @@
|
||||
|
||||
#include <echonest/Playlist.h>
|
||||
|
||||
#include "dynamic/GeneratorInterface.h"
|
||||
#include "dynamic/GeneratorFactory.h"
|
||||
#include "dynamic/DynamicControl.h"
|
||||
#include "playlist/dynamic/GeneratorInterface.h"
|
||||
#include "playlist/dynamic/GeneratorFactory.h"
|
||||
#include "playlist/dynamic/DynamicControl.h"
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
@@ -17,7 +17,7 @@
|
||||
#ifndef DYNAMIC_CONTROL_LIST_H
|
||||
#define DYNAMIC_CONTROL_LIST_H
|
||||
|
||||
#include "animatedsplitter.h"
|
||||
#include "utils/animatedsplitter.h"
|
||||
#include "typedefs.h"
|
||||
#include "dynamic/DynamicPlaylist.h"
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#include "dynamic/GeneratorInterface.h"
|
||||
#include "dynamic/GeneratorFactory.h"
|
||||
#include "pipeline.h"
|
||||
#include "audioengine.h"
|
||||
#include "audio/audioengine.h"
|
||||
#include "ReadOrWriteWidget.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
@@ -203,14 +203,14 @@ DynamicWidget::applyModeChange( int mode )
|
||||
m_generateButton->setText( tr( "Play" ) );
|
||||
m_genNumber->hide();
|
||||
|
||||
connect( TomahawkApp::instance()->audioEngine(), SIGNAL( loading( Tomahawk::result_ptr ) ), this, SLOT( newTrackLoading() ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( loading( Tomahawk::result_ptr ) ), this, SLOT( newTrackLoading() ) );
|
||||
} else if( mode == Static ) {
|
||||
m_generateButton->setText( tr( "Generate" ) );
|
||||
m_genNumber->show();
|
||||
if( m_headerLayout->indexOf( m_genNumber ) == -1 )
|
||||
m_headerLayout->insertWidget( 4, m_genNumber );
|
||||
|
||||
disconnect( TomahawkApp::instance()->audioEngine(), SIGNAL( loading( Tomahawk::result_ptr ) ), this, SLOT( newTrackLoading() ) );
|
||||
disconnect( AudioEngine::instance(), SIGNAL( loading( Tomahawk::result_ptr ) ), this, SLOT( newTrackLoading() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ DynamicWidget::onDemandFetched( const Tomahawk::query_ptr& track )
|
||||
connect( track.data(), SIGNAL( resolveFailed() ), this, SLOT( trackResolveFailed() ) );
|
||||
connect( track.data(), SIGNAL( resultsAdded( QList<Tomahawk::result_ptr> ) ), this, SLOT( trackResolved() ) );
|
||||
|
||||
m_model->appendTrack( track );
|
||||
m_model->append( track );
|
||||
Pipeline::instance()->add( track );
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ DynamicWidget::trackResolved()
|
||||
|
||||
if( m_startOnResolved ) {
|
||||
m_startOnResolved = false;
|
||||
TomahawkApp::instance()->audioEngine()->play();
|
||||
AudioEngine::instance()->play();
|
||||
}
|
||||
|
||||
}
|
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "query.h"
|
||||
#include "result.h"
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
|
||||
#include "playlist/plitem.h"
|
||||
#include "playlist/trackproxymodel.h"
|
@@ -3,9 +3,11 @@
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class TrackProxyModel;
|
||||
|
||||
class PlaylistItemDelegate : public QStyledItemDelegate
|
||||
class DLLEXPORT PlaylistItemDelegate : public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -19,13 +19,22 @@
|
||||
#include "sourcelist.h"
|
||||
#include "tomahawksettings.h"
|
||||
|
||||
#include "infowidgets/sourceinfowidget.h"
|
||||
#include <widgets/DynamicWidget.h>
|
||||
#include "dynamic/widgets/DynamicWidget.h"
|
||||
|
||||
#include "widgets/welcomewidget.h"
|
||||
#include "widgets/infowidgets/sourceinfowidget.h"
|
||||
|
||||
#define FILTER_TIMEOUT 280
|
||||
|
||||
PlaylistManager* PlaylistManager::s_instance = 0;
|
||||
|
||||
|
||||
PlaylistManager*
|
||||
PlaylistManager::instance()
|
||||
{
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
|
||||
PlaylistManager::PlaylistManager( QObject* parent )
|
||||
: QObject( parent )
|
||||
@@ -36,6 +45,7 @@ PlaylistManager::PlaylistManager( QObject* parent )
|
||||
, m_statsAvailable( false )
|
||||
, m_modesAvailable( false )
|
||||
{
|
||||
s_instance = this;
|
||||
m_stack = new QStackedWidget();
|
||||
|
||||
m_widget->setLayout( new QVBoxLayout() );
|
||||
@@ -49,7 +59,7 @@ PlaylistManager::PlaylistManager( QObject* parent )
|
||||
m_queueView = new QueueView( m_splitter );
|
||||
m_queueModel = new PlaylistModel( m_queueView );
|
||||
m_queueView->queue()->setModel( m_queueModel );
|
||||
APP->audioEngine()->setQueue( m_queueView->queue()->proxyModel() );
|
||||
AudioEngine::instance()->setQueue( m_queueView->queue()->proxyModel() );
|
||||
|
||||
m_splitter->addWidget( m_queueView );
|
||||
m_splitter->hide( 1, false );
|
||||
@@ -75,6 +85,11 @@ PlaylistManager::PlaylistManager( QObject* parent )
|
||||
m_playlistModel = new PlaylistModel();
|
||||
|
||||
show( new WelcomeWidget() );
|
||||
|
||||
m_stack->setContentsMargins( 0, 0, 0, 0 );
|
||||
m_widget->setContentsMargins( 0, 0, 0, 0 );
|
||||
m_widget->layout()->setContentsMargins( 0, 0, 0, 0 );
|
||||
m_widget->layout()->setMargin( 0 );
|
||||
|
||||
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) );
|
||||
}
|
||||
@@ -148,18 +163,54 @@ PlaylistManager::show(const Tomahawk::dynplaylist_ptr& playlist)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
PlaylistManager::show( const Tomahawk::artist_ptr& artist )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << &artist << artist.data();
|
||||
unlinkPlaylist();
|
||||
|
||||
if ( !m_artistViews.contains( artist ) )
|
||||
{
|
||||
PlaylistView* view = new PlaylistView();
|
||||
PlaylistModel* model = new PlaylistModel();
|
||||
view->setModel( model );
|
||||
model->append( artist );
|
||||
|
||||
m_currentInterface = view->proxyModel();
|
||||
m_artistViews.insert( artist, view );
|
||||
|
||||
m_stack->addWidget( view );
|
||||
m_stack->setCurrentWidget( view );
|
||||
}
|
||||
else
|
||||
{
|
||||
PlaylistView* view = m_artistViews.value( artist );
|
||||
m_stack->setCurrentWidget( view );
|
||||
m_currentInterface = view->proxyModel();
|
||||
}
|
||||
|
||||
m_superCollectionVisible = false;
|
||||
m_statsAvailable = false;
|
||||
m_modesAvailable = false;
|
||||
linkPlaylist();
|
||||
|
||||
emit numSourcesChanged( 1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
PlaylistManager::show( const Tomahawk::album_ptr& album )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << &album << album.data();
|
||||
unlinkPlaylist();
|
||||
|
||||
m_playlistModel->appendAlbum( album );
|
||||
m_playlistModel->clear();
|
||||
m_playlistModel->append( album );
|
||||
m_stack->setCurrentWidget( m_playlistView );
|
||||
|
||||
m_currentInterface = m_playlistView->proxyModel();
|
||||
|
||||
|
||||
m_superCollectionVisible = false;
|
||||
m_statsAvailable = false;
|
||||
m_modesAvailable = false;
|
||||
@@ -456,7 +507,7 @@ PlaylistManager::linkPlaylist()
|
||||
}
|
||||
|
||||
applyFilter();
|
||||
APP->audioEngine()->setPlaylist( m_currentInterface );
|
||||
AudioEngine::instance()->setPlaylist( m_currentInterface );
|
||||
|
||||
if ( m_currentInterface && m_statsAvailable )
|
||||
{
|
||||
@@ -511,12 +562,31 @@ PlaylistManager::setShuffled( bool enabled )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistManager::createPlaylist( const Tomahawk::source_ptr& src,
|
||||
const QVariant& contents)
|
||||
{
|
||||
Tomahawk::playlist_ptr p = Tomahawk::playlist_ptr( new Tomahawk::Playlist( src ) );
|
||||
QJson::QObjectHelper::qvariant2qobject( contents.toMap(), p.data() );
|
||||
p->reportCreated( p );
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistManager::createDynamicPlaylist( const Tomahawk::source_ptr& src,
|
||||
const QVariant& contents)
|
||||
{
|
||||
Tomahawk::dynplaylist_ptr p = Tomahawk::dynplaylist_ptr( new Tomahawk::DynamicPlaylist( src, contents.toMap().value( "type", QString() ).toString() ) );
|
||||
QJson::QObjectHelper::qvariant2qobject( contents.toMap(), p.data() );
|
||||
p->reportCreated( p );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistManager::showCurrentTrack()
|
||||
{
|
||||
unlinkPlaylist();
|
||||
|
||||
m_currentInterface = APP->audioEngine()->currentTrackPlaylist();
|
||||
m_currentInterface = AudioEngine::instance()->currentTrackPlaylist();
|
||||
|
||||
if ( m_currentInterface->widget() )
|
||||
m_stack->setCurrentWidget( m_currentInterface->widget() );
|
@@ -8,9 +8,7 @@
|
||||
#include "collection.h"
|
||||
#include "playlistinterface.h"
|
||||
|
||||
namespace Tomahawk {
|
||||
class DynamicWidget;
|
||||
}
|
||||
#include "dllmacro.h"
|
||||
|
||||
class AnimatedSplitter;
|
||||
class AlbumModel;
|
||||
@@ -26,11 +24,17 @@ class TrackModel;
|
||||
class TrackView;
|
||||
class SourceInfoWidget;
|
||||
|
||||
class PlaylistManager : public QObject
|
||||
namespace Tomahawk {
|
||||
class DynamicWidget;
|
||||
}
|
||||
|
||||
class DLLEXPORT PlaylistManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static PlaylistManager* instance();
|
||||
|
||||
explicit PlaylistManager( QObject* parent = 0 );
|
||||
~PlaylistManager();
|
||||
|
||||
@@ -41,6 +45,7 @@ public:
|
||||
|
||||
bool show( const Tomahawk::playlist_ptr& playlist );
|
||||
bool show( const Tomahawk::dynplaylist_ptr& playlist );
|
||||
bool show( const Tomahawk::artist_ptr& artist );
|
||||
bool show( const Tomahawk::album_ptr& album );
|
||||
bool show( const Tomahawk::collection_ptr& collection );
|
||||
bool show( const Tomahawk::source_ptr& source );
|
||||
@@ -74,7 +79,10 @@ public slots:
|
||||
|
||||
void setRepeatMode( PlaylistInterface::RepeatMode mode );
|
||||
void setShuffled( bool enabled );
|
||||
|
||||
|
||||
// called by the playlist creation dbcmds
|
||||
void createPlaylist( const Tomahawk::source_ptr& src, const QVariant& contents );
|
||||
void createDynamicPlaylist( const Tomahawk::source_ptr& src, const QVariant& contents );
|
||||
private slots:
|
||||
void applyFilter();
|
||||
|
||||
@@ -104,6 +112,7 @@ private:
|
||||
QHash< Tomahawk::dynplaylist_ptr, Tomahawk::DynamicWidget* > m_dynamicWidgets;
|
||||
QHash< Tomahawk::collection_ptr, CollectionView* > m_collectionViews;
|
||||
QHash< Tomahawk::collection_ptr, AlbumView* > m_collectionAlbumViews;
|
||||
QHash< Tomahawk::artist_ptr, PlaylistView* > m_artistViews;
|
||||
QHash< Tomahawk::source_ptr, SourceInfoWidget* > m_sourceViews;
|
||||
|
||||
PlaylistInterface* m_currentInterface;
|
||||
@@ -120,6 +129,8 @@ private:
|
||||
|
||||
QTimer m_filterTimer;
|
||||
QString m_filter;
|
||||
|
||||
static PlaylistManager* s_instance;
|
||||
};
|
||||
|
||||
#endif // PLAYLISTMANAGER_H
|
@@ -94,32 +94,6 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistModel::appendAlbum( const Tomahawk::album_ptr& album )
|
||||
{
|
||||
if ( album.isNull() )
|
||||
return;
|
||||
|
||||
connect( album.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ),
|
||||
SLOT( onTracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ) );
|
||||
|
||||
onTracksAdded( album->tracks(), album->collection() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistModel::appendArtist( const Tomahawk::artist_ptr& artist )
|
||||
{
|
||||
if ( artist.isNull() )
|
||||
return;
|
||||
|
||||
connect( artist.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ),
|
||||
SLOT( onTracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ) );
|
||||
|
||||
onTracksAdded( artist->tracks(), artist->collection() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistModel::loadHistory( const Tomahawk::source_ptr& source, unsigned int amount )
|
||||
{
|
||||
@@ -143,9 +117,21 @@ PlaylistModel::loadHistory( const Tomahawk::source_ptr& source, unsigned int amo
|
||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistModel::clear()
|
||||
{
|
||||
if ( rowCount( QModelIndex() ) )
|
||||
{
|
||||
emit beginRemoveRows( QModelIndex(), 0, rowCount( QModelIndex() ) - 1 );
|
||||
delete m_rootItem;
|
||||
emit endRemoveRows();
|
||||
m_rootItem = new PlItem( 0, this );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistModel::appendTrack( const Tomahawk::query_ptr& query )
|
||||
PlaylistModel::append( const Tomahawk::query_ptr& query )
|
||||
{
|
||||
if ( query.isNull() )
|
||||
return;
|
||||
@@ -158,7 +144,33 @@ PlaylistModel::appendTrack( const Tomahawk::query_ptr& query )
|
||||
|
||||
|
||||
void
|
||||
PlaylistModel::insertTrack( unsigned int row, const Tomahawk::query_ptr& query )
|
||||
PlaylistModel::append( const Tomahawk::album_ptr& album )
|
||||
{
|
||||
if ( album.isNull() )
|
||||
return;
|
||||
|
||||
connect( album.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ),
|
||||
SLOT( onTracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ) );
|
||||
|
||||
onTracksAdded( album->tracks(), album->collection() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistModel::append( const Tomahawk::artist_ptr& artist )
|
||||
{
|
||||
if ( artist.isNull() )
|
||||
return;
|
||||
|
||||
connect( artist.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ),
|
||||
SLOT( onTracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ) );
|
||||
|
||||
onTracksAdded( artist->tracks(), artist->collection() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistModel::insert( unsigned int row, const Tomahawk::query_ptr& query )
|
||||
{
|
||||
if ( query.isNull() )
|
||||
return;
|
@@ -6,16 +6,17 @@
|
||||
|
||||
#include "plitem.h"
|
||||
#include "trackmodel.h"
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
#include "collection.h"
|
||||
#include "query.h"
|
||||
#include "typedefs.h"
|
||||
#include "playlist.h"
|
||||
#include "playlistinterface.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class QMetaData;
|
||||
|
||||
class PlaylistModel : public TrackModel
|
||||
class DLLEXPORT PlaylistModel : public TrackModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -33,11 +34,13 @@ public:
|
||||
void loadPlaylist( const Tomahawk::playlist_ptr& playlist );
|
||||
void loadHistory( const Tomahawk::source_ptr& source, unsigned int amount = 100 );
|
||||
|
||||
void appendTrack( const Tomahawk::query_ptr& query );
|
||||
void appendAlbum( const Tomahawk::album_ptr& album );
|
||||
void appendArtist( const Tomahawk::artist_ptr& artist );
|
||||
void clear();
|
||||
|
||||
void append( const Tomahawk::query_ptr& query );
|
||||
void append( const Tomahawk::album_ptr& album );
|
||||
void append( const Tomahawk::artist_ptr& artist );
|
||||
|
||||
void insertTrack( unsigned int row, const Tomahawk::query_ptr& query );
|
||||
void insert( unsigned int row, const Tomahawk::query_ptr& query );
|
||||
|
||||
virtual void removeIndex( const QModelIndex& index, bool moreToCome = false );
|
||||
|
@@ -3,7 +3,9 @@
|
||||
|
||||
#include "trackproxymodel.h"
|
||||
|
||||
class PlaylistProxyModel : public TrackProxyModel
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT PlaylistProxyModel : public TrackProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -3,10 +3,11 @@
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
#include "trackview.h"
|
||||
|
||||
class PlaylistView : public TrackView
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT PlaylistView : public TrackView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -9,7 +9,9 @@
|
||||
#include "query.h"
|
||||
#include "typedefs.h"
|
||||
|
||||
class PlItem : public QObject
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT PlItem : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
#include "playlist/playlistmanager.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
@@ -30,7 +29,7 @@ QueueProxyModel::siblingItem( int itemsAway )
|
||||
|
||||
qDebug() << "new rowcount:" << rowCount( QModelIndex() );
|
||||
if ( rowCount( QModelIndex() ) == 1 )
|
||||
APP->playlistManager()->hideQueue();
|
||||
PlaylistManager::instance()->hideQueue();
|
||||
|
||||
removeIndex( currentItem() );
|
||||
|
@@ -3,9 +3,11 @@
|
||||
|
||||
#include "playlistproxymodel.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class QMetaData;
|
||||
|
||||
class QueueProxyModel : public PlaylistProxyModel
|
||||
class DLLEXPORT QueueProxyModel : public PlaylistProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -6,7 +6,9 @@
|
||||
#include "utils/animatedsplitter.h"
|
||||
#include "playlistview.h"
|
||||
|
||||
class QueueView : public AnimatedWidget
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT QueueView : public AnimatedWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -4,7 +4,6 @@
|
||||
#include <QDebug>
|
||||
#include <QMenu>
|
||||
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
#include "tomahawksettings.h"
|
||||
#include "playlist/trackmodel.h"
|
||||
#include "playlist/trackview.h"
|
@@ -4,9 +4,11 @@
|
||||
#include <QHeaderView>
|
||||
#include <QSignalMapper>
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class TrackView;
|
||||
|
||||
class TrackHeader : public QHeaderView
|
||||
class DLLEXPORT TrackHeader : public QHeaderView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -4,7 +4,9 @@
|
||||
#include <QMimeData>
|
||||
#include <QTreeView>
|
||||
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
#include "audio/audioengine.h"
|
||||
#include "utils/tomahawkutils.h"
|
||||
|
||||
#include "album.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
@@ -17,8 +19,8 @@ TrackModel::TrackModel( QObject* parent )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
connect( (QObject*)APP->audioEngine(), SIGNAL( finished( Tomahawk::result_ptr ) ), SLOT( onPlaybackFinished( Tomahawk::result_ptr ) ), Qt::DirectConnection );
|
||||
connect( (QObject*)APP->audioEngine(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ), Qt::DirectConnection );
|
||||
connect( AudioEngine::instance(), SIGNAL( finished( Tomahawk::result_ptr ) ), SLOT( onPlaybackFinished( Tomahawk::result_ptr ) ), Qt::DirectConnection );
|
||||
connect( AudioEngine::instance(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ), Qt::DirectConnection );
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,11 @@
|
||||
#include "playlistinterface.h"
|
||||
#include "playlist/plitem.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class QMetaData;
|
||||
|
||||
class TrackModel : public QAbstractItemModel
|
||||
class DLLEXPORT TrackModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -51,7 +53,7 @@ public:
|
||||
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
|
||||
virtual bool shuffled() const { return false; }
|
||||
|
||||
virtual void appendTrack( const Tomahawk::query_ptr& query ) = 0;
|
||||
virtual void append( const Tomahawk::query_ptr& query ) = 0;
|
||||
|
||||
PlItem* itemFromIndex( const QModelIndex& index ) const;
|
||||
|
@@ -6,7 +6,9 @@
|
||||
#include "playlistinterface.h"
|
||||
#include "playlist/trackmodel.h"
|
||||
|
||||
class TrackProxyModel : public QSortFilterProxyModel, public PlaylistInterface
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT TrackProxyModel : public QSortFilterProxyModel, public PlaylistInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -5,11 +5,12 @@
|
||||
#include <QPainter>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "tomahawk/tomahawkapp.h"
|
||||
#include "playlist/trackheader.h"
|
||||
#include "playlist/playlistmanager.h"
|
||||
#include "playlist/queueview.h"
|
||||
#include "audioengine.h"
|
||||
#include "audio/audioengine.h"
|
||||
#include "utils/tomahawkutils.h"
|
||||
|
||||
#include "trackheader.h"
|
||||
#include "playlistmanager.h"
|
||||
#include "queueview.h"
|
||||
#include "trackmodel.h"
|
||||
#include "trackproxymodel.h"
|
||||
|
||||
@@ -94,7 +95,7 @@ TrackView::onItemActivated( const QModelIndex& index )
|
||||
{
|
||||
qDebug() << "Result activated:" << item->query()->toString() << item->query()->results().first()->url();
|
||||
m_proxyModel->setCurrentItem( index );
|
||||
APP->audioEngine()->playItem( m_proxyModel, item->query()->results().first() );
|
||||
AudioEngine::instance()->playItem( m_proxyModel, item->query()->results().first() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,8 +142,8 @@ TrackView::addItemsToQueue()
|
||||
PlItem* item = model()->itemFromIndex( proxyModel()->mapToSource( idx ) );
|
||||
if ( item && item->query()->numResults() )
|
||||
{
|
||||
APP->playlistManager()->queue()->model()->appendTrack( item->query() );
|
||||
APP->playlistManager()->showQueue();
|
||||
PlaylistManager::instance()->queue()->model()->append( item->query() );
|
||||
PlaylistManager::instance()->showQueue();
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,12 +6,14 @@
|
||||
|
||||
#include "playlistitemdelegate.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class PlaylistInterface;
|
||||
class TrackHeader;
|
||||
class TrackModel;
|
||||
class TrackProxyModel;
|
||||
|
||||
class TrackView : public QTreeView
|
||||
class DLLEXPORT TrackView : public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -8,7 +8,9 @@
|
||||
#include <QEasingCurve>
|
||||
#include <cmath>
|
||||
|
||||
class AnimatedCounterLabel : public QLabel
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT AnimatedCounterLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -5,9 +5,11 @@
|
||||
#include <QSplitter>
|
||||
#include <QTimeLine>
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class AnimatedWidget;
|
||||
|
||||
class AnimatedSplitter : public QSplitter
|
||||
class DLLEXPORT AnimatedSplitter : public QSplitter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -44,7 +46,7 @@ private:
|
||||
QTimeLine* m_timeLine;
|
||||
};
|
||||
|
||||
class AnimatedWidget : public QWidget
|
||||
class DLLEXPORT AnimatedWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
@@ -4,7 +4,9 @@
|
||||
#include <QFrame>
|
||||
#include <QTime>
|
||||
|
||||
class ElidedLabel : public QFrame
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT ElidedLabel : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY( QString text READ text WRITE setText NOTIFY textChanged )
|
@@ -5,8 +5,9 @@
|
||||
#include <QIcon>
|
||||
#include <QMap>
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class ImageButton : public QAbstractButton
|
||||
class DLLEXPORT ImageButton : public QAbstractButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -4,7 +4,9 @@
|
||||
#include <QTreeView>
|
||||
#include <QProgressBar>
|
||||
|
||||
class ProgressTreeView : public QTreeView
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT ProgressTreeView : public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -4,7 +4,9 @@
|
||||
#include <QtGlobal>
|
||||
#include <QProxyStyle>
|
||||
|
||||
class ProxyStyle : public QProxyStyle
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT ProxyStyle : public QProxyStyle
|
||||
{
|
||||
public:
|
||||
ProxyStyle() {}
|
@@ -5,8 +5,11 @@
|
||||
#include <QTime>
|
||||
|
||||
#include "result.h"
|
||||
#include "query.h"
|
||||
#include "typedefs.h"
|
||||
#include "dllmacro.h"
|
||||
|
||||
class QueryLabel : public QFrame
|
||||
class DLLEXPORT QueryLabel : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include <QDir>
|
||||
#include <QPainter>
|
||||
#include <QPixmap>
|
||||
#include <QNetworkAccessManager>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
@@ -273,4 +274,35 @@ createDragPixmap( int itemCount )
|
||||
return dragPixmap;
|
||||
}
|
||||
|
||||
|
||||
QNetworkAccessManager* s_nam = 0;
|
||||
QNetworkProxy* s_proxy = 0;
|
||||
|
||||
QNetworkAccessManager*
|
||||
nam()
|
||||
{
|
||||
return s_nam;
|
||||
}
|
||||
|
||||
|
||||
QNetworkProxy*
|
||||
proxy()
|
||||
{
|
||||
return s_proxy;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
setNam( QNetworkAccessManager* nam )
|
||||
{
|
||||
s_nam = nam;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
setProxy( QNetworkProxy* proxy )
|
||||
{
|
||||
s_proxy = proxy;
|
||||
}
|
||||
|
||||
} // ns
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user