/* * Strawberry Music Player * This file was part of Clementine. * Copyright 2012, David Sansome * Copyright 2012, 2014, John Maguire * Copyright 2018-2021, 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 "scoped_ptr.h" #include "shared_ptr.h" #include "settings/settingsdialog.h" class QThread; class TaskManager; class ApplicationImpl; class TagReaderClient; class Database; class DeviceFinders; class Player; class NetworkAccessManager; class SCollection; class CollectionBackend; class CollectionModel; class PlaylistBackend; class PlaylistManager; #ifndef Q_OS_WIN class DeviceManager; #endif 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 tag_reader_client() const; SharedPtr database() const; SharedPtr task_manager() const; SharedPtr player() const; SharedPtr network() const; SharedPtr device_finders() const; #ifndef Q_OS_WIN SharedPtr device_manager() const; #endif SharedPtr collection() const; SharedPtr collection_backend() const; CollectionModel *collection_model() const; SharedPtr playlist_backend() const; SharedPtr playlist_manager() const; SharedPtr cover_providers() const; SharedPtr album_cover_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(); public Q_SLOTS: void AddError(const QString &message); void ReloadSettings(); void OpenSettingsDialogAtPage(SettingsDialog::Page page); Q_SIGNALS: void ErrorAdded(const QString &message); void SettingsChanged(); void SettingsDialogRequested(const SettingsDialog::Page page); void ExitFinished(); void ClearPixmapDiskCache(); private: ScopedPtr p_; QList threads_; QList wait_for_exit_; }; #endif // APPLICATION_H