diff --git a/CMakeLists.txt b/CMakeLists.txt index 77479e0be..6255c2c9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,14 +16,11 @@ ENDIF() FIND_PACKAGE( Taglib 1.6.0 REQUIRED ) FIND_PACKAGE( LibLastFm REQUIRED ) -IF( "${gui}" STREQUAL "no" ) +IF( UNIX AND NOT APPLE ) + ADD_SUBDIRECTORY( alsa-playback ) ELSE() - IF( UNIX AND NOT APPLE ) - ADD_SUBDIRECTORY( alsa-playback ) - ELSE() - ADD_SUBDIRECTORY( rtaudio ) - ENDIF( UNIX AND NOT APPLE ) -ENDIF() + ADD_SUBDIRECTORY( rtaudio ) +ENDIF( UNIX AND NOT APPLE ) ADD_SUBDIRECTORY( libportfwd ) ADD_SUBDIRECTORY( qxtweb-standalone ) diff --git a/include/tomahawk/tomahawkapp.h b/include/tomahawk/tomahawkapp.h index 32df60925..1ad02fcef 100644 --- a/include/tomahawk/tomahawkapp.h +++ b/include/tomahawk/tomahawkapp.h @@ -27,6 +27,7 @@ #include "sourcelist.h" #include "servent.h" +class AudioEngine; class Database; class Jabber; class XMPPBot; @@ -42,7 +43,6 @@ namespace Tomahawk } #ifndef TOMAHAWK_HEADLESS -class AudioEngine; class TomahawkWindow; class PlaylistManager; #include @@ -69,6 +69,7 @@ public: static TomahawkApp* instance(); Tomahawk::Pipeline* pipeline() { return &m_pipeline; } + AudioEngine* audioEngine() { return m_audioEngine; } Database* database() { return m_db; } SourceList& sourcelist() { return m_sources; } Servent& servent() { return m_servent; } @@ -78,10 +79,10 @@ public: XMPPBot* xmppBot() { return m_xmppBot; } const QString& nodeID() const; + #ifndef TOMAHAWK_HEADLESS AudioControls* audioControls(); PlaylistManager* playlistManager(); - AudioEngine* audioEngine() { return m_audioEngine; } #endif void registerIODeviceFactory( const QString &proto, boost::function(Tomahawk::result_ptr)> fac ); @@ -121,6 +122,7 @@ private: QList m_plugins; Tomahawk::Pipeline m_pipeline; + AudioEngine* m_audioEngine; Database* m_db; Servent m_servent; SourceList m_sources; @@ -130,7 +132,6 @@ private: #ifndef TOMAHAWK_HEADLESS TomahawkWindow* m_mainwindow; - AudioEngine* m_audioEngine; #ifndef NO_LIBLASTFM Scrobbler* m_scrobbler; #endif diff --git a/src/CMakeLists.linux.txt b/src/CMakeLists.linux.txt index f1f07659f..edbcafd3a 100644 --- a/src/CMakeLists.linux.txt +++ b/src/CMakeLists.linux.txt @@ -1,8 +1,12 @@ +SET( OS_SPECIFIC_LINK_LIBRARIES + ${OS_SPECIFIC_LINK_LIBRARIES} + alsaplayback +) + IF( "${gui}" STREQUAL "no" ) ELSE() SET( OS_SPECIFIC_LINK_LIBRARIES ${OS_SPECIFIC_LINK_LIBRARIES} - alsaplayback gnutls ) ENDIF() diff --git a/src/CMakeLists.osx.txt b/src/CMakeLists.osx.txt index f12f7a6ca..7db1f0f95 100644 --- a/src/CMakeLists.osx.txt +++ b/src/CMakeLists.osx.txt @@ -1,21 +1,13 @@ -IF( "${gui}" STREQUAL "no" ) -ELSE() - SET( tomahawkSourcesGui ${tomahawkSourcesGui} - audio/rtaudiooutput.cpp - ) +SET( tomahawkSourcesGui ${tomahawkSourcesGui} audio/rtaudiooutput.cpp ) +SET( tomahawkHeadersGui ${tomahawkHeadersGui} audio/rtaudiooutput.h ) - SET( tomahawkHeadersGui ${tomahawkHeadersGui} - audio/rtaudiooutput.h - ) +FIND_LIBRARY( COREAUDIO_LIBRARY CoreAudio ) +FIND_LIBRARY( COREFOUNDATION_LIBRARY CoreFoundation ) +MARK_AS_ADVANCED( COREAUDIO_LIBRARY COREFOUNDATION_LIBRARY ) - 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} - ${COREFOUNDATION_LIBRARY} - rtaudio - ) -ENDIF() +SET( OS_SPECIFIC_LINK_LIBRARIES + ${OS_SPECIFIC_LINK_LIBRARIES} + ${COREAUDIO_LIBRARY} + ${COREFOUNDATION_LIBRARY} + rtaudio +) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 016859bb2..09e08af42 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -35,6 +35,10 @@ SET( tomahawkSources ${tomahawkSources} source.cpp sourcelist.cpp + audio/madtranscode.cpp + audio/vorbistranscode.cpp + audio/audioengine.cpp + utils/tomahawkutils.cpp jabber/jabber_p.cpp @@ -81,8 +85,9 @@ SET( tomahawkSources ${tomahawkSources} database/databasecommand_updatesearchindex.cpp database/databasecollection.cpp - xmppbot/xmppbot.cpp + scrobbler.cpp + xmppbot/xmppbot.cpp web/api_v1.cpp tomahawksettings.cpp @@ -98,9 +103,6 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui} utils/proxystyle.cpp utils/widgetdragfilter.cpp - audio/madtranscode.cpp - audio/audioengine.cpp - playlist/collectionmodel.cpp playlist/collectionproxymodel.cpp playlist/collectionflatmodel.cpp @@ -153,6 +155,11 @@ SET( tomahawkHeaders ${tomahawkHeaders} "${TOMAHAWK_INC_DIR}/tomahawk/functimeout.h" # "${TOMAHAWK_INC_DIR}/tomahawk/tomahawkplugin.h" + audio/transcodeinterface.h + audio/madtranscode.h + audio/vorbistranscode.h + audio/audioengine.h + database/fuzzyindex.h database/database.h database/databaseworker.h @@ -199,8 +206,9 @@ SET( tomahawkHeaders ${tomahawkHeaders} network/filetransferconnection.h network/dbsyncconnection.h - xmppbot/xmppbot.h + scrobbler.h + xmppbot/xmppbot.h web/api_v1.h ) @@ -212,10 +220,6 @@ SET( tomahawkHeadersGui ${tomahawkHeadersGui} utils/progresstreeview.h utils/widgetdragfilter.h - audio/transcodeinterface.h - audio/madtranscode.h - audio/audioengine.h - playlist/collectionmodel.h playlist/collectionproxymodel.h playlist/collectionflatmodel.h diff --git a/src/CMakeLists.unix.txt b/src/CMakeLists.unix.txt index 33c7e9480..f42700174 100644 --- a/src/CMakeLists.unix.txt +++ b/src/CMakeLists.unix.txt @@ -12,15 +12,9 @@ SET( OS_SPECIFIC_LINK_LIBRARIES qxtweb-standalone ) -IF( "${gui}" STREQUAL "no" ) -ELSE() - SET( OS_SPECIFIC_LINK_LIBRARIES - ${OS_SPECIFIC_LINK_LIBRARIES} - mad - vorbisfile - ogg - ) - - SET( tomahawkSourcesGui ${tomahawkSourcesGui} audio/vorbistranscode.cpp scrobbler.cpp ) - SET( tomahawkHeadersGui ${tomahawkHeadersGui} audio/vorbistranscode.h scrobbler.h ) -ENDIF() +SET( OS_SPECIFIC_LINK_LIBRARIES + ${OS_SPECIFIC_LINK_LIBRARIES} + mad + vorbisfile + ogg +) diff --git a/src/CMakeLists.win32.txt b/src/CMakeLists.win32.txt index 3327fd0d0..8fb3c11f2 100644 --- a/src/CMakeLists.win32.txt +++ b/src/CMakeLists.win32.txt @@ -31,22 +31,17 @@ SET( OS_SPECIFIC_LINK_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../qxtweb-standalone/libqxtweb-standalone.dll" ) -IF( "${gui}" STREQUAL "no" ) -ELSE() - SET( tomahawkSourcesGui ${tomahawkSourcesGui} - audio/rtaudiooutput.cpp - ) - SET( tomahawkHeadersGui ${tomahawkHeadersGui} audio/rtaudiooutput.h ) +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" - "${CMAKE_CURRENT_SOURCE_DIR}/../rtaudio/librtaudio.dll" - ) -ENDIF() +SET( OS_SPECIFIC_LINK_LIBRARIES + ${OS_SPECIFIC_LINK_LIBRARIES} + "dsound.dll" + "winmm.dll" + "iphlpapi.a" + "mad" + "vorbisfile" + "ogg" + "${CMAKE_CURRENT_SOURCE_DIR}/../rtaudio/librtaudio.dll" +)