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
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSet>
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
#include "core/song.h"
|
|
|
|
|
2010-08-31 23:24:57 +02:00
|
|
|
class LibraryBackendInterface;
|
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
|
|
|
|
public:
|
2011-03-06 15:46:01 +01:00
|
|
|
SongLoaderInserter(TaskManager* task_manager, LibraryBackendInterface* library);
|
2010-06-15 20:24:08 +02:00
|
|
|
~SongLoaderInserter();
|
|
|
|
|
2011-01-10 23:26:13 +01:00
|
|
|
void Load(Playlist* destination, int row, bool play_now, bool enqueue,
|
|
|
|
const QList<QUrl>& urls);
|
2010-06-15 20:24:08 +02:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void Error(const QString& message);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void PendingLoadFinished(bool success);
|
2011-03-06 15:46:01 +01:00
|
|
|
void DestinationDestroyed();
|
2010-06-15 20:24:08 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void Finished();
|
|
|
|
|
|
|
|
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_;
|
2010-06-15 20:24:08 +02:00
|
|
|
|
|
|
|
SongList songs_;
|
|
|
|
|
|
|
|
QSet<SongLoader*> pending_;
|
2010-06-23 15:21:30 +02:00
|
|
|
int async_load_id_;
|
|
|
|
int async_progress_;
|
2010-08-31 23:24:57 +02:00
|
|
|
LibraryBackendInterface* library_;
|
2010-06-15 20:24:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SONGLOADERINSERTER_H
|