connect(ui->cfavButton, SIGNAL(clicked()), this, SLOT(_c_add_to_favorites()));
connect(ui->ctagButton, SIGNAL(clicked()), this, SLOT(_c_edit_tags()));
connect(_cover, SIGNAL(clicked()), this, SLOT(_toggle_extra_buttons()));
+ connect(_player, SIGNAL(startPlaylist()), this, SLOT(_start_playlist()));
+ connect(_player, SIGNAL(saveLastPlayed(LastPlayed)), _lib, SLOT(saveLastPlayedForCurPlaylist(LastPlayed)));
ui->viewButton->setIcon(QIcon(":/icons/"+_icons_theme+"/playback.png"));
_top_gradient = ui->topWidget->styleSheet();
_bottom_gradient = ui->bottomWidget->styleSheet();
void PlayerForm::_process_click(QModelIndex index) {
if (index.column() == 1) {
int id = index.row();
- _player->stop();
_player->setTrackId(id);
_player->play();
_track_renderer->setActiveRow(id);
ui->playlistView->show();
_display_track(track);
_context_menu->actions().at(2)->setText(_lib->isFavorite(track) ? tr("Remove from favorites") : tr("Add to favorites"));
+ emit trackChanged();
}
void PlayerForm::_display_track(Track track) {
void PlayerForm::prev() {
_player->prev();
}
+
+QString PlayerForm::playerCaption() {
+ TrackMetadata meta = _player->current().metadata();
+ return QString("%1 - %2").arg(meta.artist()).arg(meta.title());
+}
+
+void PlayerForm::_start_playlist() {
+ Config config;
+ if (config.getValue("playback/autoresume_off").toBool()) {
+ _player->next();
+ return;
+ }
+ LastPlayed lp = _lib->getLastPlayedForCurPlaylist();
+ _player->setTrackId(lp.trackId);
+ _player->setAwaitingSeek(lp.position);
+}