Start refactoring the RadioModel to inherit from QStandardItemModel

This commit is contained in:
David Sansome 2011-01-09 18:27:41 +00:00
parent 81c31b5af8
commit dc619eb437
71 changed files with 1078 additions and 724 deletions

View File

@ -141,7 +141,6 @@ set(SOURCES
radio/magnatunedownloaddialog.cpp
radio/magnatuneplaylistitem.cpp
radio/magnatuneservice.cpp
radio/radioitem.cpp
radio/radiomodel.cpp
radio/radioplaylistitem.cpp
radio/radioservice.cpp

View File

@ -607,7 +607,8 @@ bool Playlist::dropMimeData(const QMimeData* data, Qt::DropAction action, int ro
InsertSongItems<SongPlaylistItem>(this, song_data->songs, row);
} else if (const RadioMimeData* radio_data = qobject_cast<const RadioMimeData*>(data)) {
// Dragged from the Radio pane
InsertRadioStations(radio_data->items, row, data->hasFormat(kPlayNowMimetype));
InsertRadioStations(radio_data->model, radio_data->indexes,
row, data->hasFormat(kPlayNowMimetype));
} else if (const GeneratorMimeData* generator_data = qobject_cast<const GeneratorMimeData*>(data)) {
InsertSmartPlaylist(generator_data->generator_, row, data->hasFormat(kPlayNowMimetype));
} else if (data->hasFormat(kRowsMimetype)) {
@ -838,18 +839,24 @@ QModelIndex Playlist::InsertSongsOrLibraryItems(const SongList& songs, int pos,
return InsertItems(items, pos, enqueue);
}
QModelIndex Playlist::InsertRadioStations(const QList<RadioItem*>& items, int pos, bool play_now) {
QModelIndex Playlist::InsertRadioStations(
const RadioModel* model, const QModelIndexList& items, int pos, bool play_now) {
PlaylistItemList playlist_items;
QList<QUrl> song_urls;
foreach (RadioItem* item, items) {
if (!item->playable)
continue;
if (item->use_song_loader) {
song_urls << item->Url();
} else {
playlist_items << shared_ptr<PlaylistItem>(
new RadioPlaylistItem(item->service, item->Url(), item->Title(), item->Artist()));
foreach (const QModelIndex& item, items) {
switch (item.data(RadioModel::Role_PlayBehaviour).toInt()) {
case RadioModel::PlayBehaviour_SingleItem:
playlist_items << shared_ptr<PlaylistItem>(new RadioPlaylistItem(
model->ServiceForIndex(item),
item.data(RadioModel::Role_Url).toUrl(),
item.data(RadioModel::Role_Title).toString(),
item.data(RadioModel::Role_Artist).toString()));
break;
case RadioModel::PlayBehaviour_UseSongLoader:
song_urls << item.data(RadioModel::Role_Url).toUrl();
break;
}
}

View File

@ -26,14 +26,13 @@
#include "playlistitem.h"
#include "playlistsequence.h"
#include "core/song.h"
#include "radio/radioitem.h"
#include "smartplaylists/generator_fwd.h"
class LibraryBackend;
class PlaylistBackend;
class PlaylistFilter;
class Queue;
class RadioService;
class RadioModel;
class TaskManager;
class QSortFilterProxyModel;
@ -170,7 +169,6 @@ class Playlist : public QAbstractListModel {
QModelIndex InsertLibraryItems(const SongList& items, int pos = -1, bool enqueue = false);
QModelIndex InsertSongs(const SongList& items, int pos = -1, bool enqueue = false);
QModelIndex InsertSongsOrLibraryItems(const SongList& items, int pos = -1, bool enqueue = false);
QModelIndex InsertRadioStations(const QList<RadioItem*>& items, int pos = -1, bool play_now = false);
void InsertSmartPlaylist(smart_playlists::GeneratorPtr generator, int pos = -1, bool play_now = false);
void InsertUrls(const QList<QUrl>& urls, bool play_now, int pos = -1);
void StopAfter(int row);
@ -233,6 +231,9 @@ class Playlist : public QAbstractListModel {
bool FilterContainsVirtualIndex(int i) const;
void TurnOnDynamicPlaylist(smart_playlists::GeneratorPtr gen);
QModelIndex InsertRadioStations(
const RadioModel* model, const QModelIndexList& items, int pos, bool play_now);
// Modify the playlist without changing the undo stack. These are used by
// our friends in PlaylistUndoCommands
QModelIndex InsertItemsWithoutUndo(const PlaylistItemList& items, int pos,

View File

@ -63,19 +63,17 @@ IcecastService::IcecastService(RadioModel* parent)
IcecastService::~IcecastService() {
}
RadioItem* IcecastService::CreateRootItem(RadioItem* parent) {
root_ = new RadioItem(this, RadioItem::Type_Service, kServiceName, parent);
root_->icon = QIcon(":last.fm/icon_radio.png");
QStandardItem* IcecastService::CreateRootItem() {
root_ = new QStandardItem(QIcon(":last.fm/icon_radio.png"), kServiceName);
root_->setData(true, RadioModel::Role_CanLazyLoad);
return root_;
}
void IcecastService::LazyPopulate(RadioItem* item) {
switch (item->type) {
case RadioItem::Type_Service:
void IcecastService::LazyPopulate(QStandardItem* item) {
switch (item->data(RadioModel::Role_Type).toInt()) {
case RadioModel::Type_Service:
model_->Init();
model()->merged_model()->AddSubModel(
model()->index(root_->row, 0, model()->ItemToIndex(item->parent)),
model_);
model()->merged_model()->AddSubModel(model()->indexFromItem(item), model_);
if (backend_->IsEmpty()) {
LoadDirectory();
@ -85,7 +83,6 @@ void IcecastService::LazyPopulate(RadioItem* item) {
default:
break;
}
item->lazy_loaded = true;
}
void IcecastService::LoadDirectory() {
@ -262,7 +259,7 @@ QWidget* IcecastService::HeaderWidget() const {
return filter_;
}
void IcecastService::ShowContextMenu(RadioItem* item, const QModelIndex& index,
void IcecastService::ShowContextMenu(const QModelIndex& index,
const QPoint& global_pos) {
EnsureMenuCreated();

View File

@ -45,11 +45,10 @@ class IcecastService : public RadioService {
Type_Genre,
};
RadioItem* CreateRootItem(RadioItem* parent);
void LazyPopulate(RadioItem* item);
QStandardItem* CreateRootItem();
void LazyPopulate(QStandardItem* item);
void ShowContextMenu(RadioItem* item, const QModelIndex& index,
const QPoint& global_pos);
void ShowContextMenu(const QModelIndex& index, const QPoint& global_pos);
QWidget* HeaderWidget() const;
@ -66,7 +65,7 @@ class IcecastService : public RadioService {
void AddSelectedToPlaylist(bool clear_first);
RadioItem* root_;
QStandardItem* root_;
NetworkAccessManager* network_;
QMenu* context_menu_;
QModelIndex context_item_;

View File

@ -67,7 +67,6 @@ const int JamendoService::kApproxDatabaseSize = 300000;
JamendoService::JamendoService(RadioModel* parent)
: RadioService(kServiceName, parent),
network_(new NetworkAccessManager(this)),
root_(NULL),
context_menu_(NULL),
library_backend_(NULL),
library_filter_(NULL),
@ -118,25 +117,22 @@ JamendoService::JamendoService(RadioModel* parent)
JamendoService::~JamendoService() {
}
RadioItem* JamendoService::CreateRootItem(RadioItem* parent) {
root_ = new RadioItem(this, RadioItem::Type_Service, kServiceName, parent);
root_->icon = QIcon(":providers/jamendo.png");
return root_;
QStandardItem* JamendoService::CreateRootItem() {
QStandardItem* item = new QStandardItem(QIcon(":providers/jamendo.png"), kServiceName);
item->setData(true, RadioModel::Role_CanLazyLoad);
return item;
}
void JamendoService::LazyPopulate(RadioItem* item) {
switch (item->type) {
case RadioItem::Type_Service: {
void JamendoService::LazyPopulate(QStandardItem* item) {
switch (item->data(RadioModel::Role_Type).toInt()) {
case RadioModel::Type_Service: {
library_model_->Init();
model()->merged_model()->AddSubModel(
model()->index(root_->row, 0, model()->ItemToIndex(item->parent)),
library_sort_model_);
model()->merged_model()->AddSubModel(item->index(), library_sort_model_);
break;
}
default:
break;
}
item->lazy_loaded = true;
}
void JamendoService::UpdateTotalSongCount(int count) {
@ -401,8 +397,7 @@ void JamendoService::EnsureMenuCreated() {
library_filter_->SetAgeFilterEnabled(false);
}
void JamendoService::ShowContextMenu(RadioItem*, const QModelIndex& index,
const QPoint& global_pos) {
void JamendoService::ShowContextMenu(const QModelIndex& index, const QPoint& global_pos) {
EnsureMenuCreated();
if (index.model() == library_sort_model_) {

View File

@ -38,11 +38,10 @@ class JamendoService : public RadioService {
JamendoService(RadioModel* parent);
~JamendoService();
RadioItem* CreateRootItem(RadioItem* parent);
void LazyPopulate(RadioItem* item);
QStandardItem* CreateRootItem();
void LazyPopulate(QStandardItem* item);
void ShowContextMenu(RadioItem* item, const QModelIndex& index,
const QPoint& global_pos);
void ShowContextMenu(const QModelIndex& index, const QPoint& global_pos);
QWidget* HeaderWidget() const;
@ -102,7 +101,6 @@ class JamendoService : public RadioService {
private:
NetworkAccessManager* network_;
RadioItem* root_;
QMenu* context_menu_;
QModelIndex context_item_;

View File

@ -16,7 +16,6 @@
*/
#include "lastfmservice.h"
#include "radioitem.h"
#include "lastfmstationdialog.h"
#include "radiomodel.h"
#include "radioplaylistitem.h"
@ -51,6 +50,14 @@ const char* LastFMService::kAudioscrobblerClientId = "tng";
const char* LastFMService::kApiKey = "75d20fb472be99275392aefa2760ea09";
const char* LastFMService::kSecret = "d3072b60ae626be12be69448f5c46e70";
const char* LastFMService::kUrlArtist = "lastfm://artist/%1/similarartists";
const char* LastFMService::kUrlTag = "lastfm://globaltags/%1";
const char* LastFMService::kUrlCustom = "lastfm://rql/%1";
const char* LastFMService::kTitleArtist = QT_TR_NOOP("Last.fm Similar Artists to %1");
const char* LastFMService::kTitleTag = QT_TR_NOOP("Last.fm Tag Radio: %1");
const char* LastFMService::kTitleCustom = QT_TR_NOOP("Last.fm Custom Radio: %1");
LastFMService::LastFMService(RadioModel* parent)
: RadioService(kServiceName, parent),
scrobbler_(NULL),
@ -112,43 +119,63 @@ bool LastFMService::IsAuthenticated() const {
return !lastfm::ws::SessionKey.isEmpty();
}
RadioItem* LastFMService::CreateRootItem(RadioItem* parent) {
RadioItem* item = new RadioItem(this, RadioItem::Type_Service, kServiceName, parent);
item->icon = QIcon(":last.fm/as.png");
QStandardItem* LastFMService::CreateRootItem() {
QStandardItem* item = new QStandardItem(QIcon(":last.fm/as.png"), kServiceName);
item->setData(true, RadioModel::Role_CanLazyLoad);
return item;
}
void LastFMService::LazyPopulate(RadioItem *item) {
switch (item->type) {
case RadioItem::Type_Service:
void LastFMService::LazyPopulate(QStandardItem* parent) {
switch (parent->data(RadioModel::Role_Type).toInt()) {
case RadioModel::Type_Service:
// Normal radio types
CreateStationItem(Type_MyRecommendations, tr("My Recommendations"), ":last.fm/recommended_radio.png", item);
CreateStationItem(Type_MyRadio, tr("My Radio Station"), ":last.fm/personal_radio.png", item);
CreateStationItem(Type_MyMix, tr("My Mix Radio"), ":last.fm/loved_radio.png", item);
CreateStationItem(Type_MyNeighbourhood, tr("My Neighborhood"), ":last.fm/neighbour_radio.png", item);
CreateStationItem(parent,
tr("My Recommendations"),
":last.fm/recommended_radio.png",
"lastfm://user/USERNAME/recommended",
tr("My Last.fm Recommended Radio"));
CreateStationItem(parent,
tr("My Radio Station"),
":last.fm/personal_radio.png",
"lastfm://user/USERNAME/library",
tr("My Last.fm Library"));
CreateStationItem(parent,
tr("My Mix Radio"),
":last.fm/loved_radio.png",
"lastfm://user/USERNAME/mix",
tr("My Last.fm Mix Radio"));
CreateStationItem(parent,
tr("My Neighborhood"),
":last.fm/neighbour_radio.png",
"lastfm://user/USERNAME/neighbours",
tr("My Last.fm Neighborhood"));
// Types that have children
artist_list_ = new RadioItem(this, Type_ArtistRadio, tr("Artist radio"), item);
artist_list_->icon = QIcon(":last.fm/icon_radio.png");
artist_list_->lazy_loaded = true;
artist_list_ = new QStandardItem(QIcon(":last.fm/icon_radio.png"), tr("Artist radio"));
artist_list_->setData(Type_Artists, RadioModel::Role_Type);
parent->appendRow(artist_list_);
tag_list_ = new RadioItem(this, Type_TagRadio, tr("Tag radio"), item);
tag_list_->icon = QIcon(":last.fm/icon_tag.png");
tag_list_->lazy_loaded = true;
tag_list_ = new QStandardItem(QIcon(":last.fm/icon_tag.png"), tr("Tag radio"));
tag_list_->setData(Type_Tags, RadioModel::Role_Type);
parent->appendRow(tag_list_);
custom_list_ = new RadioItem(this, Type_CustomRadio, tr("Custom radio"), item);
custom_list_->icon = QIcon(":last.fm/icon_radio.png");
custom_list_->lazy_loaded = true;
custom_list_ = new QStandardItem(QIcon(":last.fm/icon_radio.png"), tr("Custom radio"));
custom_list_->setData(Type_Custom, RadioModel::Role_Type);
parent->appendRow(custom_list_);
RestoreList("artists", Type_Artist, QIcon(":last.fm/icon_radio.png"), artist_list_);
RestoreList("tags", Type_Tag, QIcon(":last.fm/icon_tag.png"), tag_list_);
RestoreList("custom", Type_Custom, QIcon(":last.fm/icon_radio.png"), custom_list_);
RestoreList("artists", kUrlArtist, kTitleArtist, QIcon(":last.fm/icon_radio.png"), artist_list_);
RestoreList("tags", kUrlTag, kTitleTag, QIcon(":last.fm/icon_tag.png"), tag_list_);
RestoreList("custom", kUrlCustom, kTitleCustom, QIcon(":last.fm/icon_radio.png"), custom_list_);
friends_list_ = new RadioItem(this, Type_MyFriends, tr("Friends"), item);
friends_list_->icon = QIcon(":last.fm/my_friends.png");
friends_list_ = new QStandardItem(QIcon(":last.fm/my_friends.png"), tr("Friends"));
friends_list_->setData(Type_Friends, RadioModel::Role_Type);
friends_list_->setData(true, RadioModel::Role_CanLazyLoad);
parent->appendRow(friends_list_);
neighbours_list_ = new RadioItem(this, Type_MyNeighbours, tr("Neighbors"), item);
neighbours_list_->icon = QIcon(":last.fm/my_neighbours.png");
neighbours_list_ = new QStandardItem(QIcon(":last.fm/my_neighbours.png"), tr("Neighbors"));
neighbours_list_->setData(Type_Neighbours, RadioModel::Role_Type);
neighbours_list_->setData(true, RadioModel::Role_CanLazyLoad);
parent->appendRow(neighbours_list_);
if (!IsAuthenticated())
ShowConfig();
@ -158,37 +185,45 @@ void LastFMService::LazyPopulate(RadioItem *item) {
add_custom_action_->setEnabled(true);
break;
case Type_MyFriends:
case Type_Friends:
RefreshFriends();
break;
case Type_MyNeighbours:
case Type_Neighbours:
RefreshNeighbours();
break;
case Type_OtherUser:
CreateStationItem(Type_OtherUserRadio, item->key, ":last.fm/recommended_radio.png", item)
->display_text = tr("Last.fm Radio Station - %1").arg(item->key);
CreateStationItem(Type_OtherUserMix, item->key, ":last.fm/loved_radio.png", item)
->display_text = tr("Last.fm Mix Radio - %1").arg(item->key);
CreateStationItem(Type_OtherUserNeighbourhood, item->key, ":last.fm/neighbour_radio.png", item)
->display_text = tr("Last.fm Neighbor Radio - %1").arg(item->key);
CreateStationItem(parent,
tr("Last.fm Radio Station - %1").arg(parent->text()),
":last.fm/personal_radio.png",
"lastfm://user/" + parent->text() + "/library",
tr("Last.fm Library - %1").arg(parent->text()));
CreateStationItem(parent,
tr("Last.fm Mix Radio - %1").arg(parent->text()),
":last.fm/loved_radio.png",
"lastfm://user/" + parent->text() + "/mix",
tr("Last.fm Mix Radio - %1").arg(parent->text()));
CreateStationItem(parent,
tr("Last.fm Neighbor Radio - %1").arg(parent->text()),
":last.fm/neighbour_radio.png",
"lastfm://user/" + parent->text() + "/neighbours",
tr("Last.fm Neighbor Radio - %1").arg(parent->text()));
break;
default:
break;
}
item->lazy_loaded = true;
}
RadioItem* LastFMService::CreateStationItem(ItemType type, const QString& name,
const QString& icon, RadioItem* parent) {
RadioItem* ret = new RadioItem(this, type, name, parent);
ret->lazy_loaded = true;
ret->icon = QIcon(icon);
ret->playable = true;
QStandardItem* LastFMService::CreateStationItem(
QStandardItem* parent, const QString& name, const QString& icon,
const QString& url, const QString& title) {
QStandardItem* ret = new QStandardItem(QIcon(icon), name);
ret->setData(url, RadioModel::Role_Url);
ret->setData(title, RadioModel::Role_Title);
ret->setData(RadioModel::PlayBehaviour_SingleItem, RadioModel::Role_PlayBehaviour);
parent->appendRow(ret);
return ret;
}
@ -248,59 +283,11 @@ void LastFMService::AuthenticateReplyFinished() {
emit AuthenticationComplete(true);
}
QUrl LastFMService::UrlForItem(const RadioItem* item) const {
switch (item->type) {
case Type_MyRecommendations:
return "lastfm://user/" + lastfm::ws::Username + "/recommended";
case Type_MyMix:
return QString("lastfm://rql/") + QString("adv:" + lastfm::ws::Username).toUtf8().toBase64();
case Type_MyNeighbourhood:
return "lastfm://user/" + lastfm::ws::Username + "/neighbours";
case Type_MyRadio:
return "lastfm://user/" + lastfm::ws::Username + "/library";
case Type_OtherUser:
case Type_OtherUserRadio:
return "lastfm://user/" + item->key + "/library";
case Type_OtherUserMix:
return QString("lastfm://rql/") + QString("adv:" + item->key).toUtf8().toBase64();
case Type_OtherUserNeighbourhood:
return "lastfm://user/" + item->key + "/neighbours";
case Type_Artist:
return "lastfm://artist/" + item->key + "/similarartists";
case Type_Tag:
return "lastfm://globaltags/" + item->key;
case Type_Custom:
return QString("lastfm://rql/" + item->key.toUtf8().toBase64());
}
return QUrl();
}
QString LastFMService::TitleForItem(const RadioItem* item) const {
const QString me(lastfm::ws::Username);
switch (item->type) {
case Type_MyRecommendations: return tr("Last.fm Recommended Radio - %1").arg(me);
case Type_MyMix: return tr("Last.fm Mix Radio - %1").arg(me);
case Type_MyNeighbourhood: return tr("Last.fm Neighbor Radio - %1").arg(me);
case Type_MyRadio: return tr("Last.fm Library - %1").arg(me);
case Type_OtherUser:
case Type_OtherUserRadio: return tr("Last.fm Library - %1").arg(item->key);
case Type_OtherUserMix: return tr("Last.fm Mix Radio - %1").arg(item->key);
case Type_OtherUserNeighbourhood: return tr("Last.fm Neighbor Radio - %1").arg(item->key);
case Type_Artist: return tr("Last.fm Similar Artists to %1").arg(item->key);
case Type_Tag: return tr("Last.fm Tag Radio: %1").arg(item->key);
case Type_Custom: return tr("Last.fm Custom Radio: %1").arg(item->key);
}
return QString();
QUrl LastFMService::FixupUrl(const QUrl& url) {
QUrl ret;
ret.setEncodedUrl(url.toEncoded().replace(
"USERNAME", QUrl::toPercentEncoding(lastfm::ws::Username)));
return ret;
}
PlaylistItem::SpecialLoadResult LastFMService::StartLoading(const QUrl& url) {
@ -314,13 +301,13 @@ PlaylistItem::SpecialLoadResult LastFMService::StartLoading(const QUrl& url) {
last_url_ = url;
initial_tune_ = true;
Tune(lastfm::RadioStation(url));
Tune(lastfm::RadioStation(FixupUrl(url)));
return PlaylistItem::SpecialLoadResult(
PlaylistItem::SpecialLoadResult::WillLoadAsynchronously, url);
}
PlaylistItem::SpecialLoadResult LastFMService::LoadNext(const QUrl &) {
PlaylistItem::SpecialLoadResult LastFMService::LoadNext(const QUrl&) {
if (playlist_.empty()) {
return PlaylistItem::SpecialLoadResult();
}
@ -464,13 +451,12 @@ void LastFMService::Ban() {
emit AsyncLoadFinished(LoadNext(last_url_));
}
void LastFMService::ShowContextMenu(RadioItem* item, const QModelIndex&,
const QPoint &global_pos) {
context_item_ = item;
void LastFMService::ShowContextMenu(const QModelIndex& index, const QPoint &global_pos) {
context_item_ = model()->itemFromIndex(index);
switch (item->type) {
case Type_Artist:
case Type_Tag:
switch (index.parent().data(RadioModel::Role_Type).toInt()) {
case Type_Artists:
case Type_Tags:
case Type_Custom:
remove_action_->setEnabled(true);
break;
@ -480,8 +466,9 @@ void LastFMService::ShowContextMenu(RadioItem* item, const QModelIndex&,
break;
}
play_action_->setEnabled(item->playable);
load_action_->setEnabled(item->playable);
const bool playable = model()->IsPlayable(index);
play_action_->setEnabled(playable);
load_action_->setEnabled(playable);
context_menu_->popup(global_pos);
}
@ -489,7 +476,8 @@ void LastFMService::RefreshFriends() {
if (!friends_list_ || !IsAuthenticated())
return;
friends_list_->ClearNotify();
if (friends_list_->hasChildren())
friends_list_->removeRows(0, friends_list_->rowCount());
lastfm::AuthenticatedUser user;
QNetworkReply* reply = user.getFriends();
@ -497,10 +485,11 @@ void LastFMService::RefreshFriends() {
}
void LastFMService::RefreshNeighbours() {
if (!friends_list_ || !IsAuthenticated())
if (!neighbours_list_ || !IsAuthenticated())
return;
neighbours_list_->ClearNotify();
if (neighbours_list_->hasChildren())
neighbours_list_->removeRows(0, neighbours_list_->rowCount());
lastfm::AuthenticatedUser user;
QNetworkReply* reply = user.getNeighbours();
@ -526,10 +515,13 @@ void LastFMService::RefreshFriendsFinished() {
}
foreach (const lastfm::User& f, friends) {
RadioItem* item = new RadioItem(this, Type_OtherUser, f);
item->icon = QIcon(":last.fm/icon_user.png");
item->playable = true;
item->InsertNotify(friends_list_);
QStandardItem* item = new QStandardItem(QIcon(":last.fm/icon_user.png"), f.name());
item->setData(QUrl("lastfm://user/" + f.name() + "/library"), RadioModel::Role_Url);
item->setData(tr("Last.fm Library - %1").arg(f.name()), RadioModel::Role_Title);
item->setData(true, RadioModel::Role_CanLazyLoad);
item->setData(Type_OtherUser, RadioModel::Role_Type);
item->setData(RadioModel::PlayBehaviour_SingleItem, RadioModel::Role_PlayBehaviour);
friends_list_->appendRow(item);
}
}
@ -552,10 +544,13 @@ void LastFMService::RefreshNeighboursFinished() {
}
foreach (const lastfm::User& n, neighbours) {
RadioItem* item = new RadioItem(this, Type_OtherUser, n);
item->icon = QIcon(":last.fm/user_purple.png");
item->playable = true;
item->InsertNotify(neighbours_list_);
QStandardItem* item = new QStandardItem(QIcon(":last.fm/user_purple.png"), n.name());
item->setData(QUrl("lastfm://user/" + n.name() + "/library"), RadioModel::Role_Url);
item->setData(tr("Last.fm Library - %1").arg(n.name()), RadioModel::Role_Title);
item->setData(true, RadioModel::Role_CanLazyLoad);
item->setData(Type_OtherUser, RadioModel::Role_Type);
item->setData(RadioModel::PlayBehaviour_SingleItem, RadioModel::Role_PlayBehaviour);
neighbours_list_->appendRow(item);
}
}
@ -568,20 +563,28 @@ void LastFMService::LoadToPlaylist() {
}
void LastFMService::AddArtistRadio() {
AddArtistOrTag("artists", LastFMStationDialog::Artist, Type_Artist, QIcon(":last.fm/icon_radio.png"), artist_list_);
AddArtistOrTag("artists", LastFMStationDialog::Artist,
kUrlArtist, tr(kTitleArtist),
":last.fm/icon_radio.png", artist_list_);
}
void LastFMService::AddTagRadio() {
AddArtistOrTag("tags", LastFMStationDialog::Tag, Type_Tag, QIcon(":last.fm/icon_tag.png"), tag_list_);
AddArtistOrTag("tags", LastFMStationDialog::Tag,
kUrlTag, tr(kTitleTag),
":last.fm/icon_tag.png", tag_list_);
}
void LastFMService::AddCustomRadio() {
AddArtistOrTag("custom", LastFMStationDialog::Custom, Type_Custom, QIcon(":last.fm/icon_radio.png"), custom_list_);
AddArtistOrTag("custom", LastFMStationDialog::Custom,
kUrlCustom, tr(kTitleCustom),
":last.fm/icon_radio.png", custom_list_);
}
void LastFMService::AddArtistOrTag(const QString& name,
LastFMStationDialog::Type dialog_type, ItemType item_type,
const QIcon& icon, RadioItem* list) {
LastFMStationDialog::Type dialog_type,
const QString& url_pattern,
const QString& title_pattern,
const QString& icon, QStandardItem* list) {
station_dialog_->SetType(dialog_type);
if (station_dialog_->exec() == QDialog::Rejected)
return;
@ -589,55 +592,72 @@ void LastFMService::AddArtistOrTag(const QString& name,
if (station_dialog_->content().isEmpty())
return;
RadioItem* item = new RadioItem(this, item_type, station_dialog_->content());
item->icon = icon;
item->playable = true;
item->lazy_loaded = true;
item->InsertNotify(list);
QString content = station_dialog_->content();
QString url_content;
if (name == "custom")
url_content = content.toUtf8().toBase64();
else
url_content = content;
QStandardItem* item = new QStandardItem(QIcon(icon), content);
item->setData(url_pattern.arg(url_content), RadioModel::Role_Url);
item->setData(title_pattern.arg(content), RadioModel::Role_Title);
item->setData(RadioModel::PlayBehaviour_SingleItem, RadioModel::Role_PlayBehaviour);
list->appendRow(item);
emit AddItemToPlaylist(item, false);
SaveList(name, list);
}
void LastFMService::SaveList(const QString& name, RadioItem* list) const {
void LastFMService::SaveList(const QString& name, QStandardItem* list) const {
QSettings settings;
settings.beginGroup(kSettingsGroup);
settings.beginWriteArray(name, list->children.count());
for (int i=0 ; i<list->children.count() ; ++i) {
settings.beginWriteArray(name, list->rowCount());
for (int i=0 ; i<list->rowCount() ; ++i) {
settings.setArrayIndex(i);
settings.setValue("key", list->children[i]->key);
settings.setValue("key", list->child(i)->text());
}
settings.endArray();
}
void LastFMService::RestoreList(const QString &name, ItemType item_type,
const QIcon& icon, RadioItem *list) {
void LastFMService::RestoreList(const QString& name,
const QString& url_pattern,
const QString& title_pattern,
const QIcon& icon, QStandardItem* parent) {
QSettings settings;
settings.beginGroup(kSettingsGroup);
list->ClearNotify();
if (parent->hasChildren())
parent->removeRows(0, parent->rowCount());
int count = settings.beginReadArray(name);
for (int i=0 ; i<count ; ++i) {
settings.setArrayIndex(i);
RadioItem* item = new RadioItem(this, item_type,
settings.value("key").toString(), list);
item->icon = icon;
item->playable = true;
item->lazy_loaded = true;
QString content = settings.value("key").toString();
QString url_content;
if (name == "custom")
url_content = content.toUtf8().toBase64();
else
url_content = content;
QStandardItem* item = new QStandardItem(icon, content);
item->setData(url_pattern.arg(url_content), RadioModel::Role_Url);
item->setData(title_pattern.arg(content), RadioModel::Role_Title);
item->setData(RadioModel::PlayBehaviour_SingleItem, RadioModel::Role_PlayBehaviour);
parent->appendRow(item);
}
settings.endArray();
}
void LastFMService::Remove() {
int type = context_item_->type;
int type = context_item_->parent()->data(RadioModel::Role_Type).toInt();
context_item_->parent->DeleteNotify(context_item_->row);
context_item_->parent()->removeRow(context_item_->row());
if (type == Type_Artist)
if (type == Type_Artists)
SaveList("artists", artist_list_);
else if (type == Type_Tag)
else if (type == Type_Tags)
SaveList("tags", tag_list_);
else if (type == Type_Custom)
SaveList("custom", custom_list_);

View File

@ -30,6 +30,7 @@ uint qHash(const lastfm::Track& track);
#include <lastfm/Track>
#include <lastfm/ws.h>
#include "radiomodel.h"
#include "radioservice.h"
#include "lastfmstationdialog.h"
#include "core/song.h"
@ -58,34 +59,29 @@ class LastFMService : public RadioService {
static const char* kApiKey;
static const char* kSecret;
static const char* kUrlArtist;
static const char* kUrlTag;
static const char* kUrlCustom;
static const char* kTitleArtist;
static const char* kTitleTag;
static const char* kTitleCustom;
enum ItemType {
Type_MyRecommendations = 1000,
Type_MyRadio,
Type_MyMix,
Type_MyNeighbourhood,
Type_ArtistRadio,
Type_TagRadio,
Type_MyFriends,
Type_MyNeighbours,
Type_OtherUser,
Type_OtherUserRadio,
Type_OtherUserMix,
Type_OtherUserNeighbourhood,
Type_Artist,
Type_Tag,
Type_Root = RadioModel::TypeCount,
Type_Artists,
Type_Tags,
Type_Custom,
Type_CustomRadio,
Type_Friends,
Type_Neighbours,
Type_OtherUser,
};
// RadioService
RadioItem* CreateRootItem(RadioItem* parent);
void LazyPopulate(RadioItem *item);
QStandardItem* CreateRootItem();
void LazyPopulate(QStandardItem* parent);
QUrl UrlForItem(const RadioItem* item) const;
QString TitleForItem(const RadioItem* item) const;
void ShowContextMenu(RadioItem *item, const QModelIndex& index,
const QPoint &global_pos);
void ShowContextMenu(const QModelIndex& index, const QPoint &global_pos);
PlaylistItem::SpecialLoadResult StartLoading(const QUrl& url);
PlaylistItem::SpecialLoadResult LoadNext(const QUrl& url);
@ -142,20 +138,26 @@ class LastFMService : public RadioService {
void StreamMetadataReady();
private:
RadioItem* CreateStationItem(ItemType type, const QString& name,
const QString& icon, RadioItem* parent);
QStandardItem* CreateStationItem(QStandardItem* parent,
const QString& name, const QString& icon, const QString& url,
const QString& title);
QString ErrorString(lastfm::ws::Error error) const;
bool InitScrobbler();
lastfm::Track TrackFromSong(const Song& song) const;
void RefreshFriends();
void RefreshNeighbours();
void AddArtistOrTag(const QString& name,
LastFMStationDialog::Type dialog_type, ItemType item_type,
const QIcon& icon, RadioItem* list);
void SaveList(const QString& name, RadioItem* list) const;
void RestoreList(const QString &name, ItemType item_type,
const QIcon& icon, RadioItem *list);
LastFMStationDialog::Type dialog_type,
const QString& url_pattern,
const QString& title_pattern,
const QString& icon, QStandardItem* list);
void SaveList(const QString& name, QStandardItem* list) const;
void RestoreList(const QString& name,
const QString& url_pattern,
const QString& title_pattern,
const QIcon& icon, QStandardItem* parent);
static QUrl FixupUrl(const QUrl& url);
void Tune(const lastfm::RadioStation& station);
void AddSelectedToPlaylist(bool clear_first);
@ -175,7 +177,7 @@ class LastFMService : public RadioService {
QAction* add_artist_action_;
QAction* add_tag_action_;
QAction* add_custom_action_;
RadioItem* context_item_;
QStandardItem* context_item_;
QUrl last_url_;
bool initial_tune_;
@ -184,11 +186,11 @@ class LastFMService : public RadioService {
bool scrobbling_enabled_;
bool buttons_visible_;
RadioItem* artist_list_;
RadioItem* tag_list_;
RadioItem* custom_list_;
RadioItem* friends_list_;
RadioItem* neighbours_list_;
QStandardItem* artist_list_;
QStandardItem* tag_list_;
QStandardItem* custom_list_;
QStandardItem* friends_list_;
QStandardItem* neighbours_list_;
QHash<lastfm::Track, QString> art_urls_;
};

View File

@ -60,8 +60,8 @@ const char* MagnatuneService::kDownloadUrl = "http://download.magnatune.com/buy/
MagnatuneService::MagnatuneService(RadioModel* parent)
: RadioService(kServiceName, parent),
root_(NULL),
context_menu_(NULL),
root_(NULL),
library_backend_(NULL),
library_model_(NULL),
library_filter_(NULL),
@ -105,27 +105,22 @@ void MagnatuneService::ReloadSettings() {
format_ = PreferredFormat(s.value("format", Format_Ogg).toInt());
}
RadioItem* MagnatuneService::CreateRootItem(RadioItem *parent) {
root_ = new RadioItem(this, RadioItem::Type_Service, kServiceName, parent);
root_->icon = QIcon(":/providers/magnatune.png");
QStandardItem* MagnatuneService::CreateRootItem() {
root_ = new QStandardItem(QIcon(":/providers/magnatune.png"), kServiceName);
root_->setData(true, RadioModel::Role_CanLazyLoad);
return root_;
}
void MagnatuneService::LazyPopulate(RadioItem *item) {
switch (item->type) {
case RadioItem::Type_Service:
void MagnatuneService::LazyPopulate(QStandardItem* item) {
switch (item->data(RadioModel::Role_Type).toInt()) {
case RadioModel::Type_Service:
library_model_->Init();
model()->merged_model()->AddSubModel(
model()->index(root_->row, 0, model()->ItemToIndex(item->parent)),
library_sort_model_);
model()->merged_model()->AddSubModel(item->index(), library_sort_model_);
break;
default:
break;
}
item->lazy_loaded = true;
}
void MagnatuneService::UpdateTotalSongCount(int count) {
@ -154,15 +149,14 @@ void MagnatuneService::ReloadDatabaseFinished() {
model()->task_manager()->SetTaskFinished(load_database_task_id_);
load_database_task_id_ = 0;
root_->lazy_loaded = true;
if (reply->error() != QNetworkReply::NoError) {
// TODO: Error handling
qDebug() << reply->errorString();
return;
}
root_->ClearNotify();
if (root_->hasChildren())
root_->removeRows(0, root_->rowCount());
// The XML file is compressed
QtIOCompressor gzip(reply);
@ -274,8 +268,7 @@ void MagnatuneService::EnsureMenuCreated() {
library_filter_->AddMenuAction(config_action);
}
void MagnatuneService::ShowContextMenu(RadioItem*, const QModelIndex& index,
const QPoint& global_pos) {
void MagnatuneService::ShowContextMenu(const QModelIndex& index, const QPoint& global_pos) {
EnsureMenuCreated();
if (index.model() == library_sort_model_)

View File

@ -67,11 +67,10 @@ class MagnatuneService : public RadioService {
static QString ReadElementText(QXmlStreamReader& reader);
RadioItem* CreateRootItem(RadioItem* parent);
void LazyPopulate(RadioItem* item);
QStandardItem* CreateRootItem();
void LazyPopulate(QStandardItem* item);
void ShowContextMenu(RadioItem* item, const QModelIndex& index,
const QPoint& global_pos);
void ShowContextMenu(const QModelIndex& index, const QPoint& global_pos);
QWidget* HeaderWidget() const;
@ -107,9 +106,9 @@ class MagnatuneService : public RadioService {
Song ReadTrack(QXmlStreamReader& reader);
private:
RadioItem* root_;
QMenu* context_menu_;
QModelIndex context_item_;
QStandardItem* root_;
QAction* add_to_playlist_;
QAction* load_to_playlist_;

View File

@ -1,47 +0,0 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
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 "radioitem.h"
#include "radioservice.h"
RadioItem::RadioItem(SimpleTreeModel<RadioItem> *model)
: SimpleTreeItem<RadioItem>(Type_Root, model),
service(NULL),
use_song_loader(false)
{
}
RadioItem::RadioItem(RadioService* _service, int type, const QString& key,
RadioItem* parent)
: SimpleTreeItem<RadioItem>(type, key, parent),
service(_service),
playable(false),
use_song_loader(false)
{
}
QUrl RadioItem::Url() const {
return service->UrlForItem(this);
}
QString RadioItem::Title() const {
return service->TitleForItem(this);
}
QString RadioItem::Artist() const {
return service->ArtistForItem(this);
}

View File

@ -1,50 +0,0 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
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 RADIOITEM_H
#define RADIOITEM_H
#include <QIcon>
#include <QUrl>
#include "core/simpletreeitem.h"
class RadioService;
class RadioItem : public SimpleTreeItem<RadioItem> {
public:
enum Type {
Type_Root = 1,
Type_Service,
};
RadioItem(SimpleTreeModel<RadioItem>* model);
RadioItem(RadioService* _service, int type, const QString& key = QString::null,
RadioItem* parent = NULL);
QUrl Url() const;
QString Title() const;
QString Artist() const;
QIcon icon;
QString artist;
RadioService* service;
bool playable;
bool use_song_loader;
};
#endif // RADIOITEM_H

View File

@ -19,14 +19,18 @@
#define RADIOMIMEDATA_H
#include <QMimeData>
#include <QModelIndexList>
class RadioItem;
class RadioModel;
class RadioMimeData : public QMimeData {
Q_OBJECT
public:
QList<RadioItem*> items;
public:
RadioMimeData(const RadioModel* _model) : model(_model) {}
const RadioModel* model;
QModelIndexList indexes;
};
#endif // RADIOMIMEDATA_H

View File

@ -36,7 +36,7 @@ QMap<QString, RadioService*>* RadioModel::sServices = NULL;
RadioModel::RadioModel(BackgroundThread<Database>* db_thread,
TaskManager* task_manager, QObject* parent)
: SimpleTreeModel<RadioItem>(new RadioItem(this), parent),
: QStandardItemModel(parent),
db_thread_(db_thread),
merged_model_(new MergedProxyModel(this)),
task_manager_(task_manager)
@ -46,7 +46,6 @@ RadioModel::RadioModel(BackgroundThread<Database>* db_thread,
}
Q_ASSERT(sServices->isEmpty());
root_->lazy_loaded = true;
merged_model_->setSourceModel(this);
#ifdef HAVE_LIBLASTFM
@ -60,15 +59,22 @@ RadioModel::RadioModel(BackgroundThread<Database>* db_thread,
}
void RadioModel::AddService(RadioService *service) {
QStandardItem* root = service->CreateRootItem();
if (!root)
return;
root->setData(Type_Service, Role_Type);
root->setData(QVariant::fromValue(service), Role_Service);
invisibleRootItem()->appendRow(root);
sServices->insert(service->name(), service);
service->CreateRootItem(root_);
connect(service, SIGNAL(AsyncLoadFinished(PlaylistItem::SpecialLoadResult)), SIGNAL(AsyncLoadFinished(PlaylistItem::SpecialLoadResult)));
connect(service, SIGNAL(StreamError(QString)), SIGNAL(StreamError(QString)));
connect(service, SIGNAL(StreamMetadataFound(QUrl,Song)), SIGNAL(StreamMetadataFound(QUrl,Song)));
connect(service, SIGNAL(OpenSettingsAtPage(SettingsDialog::Page)), SIGNAL(OpenSettingsAtPage(SettingsDialog::Page)));
connect(service, SIGNAL(AddItemToPlaylist(RadioItem*,bool)), SIGNAL(AddItemToPlaylist(RadioItem*,bool)));
connect(service, SIGNAL(AddItemsToPlaylist(PlaylistItemList,bool)), SIGNAL(AddItemsToPlaylist(PlaylistItemList,bool)));
//connect(service, SIGNAL(AddItemToPlaylist(RadioItem*,bool)), SIGNAL(AddItemToPlaylist(RadioItem*,bool)));
//connect(service, SIGNAL(AddItemsToPlaylist(PlaylistItemList,bool)), SIGNAL(AddItemsToPlaylist(PlaylistItemList,bool)));
}
RadioService* RadioModel::ServiceByName(const QString& name) {
@ -77,41 +83,24 @@ RadioService* RadioModel::ServiceByName(const QString& name) {
return NULL;
}
QVariant RadioModel::data(const QModelIndex& index, int role) const {
const RadioItem* item = IndexToItem(index);
return data(item, role);
RadioService* RadioModel::ServiceForItem(const QStandardItem* item) const {
return ServiceForIndex(indexFromItem(item));
}
QVariant RadioModel::data(const RadioItem* item, int role) const {
switch (role) {
case Qt::DisplayRole:
return item->DisplayText();
case Qt::DecorationRole:
return item->icon;
break;
case Role_Type:
return item->type;
case Role_Key:
return item->key;
case Role_SortText:
return item->SortText();
RadioService* RadioModel::ServiceForIndex(const QModelIndex& index) const {
QModelIndex current_index = index;
while (current_index.isValid()) {
RadioService* service = current_index.data(Role_Service).value<RadioService*>();
if (service) {
return service;
}
current_index = current_index.parent();
}
return QVariant();
}
void RadioModel::LazyPopulate(RadioItem* parent) {
if (parent->service)
parent->service->LazyPopulate(parent);
return NULL;
}
Qt::ItemFlags RadioModel::flags(const QModelIndex& index) const {
RadioItem* item = IndexToItem(index);
if (item->playable)
if (IsPlayable(index))
return Qt::ItemIsSelectable |
Qt::ItemIsEnabled |
Qt::ItemIsDragEnabled;
@ -120,29 +109,54 @@ Qt::ItemFlags RadioModel::flags(const QModelIndex& index) const {
Qt::ItemIsEnabled;
}
bool RadioModel::hasChildren(const QModelIndex& parent) const {
if (parent.data(Role_CanLazyLoad).toBool())
return true;
return QStandardItemModel::hasChildren(parent);
}
int RadioModel::rowCount(const QModelIndex& parent) const {
if (parent.data(Role_CanLazyLoad).toBool()) {
QStandardItem* item = itemFromIndex(parent);
RadioService* service = ServiceForItem(item);
if (service) {
item->setData(false, Role_CanLazyLoad);
service->LazyPopulate(item);
}
}
return QStandardItemModel::rowCount(parent);
}
bool RadioModel::IsPlayable(const QModelIndex& index) const {
QVariant behaviour = index.data(Role_PlayBehaviour);
if (!behaviour.isValid() || behaviour.toInt() == PlayBehaviour_None)
return false;
return true;
}
QStringList RadioModel::mimeTypes() const {
return QStringList() << "text/uri-list";
}
QMimeData* RadioModel::mimeData(const QModelIndexList& indexes) const {
QList<QUrl> urls;
QList<RadioItem*> items;
QModelIndexList items;
foreach (const QModelIndex& index, indexes) {
RadioItem* item = IndexToItem(index);
if (!item || !item->service || !item->playable)
if (!IsPlayable(index))
continue;
items << item;
urls << item->service->UrlForItem(item);
items << index;
urls << index.data(Role_Url).toUrl();
}
if (urls.isEmpty())
return NULL;
RadioMimeData* data = new RadioMimeData;
RadioMimeData* data = new RadioMimeData(this);
data->setUrls(urls);
data->items = items;
data->indexes = indexes;
return data;
}
@ -153,10 +167,11 @@ LastFMService* RadioModel::GetLastFMService() const {
}
#endif
void RadioModel::ShowContextMenu(RadioItem* item, const QModelIndex& index,
void RadioModel::ShowContextMenu(const QModelIndex& merged_model_index,
const QPoint& global_pos) {
if (item->service)
item->service->ShowContextMenu(item, index, global_pos);
RadioService* service = ServiceForIndex(merged_model_index);
if (service)
service->ShowContextMenu(merged_model_->mapToSource(merged_model_index), global_pos);
}
void RadioModel::ReloadSettings() {

View File

@ -18,9 +18,7 @@
#ifndef RADIOMODEL_H
#define RADIOMODEL_H
#include "radioitem.h"
#include "core/backgroundthread.h"
#include "core/simpletreemodel.h"
#include "core/song.h"
#include "playlist/playlistitem.h"
#include "ui/settingsdialog.h"
@ -36,17 +34,66 @@ class TaskManager;
class LastFMService;
#endif
class RadioModel : public SimpleTreeModel<RadioItem> {
class RadioModel : public QStandardItemModel {
Q_OBJECT
public:
RadioModel(BackgroundThread<Database>* db_thread, TaskManager* task_manager,
QObject* parent = 0);
enum {
Role_Type = Qt::UserRole + 1,
Role_SortText,
Role_Key,
enum Role {
// Services can use this role to distinguish between different types of
// items that they add. The root item's type is automatically set to
// Type_Service, but apart from that Services are free to define their own
// values for this field (starting from TypeCount).
Role_Type = Qt::UserRole + 1000,
// If this is not set the item is not playable (ie. it can't be dragged to
// the playlist). Otherwise it describes how this item is converted to
// playlist items. See the PlayBehaviour enum for more details.
Role_PlayBehaviour,
// The URL of the media for this item. This is required if the
// PlayBehaviour is set to something other than None. How the URL is
// used depends on the PlayBehaviour.
Role_Url,
// These fields are used to populate the playlist columns for this item
// only when using PlayBehaviour_SingleItem. They are ignored otherwise
Role_Title,
Role_Artist,
// If this is set to true then the model will call the service's
// LazyPopulate method when this item is expanded. Use this if your item's
// children have to be downloaded or fetched remotely.
Role_CanLazyLoad,
// This is automatically set on the root item for a service. It contains
// a pointer to a RadioService. Services should not set this field
// themselves.
Role_Service,
};
enum Type {
Type_Service = 1,
TypeCount
};
enum PlayBehaviour {
// The item can't be played. This is the default.
PlayBehaviour_None = 0,
// This item's URL is passed through the normal song loader. This supports
// loading remote playlists, remote files and local files. This is probably
// the most sensible behaviour to use if you're just returning normal radio
// stations.
PlayBehaviour_UseSongLoader,
// This item's URL, Title and Artist are used in the playlist. No special
// behaviour occurs - the URL is just passed straight to gstreamer when
// the user starts playing.
PlayBehaviour_SingleItem,
};
// Needs to be static for RadioPlaylistItem::restore
@ -57,18 +104,24 @@ public:
return static_cast<T*>(ServiceByName(T::kServiceName));
}
RadioService* ServiceForItem(const QStandardItem* item) const;
RadioService* ServiceForIndex(const QModelIndex& index) const;
bool IsPlayable(const QModelIndex& index) const;
// This is special because Player needs it for scrobbling
#ifdef HAVE_LIBLASTFM
LastFMService* GetLastFMService() const;
#endif
// QAbstractItemModel
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex& index) const;
QStringList mimeTypes() const;
QMimeData* mimeData(const QModelIndexList& indexes) const;
bool hasChildren(const QModelIndex& parent) const;
int rowCount(const QModelIndex& parent) const;
void ShowContextMenu(RadioItem* item, const QModelIndex& index,
void ShowContextMenu(const QModelIndex& merged_model_index,
const QPoint& global_pos);
void ReloadSettings();
@ -82,14 +135,10 @@ signals:
void StreamMetadataFound(const QUrl& original_url, const Song& song);
void OpenSettingsAtPage(SettingsDialog::Page);
void AddItemToPlaylist(RadioItem* item, bool clear_first);
/*void AddItemToPlaylist(RadioItem* item, bool clear_first);*/
void AddItemsToPlaylist(const PlaylistItemList& items, bool clear_first);
protected:
void LazyPopulate(RadioItem* parent);
private:
QVariant data(const RadioItem* item, int role) const;
void AddService(RadioService* service);
private:

View File

@ -25,18 +25,6 @@ RadioService::RadioService(const QString& name, RadioModel* model)
{
}
QUrl RadioService::UrlForItem(const RadioItem* item) const {
return item->key;
}
QString RadioService::TitleForItem(const RadioItem* item) const {
return item->DisplayText();
}
QString RadioService::ArtistForItem(const RadioItem* item) const {
return item->artist;
}
PlaylistItem::SpecialLoadResult RadioService::StartLoading(const QUrl &url) {
return PlaylistItem::SpecialLoadResult(
PlaylistItem::SpecialLoadResult::TrackAvailable, url, url);

View File

@ -22,7 +22,6 @@
#include <QList>
#include <QUrl>
#include "radioitem.h"
#include "core/song.h"
#include "playlist/playlistitem.h"
#include "ui/settingsdialog.h"
@ -41,16 +40,11 @@ class RadioService : public QObject {
QString name() const { return name_; }
RadioModel* model() const { return model_; }
virtual RadioItem* CreateRootItem(RadioItem* parent) = 0;
virtual void LazyPopulate(RadioItem* item) = 0;
virtual QStandardItem* CreateRootItem() = 0;
virtual void LazyPopulate(QStandardItem* parent) = 0;
virtual QUrl UrlForItem(const RadioItem* item) const;
virtual QString TitleForItem(const RadioItem* item) const;
virtual QString ArtistForItem(const RadioItem* item) const;
virtual void ShowContextMenu(RadioItem* item, const QModelIndex& index,
const QPoint& global_pos) {
Q_UNUSED(item); Q_UNUSED(index); Q_UNUSED(global_pos); }
virtual void ShowContextMenu(const QModelIndex& index, const QPoint& global_pos) {
Q_UNUSED(index); Q_UNUSED(global_pos); }
virtual PlaylistItem::SpecialLoadResult StartLoading(const QUrl& url);
virtual PlaylistItem::SpecialLoadResult LoadNext(const QUrl& url);
@ -69,7 +63,7 @@ class RadioService : public QObject {
void StreamMetadataFound(const QUrl& original_url, const Song& song);
void OpenSettingsAtPage(SettingsDialog::Page page);
void AddItemToPlaylist(RadioItem* item, bool clear_first);
void AddItemToPlaylist(QStandardItem* item, bool clear_first);
void AddItemsToPlaylist(const PlaylistItemList& items, bool clear_first);
private:
@ -77,4 +71,6 @@ class RadioService : public QObject {
QString name_;
};
Q_DECLARE_METATYPE(RadioService*);
#endif // RADIOSERVICE_H

View File

@ -38,10 +38,7 @@ void RadioView::contextMenuEvent(QContextMenuEvent* e) {
MergedProxyModel* merged_model = static_cast<MergedProxyModel*>(model());
RadioModel* radio_model = static_cast<RadioModel*>(merged_model->sourceModel());
radio_model->ShowContextMenu(
radio_model->IndexToItem(merged_model->FindSourceParent(index)),
merged_model->mapToSource(index),
e->globalPos());
radio_model->ShowContextMenu(index, e->globalPos());
}
void RadioView::currentChanged(const QModelIndex &current, const QModelIndex&) {

View File

@ -58,12 +58,7 @@ void RadioViewContainer::SetModel(RadioModel* model) {
}
void RadioViewContainer::ServiceChanged(const QModelIndex& index) {
RadioItem* item = model_->IndexToItem(
model_->merged_model()->FindSourceParent(index));
if (!item)
return;
RadioService* service = item->service;
RadioService* service = index.data(RadioModel::Role_Service).value<RadioService*>();
if (!service || service == current_service_)
return;
current_service_ = service;

View File

@ -15,6 +15,7 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "radiomodel.h"
#include "savedradio.h"
#include "ui/addstreamdialog.h"
#include "ui/iconloader.h"
@ -27,8 +28,8 @@ const char* SavedRadio::kSettingsGroup = "SavedRadio";
SavedRadio::SavedRadio(RadioModel* parent)
: RadioService(kServiceName, parent),
root_(NULL),
context_menu_(NULL)
context_menu_(NULL),
root_(NULL)
{
LoadStreams();
}
@ -37,25 +38,24 @@ SavedRadio::~SavedRadio() {
delete context_menu_;
}
RadioItem* SavedRadio::CreateRootItem(RadioItem* parent) {
root_ = new RadioItem(this, RadioItem::Type_Service, tr("Your radio streams"), parent);
root_->icon = IconLoader::Load("document-open-remote");
QStandardItem* SavedRadio::CreateRootItem() {
root_ = new QStandardItem(IconLoader::Load("document-open-remote"),
tr("Your radio streams"));
root_->setData(true, RadioModel::Role_CanLazyLoad);
return root_;
}
void SavedRadio::LazyPopulate(RadioItem* item) {
switch (item->type) {
case RadioItem::Type_Service:
void SavedRadio::LazyPopulate(QStandardItem* item) {
switch (item->data(RadioModel::Role_Type).toInt()) {
case RadioModel::Type_Service:
foreach (const Stream& stream, streams_)
ItemForStream(stream, root_);
AddStreamToList(stream, root_);
break;
default:
break;
}
item->lazy_loaded = true;
}
void SavedRadio::LoadStreams() {
@ -85,7 +85,7 @@ void SavedRadio::SaveStreams() {
s.endArray();
}
void SavedRadio::ShowContextMenu(RadioItem* item, const QModelIndex&,
void SavedRadio::ShowContextMenu(const QModelIndex& index,
const QPoint& global_pos) {
if (!context_menu_) {
context_menu_ = new QMenu;
@ -97,19 +97,20 @@ void SavedRadio::ShowContextMenu(RadioItem* item, const QModelIndex&,
context_menu_->addAction(IconLoader::Load("document-open-remote"), tr("Add another stream..."), this, SIGNAL(ShowAddStreamDialog()));
}
context_item_ = item;
context_item_ = model()->itemFromIndex(index);
const bool is_root = index.data(RadioModel::Role_Type).toInt() == RadioModel::Type_Service;
add_action_->setEnabled(item != root_);
load_action_->setEnabled(item != root_);
remove_action_->setEnabled(item != root_);
edit_action_->setEnabled(item != root_);
add_action_->setEnabled(!is_root);
load_action_->setEnabled(!is_root);
remove_action_->setEnabled(!is_root);
edit_action_->setEnabled(!is_root);
context_menu_->popup(global_pos);
}
void SavedRadio::Remove() {
streams_.removeAll(Stream(QUrl(context_item_->key)));
context_item_->parent->DeleteNotify(context_item_->row);
streams_.removeAll(Stream(QUrl(context_item_->data(RadioModel::Role_Url).toUrl())));
context_item_->parent()->removeRow(context_item_->row());
SaveStreams();
}
@ -119,19 +120,18 @@ void SavedRadio::Edit() {
edit_dialog_->set_save_visible(false);
}
edit_dialog_->set_name(context_item_->display_text);
edit_dialog_->set_url(context_item_->key);
edit_dialog_->set_name(context_item_->text());
edit_dialog_->set_url(context_item_->data(RadioModel::Role_Url).toUrl());
if (edit_dialog_->exec() == QDialog::Rejected)
return;
int i = streams_.indexOf(Stream(QUrl(context_item_->key)));
int i = streams_.indexOf(Stream(QUrl(context_item_->data(RadioModel::Role_Url).toUrl())));
Stream& stream = streams_[i];
stream.name_ = edit_dialog_->name();
stream.url_ = edit_dialog_->url();
context_item_->display_text = stream.name_;
context_item_->key = stream.url_.toString();
context_item_->ChangedNotify();
context_item_->setText(stream.name_);
context_item_->setData(stream.url_, RadioModel::Role_Url);
SaveStreams();
}
@ -144,15 +144,11 @@ void SavedRadio::LoadToPlaylist() {
emit AddItemToPlaylist(context_item_, true);
}
RadioItem* SavedRadio::ItemForStream(const Stream& stream, RadioItem* parent) {
RadioItem* s = new RadioItem(this, Type_Stream, stream.url_.toString(), parent);
if (!stream.name_.isEmpty())
s->display_text = stream.name_;
s->lazy_loaded = true;
s->icon = QIcon(":last.fm/icon_radio.png");
s->playable = true;
s->use_song_loader = true;
return s;
void SavedRadio::AddStreamToList(const Stream& stream, QStandardItem* parent) {
QStandardItem* s = new QStandardItem(QIcon(":last.fm/icon_radio.png"), stream.name_);
s->setData(stream.url_, RadioModel::Role_Url);
s->setData(RadioModel::PlayBehaviour_UseSongLoader, RadioModel::Role_PlayBehaviour);
parent->appendRow(s);
}
void SavedRadio::Add(const QUrl &url, const QString& name) {
@ -162,9 +158,8 @@ void SavedRadio::Add(const QUrl &url, const QString& name) {
Stream stream(url, name);
streams_ << stream;
if (root_->lazy_loaded) {
RadioItem* s = ItemForStream(stream, NULL);
s->InsertNotify(root_);
if (!root_->data(RadioModel::Role_CanLazyLoad).toBool()) {
AddStreamToList(stream, root_);
}
SaveStreams();
}

View File

@ -40,11 +40,10 @@ class SavedRadio : public RadioService {
static const char* kServiceName;
static const char* kSettingsGroup;
RadioItem* CreateRootItem(RadioItem* parent);
void LazyPopulate(RadioItem* item);
QStandardItem* CreateRootItem();
void LazyPopulate(QStandardItem* item);
void ShowContextMenu(RadioItem* item, const QModelIndex& index,
const QPoint& global_pos);
void ShowContextMenu(const QModelIndex& index, const QPoint& global_pos);
void Add(const QUrl& url, const QString& name = QString());
@ -71,12 +70,12 @@ class SavedRadio : public RadioService {
void LoadStreams();
void SaveStreams();
RadioItem* ItemForStream(const Stream& stream, RadioItem* parent);
void AddStreamToList(const Stream& stream, QStandardItem* parent);
private:
RadioItem* root_;
QMenu* context_menu_;
RadioItem* context_item_;
QStandardItem* context_item_;
QStandardItem* root_;
QAction* add_action_;
QAction* load_action_;

View File

@ -49,27 +49,24 @@ SomaFMService::~SomaFMService() {
delete context_menu_;
}
RadioItem* SomaFMService::CreateRootItem(RadioItem* parent) {
root_ = new RadioItem(this, RadioItem::Type_Service, kServiceName, parent);
root_->icon = QIcon(":/providers/somafm.png");
QStandardItem* SomaFMService::CreateRootItem() {
root_ = new QStandardItem(QIcon(":/providers/somafm.png"), kServiceName);
root_->setData(true, RadioModel::Role_CanLazyLoad);
return root_;
}
void SomaFMService::LazyPopulate(RadioItem* item) {
switch (item->type) {
case RadioItem::Type_Service:
void SomaFMService::LazyPopulate(QStandardItem* item) {
switch (item->data(RadioModel::Role_Type).toInt()) {
case RadioModel::Type_Service:
RefreshChannels();
break;
default:
break;
}
item->lazy_loaded = true;
}
void SomaFMService::ShowContextMenu(RadioItem* item, const QModelIndex&,
const QPoint& global_pos) {
void SomaFMService::ShowContextMenu(const QModelIndex& index, const QPoint& global_pos) {
if (!context_menu_) {
context_menu_ = new QMenu;
context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Add to playlist"), this, SLOT(AddToPlaylist()));
@ -79,7 +76,7 @@ void SomaFMService::ShowContextMenu(RadioItem* item, const QModelIndex&,
context_menu_->addAction(IconLoader::Load("view-refresh"), tr("Refresh channels"), this, SLOT(RefreshChannels()));
}
context_item_ = item;
context_item_ = model()->itemFromIndex(index);
context_menu_->popup(global_pos);
}
@ -151,7 +148,8 @@ void SomaFMService::RefreshChannelsFinished() {
return;
}
root_->ClearNotify();
if (root_->hasChildren())
root_->removeRows(0, root_->rowCount());
QXmlStreamReader reader(reply);
while (!reader.atEnd()) {
@ -162,34 +160,31 @@ void SomaFMService::RefreshChannelsFinished() {
ReadChannel(reader);
}
}
root_->lazy_loaded = true;
}
void SomaFMService::ReadChannel(QXmlStreamReader& reader) {
RadioItem* item = new RadioItem(this, Type_Stream, QString::null);
item->lazy_loaded = true;
item->playable = true;
item->icon = QIcon(":last.fm/icon_radio.png");
QStandardItem* item = new QStandardItem(QIcon(":last.fm/icon_radio.png"), QString());
item->setData(RadioModel::PlayBehaviour_SingleItem, RadioModel::Role_PlayBehaviour);
while (!reader.atEnd()) {
switch (reader.readNext()) {
case QXmlStreamReader::EndElement:
if (item->key.isNull()) {
if (item->data(RadioModel::Role_Url).toString().isNull()) {
// Didn't find a URL
delete item;
} else {
item->InsertNotify(root_);
root_->appendRow(item);
}
return;
case QXmlStreamReader::StartElement:
if (reader.name() == "title") {
item->display_text = reader.readElementText();
item->setText(reader.readElementText());
item->setData("SomaFM " + item->text(), RadioModel::Role_Title);
} else if (reader.name() == "dj") {
item->artist = reader.readElementText();
item->setData(reader.readElementText(), RadioModel::Role_Artist);
} else if (reader.name() == "fastpls" && reader.attributes().value("format") == "mp3") {
item->key = reader.readElementText();
item->setData(reader.readElementText(), RadioModel::Role_Url);
} else {
ConsumeElement(reader);
}
@ -217,10 +212,6 @@ void SomaFMService::ConsumeElement(QXmlStreamReader& reader) {
}
}
QString SomaFMService::TitleForItem(const RadioItem* item) const {
return "SomaFM " + item->display_text;
}
void SomaFMService::Homepage() {
QDesktopServices::openUrl(QUrl(kHomepage));
}

View File

@ -40,12 +40,10 @@ class SomaFMService : public RadioService {
static const char* kChannelListUrl;
static const char* kHomepage;
RadioItem* CreateRootItem(RadioItem* parent);
void LazyPopulate(RadioItem* item);
QStandardItem* CreateRootItem();
void LazyPopulate(QStandardItem* item);
QString TitleForItem(const RadioItem* item) const;
void ShowContextMenu(RadioItem* item, const QModelIndex& index, const QPoint& global_pos);
void ShowContextMenu(const QModelIndex& index, const QPoint& global_pos);
PlaylistItem::Options playlistitem_options() const;
PlaylistItem::SpecialLoadResult StartLoading(const QUrl& url);
@ -64,9 +62,9 @@ class SomaFMService : public RadioService {
void ConsumeElement(QXmlStreamReader& reader);
private:
RadioItem* root_;
QStandardItem* root_;
QMenu* context_menu_;
RadioItem* context_item_;
QStandardItem* context_item_;
int get_channels_task_id_;
int get_stream_task_id_;

View File

@ -1237,10 +1237,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1427,6 +1423,18 @@ msgstr "مكتبة الصوتيات"
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1251,10 +1251,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1441,6 +1437,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1241,10 +1241,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm Радио Станция - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Last.fm Препоръчано Радио - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1431,6 +1427,18 @@ msgstr ""
msgid "Mute"
msgstr "Без звук"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2588,6 +2596,9 @@ msgstr ""
msgid "track %1"
msgstr ""
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Last.fm Препоръчано Радио - %1"
#~ msgid "Editing %n tracks"
#~ msgstr "Редактиране на %n песни"

View File

@ -1237,10 +1237,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1427,6 +1423,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1271,10 +1271,6 @@ msgstr "Radio dels veins de Last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Estació de radio de Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Radio recomanada de Last.fm - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm Artistes Similars a %1"
@ -1463,6 +1459,18 @@ msgstr "Biblioteca de Música"
msgid "Mute"
msgstr "Silenci"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2638,6 +2646,9 @@ msgstr "atura"
msgid "track %1"
msgstr "peça %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Radio recomanada de Last.fm - %1"
#~ msgid "Select engine"
#~ msgstr "Seleccionar motor"

View File

@ -1272,10 +1272,6 @@ msgstr "Sousedský rozhlas Last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Rozhlasová stanice Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Doporučované rádio Last.fm - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Podobný umělec Last.fm jako %1"
@ -1464,6 +1460,18 @@ msgstr "Hudební knihovna"
msgid "Mute"
msgstr "Ztlumit"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Moje Rádio Mix"
@ -2647,6 +2655,9 @@ msgstr "Zastavit"
msgid "track %1"
msgstr "Skladba %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Doporučované rádio Last.fm - %1"
#~ msgid "Select engine"
#~ msgstr "Vybrat stroj"

View File

@ -1237,10 +1237,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1427,6 +1423,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1242,10 +1242,6 @@ msgstr "Last.fm naboradio - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm radiostation - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Last.fm anbefaletradio - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm kunstnere der minder om %1"
@ -1432,6 +1428,18 @@ msgstr "Musikbibliotek"
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2591,6 +2599,9 @@ msgstr ""
msgid "track %1"
msgstr "spor %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Last.fm anbefaletradio - %1"
#~ msgid "Select engine"
#~ msgstr "Vælg motor"

View File

@ -1275,10 +1275,6 @@ msgstr "Last.fm Nachbarschaft - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm Radio Station %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Empfohlenes Last.fm Radio - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm Ähnliche Künstler wie %1"
@ -1467,6 +1463,18 @@ msgstr "Musiksammlung"
msgid "Mute"
msgstr "Stumm"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2655,6 +2663,9 @@ msgstr "Anhalten"
msgid "track %1"
msgstr "Stück %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Empfohlenes Last.fm Radio - %1"
#~ msgid "Select engine"
#~ msgstr "Engine:"

View File

@ -1282,10 +1282,6 @@ msgstr "Γειτονικό ραδιόφωνο του Last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Ραδιοφωνικός σταθμός Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Προτεινόμενο ραδιόφωνο του Last.fm - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Καλλιτέχνες του Last.fm όμοιοι με %1"
@ -1472,6 +1468,18 @@ msgstr "Μουσική βιβλιοθήκη"
msgid "Mute"
msgstr "Σίγαση"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Το δικό μου Mix Radio"
@ -2664,6 +2672,9 @@ msgstr "διακοπή"
msgid "track %1"
msgstr "κομμάτι %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Προτεινόμενο ραδιόφωνο του Last.fm - %1"
#~ msgid "Select engine"
#~ msgstr "Επιλογή μηχανής"

View File

@ -1226,10 +1226,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1416,6 +1412,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1241,10 +1241,6 @@ msgstr "Last.fm Neighbour Radio - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm Radio Station - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Last.fm Recommended Radio - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm Similar Artists to %1"
@ -1431,6 +1427,18 @@ msgstr "Music Library"
msgid "Mute"
msgstr "Mute"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2589,6 +2597,9 @@ msgstr ""
msgid "track %1"
msgstr "track %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Last.fm Recommended Radio - %1"
#~ msgid "Select engine"
#~ msgstr "Select engine"

View File

@ -1239,10 +1239,6 @@ msgstr "Last.fm Neighbour Radio - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm Radio Station - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Last.fm Recommended Radio - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm Similar Artists to %1"
@ -1429,6 +1425,18 @@ msgstr "Music Library"
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2586,6 +2594,9 @@ msgstr ""
msgid "track %1"
msgstr "track %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Last.fm Recommended Radio - %1"
#~ msgid "Select engine"
#~ msgstr "Select engine"

View File

@ -1237,10 +1237,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1427,6 +1423,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1281,10 +1281,6 @@ msgstr "Radio en Last.fm de la Vecindad de %1"
msgid "Last.fm Radio Station - %1"
msgstr "Estación de Radio en Last.fm de %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "La Radio en Last.fm Recomendada para %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Artistas Similares en Last.fm a %1"
@ -1473,6 +1469,18 @@ msgstr "Colección de Música"
msgid "Mute"
msgstr "SIlenciar"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2659,6 +2667,9 @@ msgstr "detener"
msgid "track %1"
msgstr "Pista %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "La Radio en Last.fm Recomendada para %1"
#~ msgid "Select engine"
#~ msgstr "Seleccione motor de audio"

View File

@ -1239,10 +1239,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1429,6 +1425,18 @@ msgstr "Muusika kogu"
msgid "Mute"
msgstr "Vaigista"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1237,10 +1237,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1427,6 +1423,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1238,10 +1238,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1429,6 +1425,18 @@ msgstr "Musiikkikirjasto"
msgid "Mute"
msgstr "Vaimenna"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1284,10 +1284,6 @@ msgstr "Last.fm Radio voisin - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Station radio Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Radio recommandée Last.fr - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Artistes Last.fm similaires à %1"
@ -1478,6 +1474,18 @@ msgstr "Bibliothèque musicale"
msgid "Mute"
msgstr "Sourdine"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Ma radio mix"
@ -2671,6 +2679,9 @@ msgstr "stop"
msgid "track %1"
msgstr "piste %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Radio recommandée Last.fr - %1"
#~ msgid "Select engine"
#~ msgstr "Sélectionner un moteur"

View File

@ -1242,10 +1242,6 @@ msgstr "Rádios dos viciños da Last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Radio da Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Artistas da Last.fm similares com %1"
@ -1433,6 +1429,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1244,10 +1244,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1434,6 +1430,18 @@ msgstr "ספריית המוזיקה"
msgid "Mute"
msgstr "השתק"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1237,10 +1237,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1427,6 +1423,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1243,10 +1243,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1433,6 +1429,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1272,10 +1272,6 @@ msgstr "Last.fm Szomszédos Rádió - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm Rádió Állomás - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Last.fm Ajánlott Rádió - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm Hasonló Előadók - %1"
@ -1463,6 +1459,18 @@ msgstr "Zenetár"
msgid "Mute"
msgstr "Némítás"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Az én mixem rádió"
@ -2647,6 +2655,9 @@ msgstr "leállítás"
msgid "track %1"
msgstr "%1. szám"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Last.fm Ajánlott Rádió - %1"
#~ msgid "Select engine"
#~ msgstr "Meghajtó kiválasztása"

View File

@ -1278,10 +1278,6 @@ msgstr "Radio dei vicini di Last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Stazione radio di Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Radio consigliata di Last.fm - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Artisti simili a %1 di Last.fm"
@ -1470,6 +1466,18 @@ msgstr "Raccolta musicale"
msgid "Mute"
msgstr "Silenzia"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "La mia radio mista"
@ -2661,6 +2669,9 @@ msgstr "ferma"
msgid "track %1"
msgstr "traccia %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Radio consigliata di Last.fm - %1"
#~ msgid "Select engine"
#~ msgstr "Seleziona motore"

View File

@ -1262,10 +1262,6 @@ msgstr "Last.fm ご近所さんのラジオ - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm ラジオ局 - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Last.fm おすすめラジオ - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm %1 にテイストの似たアーティスト"
@ -1453,6 +1449,18 @@ msgstr "ミュージック ライブラリ"
msgid "Mute"
msgstr "ミュート"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2630,6 +2638,9 @@ msgstr "停止"
msgid "track %1"
msgstr "トラック %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Last.fm おすすめラジオ - %1"
#~ msgid "Select engine"
#~ msgstr "エンジンの選択"

View File

@ -1239,10 +1239,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1429,6 +1425,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1237,10 +1237,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1427,6 +1423,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1251,10 +1251,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1441,6 +1437,18 @@ msgstr "Musikkbibliotek"
msgid "Mute"
msgstr "Demp"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1265,10 +1265,6 @@ msgstr "Last.fm buurman radio - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm radio station - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Last.fm aanbevolen radio - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm artiesten vergelijkbaar met %1"
@ -1456,6 +1452,18 @@ msgstr "Muziekbibliotheek"
msgid "Mute"
msgstr "Dempen"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2647,6 +2655,9 @@ msgstr "stoppen"
msgid "track %1"
msgstr "track %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Last.fm aanbevolen radio - %1"
#~ msgid "Select engine"
#~ msgstr "Engine kiezen"

View File

@ -1237,10 +1237,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1427,6 +1423,18 @@ msgstr "Discotèca"
msgid "Mute"
msgstr "Mut"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1272,10 +1272,6 @@ msgstr "Radio sąsiadów na Last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Stacja radiowa Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Rekomendowane radio Last.fm - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Podobni do %1 artyści z Last.fm"
@ -1464,6 +1460,18 @@ msgstr "Biblioteka muzyki"
msgid "Mute"
msgstr "Wycisz"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Moje radio miksów"
@ -2647,6 +2655,9 @@ msgstr "zatrzymaj"
msgid "track %1"
msgstr "utwór %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Rekomendowane radio Last.fm - %1"
#~ msgid "Editing %n tracks"
#~ msgstr "Edycja %n ścieżek"

View File

@ -1275,10 +1275,6 @@ msgstr "Rádio do vizinho last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Estação de rádio last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Rádios recomendadas pela last.fm - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Artistas semelhantes a %1 na last.fm"
@ -1467,6 +1463,18 @@ msgstr "Biblioteca de músicas"
msgid "Mute"
msgstr "Sem áudio"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "A minha rádio diversificada"
@ -2655,6 +2663,9 @@ msgstr "parar"
msgid "track %1"
msgstr "faixa %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Rádios recomendadas pela last.fm - %1"
#~ msgid "Select engine"
#~ msgstr "Selecione o sistema"

View File

@ -1270,10 +1270,6 @@ msgstr "Rádio Vizinha Last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Estação de Rádio Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Rádio Recomendada Last.fm - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Artistas Last.fm Similares a %1"
@ -1462,6 +1458,18 @@ msgstr "Biblioteca de Músicas"
msgid "Mute"
msgstr "Mudo"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2631,6 +2639,9 @@ msgstr ""
msgid "track %1"
msgstr "faixa %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Rádio Recomendada Last.fm - %1"
#~ msgid "Select engine"
#~ msgstr "Selecionar mecanismo"

View File

@ -1238,10 +1238,6 @@ msgstr "Radio vecin Last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Post de radio Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Radio recomandat Last.fm - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Artiști Last.fm similari cu %1"
@ -1428,6 +1424,18 @@ msgstr "Biblioteca audio"
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2585,6 +2593,9 @@ msgstr ""
msgid "track %1"
msgstr "pistă %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Radio recomandat Last.fm - %1"
#~ msgid "Show section"
#~ msgstr "Arată secțiune"

View File

@ -1267,10 +1267,6 @@ msgstr "Радио соседей Last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Радиостанция Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Рекомендуемое радио Last.fm - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Похожие исполнители Last.fm на %1"
@ -1458,6 +1454,18 @@ msgstr "Музыкальная коллекция"
msgid "Mute"
msgstr "Выключить звук"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Радио Мой Микс"
@ -2641,6 +2649,9 @@ msgstr "Остановить"
msgid "track %1"
msgstr "композиция %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Рекомендуемое радио Last.fm - %1"
#~ msgid "Select engine"
#~ msgstr "Укажите движок"

View File

@ -1265,10 +1265,6 @@ msgstr "%1 - rádio suseda"
msgid "Last.fm Radio Station - %1"
msgstr "%1 - rádio stanica"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "%1 - odporúčané rádio"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Podobný interprét ako %1"
@ -1455,6 +1451,18 @@ msgstr "Hudobná zbierka"
msgid "Mute"
msgstr "Stlmiť"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Moja rádio zmes"
@ -2637,6 +2645,9 @@ msgstr "zastaviť"
msgid "track %1"
msgstr "skladba %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "%1 - odporúčané rádio"
#~ msgid "Select engine"
#~ msgstr "Vybrať engine"

View File

@ -1267,10 +1267,6 @@ msgstr "Last.fm radio soseske - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm radio postaja - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Last.fm radio iz priporočil - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm izvajalci podobni %1"
@ -1457,6 +1453,18 @@ msgstr "Glasbena knjižnica"
msgid "Mute"
msgstr "Utišaj"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Moj miks radio"
@ -2639,6 +2647,9 @@ msgstr "zaustavi"
msgid "track %1"
msgstr "skladba %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Last.fm radio iz priporočil - %1"
#~ msgid "Select engine"
#~ msgstr "Izberi pogon"

View File

@ -1241,10 +1241,6 @@ msgstr "ЛастФМ комшијски радио -%1"
msgid "Last.fm Radio Station - %1"
msgstr "ЛастФМ радио станица - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Препоручни ЛастФМ радио -%1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm Сличан Извођач са %1"
@ -1432,6 +1428,18 @@ msgstr "Музичка библиотека"
msgid "Mute"
msgstr "Утишај"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""
@ -2591,6 +2599,9 @@ msgstr "Заустави"
msgid "track %1"
msgstr "нумера %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Препоручни ЛастФМ радио -%1"
#~ msgid "Select engine"
#~ msgstr "Одабери мотор"

View File

@ -1271,10 +1271,6 @@ msgstr "Last.fm-grannradio - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm-radiostation - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Rekommenderad Last.fm-radio - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm-artister som liknar %1"
@ -1461,6 +1457,18 @@ msgstr "Musikbibliotek"
msgid "Mute"
msgstr "Tyst"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Min Blandade Radio"
@ -2641,6 +2649,9 @@ msgstr "stoppa"
msgid "track %1"
msgstr "spår %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Rekommenderad Last.fm-radio - %1"
#~ msgid "Select engine"
#~ msgstr "Välj motor"

View File

@ -1265,10 +1265,6 @@ msgstr "Last.fm Komşu Radyo - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Last.fm Radyo İstasyonu - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Last.fm Önerilen Radyo - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Last.fm %1 ile Benzer Sanatçılar"
@ -1457,6 +1453,18 @@ msgstr "Müzik Kütüphanesi"
msgid "Mute"
msgstr "Sessiz"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Karışık Radyom"
@ -2631,6 +2639,9 @@ msgstr "durdur"
msgid "track %1"
msgstr "parça %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Last.fm Önerilen Radyo - %1"
#~ msgid "Select engine"
#~ msgstr "Çalma motorunu seç"

View File

@ -1227,10 +1227,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1417,6 +1413,18 @@ msgstr ""
msgid "Mute"
msgstr ""
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1269,10 +1269,6 @@ msgstr "Радіо сусідів Last.fm - %1"
msgid "Last.fm Radio Station - %1"
msgstr "Радіостанція Last.fm - %1"
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr "Рекомендоване радіо Last.fm - %1"
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr "Подібні виконавці Last.fm на %1"
@ -1459,6 +1455,18 @@ msgstr "Фонотека"
msgid "Mute"
msgstr "Вимкнути звук"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr "Моє Mix Radio"
@ -2636,6 +2644,9 @@ msgstr "зупинити"
msgid "track %1"
msgstr "доріжка %1"
#~ msgid "Last.fm Recommended Radio - %1"
#~ msgstr "Рекомендоване радіо Last.fm - %1"
#~ msgid "Select engine"
#~ msgstr "Вибрати рушій"

View File

@ -1241,10 +1241,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1431,6 +1427,18 @@ msgstr "音乐库"
msgid "Mute"
msgstr "静音"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -1242,10 +1242,6 @@ msgstr ""
msgid "Last.fm Radio Station - %1"
msgstr ""
#, qt-format
msgid "Last.fm Recommended Radio - %1"
msgstr ""
#, qt-format
msgid "Last.fm Similar Artists to %1"
msgstr ""
@ -1432,6 +1428,18 @@ msgstr "音樂庫"
msgid "Mute"
msgstr "静音"
msgid "My Last.fm Library"
msgstr ""
msgid "My Last.fm Mix Radio"
msgstr ""
msgid "My Last.fm Neighborhood"
msgstr ""
msgid "My Last.fm Recommended Radio"
msgstr ""
msgid "My Mix Radio"
msgstr ""

View File

@ -462,8 +462,6 @@ MainWindow::MainWindow(
connect(radio_model_, SIGNAL(AsyncLoadFinished(PlaylistItem::SpecialLoadResult)), player_, SLOT(HandleSpecialLoad(PlaylistItem::SpecialLoadResult)));
connect(radio_model_, SIGNAL(StreamMetadataFound(QUrl,Song)), playlists_, SLOT(SetActiveStreamMetadata(QUrl,Song)));
connect(radio_model_, SIGNAL(OpenSettingsAtPage(SettingsDialog::Page)), SLOT(OpenSettingsDialogAtPage(SettingsDialog::Page)));
connect(radio_model_, SIGNAL(AddItemToPlaylist(RadioItem*,bool)), SLOT(InsertRadioItem(RadioItem*,bool)));
connect(radio_model_, SIGNAL(AddItemsToPlaylist(PlaylistItemList,bool)), SLOT(InsertRadioItems(PlaylistItemList,bool)));
#ifdef HAVE_LIBLASTFM
connect(radio_model_->GetLastFMService(), SIGNAL(ScrobblingEnabledChanged(bool)), SLOT(ScrobblingEnabledChanged(bool)));
connect(radio_model_->GetLastFMService(), SIGNAL(ButtonVisibilityChanged(bool)), SLOT(LastFMButtonVisibilityChanged(bool)));
@ -1075,25 +1073,7 @@ void MainWindow::RadioDoubleClick(const QModelIndex& index) {
}
}
void MainWindow::InsertRadioItem(RadioItem* item, bool clear_first) {
if (clear_first)
playlists_->ClearCurrent();
QModelIndex first_song = playlists_->current()->InsertRadioStations(
QList<RadioItem*>() << item);
if (!playlists_->current()->proxy()->mapFromSource(first_song).isValid()) {
// The first song doesn't match the filter, so don't play it
return;
}
if (first_song.isValid() && player_->GetState() != Engine::Playing) {
playlists_->SetActiveToCurrent();
player_->PlayAt(first_song.row(), Engine::First, true);
}
}
void MainWindow::InsertRadioItems(const PlaylistItemList& items, bool clear_first) {
void MainWindow::InsertPlaylistItems(const PlaylistItemList& items, bool clear_first) {
if (clear_first)
playlists_->ClearCurrent();
@ -1766,7 +1746,7 @@ void MainWindow::ConnectInfoView(SongInfoBase* view) {
connect(view, SIGNAL(ShowSettingsDialog()), SLOT(ShowSongInfoConfig()));
connect(view, SIGNAL(AddPlaylistItems(PlaylistItemList,bool)),
SLOT(InsertRadioItems(PlaylistItemList,bool)));
SLOT(InsertPlaylistItems(PlaylistItemList,bool)));
connect(view, SIGNAL(AddGenerator(smart_playlists::GeneratorPtr)),
SLOT(AddSongInfoGenerator(smart_playlists::GeneratorPtr)));
}

View File

@ -174,8 +174,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
void UpdateTrackPosition();
void RadioDoubleClick(const QModelIndex& index);
void InsertRadioItem(RadioItem*, bool clear_first);
void InsertRadioItems(const PlaylistItemList& items, bool clear_first);
void InsertPlaylistItems(const PlaylistItemList& items, bool clear_first);
void LastFMButtonVisibilityChanged(bool value);
#ifdef HAVE_LIBLASTFM
void ScrobblingEnabledChanged(bool value);