2018-02-27 18:06:05 +01:00
|
|
|
/*
|
|
|
|
* Strawberry Music Player
|
|
|
|
* This file was part of Clementine.
|
|
|
|
* Copyright 2012, David Sansome <me@davidsansome.com>
|
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
2018-08-09 18:10:03 +02:00
|
|
|
*
|
2018-02-27 18:06:05 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef APPLICATION_H_
|
|
|
|
#define APPLICATION_H_
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <memory>
|
2018-05-01 00:41:33 +02:00
|
|
|
#include <stdbool.h>
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
#include <QObject>
|
2018-03-18 18:39:30 +01:00
|
|
|
#include <QThread>
|
2018-05-01 00:41:33 +02:00
|
|
|
#include <QList>
|
|
|
|
#include <QString>
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
#include "settings/settingsdialog.h"
|
|
|
|
|
2018-05-01 00:41:33 +02:00
|
|
|
class TaskManager;
|
2018-02-27 18:06:05 +01:00
|
|
|
class ApplicationImpl;
|
|
|
|
class TagReaderClient;
|
|
|
|
class Database;
|
2018-05-01 00:41:33 +02:00
|
|
|
class EngineDevice;
|
2018-02-27 18:06:05 +01:00
|
|
|
class Player;
|
2018-05-01 00:41:33 +02:00
|
|
|
class Appearance;
|
2018-07-01 22:26:46 +02:00
|
|
|
class SCollection;
|
2018-05-01 00:41:33 +02:00
|
|
|
class CollectionBackend;
|
|
|
|
class CollectionModel;
|
2018-02-27 18:06:05 +01:00
|
|
|
class PlaylistBackend;
|
|
|
|
class PlaylistManager;
|
2018-09-20 17:36:23 +02:00
|
|
|
#ifndef Q_OS_WIN
|
2018-05-01 00:41:33 +02:00
|
|
|
class DeviceManager;
|
2018-09-20 17:36:23 +02:00
|
|
|
#endif
|
2018-02-27 18:06:05 +01:00
|
|
|
class CoverProviders;
|
2018-05-01 00:41:33 +02:00
|
|
|
class AlbumCoverLoader;
|
2018-02-27 18:06:05 +01:00
|
|
|
class CurrentArtLoader;
|
2018-10-14 00:08:33 +02:00
|
|
|
class LyricsProviders;
|
2018-08-09 18:10:03 +02:00
|
|
|
class InternetModel;
|
2018-10-17 21:18:39 +02:00
|
|
|
class InternetSearch;
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
class Application : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
static bool kIsPortable;
|
|
|
|
|
|
|
|
explicit Application(QObject *parent = nullptr);
|
|
|
|
~Application();
|
|
|
|
|
|
|
|
TagReaderClient *tag_reader_client() const;
|
|
|
|
Database *database() const;
|
|
|
|
Appearance *appearance() const;
|
|
|
|
TaskManager *task_manager() const;
|
|
|
|
Player *player() const;
|
|
|
|
EngineDevice *enginedevice() const;
|
2018-09-20 17:36:23 +02:00
|
|
|
#ifndef Q_OS_WIN
|
2018-02-27 18:06:05 +01:00
|
|
|
DeviceManager *device_manager() const;
|
2018-09-20 17:36:23 +02:00
|
|
|
#endif
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2018-07-01 22:26:46 +02:00
|
|
|
SCollection *collection() const;
|
2018-10-14 00:08:33 +02:00
|
|
|
CollectionBackend *collection_backend() const;
|
|
|
|
CollectionModel *collection_model() const;
|
2018-07-01 22:26:46 +02:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
PlaylistBackend *playlist_backend() const;
|
|
|
|
PlaylistManager *playlist_manager() const;
|
|
|
|
|
|
|
|
CoverProviders *cover_providers() const;
|
|
|
|
AlbumCoverLoader *album_cover_loader() const;
|
|
|
|
CurrentArtLoader *current_art_loader() const;
|
2018-07-01 22:26:46 +02:00
|
|
|
|
2018-10-14 00:08:33 +02:00
|
|
|
LyricsProviders *lyrics_providers() const;
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2018-08-09 18:10:03 +02:00
|
|
|
InternetModel *internet_model() const;
|
2018-10-17 23:49:02 +02:00
|
|
|
#ifdef HAVE_STREAM_TIDAL
|
2018-10-17 21:18:39 +02:00
|
|
|
InternetSearch *tidal_search() const;
|
2018-10-17 23:49:02 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_STREAM_DEEZER
|
2018-10-17 21:18:39 +02:00
|
|
|
InternetSearch *deezer_search() const;
|
2018-10-17 23:49:02 +02:00
|
|
|
#endif
|
2018-08-29 21:42:24 +02:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
void MoveToNewThread(QObject *object);
|
|
|
|
void MoveToThread(QObject *object, QThread *thread);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void AddError(const QString &message);
|
|
|
|
void ReloadSettings();
|
|
|
|
void OpenSettingsDialogAtPage(SettingsDialog::Page page);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void ErrorAdded(const QString &message);
|
|
|
|
void SettingsChanged();
|
|
|
|
void SettingsDialogRequested(SettingsDialog::Page page);
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<ApplicationImpl> p_;
|
|
|
|
QList<QThread*> threads_;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // APPLICATION_H_
|