Start of work on a queue manager
This commit is contained in:
parent
b62263540f
commit
41183107d2
|
@ -87,6 +87,8 @@ set(SOURCES
|
|||
playlist/playlisttabbar.cpp
|
||||
playlist/playlistundocommands.cpp
|
||||
playlist/playlistview.cpp
|
||||
playlist/queue.cpp
|
||||
playlist/queuemanager.cpp
|
||||
playlist/songloaderinserter.cpp
|
||||
playlist/songplaylistitem.cpp
|
||||
|
||||
|
@ -204,6 +206,8 @@ set(HEADERS
|
|||
playlist/playlistsequence.h
|
||||
playlist/playlisttabbar.h
|
||||
playlist/playlistview.h
|
||||
playlist/queue.h
|
||||
playlist/queuemanager.h
|
||||
playlist/songloaderinserter.h
|
||||
playlist/songmimedata.h
|
||||
|
||||
|
@ -272,6 +276,7 @@ set(UI
|
|||
|
||||
playlist/playlistcontainer.ui
|
||||
playlist/playlistsequence.ui
|
||||
playlist/queuemanager.ui
|
||||
|
||||
radio/lastfmconfig.ui
|
||||
radio/lastfmstationdialog.ui
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "playlistbackend.h"
|
||||
#include "playlistfilter.h"
|
||||
#include "playlistundocommands.h"
|
||||
#include "queue.h"
|
||||
#include "songloaderinserter.h"
|
||||
#include "songmimedata.h"
|
||||
#include "songplaylistitem.h"
|
||||
|
@ -53,6 +54,7 @@ Playlist::Playlist(PlaylistBackend* backend, TaskManager* task_manager,
|
|||
int id, QObject *parent)
|
||||
: QAbstractListModel(parent),
|
||||
proxy_(new PlaylistFilter(this)),
|
||||
queue_(new Queue(this)),
|
||||
backend_(backend),
|
||||
task_manager_(task_manager),
|
||||
id_(id),
|
||||
|
@ -71,6 +73,7 @@ Playlist::Playlist(PlaylistBackend* backend, TaskManager* task_manager,
|
|||
Restore();
|
||||
|
||||
proxy_->setSourceModel(this);
|
||||
queue_->setSourceModel(this);
|
||||
}
|
||||
|
||||
Playlist::~Playlist() {
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
class RadioService;
|
||||
class PlaylistBackend;
|
||||
class PlaylistFilter;
|
||||
class Queue;
|
||||
class TaskManager;
|
||||
|
||||
class QSortFilterProxyModel;
|
||||
|
@ -101,6 +102,7 @@ class Playlist : public QAbstractListModel {
|
|||
|
||||
// Accessors
|
||||
QSortFilterProxyModel* proxy() const;
|
||||
Queue* queue() const { return queue_; }
|
||||
|
||||
int id() const { return id_; }
|
||||
int current_index() const;
|
||||
|
@ -196,6 +198,7 @@ class Playlist : public QAbstractListModel {
|
|||
|
||||
private:
|
||||
PlaylistFilter* proxy_;
|
||||
Queue* queue_;
|
||||
|
||||
PlaylistBackend* backend_;
|
||||
TaskManager* task_manager_;
|
||||
|
|
|
@ -0,0 +1,137 @@
|
|||
/* This file is part of Clementine.
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#include "queue.h"
|
||||
|
||||
Queue::Queue(QObject* parent)
|
||||
: QAbstractProxyModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QModelIndex Queue::mapFromSource(const QModelIndex& source_index) const {
|
||||
if (!source_index.isValid())
|
||||
return QModelIndex();
|
||||
|
||||
const int source_row = source_index.row();
|
||||
for (int i=0 ; i<source_indexes_.count() ; ++i) {
|
||||
if (source_indexes_[i].row() == source_row)
|
||||
return index(i, source_index.column());
|
||||
}
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
QModelIndex Queue::mapToSource(const QModelIndex& proxy_index) const {
|
||||
return source_indexes_[proxy_index.row()];
|
||||
}
|
||||
|
||||
void Queue::setSourceModel(QAbstractItemModel* source_model) {
|
||||
if (sourceModel()) {
|
||||
disconnect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||
this, SLOT(SourceDataChanged(QModelIndex,QModelIndex)));
|
||||
disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)),
|
||||
this, SLOT(SourceLayoutChanged()));
|
||||
disconnect(sourceModel(), SIGNAL(layoutChanged()),
|
||||
this, SLOT(SourceLayoutChanged()));
|
||||
}
|
||||
|
||||
QAbstractProxyModel::setSourceModel(source_model);
|
||||
|
||||
connect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||
this, SLOT(SourceDataChanged(QModelIndex,QModelIndex)));
|
||||
connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)),
|
||||
this, SLOT(SourceLayoutChanged()));
|
||||
connect(sourceModel(), SIGNAL(layoutChanged()),
|
||||
this, SLOT(SourceLayoutChanged()));
|
||||
}
|
||||
|
||||
void Queue::SourceDataChanged(const QModelIndex& top_left,
|
||||
const QModelIndex& bottom_right) {
|
||||
const int last_col = ColumnCount - 1;
|
||||
|
||||
for (int row = top_left.row() ; row <= bottom_right.row() ; ++row) {
|
||||
QModelIndex proxy_index = mapFromSource(sourceModel()->index(row, 0));
|
||||
if (!proxy_index.isValid())
|
||||
continue;
|
||||
|
||||
emit dataChanged(proxy_index, proxy_index.sibling(proxy_index.row(), last_col));
|
||||
}
|
||||
}
|
||||
|
||||
void Queue::SourceLayoutChanged() {
|
||||
for (int i=0 ; i<source_indexes_.count() ; ++i) {
|
||||
if (!source_indexes_[i].isValid()) {
|
||||
beginRemoveRows(QModelIndex(), i, i);
|
||||
source_indexes_.removeAt(i);
|
||||
endRemoveRows();
|
||||
|
||||
--i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QModelIndex Queue::index(int row, int column, const QModelIndex& parent) const {
|
||||
return createIndex(row, column);
|
||||
}
|
||||
|
||||
QModelIndex Queue::parent(const QModelIndex &child) const {
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
int Queue::rowCount(const QModelIndex &parent) const {
|
||||
if (parent.isValid())
|
||||
return 0;
|
||||
return source_indexes_.count();
|
||||
}
|
||||
|
||||
int Queue::columnCount(const QModelIndex &parent) const {
|
||||
return ColumnCount;
|
||||
}
|
||||
|
||||
QVariant Queue::data(const QModelIndex& proxy_index, int role) const {
|
||||
if (role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
|
||||
QModelIndex source_index = source_indexes_[proxy_index.row()];
|
||||
|
||||
if (proxy_index.column() == Column_CombinedArtistTitle) {
|
||||
const QString artist = source_index.sibling(source_index.row(), Playlist::Column_Artist).data().toString();
|
||||
const QString title = source_index.sibling(source_index.row(), Playlist::Column_Title).data().toString();
|
||||
|
||||
if (artist.isEmpty())
|
||||
return title;
|
||||
return artist + " - " + title;
|
||||
}
|
||||
return source_index.data(role);
|
||||
}
|
||||
|
||||
void Queue::ToggleTracks(const QModelIndexList &source_indexes) {
|
||||
foreach (const QModelIndex& source_index, source_indexes) {
|
||||
QModelIndex proxy_index = mapFromSource(source_index);
|
||||
if (proxy_index.isValid()) {
|
||||
// Dequeue the track
|
||||
const int row = proxy_index.row();
|
||||
beginRemoveRows(QModelIndex(), row, row);
|
||||
source_indexes_.removeAt(row);
|
||||
endRemoveRows();
|
||||
} else {
|
||||
// Enqueue the track
|
||||
const int row = source_indexes_.count();
|
||||
beginInsertRows(QModelIndex(), row, row);
|
||||
source_indexes_ << QPersistentModelIndex(source_index);
|
||||
endInsertRows();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/* This file is part of Clementine.
|
||||
|
||||
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 QUEUE_H
|
||||
#define QUEUE_H
|
||||
|
||||
#include "playlist.h"
|
||||
|
||||
#include <QAbstractProxyModel>
|
||||
|
||||
class Queue : public QAbstractProxyModel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Queue(QObject* parent = 0);
|
||||
|
||||
enum Columns {
|
||||
Column_CombinedArtistTitle = Playlist::ColumnCount,
|
||||
|
||||
ColumnCount
|
||||
};
|
||||
|
||||
bool is_empty() const;
|
||||
|
||||
QModelIndex TakeNext();
|
||||
void ToggleTracks(const QModelIndexList& source_indexes);
|
||||
|
||||
// QAbstractProxyModel
|
||||
void setSourceModel(QAbstractItemModel* source_model);
|
||||
QModelIndex mapFromSource(const QModelIndex& source_index) const;
|
||||
QModelIndex mapToSource(const QModelIndex& proxy_index) const;
|
||||
|
||||
// QAbstractItemModel
|
||||
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
||||
QModelIndex parent(const QModelIndex &child) const;
|
||||
int rowCount(const QModelIndex &parent) const;
|
||||
int columnCount(const QModelIndex &parent) const;
|
||||
QVariant data(const QModelIndex& proxy_index, int role) const;
|
||||
|
||||
private slots:
|
||||
void SourceDataChanged(const QModelIndex& top_left, const QModelIndex& bottom_right);
|
||||
void SourceLayoutChanged();
|
||||
|
||||
private:
|
||||
QList<QPersistentModelIndex> source_indexes_;
|
||||
};
|
||||
|
||||
#endif // QUEUE_H
|
|
@ -0,0 +1,46 @@
|
|||
/* This file is part of Clementine.
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#include "playlist.h"
|
||||
#include "playlistmanager.h"
|
||||
#include "queue.h"
|
||||
#include "queuemanager.h"
|
||||
#include "ui_queuemanager.h"
|
||||
|
||||
QueueManager::QueueManager(QWidget *parent)
|
||||
: QDialog(parent),
|
||||
ui_(new Ui_QueueManager),
|
||||
playlists_(NULL),
|
||||
current_playlist_(NULL)
|
||||
{
|
||||
ui_->setupUi(this);
|
||||
}
|
||||
|
||||
QueueManager::~QueueManager() {
|
||||
delete ui_;
|
||||
}
|
||||
|
||||
void QueueManager::SetPlaylistManager(PlaylistManager* manager) {
|
||||
playlists_ = manager;
|
||||
|
||||
connect(playlists_, SIGNAL(CurrentChanged(Playlist*)), SLOT(CurrentPlaylistChanged(Playlist*)));
|
||||
}
|
||||
|
||||
void QueueManager::CurrentPlaylistChanged(Playlist* playlist) {
|
||||
current_playlist_ = playlist;
|
||||
ui_->list->setModel(current_playlist_->queue());
|
||||
ui_->list->setModelColumn(Queue::Column_CombinedArtistTitle);
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/* This file is part of Clementine.
|
||||
|
||||
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 QUEUEMANAGER_H
|
||||
#define QUEUEMANAGER_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class Playlist;
|
||||
class PlaylistManager;
|
||||
class Ui_QueueManager;
|
||||
|
||||
class QueueManager : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QueueManager(QWidget* parent = 0);
|
||||
~QueueManager();
|
||||
|
||||
void SetPlaylistManager(PlaylistManager* manager);
|
||||
|
||||
private slots:
|
||||
void CurrentPlaylistChanged(Playlist* playlist);
|
||||
|
||||
private:
|
||||
Ui_QueueManager* ui_;
|
||||
|
||||
PlaylistManager* playlists_;
|
||||
Playlist* current_playlist_;
|
||||
};
|
||||
|
||||
#endif // QUEUEMANAGER_H
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QueueManager</class>
|
||||
<widget class="QDialog" name="QueueManager">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>455</width>
|
||||
<height>366</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Queue Manager</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QListView" name="list"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="move_up">
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="move_down">
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="clear">
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>QueueManager</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>QueueManager</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
|
@ -1181,6 +1181,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1185,6 +1185,12 @@ msgstr "Průběh"
|
|||
msgid "Quality"
|
||||
msgstr "Kvalita"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Rádio (vyrovnaná hlasitost pro všechny stopy)"
|
||||
|
||||
|
|
|
@ -1186,6 +1186,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1189,6 +1189,12 @@ msgstr "Fortschritt"
|
|||
msgid "Quality"
|
||||
msgstr "Qualität"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Radio (gleicher Pegel für alle Titel)"
|
||||
|
||||
|
|
|
@ -1196,6 +1196,12 @@ msgstr "Πρόοδος"
|
|||
msgid "Quality"
|
||||
msgstr "Ποιότητα"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Ραδιόφωνο (ίση ένταση για όλα τα κομμάτια)"
|
||||
|
||||
|
|
|
@ -1186,6 +1186,12 @@ msgstr "Progress"
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Radio (equal loudness for all tracks)"
|
||||
|
||||
|
|
|
@ -1183,6 +1183,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1194,6 +1194,12 @@ msgstr "Progreso"
|
|||
msgid "Quality"
|
||||
msgstr "Calidad"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Radio (volumen igual para todas las pistas)"
|
||||
|
||||
|
|
|
@ -1183,6 +1183,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr "Laatu"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Radio (sama äänenvoimakkuus kaikille kappaleille)"
|
||||
|
||||
|
|
|
@ -1189,6 +1189,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1183,6 +1183,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1192,6 +1192,12 @@ msgstr "Avanzamento"
|
|||
msgid "Quality"
|
||||
msgstr "Qualità"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Radio (volume uguale per tutte le tracce)"
|
||||
|
||||
|
|
|
@ -1183,6 +1183,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1184,6 +1184,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1181,6 +1181,12 @@ msgstr "Progression"
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1183,6 +1183,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1193,6 +1193,12 @@ msgstr "Evolução"
|
|||
msgid "Quality"
|
||||
msgstr "Qualidade"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Rádio (volume igual para todas as faixas)"
|
||||
|
||||
|
|
|
@ -1193,6 +1193,12 @@ msgstr "Andamento"
|
|||
msgid "Quality"
|
||||
msgstr "Qualidade"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Rádio (equalizar sonoridade para todas as faixas)"
|
||||
|
||||
|
|
|
@ -1182,6 +1182,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1187,6 +1187,12 @@ msgstr "Ход выполнения"
|
|||
msgid "Quality"
|
||||
msgstr "Качество"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Радио (одинаковая громкость для всех композиций)"
|
||||
|
||||
|
|
|
@ -1192,6 +1192,12 @@ msgstr "Priebeh"
|
|||
msgid "Quality"
|
||||
msgstr "Kvalita"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Rádio (rovnaká hlasitosť pre všetky skladby)"
|
||||
|
||||
|
|
|
@ -1186,6 +1186,12 @@ msgstr "Förlopp"
|
|||
msgid "Quality"
|
||||
msgstr "Kvalitet"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Radio (samma loudness för alla spår)"
|
||||
|
||||
|
|
|
@ -1183,6 +1183,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1172,6 +1172,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1192,6 +1192,12 @@ msgstr "Поступ"
|
|||
msgid "Quality"
|
||||
msgstr "Якість"
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr "Радіо (однакова гучність всіх композицій)"
|
||||
|
||||
|
|
|
@ -1181,6 +1181,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1181,6 +1181,12 @@ msgstr ""
|
|||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue Manager"
|
||||
msgstr ""
|
||||
|
||||
msgid "Queue this track"
|
||||
msgstr ""
|
||||
|
||||
msgid "Radio (equal loudness for all tracks)"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
#include "playlist/playlistmanager.h"
|
||||
#include "playlist/playlistsequence.h"
|
||||
#include "playlist/playlistview.h"
|
||||
#include "playlist/queue.h"
|
||||
#include "playlist/queuemanager.h"
|
||||
#include "playlist/songloaderinserter.h"
|
||||
#include "playlist/songplaylistitem.h"
|
||||
#include "playlistparsers/playlistparser.h"
|
||||
|
@ -128,6 +130,7 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
|
|||
#endif
|
||||
error_dialog_(new ErrorDialog),
|
||||
organise_dialog_(new OrganiseDialog(task_manager_)),
|
||||
queue_manager_(new QueueManager),
|
||||
#ifdef ENABLE_VISUALISATIONS
|
||||
visualisation_(new VisualisationContainer),
|
||||
#endif
|
||||
|
@ -188,6 +191,7 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
|
|||
library_sort_model_->sort(0);
|
||||
|
||||
ui_->playlist->SetManager(playlists_);
|
||||
queue_manager_->SetPlaylistManager(playlists_);
|
||||
|
||||
ui_->library_view->setModel(library_sort_model_);
|
||||
ui_->library_view->SetLibrary(library_->model());
|
||||
|
@ -271,6 +275,7 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
|
|||
connect(ui_->action_jump, SIGNAL(triggered()), ui_->playlist->view(), SLOT(JumpToCurrentlyPlayingTrack()));
|
||||
connect(ui_->action_update_library, SIGNAL(triggered()), library_, SLOT(IncrementalScan()));
|
||||
connect(ui_->action_rain, SIGNAL(toggled(bool)), player_, SLOT(MakeItRain(bool)));
|
||||
connect(ui_->action_queue_manager, SIGNAL(triggered()), queue_manager_.get(), SLOT(show()));
|
||||
|
||||
// Give actions to buttons
|
||||
ui_->forward_button->setDefaultAction(ui_->action_next_track);
|
||||
|
@ -371,6 +376,7 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
|
|||
playlist_play_pause_ = playlist_menu_->addAction(tr("Play"), this, SLOT(PlaylistPlay()));
|
||||
playlist_menu_->addAction(ui_->action_stop);
|
||||
playlist_stop_after_ = playlist_menu_->addAction(IconLoader::Load("media-playback-stop"), tr("Stop after this track"), this, SLOT(PlaylistStopAfter()));
|
||||
playlist_queue_ = playlist_menu_->addAction(IconLoader::Load("go-next"), tr("Queue this track"), this, SLOT(PlaylistQueue()));
|
||||
playlist_menu_->addSeparator();
|
||||
playlist_menu_->addAction(ui_->action_remove_from_playlist);
|
||||
playlist_undoredo_ = playlist_menu_->addSeparator();
|
||||
|
@ -1292,5 +1298,11 @@ void MainWindow::PlaylistOrganiseSelected(bool copy) {
|
|||
}
|
||||
|
||||
void MainWindow::PlaylistDelete() {
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
void MainWindow::PlaylistQueue() {
|
||||
QModelIndexList indexes = playlists_->current()->proxy()->mapSelectionToSource(
|
||||
ui_->playlist->view()->selectionModel()->selection()).indexes();
|
||||
playlists_->current()->queue()->ToggleTracks(indexes);
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ class Player;
|
|||
class PlaylistBackend;
|
||||
class PlaylistManager;
|
||||
class PlaylistParser;
|
||||
class QueueManager;
|
||||
class RadioItem;
|
||||
class RadioModel;
|
||||
class SettingsDialog;
|
||||
|
@ -101,6 +102,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
|||
void PlaylistRightClick(const QPoint& global_pos, const QModelIndex& index);
|
||||
void PlaylistPlay();
|
||||
void PlaylistStopAfter();
|
||||
void PlaylistQueue();
|
||||
void PlaylistRemoveCurrent();
|
||||
void PlaylistEditFinished(const QModelIndex& index);
|
||||
void EditTracks();
|
||||
|
@ -194,6 +196,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
|||
boost::scoped_ptr<TranscodeDialog> transcode_dialog_;
|
||||
boost::scoped_ptr<ErrorDialog> error_dialog_;
|
||||
boost::scoped_ptr<OrganiseDialog> organise_dialog_;
|
||||
boost::scoped_ptr<QueueManager> queue_manager_;
|
||||
|
||||
#ifdef ENABLE_VISUALISATIONS
|
||||
boost::scoped_ptr<VisualisationContainer> visualisation_;
|
||||
|
@ -207,6 +210,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
|||
QAction* playlist_copy_to_library_;
|
||||
QAction* playlist_move_to_library_;
|
||||
QAction* playlist_delete_;
|
||||
QAction* playlist_queue_;
|
||||
QModelIndex playlist_menu_index_;
|
||||
|
||||
QSortFilterProxyModel* library_sort_model_;
|
||||
|
|
|
@ -558,6 +558,7 @@
|
|||
<string>Tools</string>
|
||||
</property>
|
||||
<addaction name="action_cover_manager"/>
|
||||
<addaction name="action_queue_manager"/>
|
||||
<addaction name="action_equalizer"/>
|
||||
<addaction name="action_visualisations"/>
|
||||
<addaction name="action_transcode"/>
|
||||
|
@ -820,6 +821,11 @@
|
|||
<string>Visualizations</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_queue_manager">
|
||||
<property name="text">
|
||||
<string>Queue Manager</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
|
Loading…
Reference in New Issue