Ipod Playlist Support (#220)
* Ipod Playlist Support Copy a whole playlist to the ipod and create an entry in Playlists on the iPod * Fix formatting and indentation Fix indenting and formatting to be consistent
This commit is contained in:
@@ -52,7 +52,7 @@ const int Organise::kBatchSize = 10;
|
||||
const int Organise::kTranscodeProgressInterval = 500;
|
||||
#endif
|
||||
|
||||
Organise::Organise(TaskManager *task_manager, std::shared_ptr<MusicStorage> destination, const OrganiseFormat &format, bool copy, bool overwrite, bool mark_as_listened, bool albumcover, const NewSongInfoList &songs_info, bool eject_after)
|
||||
Organise::Organise(TaskManager *task_manager, std::shared_ptr<MusicStorage> destination, const OrganiseFormat &format, bool copy, bool overwrite, bool mark_as_listened, bool albumcover, const NewSongInfoList &songs_info, bool eject_after, const QString &playlist)
|
||||
: thread_(nullptr),
|
||||
task_manager_(task_manager),
|
||||
#ifdef HAVE_GSTREAMER
|
||||
@@ -66,10 +66,11 @@ Organise::Organise(TaskManager *task_manager, std::shared_ptr<MusicStorage> dest
|
||||
albumcover_(albumcover),
|
||||
eject_after_(eject_after),
|
||||
task_count_(songs_info.count()),
|
||||
playlist_(playlist),
|
||||
tasks_complete_(0),
|
||||
started_(false),
|
||||
task_id_(0),
|
||||
current_copy_progress_(0) {
|
||||
current_copy_progress_(0){
|
||||
|
||||
original_thread_ = thread();
|
||||
|
||||
@@ -208,6 +209,7 @@ void Organise::ProcessSomeFiles() {
|
||||
job.mark_as_listened_ = mark_as_listened_;
|
||||
job.albumcover_ = albumcover_;
|
||||
job.remove_original_ = !copy_;
|
||||
job.playlist_ = playlist_;
|
||||
|
||||
if (task.song_info_.song_.art_manual_is_valid() && task.song_info_.song_.art_manual().path() != Song::kManuallyUnsetCover) {
|
||||
if (task.song_info_.song_.art_manual().isLocalFile() && QFile::exists(task.song_info_.song_.art_manual().toLocalFile())) {
|
||||
|
||||
@@ -61,7 +61,7 @@ class Organise : public QObject {
|
||||
};
|
||||
typedef QList<NewSongInfo> NewSongInfoList;
|
||||
|
||||
Organise(TaskManager *task_manager, std::shared_ptr<MusicStorage> destination, const OrganiseFormat &format, bool copy, bool overwrite, bool mark_as_listened, bool albumcover, const NewSongInfoList &songs, bool eject_after);
|
||||
Organise(TaskManager *task_manager, std::shared_ptr<MusicStorage> destination, const OrganiseFormat &format, bool copy, bool overwrite, bool mark_as_listened, bool albumcover, const NewSongInfoList &songs, bool eject_after, const QString &playlist = QString());
|
||||
~Organise();
|
||||
|
||||
static const int kBatchSize;
|
||||
@@ -123,6 +123,7 @@ class Organise : public QObject {
|
||||
const bool albumcover_;
|
||||
const bool eject_after_;
|
||||
int task_count_;
|
||||
const QString playlist_;
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
QBasicTimer transcode_progress_timer_;
|
||||
|
||||
@@ -244,7 +244,12 @@ SongList OrganiseDialog::LoadSongsBlocking(const QStringList &filenames) {
|
||||
}
|
||||
|
||||
void OrganiseDialog::SetCopy(bool copy) {
|
||||
ui_->aftercopying->setCurrentIndex(copy ? 0 : 1);
|
||||
ui_->aftercopying->setCurrentIndex(copy ? 0 : 1);
|
||||
}
|
||||
|
||||
void OrganiseDialog::SetPlaylist(const QString &playlist)
|
||||
{
|
||||
playlist_ = playlist;
|
||||
}
|
||||
|
||||
void OrganiseDialog::InsertTag(const QString &tag) {
|
||||
@@ -399,7 +404,7 @@ void OrganiseDialog::accept() {
|
||||
|
||||
// It deletes itself when it's finished.
|
||||
const bool copy = ui_->aftercopying->currentIndex() == 0;
|
||||
Organise *organise = new Organise(task_manager_, storage, format_, copy, ui_->overwrite->isChecked(), ui_->mark_as_listened->isChecked(), ui_->albumcover->isChecked(), new_songs_info_, ui_->eject_after->isChecked());
|
||||
Organise *organise = new Organise(task_manager_, storage, format_, copy, ui_->overwrite->isChecked(), ui_->mark_as_listened->isChecked(), ui_->albumcover->isChecked(), new_songs_info_, ui_->eject_after->isChecked(), playlist_);
|
||||
connect(organise, SIGNAL(Finished(QStringList, QStringList)), SLOT(OrganiseFinished(QStringList, QStringList)));
|
||||
connect(organise, SIGNAL(FileCopied(int)), this, SIGNAL(FileCopied(int)));
|
||||
if (backend_)
|
||||
|
||||
@@ -74,6 +74,8 @@ class OrganiseDialog : public QDialog {
|
||||
void SetCopy(bool copy);
|
||||
|
||||
static Organise::NewSongInfoList ComputeNewSongsFilenames(const SongList &songs, const OrganiseFormat &format);
|
||||
|
||||
void SetPlaylist(const QString &playlist);
|
||||
|
||||
signals:
|
||||
void FileCopied(int);
|
||||
@@ -114,6 +116,7 @@ class OrganiseDialog : public QDialog {
|
||||
SongList songs_;
|
||||
Organise::NewSongInfoList new_songs_info_;
|
||||
quint64 total_size_;
|
||||
QString playlist_;
|
||||
|
||||
std::unique_ptr<OrganiseErrorDialog> error_dialog_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user