2012-02-12 14:41:50 +01:00
|
|
|
/* This file is part of Clementine.
|
2014-11-01 19:30:40 +01:00
|
|
|
Copyright 2012-2013, Andreas <asfa194@gmail.com>
|
|
|
|
Copyright 2012-2013, David Sansome <me@davidsansome.com>
|
|
|
|
Copyright 2013, Arnaud Bienner <arnaud.bienner@gmail.com>
|
|
|
|
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
|
|
|
|
Copyright 2014, John Maguire <john.maguire@gmail.com>
|
2012-02-12 14:41:50 +01:00
|
|
|
|
|
|
|
Clementine 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.
|
|
|
|
|
|
|
|
Clementine 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 Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2014-11-01 19:26:05 +01:00
|
|
|
#ifndef CORE_APPLICATION_H_
|
|
|
|
#define CORE_APPLICATION_H_
|
2012-02-12 14:41:50 +01:00
|
|
|
|
2012-03-10 23:39:24 +01:00
|
|
|
#include "ui/settingsdialog.h"
|
|
|
|
|
2012-02-12 14:41:50 +01:00
|
|
|
#include <QObject>
|
|
|
|
|
2012-02-13 21:44:04 +01:00
|
|
|
class AlbumCoverLoader;
|
2012-02-12 14:41:50 +01:00
|
|
|
class Appearance;
|
|
|
|
class CoverProviders;
|
2012-02-13 21:44:04 +01:00
|
|
|
class CurrentArtLoader;
|
2012-02-12 14:41:50 +01:00
|
|
|
class Database;
|
|
|
|
class DeviceManager;
|
|
|
|
class GlobalSearch;
|
2012-03-09 16:25:49 +01:00
|
|
|
class GPodderSync;
|
2012-02-12 14:41:50 +01:00
|
|
|
class InternetModel;
|
|
|
|
class Library;
|
|
|
|
class LibraryBackend;
|
|
|
|
class LibraryModel;
|
2012-05-25 18:18:07 +02:00
|
|
|
class MoodbarController;
|
|
|
|
class MoodbarLoader;
|
2012-12-31 23:37:39 +01:00
|
|
|
class NetworkRemote;
|
|
|
|
class NetworkRemoteHelper;
|
2012-02-12 14:41:50 +01:00
|
|
|
class Player;
|
|
|
|
class PlaylistBackend;
|
2014-12-06 19:44:12 +01:00
|
|
|
class PodcastDeleter;
|
2012-03-10 16:32:36 +01:00
|
|
|
class PodcastDownloader;
|
2012-02-12 14:41:50 +01:00
|
|
|
class PlaylistManager;
|
2012-03-04 21:47:58 +01:00
|
|
|
class PodcastBackend;
|
2012-03-09 13:15:24 +01:00
|
|
|
class PodcastUpdater;
|
2014-03-27 18:55:58 +01:00
|
|
|
class Scrobbler;
|
2012-02-12 14:41:50 +01:00
|
|
|
class TagReaderClient;
|
|
|
|
class TaskManager;
|
|
|
|
|
|
|
|
class Application : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
public:
|
2013-09-29 10:43:34 +02:00
|
|
|
static bool kIsPortable;
|
|
|
|
|
2014-11-01 19:26:05 +01:00
|
|
|
explicit Application(QObject* parent = nullptr);
|
2012-02-12 14:41:50 +01:00
|
|
|
~Application();
|
|
|
|
|
2013-07-27 19:23:55 +02:00
|
|
|
const QString& language_name() const { return language_name_; }
|
2014-02-07 16:34:20 +01:00
|
|
|
// Same as language_name, but remove the region code at the end if there is
|
|
|
|
// one
|
2013-07-27 19:23:55 +02:00
|
|
|
QString language_without_region() const;
|
2013-07-27 07:27:08 +02:00
|
|
|
void set_language_name(const QString& name) { language_name_ = name; }
|
|
|
|
|
2012-02-12 14:41:50 +01:00
|
|
|
TagReaderClient* tag_reader_client() const { return tag_reader_client_; }
|
|
|
|
Database* database() const { return database_; }
|
2012-02-13 21:44:04 +01:00
|
|
|
AlbumCoverLoader* album_cover_loader() const { return album_cover_loader_; }
|
2012-03-06 19:37:46 +01:00
|
|
|
PlaylistBackend* playlist_backend() const { return playlist_backend_; }
|
|
|
|
PodcastBackend* podcast_backend() const { return podcast_backend_; }
|
2012-02-12 14:41:50 +01:00
|
|
|
Appearance* appearance() const { return appearance_; }
|
|
|
|
CoverProviders* cover_providers() const { return cover_providers_; }
|
|
|
|
TaskManager* task_manager() const { return task_manager_; }
|
|
|
|
Player* player() const { return player_; }
|
|
|
|
PlaylistManager* playlist_manager() const { return playlist_manager_; }
|
2012-02-13 21:44:04 +01:00
|
|
|
CurrentArtLoader* current_art_loader() const { return current_art_loader_; }
|
2012-02-12 14:41:50 +01:00
|
|
|
GlobalSearch* global_search() const { return global_search_; }
|
|
|
|
InternetModel* internet_model() const { return internet_model_; }
|
|
|
|
Library* library() const { return library_; }
|
|
|
|
DeviceManager* device_manager() const { return device_manager_; }
|
2012-03-09 13:15:24 +01:00
|
|
|
PodcastUpdater* podcast_updater() const { return podcast_updater_; }
|
2014-12-06 19:44:12 +01:00
|
|
|
PodcastDeleter* podcast_deleter() const { return podcast_deleter_; }
|
2012-03-10 16:32:36 +01:00
|
|
|
PodcastDownloader* podcast_downloader() const { return podcast_downloader_; }
|
2012-03-09 16:25:49 +01:00
|
|
|
GPodderSync* gpodder_sync() const { return gpodder_sync_; }
|
2012-05-25 18:18:07 +02:00
|
|
|
MoodbarLoader* moodbar_loader() const { return moodbar_loader_; }
|
|
|
|
MoodbarController* moodbar_controller() const { return moodbar_controller_; }
|
2012-12-31 23:37:39 +01:00
|
|
|
NetworkRemote* network_remote() const { return network_remote_; }
|
2014-02-07 16:34:20 +01:00
|
|
|
NetworkRemoteHelper* network_remote_helper() const {
|
|
|
|
return network_remote_helper_;
|
|
|
|
}
|
2014-03-27 18:55:58 +01:00
|
|
|
Scrobbler* scrobbler() const { return scrobbler_; }
|
2012-02-12 14:41:50 +01:00
|
|
|
|
|
|
|
LibraryBackend* library_backend() const;
|
|
|
|
LibraryModel* library_model() const;
|
|
|
|
|
2012-02-13 21:44:04 +01:00
|
|
|
void MoveToNewThread(QObject* object);
|
|
|
|
void MoveToThread(QObject* object, QThread* thread);
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
public slots:
|
2012-02-12 14:41:50 +01:00
|
|
|
void AddError(const QString& message);
|
2012-03-09 13:15:24 +01:00
|
|
|
void ReloadSettings();
|
2012-03-10 23:39:24 +01:00
|
|
|
void OpenSettingsDialogAtPage(SettingsDialog::Page page);
|
2012-02-12 14:41:50 +01:00
|
|
|
|
2014-11-01 19:26:05 +01:00
|
|
|
signals:
|
2012-02-12 14:41:50 +01:00
|
|
|
void ErrorAdded(const QString& message);
|
2012-03-09 13:15:24 +01:00
|
|
|
void SettingsChanged();
|
2012-03-10 23:39:24 +01:00
|
|
|
void SettingsDialogRequested(SettingsDialog::Page page);
|
2012-02-12 14:41:50 +01:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private:
|
2013-07-27 07:27:08 +02:00
|
|
|
QString language_name_;
|
|
|
|
|
2012-02-12 14:41:50 +01:00
|
|
|
TagReaderClient* tag_reader_client_;
|
|
|
|
Database* database_;
|
2012-02-13 21:44:04 +01:00
|
|
|
AlbumCoverLoader* album_cover_loader_;
|
2012-03-06 19:37:46 +01:00
|
|
|
PlaylistBackend* playlist_backend_;
|
|
|
|
PodcastBackend* podcast_backend_;
|
2012-02-12 14:41:50 +01:00
|
|
|
Appearance* appearance_;
|
|
|
|
CoverProviders* cover_providers_;
|
|
|
|
TaskManager* task_manager_;
|
|
|
|
Player* player_;
|
|
|
|
PlaylistManager* playlist_manager_;
|
2012-02-13 21:44:04 +01:00
|
|
|
CurrentArtLoader* current_art_loader_;
|
2012-02-12 14:41:50 +01:00
|
|
|
GlobalSearch* global_search_;
|
|
|
|
InternetModel* internet_model_;
|
|
|
|
Library* library_;
|
|
|
|
DeviceManager* device_manager_;
|
2012-03-09 13:15:24 +01:00
|
|
|
PodcastUpdater* podcast_updater_;
|
2014-12-06 19:44:12 +01:00
|
|
|
PodcastDeleter* podcast_deleter_;
|
2012-03-10 16:32:36 +01:00
|
|
|
PodcastDownloader* podcast_downloader_;
|
2012-03-09 16:25:49 +01:00
|
|
|
GPodderSync* gpodder_sync_;
|
2012-05-25 18:18:07 +02:00
|
|
|
MoodbarLoader* moodbar_loader_;
|
|
|
|
MoodbarController* moodbar_controller_;
|
2012-12-31 23:37:39 +01:00
|
|
|
NetworkRemote* network_remote_;
|
|
|
|
NetworkRemoteHelper* network_remote_helper_;
|
2014-03-27 18:55:58 +01:00
|
|
|
Scrobbler* scrobbler_;
|
2012-02-12 14:41:50 +01:00
|
|
|
|
|
|
|
QList<QObject*> objects_in_threads_;
|
|
|
|
QList<QThread*> threads_;
|
|
|
|
};
|
|
|
|
|
2014-11-01 19:26:05 +01:00
|
|
|
#endif // CORE_APPLICATION_H_
|