2010-06-15 20:24:08 +02:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-06-15 20:24:08 +02: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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SONGLOADERINSERTER_H
|
|
|
|
#define SONGLOADERINSERTER_H
|
|
|
|
|
2014-04-02 15:57:01 +02:00
|
|
|
#include <QList>
|
2010-06-15 20:24:08 +02:00
|
|
|
#include <QObject>
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
#include "core/song.h"
|
|
|
|
|
2010-08-31 23:24:57 +02:00
|
|
|
class LibraryBackendInterface;
|
2014-01-24 13:54:38 +01:00
|
|
|
class Player;
|
2010-06-15 20:24:08 +02:00
|
|
|
class Playlist;
|
|
|
|
class SongLoader;
|
2010-06-23 15:21:30 +02:00
|
|
|
class TaskManager;
|
2010-06-15 20:24:08 +02:00
|
|
|
|
|
|
|
class QModelIndex;
|
|
|
|
|
|
|
|
class SongLoaderInserter : public QObject {
|
|
|
|
Q_OBJECT
|
2014-02-07 16:34:20 +01:00
|
|
|
public:
|
2014-01-24 13:54:38 +01:00
|
|
|
SongLoaderInserter(TaskManager* task_manager,
|
2014-02-07 16:34:20 +01:00
|
|
|
LibraryBackendInterface* library, const Player* player);
|
2010-06-15 20:24:08 +02:00
|
|
|
~SongLoaderInserter();
|
|
|
|
|
2018-04-14 22:57:06 +02:00
|
|
|
void Load(Playlist* destination, int row, bool play_now, bool enqueue,
|
|
|
|
bool enqueue_next, const QList<QUrl>& urls);
|
|
|
|
void LoadAudioCD(Playlist* destination, int row, bool play_now, bool enqueue,
|
|
|
|
bool enqueue_now);
|
2010-06-15 20:24:08 +02:00
|
|
|
|
2018-04-14 22:57:06 +02:00
|
|
|
signals:
|
2010-06-15 20:24:08 +02:00
|
|
|
void Error(const QString& message);
|
2014-04-02 15:57:01 +02:00
|
|
|
void PreloadFinished();
|
2011-11-18 21:55:54 +01:00
|
|
|
void EffectiveLoadFinished(const SongList& songs);
|
2010-06-15 20:24:08 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private slots:
|
2011-03-06 15:46:01 +01:00
|
|
|
void DestinationDestroyed();
|
2014-10-26 03:32:37 +01:00
|
|
|
void AudioCDTracksLoaded(SongLoader* loader);
|
2011-06-10 01:08:43 +02:00
|
|
|
void AudioCDTagsLoaded(bool success);
|
2014-04-02 15:57:01 +02:00
|
|
|
void InsertSongs();
|
2010-06-15 20:24:08 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private:
|
2014-04-02 15:57:01 +02:00
|
|
|
void AsyncLoad();
|
2010-06-15 20:24:08 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private:
|
2010-06-23 15:21:30 +02:00
|
|
|
TaskManager* task_manager_;
|
|
|
|
|
2010-06-15 20:24:08 +02:00
|
|
|
Playlist* destination_;
|
|
|
|
int row_;
|
|
|
|
bool play_now_;
|
2011-01-10 23:26:13 +01:00
|
|
|
bool enqueue_;
|
2018-03-19 03:44:00 +01:00
|
|
|
bool enqueue_next_;
|
2010-06-15 20:24:08 +02:00
|
|
|
|
|
|
|
SongList songs_;
|
|
|
|
|
2014-04-02 15:57:01 +02:00
|
|
|
QList<SongLoader*> pending_;
|
2010-08-31 23:24:57 +02:00
|
|
|
LibraryBackendInterface* library_;
|
2014-01-24 13:54:38 +01:00
|
|
|
const Player* player_;
|
2010-06-15 20:24:08 +02:00
|
|
|
};
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
#endif // SONGLOADERINSERTER_H
|