/* * Strawberry Music Player * This file was part of Clementine. * Copyright 2012, David Sansome * Copyright 2012, 2014, John Maguire * Copyright 2018-2024, Jonas Kvinge * * Strawberry 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. * * Strawberry 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 Strawberry. If not, see . * */ #ifndef APPLICATION_H #define APPLICATION_H #include "config.h" #include #include #include #include #include "includes/scoped_ptr.h" #include "includes/shared_ptr.h" class QThread; class TaskManager; class ApplicationImpl; class TagReaderClient; class Database; class DeviceFinders; class UrlHandlers; class Player; class NetworkAccessManager; class CollectionLibrary; class CollectionBackend; class CollectionModel; class PlaylistBackend; class PlaylistManager; class DeviceManager; class CoverProviders; class AlbumCoverLoader; class CurrentAlbumCoverLoader; class CoverProviders; class LyricsProviders; class AudioScrobbler; class LastFMImport; class StreamingServices; class RadioServices; #ifdef HAVE_MOODBAR class MoodbarController; class MoodbarLoader; #endif class Application : public QObject { Q_OBJECT public: explicit Application(QObject *parent = nullptr); ~Application() override; SharedPtr tagreader_client() const; SharedPtr database() const; SharedPtr task_manager() const; SharedPtr player() const; SharedPtr network() const; SharedPtr device_finders() const; SharedPtr url_handlers() const; SharedPtr device_manager() const; SharedPtr collection() const; SharedPtr collection_backend() const; CollectionModel *collection_model() const; SharedPtr playlist_backend() const; SharedPtr playlist_manager() const; SharedPtr cover_providers() const; SharedPtr albumcover_loader() const; SharedPtr current_albumcover_loader() const; SharedPtr lyrics_providers() const; SharedPtr scrobbler() const; SharedPtr streaming_services() const; SharedPtr radio_services() const; #ifdef HAVE_MOODBAR SharedPtr moodbar_controller() const; SharedPtr moodbar_loader() const; #endif SharedPtr lastfm_import() const; void Exit(); QThread *MoveToNewThread(QObject *object); static void MoveToThread(QObject *object, QThread *thread); private Q_SLOTS: void ExitReceived(); Q_SIGNALS: void ExitFinished(); private: static gpointer GLibMainLoopThreadFunc(gpointer data); private: ScopedPtr p_; GThread *g_thread_; QList threads_; QList wait_for_exit_; }; #endif // APPLICATION_H