strawberry-audio-player-win.../src/core/application.h

118 lines
2.9 KiB
C
Raw Normal View History

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>
#include <stdbool.h>
2018-02-27 18:06:05 +01:00
#include <QObject>
#include <QThread>
#include <QList>
#include <QString>
2018-02-27 18:06:05 +01:00
#include "settings/settingsdialog.h"
class TaskManager;
2018-02-27 18:06:05 +01:00
class ApplicationImpl;
class TagReaderClient;
class Database;
class EngineDevice;
2018-02-27 18:06:05 +01:00
class Player;
class Appearance;
2018-07-01 22:26:46 +02:00
class SCollection;
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
class DeviceManager;
2018-09-20 17:36:23 +02:00
#endif
2018-02-27 18:06:05 +01:00
class CoverProviders;
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;
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
InternetSearch *tidal_search() const;
2018-10-17 23:49:02 +02:00
#endif
#ifdef HAVE_STREAM_DEEZER
InternetSearch *deezer_search() const;
2018-10-17 23:49:02 +02:00
#endif
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_